diff options
Diffstat (limited to 'src/lib/libcrypto/cms/cms_enc.c')
| -rw-r--r-- | src/lib/libcrypto/cms/cms_enc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/cms/cms_enc.c b/src/lib/libcrypto/cms/cms_enc.c index 09a0d155b4..cce6e95b5e 100644 --- a/src/lib/libcrypto/cms/cms_enc.c +++ b/src/lib/libcrypto/cms/cms_enc.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cms_enc.c,v 1.18 2019/08/11 10:50:23 jsing Exp $ */ | 1 | /* $OpenBSD: cms_enc.c,v 1.19 2019/08/11 10:54:11 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 4 | * project. | 4 | * project. |
| @@ -119,8 +119,7 @@ cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) | |||
| 119 | /* Generate a random IV if we need one */ | 119 | /* Generate a random IV if we need one */ |
| 120 | ivlen = EVP_CIPHER_CTX_iv_length(ctx); | 120 | ivlen = EVP_CIPHER_CTX_iv_length(ctx); |
| 121 | if (ivlen > 0) { | 121 | if (ivlen > 0) { |
| 122 | if (RAND_bytes(iv, ivlen) <= 0) | 122 | arc4random_buf(iv, ivlen); |
| 123 | goto err; | ||
| 124 | piv = iv; | 123 | piv = iv; |
| 125 | } | 124 | } |
| 126 | } else if (EVP_CIPHER_asn1_to_param(ctx, calg->parameter) <= 0) { | 125 | } else if (EVP_CIPHER_asn1_to_param(ctx, calg->parameter) <= 0) { |
