From: John Kohl Date: Fri, 26 Apr 1991 13:36:00 +0000 (+0000) Subject: use macros for checksum routines X-Git-Tag: krb5-1.0-alpha5~64 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a4ecbcac2b2ce5f931ec2ec5e6b41565d952f93d;p=krb5.git use macros for checksum routines insure that we set the timestamp/usec to zero if not in use git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2037 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/mk_priv.c b/src/lib/krb5/krb/mk_priv.c index 30ed10ddb..34788aed0 100644 --- a/src/lib/krb5/krb/mk_priv.c +++ b/src/lib/krb5/krb/mk_priv.c @@ -85,7 +85,8 @@ OLDDECLARG(krb5_data *, outbuf) if (retval = krb5_us_timeofday(&privmsg_enc_part.timestamp, &privmsg_enc_part.usec)) return retval; - } + } else + privmsg_enc_part.timestamp = 0, privmsg_enc_part.usec = 0; if (priv_flags & KRB5_PRIV_DOSEQUENCE) { privmsg_enc_part.seq_number = seq_number; } else diff --git a/src/lib/krb5/krb/mk_safe.c b/src/lib/krb5/krb/mk_safe.c index ecee2d66c..d66bd3460 100644 --- a/src/lib/krb5/krb/mk_safe.c +++ b/src/lib/krb5/krb/mk_safe.c @@ -80,7 +80,8 @@ OLDDECLARG(krb5_data *, outbuf) return KRB5_RC_REQUIRED; if (retval = krb5_us_timeofday(&safemsg.timestamp, &safemsg.usec)) return retval; - } + } else + safemsg.timestamp = 0, safemsg.usec = 0; if (safe_flags & KRB5_SAFE_DOSEQUENCE) { safemsg.seq_number = seq_number; } else @@ -104,16 +105,15 @@ OLDDECLARG(krb5_data *, outbuf) scratch->length); \ krb5_free_data(scratch);} - if (!(safe_checksum.contents = (krb5_octet *) - malloc(krb5_cksumarray[sumtype]->checksum_length))) { + if (!(safe_checksum.contents = + (krb5_octet *) malloc(krb5_checksum_size(sumtype)))) { clean_scratch(); return ENOMEM; } - if (retval = (*(krb5_cksumarray[sumtype]->sum_func))(scratch->data, - scratch->length, - (krb5_pointer) key->contents, - key->length, - &safe_checksum)) { + if (retval = krb5_calculate_checksum(sumtype, scratch->data, + scratch->length, + (krb5_pointer) key->contents, + key->length, &safe_checksum)) { xfree(safe_checksum.contents); clean_scratch(); return retval;