X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=mech_eap%2Finquire_name.c;h=2a4e0e39b74fa26c3c4cfe9e54e8e7dfce0f181c;hb=refs%2Fheads%2Fjson-name;hp=e147d00e5ec80386ae738d7f131559da97e6357e;hpb=8f1dc4a262bff76448e5e94b7899277e1af150c7;p=moonshot.git diff --git a/mech_eap/inquire_name.c b/mech_eap/inquire_name.c index e147d00..2a4e0e3 100644 --- a/mech_eap/inquire_name.c +++ b/mech_eap/inquire_name.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, JANET(UK) + * Copyright (c) 2011, JANET(UK) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +30,10 @@ * SUCH DAMAGE. */ +/* + * Enumerate name attributes. + */ + #include "gssapiP_eap.h" OM_uint32 gss_inquire_name(OM_uint32 *minor, @@ -39,22 +43,32 @@ OM_uint32 gss_inquire_name(OM_uint32 *minor, gss_buffer_set_t *attrs) { OM_uint32 major, tmpMinor; - krb5_context krbContext; - *name_is_MN = 1; - *MN_mech = GSS_EAP_MECHANISM; - *attrs = GSS_C_NO_BUFFER_SET; + *minor = 0; + + if (name_is_MN != NULL) + *name_is_MN = 0; + if (MN_mech != NULL) + *MN_mech = GSS_C_NO_OID; + if (attrs != NULL) + *attrs = GSS_C_NO_BUFFER_SET; if (name == GSS_C_NO_NAME) { *minor = EINVAL; return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_BAD_NAME; } - GSSEAP_KRB_INIT(&krbContext); + if (attrs == NULL) + return GSS_S_COMPLETE; + GSSEAP_MUTEX_LOCK(&name->mutex); -cleanup: + major = gssEapInquireName(minor, name, name_is_MN, MN_mech, attrs); + GSSEAP_MUTEX_UNLOCK(&name->mutex); + if (GSS_ERROR(major)) + gss_release_buffer_set(&tmpMinor, attrs); + return major; }