]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix SPNEGO imported cred initialization
authorGreg Hudson <ghudson@mit.edu>
Wed, 20 Jul 2016 21:08:55 +0000 (17:08 -0400)
committerTom Yu <tlyu@mit.edu>
Fri, 2 Sep 2016 18:49:38 +0000 (14:49 -0400)
In spnego_gss_import_cred(), use create_spnego_cred() to create the
SPNEGO credential structure.  Prior to this change, an imported SPNEGO
cred did not initialize the no_ask_integ field (added by commit
cf39ed349976908626cad3e05e17788f8334bce9, ticket #6938).

(cherry picked from commit 1bedcf7fc43e45882edcb9eb17d0852a30babae3)

ticket: 8460
version_fixed: 1.14.4

src/lib/gssapi/spnego/spnego_mech.c

index 5f1ca3376cd8e07ae2f696ffc62b19a3335f2306..07435d826a621263ff6d8b997c6cf4754c0a4466 100644 (file)
@@ -2979,14 +2979,11 @@ spnego_gss_import_cred(OM_uint32 *minor_status,
        ret = gss_import_cred(minor_status, token, &mcred);
        if (GSS_ERROR(ret))
                return (ret);
-       spcred = malloc(sizeof(*spcred));
-       if (spcred == NULL) {
-               gss_release_cred(minor_status, &mcred);
-               *minor_status = ENOMEM;
-               return (GSS_S_FAILURE);
-       }
-       spcred->mcred = mcred;
-       spcred->neg_mechs = GSS_C_NULL_OID_SET;
+
+       ret = create_spnego_cred(minor_status, mcred, &spcred);
+       if (GSS_ERROR(ret))
+           return (ret);
+
        *cred_handle = (gss_cred_id_t)spcred;
        return (ret);
 }