From d156945493e623a5a9cbcb260b12b92aad9df8b8 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 9 May 1990 14:43:27 +0000 Subject: [PATCH] update to new cksum interface git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@800 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/crc32/crc.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/lib/crypto/crc32/crc.c b/src/lib/crypto/crc32/crc.c index 4444b093e..0ce7589ba 100644 --- a/src/lib/crypto/crc32/crc.c +++ b/src/lib/crypto/crc32/crc.c @@ -89,23 +89,26 @@ static u_long const crc_table[256] = { }; static krb5_error_code -crc32_sum_func(in, out, seed, in_length, seed_length, outcksum) +crc32_sum_func(in, in_length, seed, seed_length, outcksum) krb5_pointer in; -krb5_pointer out; -krb5_pointer seed; size_t in_length; +krb5_pointer seed; size_t seed_length; krb5_checksum *outcksum; { - register u_char *data = (u_char *)in; + register u_char *data; register u_long c = 0; register int idx; int i; - outcksum->contents = (krb5_octet *)malloc(4); - if (!outcksum->contents) - return ENOMEM; - + data = (u_char *)seed; + for (i=0; i>= 8; + c ^= crc_table[idx]; + } + data = (u_char *)in; for (i=0; i