From: Greg Hudson Date: Fri, 12 Feb 2010 19:18:17 +0000 (+0000) Subject: Simplify the SPNEGO neg_mechs intersection logic a bit using X-Git-Tag: krb5-1.9-beta1~351 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c1ee82b90c8cd55d5951a8e923cd0d919037dca2;p=krb5.git Simplify the SPNEGO neg_mechs intersection logic a bit using gss_test_oid_set_member. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23717 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c index 60fadd5e5..bf695d845 100644 --- a/src/lib/gssapi/spnego/spnego_mech.c +++ b/src/lib/gssapi/spnego/spnego_mech.c @@ -2678,7 +2678,8 @@ get_negotiable_mechs(OM_uint32 *minor_status, spnego_gss_cred_id_t spcred, 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 @@ get_negotiable_mechs(OM_uint32 *minor_status, spnego_gss_cred_id_t spcred, } 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],