summaryrefslogtreecommitdiffstats
path: root/crypto/aes/aes_wrap.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-08-30 23:58:47 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-08-30 23:58:47 +0000
commit6f0d9950f35dd5c1de95b9c365c6fb353d5e1d0e (patch)
tree45cb92705f5fdedeab9f2ec6b83d7cb450530747 /crypto/aes/aes_wrap.c
parent4705ff7d6d1f49a76301ef1eb5391d790ec0f9d3 (diff)
fix bug in AES_unwrap()
Diffstat (limited to 'crypto/aes/aes_wrap.c')
-rw-r--r--crypto/aes/aes_wrap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/aes/aes_wrap.c b/crypto/aes/aes_wrap.c
index a9aebfe9b0..e2d73d37ce 100644
--- a/crypto/aes/aes_wrap.c
+++ b/crypto/aes/aes_wrap.c
@@ -119,9 +119,9 @@ int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
A[7] ^= (unsigned char)(t & 0xff);
if (t > 0xff)
{
- A[6] ^= (unsigned char)((t & 0xff) >> 8);
- A[5] ^= (unsigned char)((t & 0xff) >> 16);
- A[4] ^= (unsigned char)((t & 0xff) >> 24);
+ A[6] ^= (unsigned char)((t >> 8) & 0xff);
+ A[5] ^= (unsigned char)((t >> 16) & 0xff);
+ A[4] ^= (unsigned char)((t >> 24) & 0xff);
}
memcpy(B + 8, R, 8);
AES_decrypt(B, B, key);