X-Git-Url: https://git.openssl.org/gitweb/?a=blobdiff_plain;f=crypto%2Faes%2Faes_wrap.c;h=e2d73d37cedae45a33a0a3b12eeac933a2448eca;hb=13b0cae25691722c53e2050a9263720d9f444f27;hp=a9aebfe9b0c0496a133cf39c88863b202f685a16;hpb=6ca141858718c6ba0dfccb7efc9916561b9fcc15;p=openssl.git 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);