summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pem/pvkfmt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/pem/pvkfmt.c')
-rw-r--r--src/lib/libcrypto/pem/pvkfmt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/pem/pvkfmt.c b/src/lib/libcrypto/pem/pvkfmt.c
index ca7e908c29..2009c9db80 100644
--- a/src/lib/libcrypto/pem/pvkfmt.c
+++ b/src/lib/libcrypto/pem/pvkfmt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pvkfmt.c,v 1.11 2014/07/12 16:03:37 miod Exp $ */ 1/* $OpenBSD: pvkfmt.c,v 1.12 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 2005. 3 * project 2005.
4 */ 4 */
@@ -60,6 +60,7 @@
60 * and PRIVATEKEYBLOB). 60 * and PRIVATEKEYBLOB).
61 */ 61 */
62 62
63#include <stdlib.h>
63#include <string.h> 64#include <string.h>
64 65
65#include <openssl/opensslconf.h> 66#include <openssl/opensslconf.h>
@@ -67,7 +68,6 @@
67#include <openssl/bn.h> 68#include <openssl/bn.h>
68#include <openssl/err.h> 69#include <openssl/err.h>
69#include <openssl/pem.h> 70#include <openssl/pem.h>
70#include <openssl/rand.h>
71 71
72#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA) 72#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
73#include <openssl/dsa.h> 73#include <openssl/dsa.h>
@@ -869,8 +869,7 @@ i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, pem_password_cb *cb,
869 write_ledword(&p, enclevel ? PVK_SALTLEN : 0); 869 write_ledword(&p, enclevel ? PVK_SALTLEN : 0);
870 write_ledword(&p, pklen); 870 write_ledword(&p, pklen);
871 if (enclevel) { 871 if (enclevel) {
872 if (RAND_bytes(p, PVK_SALTLEN) <= 0) 872 arc4random_buf(p, PVK_SALTLEN);
873 goto error;
874 salt = p; 873 salt = p;
875 p += PVK_SALTLEN; 874 p += PVK_SALTLEN;
876 } 875 }