From 2b363db997ac4d95053fd37e765b9759417080e5 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 14 Sep 2010 02:01:12 +0200 Subject: [PATCH] fix some nits when using default mechanism --- mech_eap/inquire_context.c | 8 ++++++++ mech_eap/mech | 5 +++++ mech_eap/util_mech.c | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 mech_eap/mech diff --git a/mech_eap/inquire_context.c b/mech_eap/inquire_context.c index abe6c62..1daf446 100644 --- a/mech_eap/inquire_context.c +++ b/mech_eap/inquire_context.c @@ -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 index 0000000..a369876 --- /dev/null +++ b/mech_eap/mech @@ -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 diff --git a/mech_eap/util_mech.c b/mech_eap/util_mech.c index 7560575..d73eaf5 100644 --- a/mech_eap/util_mech.c +++ b/mech_eap/util_mech.c @@ -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; } -- 2.1.4