svn rev #22905: trunk/src/lib/crypto/builtin/enc_provider/
tsitkova@MIT.EDU
tsitkova at MIT.EDU
Fri Oct 16 13:14:15 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22905
Commit By: tsitkova
Log Message:
Fix the value of ivec in aes_decrypt_iov.
Changed Files:
U trunk/src/lib/crypto/builtin/enc_provider/aes.c
Modified: trunk/src/lib/crypto/builtin/enc_provider/aes.c
===================================================================
--- trunk/src/lib/crypto/builtin/enc_provider/aes.c 2009-10-16 12:21:59 UTC (rev 22904)
+++ trunk/src/lib/crypto/builtin/enc_provider/aes.c 2009-10-16 17:14:14 UTC (rev 22905)
@@ -338,6 +338,9 @@
krb5int_c_iov_get_block((unsigned char *)blockN2, BLOCK_SIZE, data, num_data, &input_pos);
krb5int_c_iov_get_block((unsigned char *)blockN1, BLOCK_SIZE, data, num_data, &input_pos);
+ if (ivec != NULL)
+ memcpy(ivec->data, blockN2, BLOCK_SIZE);
+
/* Decrypt second last block */
dec(tmp2, blockN2, &ctx);
/* Set tmp2 to last (possibly partial) plaintext block, and
@@ -351,9 +354,6 @@
memcpy(tmp2, blockN1, input_length ? input_length : BLOCK_SIZE);
dec(tmp3, tmp2, &ctx);
xorblock(tmp3, tmp);
- /* Copy out ivec first before we clobber blockN1 with plaintext */
- if (ivec != NULL)
- memcpy(ivec->data, blockN1, BLOCK_SIZE);
memcpy(blockN1, tmp3, BLOCK_SIZE);
/* Put the last two blocks back into the iovec */
More information about the cvs-krb5
mailing list