comment out dumping code
[mech_eap.orig] / export_name_composite.c
index 859baaa..7fb9840 100644 (file)
@@ -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
  * SUCH DAMAGE.
  */
 
-#include "gssapiP_eap.h"
-
 /*
- * Not sure about this. If we have a generalised representation of composite
- * names, it should be (a) defined in the naming extensions specification
- * and (b) implemented by the mechanism glue.
+ * Serialise a name and its attributes.
  */
+
+#include "gssapiP_eap.h"
+
 OM_uint32
 gss_export_name_composite(OM_uint32 *minor,
                           gss_name_t input_name,
                           gss_buffer_t exported_name)
 {
+    OM_uint32 major;
+
+    *minor = 0;
+
     if (input_name == GSS_C_NO_NAME) {
         *minor = EINVAL;
         return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_BAD_NAME;
     }
 
-    return gssEapExportNameInternal(minor, input_name, exported_name,
-                                    EXPORT_NAME_FLAG_OID | EXPORT_NAME_FLAG_ATTRS);
+    GSSEAP_MUTEX_LOCK(&input_name->mutex);
+
+    major = gssEapExportNameInternal(minor, input_name, exported_name,
+                                     EXPORT_NAME_FLAG_OID |
+                                     EXPORT_NAME_FLAG_COMPOSITE);
+
+    GSSEAP_MUTEX_UNLOCK(&input_name->mutex);
+
+    return major;
 }