use macros for checksum routines
authorJohn Kohl <jtkohl@mit.edu>
Fri, 26 Apr 1991 13:35:27 +0000 (13:35 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 26 Apr 1991 13:35:27 +0000 (13:35 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2036 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/rd_safe.c

index 50fd5ea38db7e34a42ee35b53ea31a397a18d1ee..57dde891b300a5b6ecc59ebd61c8f56e756c31fe 100644 (file)
@@ -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)) {