Swap gsasl GSSAPI $auth1/$auth2
authorPhil Pennock <pdp@exim.org>
Sat, 18 Feb 2012 13:14:29 +0000 (08:14 -0500)
committerPhil Pennock <pdp@exim.org>
Sat, 18 Feb 2012 13:14:29 +0000 (08:14 -0500)
doc/doc-docbook/spec.xfpt
doc/doc-txt/ChangeLog
src/src/auths/gsasl_exim.c

index e8ac8f360c042059afdda08899f85654ed5729e4..b1984b5cb3e9a5c3ae040b0f0267290ab6343524 100644 (file)
@@ -24449,8 +24449,8 @@ ANONYMOUS: only &$auth1$& is set, to the possibly empty &'anonymous token'&;
 the &%server_condition%& option must be present.
 .next
 .cindex "authentication" "GSSAPI"
-GSSAPI: &$auth1$& will be set to the &'authorization id'&,
-&$auth2$& will be set to the &'GSSAPI Display Name'&;
+GSSAPI: &$auth1$& will be set to the &'GSSAPI Display Name'&;
+&$auth2$& will be set to the &'authorization id'&,
 the &%server_condition%& option must be present.
 .endlist
 
index 75d5ccd7483e14d6f823fd8d2958652db3d8254f..aa11372cbbda676c1d30452706e194bb9fec1d54 100644 (file)
@@ -22,6 +22,9 @@ PP/03 Implemented heimdal_gssapi authenticator with "server_keytab" option.
 PP/04 Local/Makefile support for (AUTH|LOOKUP)_*_PC=foo to use
       `pkg-config foo` for cflags/libs.
 
+PP/05 Swapped $auth1/$auth2 for gsasl GSSAPI mechanism, to be more consistent
+      with rest of GSASL and with heimdal_gssapi.
+
 
 Exim version 4.77
 -----------------
index 3c8a250170afef234b5211ff3c83b98327f4085c..d9a27ea5f911e99cd072cb0c4be82eaa061777bf 100644 (file)
@@ -5,7 +5,9 @@
 /* Copyright (c) University of Cambridge 1995 - 2012 */
 /* See the file NOTICE for conditions of use and distribution. */
 
-/* Copyright (c) Twitter Inc 2012 */
+/* Copyright (c) Twitter Inc 2012
+   Author: Phil Pennock <pdp@exim.org> */
+/* Copyright (c) Phil Pennock 2012 */
 
 /* Interface to GNU SASL library for generic authentication. */
 
@@ -480,10 +482,18 @@ server_callback(Gsasl *ctx, Gsasl_session *sctx, Gsasl_property prop, auth_insta
       break;
 
     case GSASL_VALIDATE_GSSAPI:
-      /* GSASL_AUTHZID and GSASL_GSSAPI_DISPLAY_NAME */
-      propval = (uschar *) gsasl_property_get(sctx, GSASL_AUTHZID);
-      auth_vars[0] = expand_nstring[1] = propval ? propval : US"";
+      /* GSASL_AUTHZID and GSASL_GSSAPI_DISPLAY_NAME
+      The display-name is authenticated as part of GSS, the authzid is claimed
+      by the SASL integration after authentication; protected against tampering
+      (if the SASL mechanism supports that, which Kerberos does) but is
+      unverified, same as normal for other mechanisms.
+
+      First coding, we had these values swapped, but for consistency and prior
+      to the first release of Exim with this authenticator, they've been
+      switched to match the ordering of GSASL_VALIDATE_SIMPLE. */
       propval = (uschar *) gsasl_property_get(sctx, GSASL_GSSAPI_DISPLAY_NAME);
+      auth_vars[0] = expand_nstring[1] = propval ? propval : US"";
+      propval = (uschar *) gsasl_property_get(sctx, GSASL_AUTHZID);
       auth_vars[1] = expand_nstring[2] = propval ? propval : US"";
       expand_nmax = 2;
       for (i = 1; i <= 2; ++i)