diff options
Diffstat (limited to 'crypto/heimdal/lib/krb5/mk_rep.c')
-rw-r--r-- | crypto/heimdal/lib/krb5/mk_rep.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/crypto/heimdal/lib/krb5/mk_rep.c b/crypto/heimdal/lib/krb5/mk_rep.c index 060be03..ad750b0 100644 --- a/crypto/heimdal/lib/krb5/mk_rep.c +++ b/crypto/heimdal/lib/krb5/mk_rep.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997-1999 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,11 +33,11 @@ #include <krb5_locl.h> -RCSID("$Id: mk_rep.c,v 1.16 1999/12/02 17:05:11 joda Exp $"); +RCSID("$Id: mk_rep.c,v 1.18 2000/12/06 20:57:23 joda Exp $"); krb5_error_code krb5_mk_rep(krb5_context context, - krb5_auth_context *auth_context, + krb5_auth_context auth_context, krb5_data *outbuf) { krb5_error_code ret; @@ -53,21 +53,21 @@ krb5_mk_rep(krb5_context context, memset (&body, 0, sizeof(body)); - body.ctime = (*auth_context)->authenticator->ctime; - body.cusec = (*auth_context)->authenticator->cusec; + body.ctime = auth_context->authenticator->ctime; + body.cusec = auth_context->authenticator->cusec; body.subkey = NULL; - if ((*auth_context)->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) { + if (auth_context->flags & KRB5_AUTH_CONTEXT_DO_SEQUENCE) { krb5_generate_seq_number (context, - (*auth_context)->keyblock, - &(*auth_context)->local_seqnumber); + auth_context->keyblock, + &auth_context->local_seqnumber); body.seq_number = malloc (sizeof(*body.seq_number)); if (body.seq_number == NULL) return ENOMEM; - *(body.seq_number) = (*auth_context)->local_seqnumber; + *(body.seq_number) = auth_context->local_seqnumber; } else body.seq_number = NULL; - ap.enc_part.etype = (*auth_context)->keyblock->keytype; + ap.enc_part.etype = auth_context->keyblock->keytype; ap.enc_part.kvno = NULL; buf_size = length_EncAPRepPart(&body); @@ -84,8 +84,12 @@ krb5_mk_rep(krb5_context context, &len); free_EncAPRepPart (&body); - krb5_crypto_init(context, (*auth_context)->keyblock, - 0 /* ap.enc_part.etype */, &crypto); + ret = krb5_crypto_init(context, auth_context->keyblock, + 0 /* ap.enc_part.etype */, &crypto); + if (ret) { + free (buf); + return ret; + } ret = krb5_encrypt (context, crypto, KRB5_KU_AP_REQ_ENC_PART, |