comment out dumping code
[mech_eap.orig] / inquire_context.c
index 4646b49..0e7b586 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.
  */
 
+/*
+ * Return context handle properties.
+ */
+
 #include "gssapiP_eap.h"
 
 OM_uint32
@@ -45,10 +49,10 @@ gss_inquire_context(OM_uint32 *minor,
 {
     OM_uint32 major, tmpMinor;
 
-    *minor = 0;
-
-    if (ctx == GSS_C_NO_CONTEXT)
-        return GSS_S_NO_CONTEXT;
+    if (ctx == GSS_C_NO_CONTEXT) {
+        *minor = EINVAL;
+        return GSS_S_CALL_INACCESSIBLE_READ | GSS_S_NO_CONTEXT;
+    }
 
     GSSEAP_MUTEX_LOCK(&ctx->mutex);
 
@@ -80,11 +84,9 @@ gss_inquire_context(OM_uint32 *minor,
     }
 
     if (mech_type != NULL) {
-        if (!gssEapInternalizeOid(ctx->mechanismUsed, mech_type)) {
-            major = duplicateOid(minor, ctx->mechanismUsed, mech_type);
-            if (GSS_ERROR(major))
-                goto cleanup;
-        }
+        major = gssEapCanonicalizeOid(minor, ctx->mechanismUsed, 0, mech_type);
+        if (GSS_ERROR(major))
+            goto cleanup;
     }
 
     if (ctx_flags != NULL) {
@@ -100,6 +102,7 @@ gss_inquire_context(OM_uint32 *minor,
     }
 
     major = GSS_S_COMPLETE;
+    *minor = 0;
 
 cleanup:
     GSSEAP_MUTEX_UNLOCK(&ctx->mutex);