X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.git;a=blobdiff_plain;f=mech_eap%2Facquire_cred_with_password.c;h=466473b607a0106befe61394b78e0546a9bfdac9;hp=c0f41592a01db30d3b4d38e71c3d1b8b24c18065;hb=3e8ad5e079b54db722a97f41d45e098e80fad863;hpb=aa9b759792c0f213df24c935e90ac3e3d7592ff6 diff --git a/mech_eap/acquire_cred_with_password.c b/mech_eap/acquire_cred_with_password.c index c0f4159..466473b 100644 --- a/mech_eap/acquire_cred_with_password.c +++ b/mech_eap/acquire_cred_with_password.c @@ -47,7 +47,21 @@ gssspi_acquire_cred_with_password(OM_uint32 *minor, gss_OID_set *actual_mechs, OM_uint32 *time_rec) { - return gssEapAcquireCred(minor, desired_name, password, - time_req, desired_mechs, cred_usage, - output_cred_handle, actual_mechs, time_rec); + OM_uint32 major, tmpMinor; + + major = gssEapAcquireCred(minor, desired_name, + time_req, desired_mechs, cred_usage, + output_cred_handle, actual_mechs, time_rec); + if (GSS_ERROR(major)) + goto cleanup; + + major = gssEapSetCredPassword(minor, *output_cred_handle, password); + if (GSS_ERROR(major)) + goto cleanup; + +cleanup: + if (GSS_ERROR(major)) + gssEapReleaseCred(&tmpMinor, output_cred_handle); + + return major; }