Hello
Earlier this year "Number Cruncher" already reported a valgrind error in
function AES_cbc_encrypt and included a two-line patch to fix it.
Please see this post for reference:
http://marc.info/?l=openssl-dev&m=123211846607090&w=2
Yesterday I ran into the same valgrind error message using OpenSSL
0.9.8k. The patch from this earlier post fixes the error.
Since my x86_64 assembler knowledge is insufficient to verify the
correctness of the patch I would request that someone checks it and
applies it to CVS.
Regards, Peter.
diff -Nur openssl-0.9.8k/crypto/aes/asm/aes-x86_64.pl openssl-0.9.8k.patched/crypto/aes/asm/aes-x86_64.pl
--- openssl-0.9.8k/crypto/aes/asm/aes-x86_64.pl 2008-12-27 14:34:30.000000000 +0100
+++ openssl-0.9.8k.patched/crypto/aes/asm/aes-x86_64.pl 2009-10-17 22:50:33.000000000 +0200
@@ -1181,12 +1181,12 @@
.Lcbc_cleanup:
cmpl \$0,$mark # was the key schedule copied?
lea $aes_key,%rdi
- mov $_rsp,%rsp
je .Lcbc_exit
mov \$240/8,%ecx
xor %rax,%rax
.long 0x90AB48F3 # rep stosq
.Lcbc_exit:
+ mov $_rsp,%rsp
popfq
pop %r15
pop %r14