]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix SPNEGO imported cred initialization 488/head
authorGreg Hudson <ghudson@mit.edu>
Wed, 20 Jul 2016 21:08:55 +0000 (17:08 -0400)
committerGreg Hudson <ghudson@mit.edu>
Thu, 18 Aug 2016 18:20:47 +0000 (14:20 -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).

ticket: 8460 (new)
target_version: 1.14-next
tags: pullup

src/lib/gssapi/spnego/spnego_mech.c

index 7862d98e3a4966218c6afc0ac191ac2ea15a7710..9d6027ce8058de79d0af45911797a4643fd6d5d3 100644 (file)
@@ -2993,14 +2993,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);
 }