From 83b786fb8f443deeea39d7f89ea8b0ac823a33ba Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 26 Apr 1991 13:35:27 +0000 Subject: [PATCH] use macros for checksum routines git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2036 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/rd_safe.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/lib/krb5/krb/rd_safe.c b/src/lib/krb5/krb/rd_safe.c index 50fd5ea38..57dde891b 100644 --- a/src/lib/krb5/krb/rd_safe.c +++ b/src/lib/krb5/krb/rd_safe.c @@ -148,7 +148,7 @@ krb5_data *outbuf; message->checksum = his_cksum; if (!(our_cksum.contents = (krb5_octet *) - malloc(krb5_cksumarray[his_cksum->checksum_type]->checksum_length))) { + malloc(krb5_checksum_size(his_cksum->checksum_type)))) { cleanup(); return ENOMEM; } @@ -156,12 +156,10 @@ krb5_data *outbuf; #undef cleanup #define cleanup() {krb5_free_safe(message); xfree(our_cksum.contents);} - retval = (*(krb5_cksumarray[his_cksum->checksum_type]-> - sum_func))(scratch->data, - scratch->length, - (krb5_pointer) key->contents, - key->length, - &our_cksum); + retval = krb5_calculate_checksum(his_cksum->checksum_type, + scratch->data, scratch->length, + (krb5_pointer) key->contents, + key->length, &our_cksum); (void) memset((char *)scratch->data, 0, scratch->length); krb5_free_data(scratch); @@ -170,7 +168,6 @@ krb5_data *outbuf; return retval; } - if (our_cksum.length != his_cksum->length || memcmp((char *)our_cksum.contents, (char *)his_cksum->contents, our_cksum.length)) { -- 2.26.2