projects
/
mech_eap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes for Heimdal (macOS) builds from Stefan.
[mech_eap.git]
/
mech_eap
/
add_cred_with_password.c
diff --git
a/mech_eap/add_cred_with_password.c
b/mech_eap/add_cred_with_password.c
index
7907138
..
742e562
100644
(file)
--- a/
mech_eap/add_cred_with_password.c
+++ b/
mech_eap/add_cred_with_password.c
@@
-36,10
+36,15
@@
#include "gssapiP_eap.h"
#include "gssapiP_eap.h"
-OM_uint32
+OM_uint32
GSSAPI_CALLCONV
gss_add_cred_with_password(OM_uint32 *minor,
gss_add_cred_with_password(OM_uint32 *minor,
+#ifdef HAVE_HEIMDAL_VERSION
+ gss_const_cred_id_t input_cred_handle GSSEAP_UNUSED,
+ gss_const_name_t desired_name,
+#else
const gss_cred_id_t input_cred_handle GSSEAP_UNUSED,
const gss_name_t desired_name,
const gss_cred_id_t input_cred_handle GSSEAP_UNUSED,
const gss_name_t desired_name,
+#endif
const gss_OID desired_mech,
const gss_buffer_t password,
gss_cred_usage_t cred_usage,
const gss_OID desired_mech,
const gss_buffer_t password,
gss_cred_usage_t cred_usage,
@@
-50,7
+55,7
@@
gss_add_cred_with_password(OM_uint32 *minor,
OM_uint32 *initiator_time_rec,
OM_uint32 *acceptor_time_rec)
{
OM_uint32 *initiator_time_rec,
OM_uint32 *acceptor_time_rec)
{
- OM_uint32 major;
+ OM_uint32 major
, tmpMinor
;
OM_uint32 time_req, time_rec = 0;
gss_OID_set_desc mechs;
OM_uint32 time_req, time_rec = 0;
gss_OID_set_desc mechs;
@@
-67,18
+72,27
@@
gss_add_cred_with_password(OM_uint32 *minor,
major = gssEapAcquireCred(minor,
desired_name,
major = gssEapAcquireCred(minor,
desired_name,
- password,
time_req,
&mechs,
cred_usage,
output_cred_handle,
actual_mechs,
&time_rec);
time_req,
&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;
if (initiator_time_rec != NULL)
*initiator_time_rec = time_rec;
if (acceptor_time_rec != NULL)
*acceptor_time_rec = time_rec;
if (initiator_time_rec != NULL)
*initiator_time_rec = time_rec;
if (acceptor_time_rec != NULL)
*acceptor_time_rec = time_rec;
+cleanup:
+ if (GSS_ERROR(major))
+ gssEapReleaseCred(&tmpMinor, output_cred_handle);
+
return major;
}
return major;
}