Blame SOURCES/cyrus-sasl-2.1.26-gssapi-non-encrypt.patch

bfd35c
diff -up cyrus-sasl-2.1.26/plugins/gssapi.c.gssapi_non_encrypt cyrus-sasl-2.1.26/plugins/gssapi.c
bfd35c
--- cyrus-sasl-2.1.26/plugins/gssapi.c.gssapi_non_encrypt	2015-05-19 14:57:57.091212254 +0200
bfd35c
+++ cyrus-sasl-2.1.26/plugins/gssapi.c	2015-05-19 15:01:41.681011361 +0200
bfd35c
@@ -1159,19 +1159,18 @@ gssapi_server_mech_ssfreq(context_t *tex
bfd35c
     }
bfd35c
 
bfd35c
     layerchoice = (int)(((char *)(output_token->value))[0]);
bfd35c
-    if (layerchoice == LAYER_NONE &&
bfd35c
-	(text->qop & LAYER_NONE)) { /* no encryption */
bfd35c
+	if (!(layerchoice & (LAYER_INTEGRITY | LAYER_CONFIDENTIALITY)) &&
bfd35c
+	     (text->qop & LAYER_NONE)) { /* no encryption */
bfd35c
 	oparams->encode = NULL;
bfd35c
 	oparams->decode = NULL;
bfd35c
 	oparams->mech_ssf = 0;
bfd35c
-    } else if (layerchoice == LAYER_INTEGRITY &&
bfd35c
+	} else if ((layerchoice & LAYER_INTEGRITY) &&
bfd35c
 	       (text->qop & LAYER_INTEGRITY)) { /* integrity */
bfd35c
 	oparams->encode = &gssapi_integrity_encode;
bfd35c
 	oparams->decode = &gssapi_decode;
bfd35c
 	oparams->mech_ssf = 1;
bfd35c
-    } else if ((layerchoice == LAYER_CONFIDENTIALITY ||
bfd35c
-		/* For compatibility with broken clients setting both bits */
bfd35c
-		layerchoice == (LAYER_CONFIDENTIALITY|LAYER_INTEGRITY)) &&
bfd35c
+	} else if (/* For compatibility with broken clients setting both bits */
bfd35c
+		   (layerchoice & (LAYER_CONFIDENTIALITY | LAYER_INTEGRITY)) &&
bfd35c
 	       (text->qop & LAYER_CONFIDENTIALITY)) { /* privacy */
bfd35c
 	oparams->encode = &gssapi_privacy_encode;
bfd35c
 	oparams->decode = &gssapi_decode;