/*
- * Copyright (c) 2010, JANET(UK)
+ * Copyright (c) 2011, JANET(UK)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* SUCH DAMAGE.
*/
+/*
+ * Function for canonicalizing a name; presently just duplicates it.
+ */
+
#include "gssapiP_eap.h"
OM_uint32
const gss_OID mech_type,
gss_name_t *output_name)
{
- if (!gssEapIsMechanismOid(mech_type)) {
- *minor = 0;
+ OM_uint32 major;
+
+ *minor = 0;
+
+ if (!gssEapIsMechanismOid(mech_type))
return GSS_S_BAD_MECH;
+
+ if (input_name == GSS_C_NO_NAME) {
+ *minor = EINVAL;
+ return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_BAD_NAME;
}
- return gssEapDuplicateName(minor, input_name, output_name);
+ GSSEAP_MUTEX_LOCK(&input_name->mutex);
+
+ major = gssEapCanonicalizeName(minor, input_name, mech_type, output_name);
+
+ GSSEAP_MUTEX_UNLOCK(&input_name->mutex);
+
+ return major;
}