gssapi: ntlm mech should use _gss_ntlm_copy_cred() to dup cred
This commit is contained in:

committed by
Nico Williams

parent
e787bd1bc1
commit
57df2ff1cc
@@ -49,25 +49,9 @@ _gss_ntlm_duplicate_cred(OM_uint32 *minor_status,
|
||||
NULL);
|
||||
|
||||
*output_cred_handle = GSS_C_NO_CREDENTIAL;
|
||||
if ((new_cred = calloc(1, sizeof(*new_cred))) == NULL) {
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
new_cred->usage = cred->usage;
|
||||
new_cred->username = strdup(cred->username);
|
||||
new_cred->domain = strdup(cred->domain);
|
||||
new_cred->key.data = malloc(cred->key.length);
|
||||
if (new_cred->username == NULL || new_cred->domain == NULL ||
|
||||
new_cred->key.data == NULL) {
|
||||
*output_cred_handle = (gss_cred_id_t) new_cred;
|
||||
_gss_ntlm_release_cred(&junk, output_cred_handle);
|
||||
*minor_status = ENOMEM;
|
||||
return GSS_S_FAILURE;
|
||||
}
|
||||
|
||||
memcpy(new_cred->key.data, cred->key.data, cred->key.length);
|
||||
new_cred->key.length = cred->key.length;
|
||||
*output_cred_handle = (gss_cred_id_t) new_cred;
|
||||
return GSS_S_COMPLETE;
|
||||
*minor_status = _gss_ntlm_copy_cred((ntlm_cred)input_cred_handle,
|
||||
(ntlm_cred *)output_cred_handle);
|
||||
|
||||
return *minor_status == 0 ? GSS_S_COMPLETE : GSS_S_FAILURE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user