From 5f0ec332ab4b11aeaae04b3ae9bdcae5c7dfdbb3 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sat, 20 May 2006 03:06:08 +0000 Subject: [PATCH] * gssapi_krb5.hin: Add gss_mech_krb5_wrong * accept_sec_context.c (krb5_gss_accept_sec_context): * init_sec_context.c (krb5_gss_init_sec_context): * rel_oid.c (krb5_gss_internal_release_oid): Recognize gss_mech_krb5_wrong. git-svn-id: svn://anonsvn.mit.edu/krb5/branches/mechglue@18023 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/gssapi/krb5/ChangeLog | 9 +++++++++ src/lib/gssapi/krb5/accept_sec_context.c | 6 ++++++ src/lib/gssapi/krb5/gssapi_krb5.hin | 1 + src/lib/gssapi/krb5/init_sec_context.c | 3 +++ src/lib/gssapi/krb5/rel_oid.c | 1 + 5 files changed, 20 insertions(+) diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 5f6b85818..adf51162e 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,12 @@ +2006-05-19 Tom Yu + + * gssapi_krb5.hin: Add gss_mech_krb5_wrong. + + * accept_sec_context.c (krb5_gss_accept_sec_context): + * init_sec_context.c (krb5_gss_init_sec_context): + * rel_oid.c (krb5_gss_internal_release_oid): Recognize + gss_mech_krb5_wrong. + 2006-03-28 Tom Yu * krb5_gss_glue.c: Add krb5_mechanism_wrong. diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index 219d9da06..fe56e8dd7 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -341,6 +341,12 @@ krb5_gss_accept_sec_context(minor_status, context_handle, &ptr, KG_TOK_CTX_AP_REQ, input_token->length, 1))) { mech_used = gss_mech_krb5; + } else if ((code == G_WRONG_MECH) + &&!(code = g_verify_token_header((gss_OID) gss_mech_krb5_wrong, + &(ap_req.length), + &ptr, KG_TOK_CTX_AP_REQ, + input_token->length, 1))) { + mech_used = gss_mech_krb5_wrong; } else if ((code == G_WRONG_MECH) && !(code = g_verify_token_header((gss_OID) gss_mech_krb5_old, &(ap_req.length), diff --git a/src/lib/gssapi/krb5/gssapi_krb5.hin b/src/lib/gssapi/krb5/gssapi_krb5.hin index 20002478e..647d14e39 100644 --- a/src/lib/gssapi/krb5/gssapi_krb5.hin +++ b/src/lib/gssapi/krb5/gssapi_krb5.hin @@ -72,6 +72,7 @@ GSS_DLLIMP extern const gss_OID_desc * const GSS_KRB5_NT_PRINCIPAL_NAME; GSS_DLLIMP extern const gss_OID_desc * const gss_mech_krb5; GSS_DLLIMP extern const gss_OID_desc * const gss_mech_krb5_old; +GSS_DLLIMP extern const gss_OID_desc * const gss_mech_krb5_wrong; GSS_DLLIMP extern const gss_OID_set_desc * const gss_mech_set_krb5; GSS_DLLIMP extern const gss_OID_set_desc * const gss_mech_set_krb5_old; GSS_DLLIMP extern const gss_OID_set_desc * const gss_mech_set_krb5_both; diff --git a/src/lib/gssapi/krb5/init_sec_context.c b/src/lib/gssapi/krb5/init_sec_context.c index 4f4055932..8d4ddafe8 100644 --- a/src/lib/gssapi/krb5/init_sec_context.c +++ b/src/lib/gssapi/krb5/init_sec_context.c @@ -918,6 +918,9 @@ krb5_gss_init_sec_context(minor_status, claimant_cred_handle, } else if (g_OID_equal(mech_type, gss_mech_krb5_old)) { if (!cred->prerfc_mech) err = 1; + } else if (g_OID_equal(mech_type, gss_mech_krb5_wrong)) { + if (!cred->rfc_mech) + err = 1; } else { err = 1; } diff --git a/src/lib/gssapi/krb5/rel_oid.c b/src/lib/gssapi/krb5/rel_oid.c index cee46197e..dcb1fe97a 100644 --- a/src/lib/gssapi/krb5/rel_oid.c +++ b/src/lib/gssapi/krb5/rel_oid.c @@ -73,6 +73,7 @@ krb5_gss_internal_release_oid(minor_status, oid) if ((*oid != gss_mech_krb5) && (*oid != gss_mech_krb5_old) && + (*oid != gss_mech_krb5_wrong) && (*oid != gss_nt_krb5_name) && (*oid != gss_nt_krb5_principal)) { /* We don't know about this OID */ -- 2.26.2