Make *Final work for key wrap again.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(cherry picked from commit 58f4698f67)
This commit is contained in:
Dr. Stephen Henson 2014-07-17 22:27:50 +01:00
parent 6e1e5996df
commit 4c05b1f8d6

View File

@ -2075,6 +2075,8 @@ static int aes_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
{ {
EVP_AES_WRAP_CTX *wctx = ctx->cipher_data; EVP_AES_WRAP_CTX *wctx = ctx->cipher_data;
size_t rv; size_t rv;
if (!in)
return 0;
if (inlen % 8) if (inlen % 8)
return -1; return -1;
if (ctx->encrypt && inlen < 8) if (ctx->encrypt && inlen < 8)
@ -2088,8 +2090,6 @@ static int aes_wrap_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
else else
return inlen - 8; return inlen - 8;
} }
if (!in)
return 0;
if (ctx->encrypt) if (ctx->encrypt)
rv = CRYPTO_128_wrap(&wctx->ks.ks, wctx->iv, out, in, inlen, rv = CRYPTO_128_wrap(&wctx->ks.ks, wctx->iv, out, in, inlen,
(block128_f)AES_encrypt); (block128_f)AES_encrypt);