From: John Carr Date: Wed, 8 Apr 1992 20:25:49 +0000 (+0000) Subject: Fix sign error X-Git-Tag: krb5-1.0-beta2~187 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=16ca39cde2a7485ce4322212f4c07b70916a6cc5;p=krb5.git Fix sign error git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2275 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/des/krb_glue.c b/src/lib/crypto/des/krb_glue.c index 188e95dff..690e43c02 100644 --- a/src/lib/crypto/des/krb_glue.c +++ b/src/lib/crypto/des/krb_glue.c @@ -184,12 +184,14 @@ OLDDECLARG(krb5_pointer, ivec) cksum.contents = contents; - if (retval = krb5_calculate_checksum(CKSUMTYPE_CRC32, - (krb5_pointer) out, - sumsize, - (krb5_pointer)key->key->contents, - sizeof(mit_des_cblock), - &cksum)) + /* This is equivalent to krb5_calculate_checksum(CKSUMTYPE_CRC32,...) + but avoids use of the cryptosystem config table which can not be + referenced here if this object is to be included in a shared library. */ + if (retval = crc32_cksumtable_entry.sum_func((krb5_pointer) out, + sumsize, + (krb5_pointer)key->key->contents, + sizeof(mit_des_cblock), + &cksum)) return retval; memcpy((char *)out+sizeof(mit_des_cblock), (char *)contents, @@ -228,19 +230,17 @@ OLDDECLARG(krb5_pointer, ivec) memcpy((char *)contents_get, p, CRC32_CKSUM_LENGTH); memset(p, 0, CRC32_CKSUM_LENGTH); - if (retval = krb5_calculate_checksum(CKSUMTYPE_CRC32, - out, - size, - (krb5_pointer)key->key->contents, - sizeof(mit_des_cblock), - &cksum)) + if (retval = crc32_cksumtable_entry.sum_func(out, size, + (krb5_pointer)key->key->contents, + sizeof(mit_des_cblock), + &cksum)) return retval; if (memcmp((char *)contents_get, (char *)contents_prd, CRC32_CKSUM_LENGTH) ) return KRB5KRB_AP_ERR_BAD_INTEGRITY; memcpy((char *)out, (char *)out + sizeof(mit_des_cblock) + CRC32_CKSUM_LENGTH, - size - sizeof(mit_des_cblock) + CRC32_CKSUM_LENGTH); + size - sizeof(mit_des_cblock) - CRC32_CKSUM_LENGTH); return 0; }