svn rev #23717: trunk/src/lib/gssapi/spnego/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Feb 12 14:18:17 EST 2010


http://src.mit.edu/fisheye/changelog/krb5/?cs=23717
Commit By: ghudson
Log Message:
Simplify the SPNEGO neg_mechs intersection logic a bit using
gss_test_oid_set_member.



Changed Files:
U   trunk/src/lib/gssapi/spnego/spnego_mech.c
Modified: trunk/src/lib/gssapi/spnego/spnego_mech.c
===================================================================
--- trunk/src/lib/gssapi/spnego/spnego_mech.c	2010-02-11 16:07:08 UTC (rev 23716)
+++ trunk/src/lib/gssapi/spnego/spnego_mech.c	2010-02-12 19:18:17 UTC (rev 23717)
@@ -2678,7 +2678,8 @@
 	gss_cred_id_t creds = GSS_C_NO_CREDENTIAL, *credptr;
 	gss_OID_set cred_mechs = GSS_C_NULL_OID_SET;
 	gss_OID_set intersect_mechs = GSS_C_NULL_OID_SET;
-	unsigned int i, j;
+	unsigned int i;
+	int present;
 
 	if (spcred == NULL) {
 		/*
@@ -2715,12 +2716,10 @@
 	}
 
 	for (i = 0; i < spcred->neg_mechs->count; i++) {
-		for (j = 0; j < cred_mechs->count; j++) {
-			if (!g_OID_equal(&spcred->neg_mechs->elements[i],
-					 &cred_mechs->elements[j]))
-				break;
-		}
-		if (j == cred_mechs->count)
+		gss_test_oid_set_member(&tmpmin,
+					&spcred->neg_mechs->elements[i],
+					cred_mechs, &present);
+		if (!present)
 			continue;
 		ret = gss_add_oid_set_member(minor_status,
 					     &spcred->neg_mechs->elements[i],




More information about the cvs-krb5 mailing list