Changed `mutual' element of struct _krb5_gss_ctx_id_rec into more general
authorKevin Mitchell <klmitch@mit.edu>
Fri, 7 Jun 1996 19:22:25 +0000 (19:22 +0000)
committerKevin Mitchell <klmitch@mit.edu>
Fri, 7 Jun 1996 19:22:25 +0000 (19:22 +0000)
`gss_flags' and updated functions that process it; now get delegation flag
set properly :)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8275 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/gssapi/krb5/ChangeLog
src/lib/gssapi/krb5/accept_sec_context.c
src/lib/gssapi/krb5/gssapiP_krb5.h
src/lib/gssapi/krb5/init_sec_context.c
src/lib/gssapi/krb5/inq_context.c
src/lib/gssapi/krb5/ser_sctx.c

index 88112479a843b3983ec1390891004715da5b704c..27512e776db6f01e4c84b921bb157e586b1ea54e 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jun  7 14:52:56 1996  Kevin L Mitchell  <klmitch@mit.edu>
+
+       * accept_sec_context.c, init_sec_context.c, inq_context.c,
+               gssapiP_krb5.h: changed `mutual' element of struct
+               _krb5_gss_ctx_id_rec into more general `gss_flags' and
+               updated functions that process it
+
 Tue May 14 19:09:49 1996  Richard Basch  <basch@lehman.com>
 
        * k5seal.c k5unseal.c util_cksum.c:
index 7c0d11743c7bb4332982f78b43e958ad173fa818..79d41b71dafea5878f26482a7cebc7684dbac474 100644 (file)
@@ -315,7 +315,8 @@ krb5_gss_accept_sec_context(ct, minor_status, context_handle,
    memset(ctx, 0, sizeof(krb5_gss_ctx_id_rec));
    ctx->auth_context = auth_context;
    ctx->initiate = 0;
-   ctx->mutual = gss_flags & GSS_C_MUTUAL_FLAG;
+   ctx->gss_flags = GSS_C_CONF_FLAG | GSS_C_INTEG_FLAG |
+       (gss_flags & (GSS_C_MUTUAL_FLAG | GSS_C_DELEG_FLAG));
    ctx->seed_init = 0;
    ctx->big_endian = bigend;
 
@@ -370,7 +371,7 @@ krb5_gss_accept_sec_context(ct, minor_status, context_handle,
 
    /* generate an AP_REP if necessary */
 
-   if (ctx->mutual) {
+   if (ctx->gss_flags & GSS_C_MUTUAL_FLAG) {
       krb5_data ap_rep;
       unsigned char * ptr;
       if ((code = krb5_mk_rep(context, auth_context, &ap_rep))) {
@@ -433,7 +434,7 @@ krb5_gss_accept_sec_context(ct, minor_status, context_handle,
    }
 
    if (ret_flags)
-      *ret_flags = GSS_C_CONF_FLAG | GSS_C_INTEG_FLAG | ctx->mutual;
+      *ret_flags = ctx->gss_flags;
 
    ctx->established = 1;
 
index a7aebbef7215d64e92c3b093e45f23c2db31852e..53c4f469181e67e4a3e781e9ae5f5f506d99bc96 100644 (file)
@@ -83,7 +83,7 @@ typedef struct _krb5_gss_enc_desc {
 
 typedef struct _krb5_gss_ctx_id_rec {
    int initiate;       /* nonzero if initiating, zero if accepting */
-   OM_uint32 mutual;
+   OM_uint32 gss_flags;
    int seed_init;
    unsigned char seed[16];
    krb5_principal here;
index d1eac9f401ec9be51062b98081f743af0369cec9..2b671680ae7f71e5388e7279f199bb55ee3062e6 100644 (file)
@@ -305,7 +305,8 @@ krb5_gss_init_sec_context(ct, minor_status, claimant_cred_handle,
       memset(ctx, 0, sizeof(krb5_gss_ctx_id_rec));
       ctx->auth_context = NULL;
       ctx->initiate = 1;
-      ctx->mutual = req_flags & GSS_C_MUTUAL_FLAG;
+      ctx->gss_flags = ((req_flags & (GSS_C_MUTUAL_FLAG | GSS_C_DELEG_FLAG)) |
+                       GSS_C_CONF_FLAG | GSS_C_INTEG_FLAG);
       ctx->flags = req_flags & GSS_C_DELEG_FLAG;
       ctx->seed_init = 0;
       ctx->big_endian = 0;  /* all initiators do little-endian, as per spec */
@@ -337,7 +338,8 @@ krb5_gss_init_sec_context(ct, minor_status, claimant_cred_handle,
 
       if ((code = make_ap_req(context, &(ctx->auth_context), cred, 
                              ctx->there, &ctx->endtime, input_chan_bindings, 
-                             ctx->mutual, &ctx->flags, &token))) {
+                             ctx->gss_flags & GSS_C_MUTUAL_FLAG, &ctx->flags,
+                             &token))) {
         krb5_free_principal(context, ctx->here);
         krb5_free_principal(context, ctx->there);
         xfree(ctx);
@@ -403,13 +405,12 @@ krb5_gss_init_sec_context(ct, minor_status, claimant_cred_handle,
       *output_token = token;
 
       if (ret_flags)
-        *ret_flags = ((req_flags & (GSS_C_MUTUAL_FLAG | GSS_C_DELEG_FLAG)) | 
-                      GSS_C_CONF_FLAG | GSS_C_INTEG_FLAG);
+        *ret_flags = ctx->gss_flags;
 
       /* return successfully */
 
       *minor_status = 0;
-      if (ctx->mutual) {
+      if (ctx->gss_flags & GSS_C_MUTUAL_FLAG) {
         ctx->established = 0;
         return(GSS_S_CONTINUE_NEEDED);
       } else {
index 8ccd8fbb93299f6c10e92d23756768b7611c6aa6..c8499212fb2113e8abf31950d17403e9c9ec0a0b 100644 (file)
@@ -119,7 +119,7 @@ krb5_gss_inquire_context(ct, minor_status, context_handle, initiator_name,
       *mech_type = (gss_OID) gss_mech_krb5;
 
    if (ret_flags)
-      *ret_flags = GSS_C_CONF_FLAG | GSS_C_INTEG_FLAG | ctx->mutual;
+      *ret_flags = ctx->gss_flags;
 
    if (locally_initiated)
       *locally_initiated = ctx->initiate;
index 7b64f74219ce24b4e9865509570a46d627b73406..5acfd5c678734697b5841bf892039323ad40ddef 100644 (file)
@@ -578,7 +578,7 @@ kg_ctx_externalize(kcontext, arg, buffer, lenremain)
            /* Now static data */
            (void) krb5_ser_pack_int32((krb5_int32) ctx->initiate,
                                       &bp, &remain);
-           (void) krb5_ser_pack_int32((krb5_int32) ctx->mutual,
+           (void) krb5_ser_pack_int32((krb5_int32) ctx->gss_flags,
                                       &bp, &remain);
            (void) krb5_ser_pack_int32((krb5_int32) ctx->seed_init,
                                       &bp, &remain);
@@ -683,7 +683,7 @@ kg_ctx_internalize(kcontext, argp, buffer, lenremain)
            (void) krb5_ser_unpack_int32(&ibuf, &bp, &remain);
            ctx->initiate = (int) ibuf;
            (void) krb5_ser_unpack_int32(&ibuf, &bp, &remain);
-           ctx->mutual = (int) ibuf;
+           ctx->gss_flags = (int) ibuf;
            (void) krb5_ser_unpack_int32(&ibuf, &bp, &remain);
            ctx->seed_init = (int) ibuf;
            (void) krb5_ser_unpack_bytes((krb5_octet *) ctx->seed,