diff options
| author | Greg Hudson <ghudson@mit.edu> | 2009-11-30 16:12:36 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2009-11-30 16:12:36 +0000 |
| commit | a8927d0c4e159601aab0d68740dfe0b53ccf9328 (patch) | |
| tree | af470cc2de44ed23885d91a76f312a0a68991db0 /src/lib/crypto/openssl/hash_provider | |
| parent | bb7801ed460acdfde84de1310494e11ea62cd06a (diff) | |
| download | krb5-a8927d0c4e159601aab0d68740dfe0b53ccf9328.tar.gz krb5-a8927d0c4e159601aab0d68740dfe0b53ccf9328.tar.xz krb5-a8927d0c4e159601aab0d68740dfe0b53ccf9328.zip | |
Make the crc32 hash provider correctly chain multiple input buffers,
so that it returns the same result if you pass it one big buffer or
many small buffers containing the same data. To do this, change the
contract of mit_crc32 so that the cksum parameter is in-out.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23386 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/openssl/hash_provider')
| -rw-r--r-- | src/lib/crypto/openssl/hash_provider/hash_crc32.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/crypto/openssl/hash_provider/hash_crc32.c b/src/lib/crypto/openssl/hash_provider/hash_crc32.c index e748c98cfe..58efffe4f3 100644 --- a/src/lib/crypto/openssl/hash_provider/hash_crc32.c +++ b/src/lib/crypto/openssl/hash_provider/hash_crc32.c @@ -33,17 +33,15 @@ static krb5_error_code k5_crc32_hash(unsigned int icount, const krb5_data *input, krb5_data *output) { - unsigned long c, cn; + unsigned long c; unsigned int i; if (output->length != CRC32_CKSUM_LENGTH) return(KRB5_CRYPTO_INTERNAL); c = 0; - for (i=0; i<icount; i++) { - mit_crc32(input[i].data, input[i].length, &cn); - c ^= cn; - } + for (i=0; i<icount; i++) + mit_crc32(input[i].data, input[i].length, &c); store_32_le(c, output->data); return(0); |
