s4:heimdal: import lorikeet-heimdal-200908050050 (commit 8714779fa7376fd9f7761587639e...
[samba.git] / source4 / heimdal / lib / gssapi / krb5 / init_sec_context.c
index dfa0e935e6c700822d6ed75de8cfbbf8d024cef1..b269d067988ea8b7b7fcd9fc7837a10f5afd8476 100644 (file)
@@ -31,9 +31,7 @@
  * SUCH DAMAGE.
  */
 
-#include "krb5/gsskrb5_locl.h"
-
-RCSID("$Id$");
+#include "gsskrb5_locl.h"
 
 /*
  * copy the addresses from `input_chan_bindings' (if any) to
@@ -131,6 +129,7 @@ _gsskrb5_create_ctx(
     krb5_data_zero(&ctx->fwd_data);
     ctx->lifetime              = GSS_C_INDEFINITE;
     ctx->order                 = NULL;
+    ctx->crypto                        = NULL;
     HEIMDAL_MUTEX_init(&ctx->ctx_id_mutex);
 
     kret = krb5_auth_con_init (context, &ctx->auth_context);
@@ -192,7 +191,7 @@ gsskrb5_get_creds(
     }
 
     ret = _gsskrb5_canon_name(minor_status, context, use_dns,
-                             target_name, &ctx->target);
+                             ctx->source, target_name, &ctx->target);
     if (ret)
        return ret;
 
@@ -257,7 +256,8 @@ gsskrb5_initiator_ready(
 
     krb5_auth_getremoteseqnumber (context, ctx->auth_context, &seq_number);
 
-    _gsskrb5i_is_cfx(ctx, &is_cfx);
+    _gsskrb5i_is_cfx(context, ctx, 0);
+    is_cfx = (ctx->more_flags & IS_CFX);
 
     ret = _gssapi_msg_order_create(minor_status,
                                   &ctx->order,
@@ -552,8 +552,10 @@ init_auth_restart
        flags |= GSS_C_REPLAY_FLAG;
     if (req_flags & GSS_C_SEQUENCE_FLAG)
        flags |= GSS_C_SEQUENCE_FLAG;
+#if 0
     if (req_flags & GSS_C_ANON_FLAG)
        ;                               /* XXX */
+#endif
     if (req_flags & GSS_C_DCE_STYLE) {
        /* GSS_C_DCE_STYLE implies GSS_C_MUTUAL_FLAG */
        flags |= GSS_C_DCE_STYLE | GSS_C_MUTUAL_FLAG;
@@ -686,7 +688,6 @@ repl_mutual
     krb5_error_code kret;
     krb5_data indata;
     krb5_ap_rep_enc_part *repl;
-    int is_cfx = 0;
 
     output_token->length = 0;
     output_token->value = NULL;
@@ -694,7 +695,7 @@ repl_mutual
     if (actual_mech_type)
        *actual_mech_type = GSS_KRB5_MECHANISM;
 
-    if (ctx->flags & GSS_C_DCE_STYLE) {
+    if (IS_DCE_STYLE(ctx)) {
        /* There is no OID wrapping. */
        indata.length   = input_token->length;
        indata.data     = input_token->value;
@@ -759,20 +760,6 @@ repl_mutual
     krb5_free_ap_rep_enc_part (context,
                               repl);
 
-    _gsskrb5i_is_cfx(ctx, &is_cfx);
-    if (is_cfx) {
-       krb5_keyblock *key = NULL;
-
-       kret = krb5_auth_con_getremotesubkey(context,
-                                            ctx->auth_context,
-                                            &key);
-       if (kret == 0 && key != NULL) {
-           ctx->more_flags |= ACCEPTOR_SUBKEY;
-           krb5_free_keyblock (context, key);
-       }
-    }
-
-
     *minor_status = 0;
     if (time_rec) {
        ret = _gsskrb5_lifetime_left(minor_status,