summaryrefslogtreecommitdiffstats
path: root/crypto/aes/aes_wrap.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-07-09 17:25:46 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-07-09 17:25:46 +0000
commit6ca141858718c6ba0dfccb7efc9916561b9fcc15 (patch)
treeebc90815fd6021284d0e46291864655f739e6c2b /crypto/aes/aes_wrap.c
parent30dd06812e0ded4f5dd0b3643f1c6e9bc13c589b (diff)
PR: 2297
Submitted by: Antony, Benoy <bantony@ebay.com> Approved by: steve@openssl.org Fix bug in AES wrap code when t > 0xff.
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 9feacd65d8..a9aebfe9b0 100644
--- a/crypto/aes/aes_wrap.c
+++ b/crypto/aes/aes_wrap.c
@@ -85,9 +85,9 @@ int AES_wrap_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(R, B + 8, 8);
}