sbonazzo / rpms / cyrus-sasl

Forked from rpms/cyrus-sasl 2 years ago
Clone

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

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