summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/cms/cms_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/cms/cms_enc.c')
-rw-r--r--src/lib/libcrypto/cms/cms_enc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/cms/cms_enc.c b/src/lib/libcrypto/cms/cms_enc.c
index efe19a3131..f97e4d5f34 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.5 2014/07/11 08:44:48 jsing Exp $ */ 1/* $OpenBSD: cms_enc.c,v 1.6 2014/10/22 13:02:04 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project. 3 * project.
4 */ 4 */
@@ -51,11 +51,12 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#include <stdlib.h>
55
54#include <openssl/asn1t.h> 56#include <openssl/asn1t.h>
55#include <openssl/cms.h> 57#include <openssl/cms.h>
56#include <openssl/err.h> 58#include <openssl/err.h>
57#include <openssl/pem.h> 59#include <openssl/pem.h>
58#include <openssl/rand.h>
59#include <openssl/x509v3.h> 60#include <openssl/x509v3.h>
60 61
61#include "cms_lcl.h" 62#include "cms_lcl.h"
@@ -119,8 +120,7 @@ cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
119 /* Generate a random IV if we need one */ 120 /* Generate a random IV if we need one */
120 ivlen = EVP_CIPHER_CTX_iv_length(ctx); 121 ivlen = EVP_CIPHER_CTX_iv_length(ctx);
121 if (ivlen > 0) { 122 if (ivlen > 0) {
122 if (RAND_pseudo_bytes(iv, ivlen) <= 0) 123 arc4random_buf(iv, ivlen);
123 goto err;
124 piv = iv; 124 piv = iv;
125 } 125 }
126 } else if (EVP_CIPHER_asn1_to_param(ctx, calg->parameter) <= 0) { 126 } else if (EVP_CIPHER_asn1_to_param(ctx, calg->parameter) <= 0) {