Don't fail if password supplied by caller
authorLuke Howard <lukeh@padl.com>
Fri, 7 Oct 2011 14:39:32 +0000 (01:39 +1100)
committerLuke Howard <lukeh@padl.com>
Fri, 7 Oct 2011 14:39:32 +0000 (01:39 +1100)
If the libmoonshot or static (file-based) identity resolver fails, and
the caller provided a password via gss_acquire_cred_with_password(), then
resolving the credential should not fail.

mech_eap/util_cred.c

index 444a1d7..8c954c2 100644 (file)
@@ -728,9 +728,10 @@ gssEapResolveInitiatorCred(OM_uint32 *minor,
         if (major == GSS_S_CRED_UNAVAIL)
 #endif
             major = staticIdentityFileResolveInitiatorCred(minor, resolvedCred);
-        if (GSS_ERROR(major))
+        if (GSS_ERROR(major) && major != GSS_S_CRED_UNAVAIL)
             goto cleanup;
 
+        /* If we have a caller-supplied password, the credential is resolved. */
         if ((resolvedCred->flags & CRED_FLAG_PASSWORD) == 0) {
             major = GSS_S_CRED_UNAVAIL;
             *minor = GSSEAP_NO_DEFAULT_CRED;