fix some nits when using default mechanism
authorLuke Howard <lukeh@padl.com>
Tue, 14 Sep 2010 00:01:12 +0000 (02:01 +0200)
committerLuke Howard <lukeh@padl.com>
Tue, 14 Sep 2010 00:01:12 +0000 (02:01 +0200)
mech_eap/inquire_context.c
mech_eap/mech [new file with mode: 0644]
mech_eap/util_mech.c

index abe6c62..1daf446 100644 (file)
@@ -79,6 +79,14 @@ gss_inquire_context(OM_uint32 *minor,
         *lifetime_rec = lifetime;
     }
 
+    if (mech_type != NULL) {
+        if (!gssEapInternalizeOid(ctx->mechanismUsed, mech_type)) {
+            major = duplicateOid(minor, ctx->mechanismUsed, mech_type);
+            if (GSS_ERROR(major))
+                goto cleanup;
+        }
+    }
+
     if (ctx_flags != NULL) {
         *ctx_flags = ctx->gssFlags;
     }
diff --git a/mech_eap/mech b/mech_eap/mech
new file mode 100644 (file)
index 0000000..a369876
--- /dev/null
@@ -0,0 +1,5 @@
+eap                    1.3.6.1.4.1.5322.21.1           libmech_eap.dylib
+eap-des3-cbc-sha1      1.3.6.1.4.1.5322.21.1.16        libmech_eap.dylib
+eap-aes128             1.3.6.1.4.1.5322.21.1.17        libmech_eap.dylib
+eap-aes256             1.3.6.1.4.1.5322.21.1.18        libmech_eap.dylib
+eap-rc4-hmac           1.3.6.1.4.1.5322.21.1.23        libmech_eap.dylib
index 7560575..d73eaf5 100644 (file)
@@ -133,7 +133,8 @@ gssEapEnctypeToOid(OM_uint32 *minor,
         return GSS_S_FAILURE;
     }
 
-    oid->elements = GSSEAP_MALLOC(GSS_EAP_MECHANISM->length + 1);
+    oid->length = GSS_EAP_MECHANISM->length + 1;
+    oid->elements = GSSEAP_MALLOC(oid->length);
     if (oid->elements == NULL) {
         *minor = ENOMEM;
         GSSEAP_FREE(oid);
@@ -198,6 +199,7 @@ gssEapIndicateMechs(OM_uint32 *minor,
 
     GSSEAP_FREE(etypes); /* XXX */
 
+    *minor = 0;
     return major;
 }