projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
420eb6a
)
Don't zap AES CBC IV, when decrypting truncated content in place.
author
Andy Polyakov
<appro@openssl.org>
Tue, 18 Jan 2005 00:24:55 +0000
(
00:24
+0000)
committer
Andy Polyakov
<appro@openssl.org>
Tue, 18 Jan 2005 00:24:55 +0000
(
00:24
+0000)
crypto/aes/aes_cbc.c
patch
|
blob
|
history
diff --git
a/crypto/aes/aes_cbc.c
b/crypto/aes/aes_cbc.c
index f909aaf47a19a1be0da7267206f3d7497432b393..d2ba6bcdb4659d1ed9c6a01a898b08e167e0f2ef 100644
(file)
--- a/
crypto/aes/aes_cbc.c
+++ b/
crypto/aes/aes_cbc.c
@@
-120,9
+120,11
@@
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
}
if (len) {
memcpy(tmp, in, AES_BLOCK_SIZE);
- AES_decrypt(tmp,
tmp
, key);
+ AES_decrypt(tmp,
out
, key);
for(n=0; n < len; ++n)
- out[n] = tmp[n] ^ ivec[n];
+ out[n] ^= ivec[n];
+ for(n=len; n < AES_BLOCK_SIZE; ++n)
+ out[n] = tmp[n];
memcpy(ivec, tmp, AES_BLOCK_SIZE);
}
}