summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/lib/krb5/mk_priv.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/krb5/mk_priv.c')
-rw-r--r--crypto/heimdal/lib/krb5/mk_priv.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/crypto/heimdal/lib/krb5/mk_priv.c b/crypto/heimdal/lib/krb5/mk_priv.c
index 1ee2bed..c880f10 100644
--- a/crypto/heimdal/lib/krb5/mk_priv.c
+++ b/crypto/heimdal/lib/krb5/mk_priv.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -33,7 +33,7 @@
#include <krb5_locl.h>
-RCSID("$Id: mk_priv.c,v 1.25 1999/12/02 17:05:11 joda Exp $");
+RCSID("$Id: mk_priv.c,v 1.28 2000/08/18 06:48:07 assar Exp $");
/*
*
@@ -52,7 +52,7 @@ krb5_mk_priv(krb5_context context,
u_char *buf;
size_t buf_size;
size_t len;
- int tmp_seq;
+ u_int32_t tmp_seq;
krb5_keyblock *key;
int32_t sec, usec;
KerberosTime sec2;
@@ -76,7 +76,7 @@ krb5_mk_priv(krb5_context context,
usec2 = usec;
part.usec = &usec2;
if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) {
- tmp_seq = ++auth_context->local_seqnumber;
+ tmp_seq = auth_context->local_seqnumber;
part.seq_number = &tmp_seq;
} else {
part.seq_number = NULL;
@@ -117,7 +117,11 @@ krb5_mk_priv(krb5_context context,
s.enc_part.etype = key->keytype;
s.enc_part.kvno = NULL;
- krb5_crypto_init(context, key, 0, &crypto);
+ ret = krb5_crypto_init(context, key, 0, &crypto);
+ if (ret) {
+ free (buf);
+ return ret;
+ }
ret = krb5_encrypt (context,
crypto,
KRB5_KU_KRB_PRIV,
@@ -159,6 +163,9 @@ krb5_mk_priv(krb5_context context,
}
memcpy (outbuf->data, buf + buf_size - len, len);
free (buf);
+ if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE)
+ auth_context->local_seqnumber =
+ (auth_context->local_seqnumber + 1) & 0xFFFFFFFF;
return 0;
fail:
OpenPOWER on IntegriCloud