* k5seal.c (make_seal_token_v1): Use ANSI-style definition, instead of K&R plus
authorKen Raeburn <raeburn@mit.edu>
Fri, 8 Dec 2000 04:48:24 +0000 (04:48 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 8 Dec 2000 04:48:24 +0000 (04:48 +0000)
prototype.  Don't use too-big numbers even as placeholders.

* accept_sec_context.c (rd_and_store_for_creds): After creating an auth
context, set flags to require sequence numbers.
(krb5_gss_accept_sec_context): Likewise.
* init_sec_context.c (krb5_gss_init_sec_context): Likewise.
(thanks to assar for noticing this)

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

src/lib/gssapi/krb5/accept_sec_context.c
src/lib/gssapi/krb5/init_sec_context.c
src/lib/gssapi/krb5/k5seal.c

index 79f762717421bbdf8ef6c2a639eb70c669ad2c40..5250112ff7235c413b37737c9721d11688f0203a 100644 (file)
@@ -94,7 +94,8 @@ rd_and_store_for_creds(context, inbuf, out_cred)
     if ((retval = krb5_auth_con_init(context, &auth_context)))
        return(retval);
 
-    krb5_auth_con_setflags(context, auth_context, 0);
+    krb5_auth_con_setflags(context, auth_context,
+                          KRB5_AUTH_CONTEXT_DO_SEQUENCE);
 
     if ((retval = krb5_rd_cred(context, auth_context, inbuf, &creds, NULL))) 
        goto cleanup;
@@ -333,6 +334,8 @@ krb5_gss_accept_sec_context(minor_status, context_handle,
        major_status = GSS_S_FAILURE;
        goto fail;
    }
+   krb5_auth_con_setflags(context, auth_context,
+                         KRB5_AUTH_CONTEXT_DO_SEQUENCE);
    if ((code = krb5_auth_con_setrcache(context, auth_context, cred->rcache))) {
        major_status = GSS_S_FAILURE;
        goto fail;
index acac47184bd5d0c633ff3c706e9241564952a4d2..ddd849c63e4fd9c36768f8ccf82c109a93c4af96 100644 (file)
@@ -461,6 +461,8 @@ krb5_gss_init_sec_context(minor_status, claimant_cred_handle,
       ctx_free = ctx;
       if ((code = krb5_auth_con_init(context, &ctx->auth_context)))
          goto fail;
+      krb5_auth_con_setflags(context, ctx->auth_context,
+                            KRB5_AUTH_CONTEXT_DO_SEQUENCE);
       ctx->initiate = 1;
       ctx->gss_flags = KG_IMPLFLAGS(req_flags);
       ctx->seed_init = 0;
index 1ca108e653471967c4dae5b3d02228cf54e4157c..ff46afad88be14d25521745a1944f75b6a772018 100644 (file)
 #include "gssapiP_krb5.h"
 
 static krb5_error_code
-make_seal_token_v1 PROTOTYPE((krb5_context context,
-                             krb5_keyblock *enc,
-                             krb5_keyblock *seq,
-                             krb5_int32 *seqnum,
-                             int direction,
-                             gss_buffer_t text,
-                             gss_buffer_t token,
-                             int signalg,
-                             int cksum_size,
-                             int sealalg,
-                             int encrypt,
-                             int toktype,
-                             int bigend,
-                             gss_OID oid));
-
-static krb5_error_code
-make_seal_token_v1(context, enc, seq, seqnum, direction, text, token,
-                  signalg, cksum_size, sealalg, encrypt, toktype,
-                  bigend, oid)
-    krb5_context context;
-    krb5_keyblock *enc;
-    krb5_keyblock *seq;
-    krb5_int32 *seqnum;
-    int direction;
-    gss_buffer_t text;
-    gss_buffer_t token;
-    int signalg;
-    int cksum_size;
-    int sealalg;
-    int encrypt;
-    int toktype;
-    int bigend;
-    gss_OID oid;
+make_seal_token_v1 (krb5_context context,
+                   krb5_keyblock *enc,
+                   krb5_keyblock *seq,
+                   krb5_int32 *seqnum,
+                   int direction,
+                   gss_buffer_t text,
+                   gss_buffer_t token,
+                   int signalg,
+                   int cksum_size,
+                   int sealalg,
+                   int encrypt,
+                   int toktype,
+                   int bigend,
+                   gss_OID oid)
 {
     krb5_error_code code;
     size_t sumlen;
@@ -119,7 +100,7 @@ make_seal_token_v1(context, enc, seq, seqnum, direction, text, token,
        break;
     default:
        abort ();
-       return 12345654321;
+       return 12345654;
     }
 
     /* create the token buffer */