From: Dr. Stephen Henson Date: Thu, 17 Jul 2014 21:27:50 +0000 (+0100) Subject: Make *Final work for key wrap again. X-Git-Tag: master-post-reformat~575 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58f4698f67c33b723a9e99bed1101161a59eea73;p=oweals%2Fopenssl.git Make *Final work for key wrap again. Reviewed-by: Tim Hudson --- diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index ce300440a8..3501066b07 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -2097,6 +2097,8 @@ static int aes_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, { EVP_AES_WRAP_CTX *wctx = ctx->cipher_data; size_t rv; + if (!in) + return 0; if (inlen % 8) return -1; if (ctx->encrypt && inlen < 8) @@ -2110,8 +2112,6 @@ static int aes_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, else return inlen - 8; } - if (!in) - return 0; if (ctx->encrypt) rv = CRYPTO_128_wrap(&wctx->ks.ks, wctx->iv, out, in, inlen, (block128_f)AES_encrypt);