summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/evp/p_seal.c
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2015-07-28 11:46:38 -0400
committerPeter Jones <pjones@redhat.com>2015-07-28 11:46:38 -0400
commit5ce38c90cf43ee79cd999716ea83a5a44eeb819e (patch)
tree2fb3d9dd667c772fae5f87fa61e1501cf12da0ce /Cryptlib/OpenSSL/crypto/evp/p_seal.c
parent69ba24ff72921ecabbb47178de40dc5a79350040 (diff)
downloadefi-boot-shim-5ce38c90cf43ee79cd999716ea83a5a44eeb819e.tar.gz
efi-boot-shim-5ce38c90cf43ee79cd999716ea83a5a44eeb819e.zip
Update openssl to 1.0.2d
Also update Cryptlib to edk2 r17731 Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/evp/p_seal.c')
-rw-r--r--Cryptlib/OpenSSL/crypto/evp/p_seal.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Cryptlib/OpenSSL/crypto/evp/p_seal.c b/Cryptlib/OpenSSL/crypto/evp/p_seal.c
index be297dc9..ba9dfff2 100644
--- a/Cryptlib/OpenSSL/crypto/evp/p_seal.c
+++ b/Cryptlib/OpenSSL/crypto/evp/p_seal.c
@@ -82,15 +82,17 @@ int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
return 1;
if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0)
return 0;
- if (EVP_CIPHER_CTX_iv_length(ctx))
- RAND_pseudo_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx));
+ if (EVP_CIPHER_CTX_iv_length(ctx)
+ && RAND_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx)) <= 0)
+ return 0;
if (!EVP_EncryptInit_ex(ctx, NULL, NULL, key, iv))
return 0;
for (i = 0; i < npubk; i++) {
- ekl[i] = EVP_PKEY_encrypt(ek[i], key, EVP_CIPHER_CTX_key_length(ctx),
- pubk[i]);
+ ekl[i] =
+ EVP_PKEY_encrypt_old(ek[i], key, EVP_CIPHER_CTX_key_length(ctx),
+ pubk[i]);
if (ekl[i] <= 0)
return (-1);
}
@@ -113,6 +115,7 @@ int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl)
{
int i;
i = EVP_EncryptFinal_ex(ctx, out, outl);
- EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, NULL);
+ if (i)
+ i = EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, NULL);
return i;
}