Use IAKERB OID header for all IAKERB messages including AP-REQ
authorLuke Howard <lukeh@padl.com>
Mon, 27 Sep 2010 18:51:55 +0000 (18:51 +0000)
committerLuke Howard <lukeh@padl.com>
Mon, 27 Sep 2010 18:51:55 +0000 (18:51 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24363 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/accept_sec_context.c
src/lib/gssapi/krb5/iakerb.c
src/lib/gssapi/krb5/init_sec_context.c
src/lib/gssapi/krb5/rel_oid.c

index e3ec8224b4d525529264dcfac137fbce69957cce..47eff359d45fba689c9c3a6267f4f16f802ca835 100644 (file)
@@ -542,6 +542,12 @@ kg_accept_krb5(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_iakerb,
+                                                &(ap_req.length),
+                                                &ptr, KG_TOK_CTX_AP_REQ,
+                                                input_token->length, 1))) {
+        mech_used = gss_mech_iakerb;
     } else if ((code == G_WRONG_MECH)
                &&!(code = g_verify_token_header((gss_OID) gss_mech_krb5_wrong,
                                                 &(ap_req.length),
index 0a86fa56a7f5e6f57af0618ff6c93a72475352b4..8c9958ffdd7e875c16e98031a6316ca254341477 100644 (file)
@@ -857,7 +857,7 @@ iakerb_gss_accept_sec_context(OM_uint32 *minor_status,
                                                        input_token,
                                                        input_chan_bindings,
                                                        src_name,
-                                                       mech_type,
+                                                       NULL,
                                                        output_token,
                                                        ret_flags,
                                                        time_rec,
@@ -868,6 +868,8 @@ iakerb_gss_accept_sec_context(OM_uint32 *minor_status,
             ctx->gssc = NULL;
             iakerb_release_context(ctx);
         }
+        if (mech_type != NULL)
+            *mech_type = (gss_OID)gss_mech_krb5;
     }
 
 cleanup:
@@ -988,12 +990,12 @@ iakerb_gss_init_sec_context(OM_uint32 *minor_status,
                                                      (gss_cred_id_t) kcred,
                                                      &ctx->gssc,
                                                      target_name,
-                                                     GSS_C_NULL_OID,
+                                                     (gss_OID)gss_mech_iakerb,
                                                      req_flags,
                                                      time_req,
                                                      input_chan_bindings,
                                                      input_token,
-                                                     actual_mech_type,
+                                                     NULL,
                                                      output_token,
                                                      ret_flags,
                                                      time_rec,
@@ -1003,6 +1005,8 @@ iakerb_gss_init_sec_context(OM_uint32 *minor_status,
             ctx->gssc = GSS_C_NO_CONTEXT;
             iakerb_release_context(ctx);
         }
+        if (actual_mech_type != NULL)
+            *actual_mech_type = (gss_OID)gss_mech_krb5;
     } else {
         if (actual_mech_type != NULL)
             *actual_mech_type = (gss_OID)gss_mech_iakerb;
@@ -1024,4 +1028,3 @@ cleanup:
 
     return major_status;
 }
-
index 25cee16f0a2f71d2c7f621e9117ba5bdc7834998..19586b9bec9c01eaefc5fe085c74423d52025929 100644 (file)
@@ -1012,6 +1012,8 @@ krb5_gss_init_sec_context_ext(
         mech_type = (gss_OID) gss_mech_krb5_old;
     } else if (g_OID_equal(mech_type, gss_mech_krb5_wrong)) {
         mech_type = (gss_OID) gss_mech_krb5_wrong;
+    } else if (g_OID_equal(mech_type, gss_mech_iakerb)) {
+        mech_type = (gss_OID) gss_mech_iakerb;
     } else {
         k5_mutex_unlock(&cred->lock);
         if (claimant_cred_handle == GSS_C_NO_CREDENTIAL)
index dfa2738c61ec23b1bed3c82d200aefdbf66a2c00..4e6c0f671473a16124bfc8981227d94fa378b32a 100644 (file)
@@ -74,6 +74,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_mech_iakerb) &&
         (*oid != gss_nt_krb5_name) &&
         (*oid != gss_nt_krb5_principal)) {
         /* We don't know about this OID */