allow GSS_C_NO_CREDENTIAL to gssEapPrimaryMechForCred
authorLuke Howard <lukeh@padl.com>
Tue, 19 Jun 2012 15:45:38 +0000 (01:45 +1000)
committerLuke Howard <lukeh@padl.com>
Wed, 20 Jun 2012 03:41:08 +0000 (13:41 +1000)
mech_eap/util_cred.c

index 746bd61..3e67507 100644 (file)
@@ -241,13 +241,14 @@ cleanup:
 gss_OID
 gssEapPrimaryMechForCred(gss_cred_id_t cred)
 {
-    gss_OID nameMech = GSS_C_NO_OID;
+    gss_OID credMech = GSS_C_NO_OID;
 
-    if (cred->mechanisms != GSS_C_NO_OID_SET &&
+    if (cred != GSS_C_NO_CREDENTIAL &&
+        cred->mechanisms != GSS_C_NO_OID_SET &&
         cred->mechanisms->count == 1)
-        nameMech = &cred->mechanisms->elements[0];
+        credMech = &cred->mechanisms->elements[0];
 
-    return nameMech;
+    return credMech;
 }
 
 OM_uint32