summaryrefslogtreecommitdiffstats
path: root/crypto/evp
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-07-17 22:27:50 +0100
committerDr. Stephen Henson <steve@openssl.org>2014-07-17 23:31:11 +0100
commit4c05b1f8d641f3e25532aad955ed586ad614c114 (patch)
treebeae32a90db371dedfb6316b54cfbddf39daadc5 /crypto/evp
parent6e1e5996df318132eb4188e80faa17f64d94009a (diff)
Make *Final work for key wrap again.
Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 58f4698f67c33b723a9e99bed1101161a59eea73)
Diffstat (limited to 'crypto/evp')
-rw-r--r--crypto/evp/e_aes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index d20cecaaad..ae1fd0a2ed 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -2075,6 +2075,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)
@@ -2088,8 +2090,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);