summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rsa/rsa_pss.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_pss.c')
-rw-r--r--src/lib/libcrypto/rsa/rsa_pss.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_pss.c b/src/lib/libcrypto/rsa/rsa_pss.c
index f841b2f8a3..5e137a3090 100644
--- a/src/lib/libcrypto/rsa/rsa_pss.c
+++ b/src/lib/libcrypto/rsa/rsa_pss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_pss.c,v 1.10 2014/07/13 12:53:46 miod Exp $ */ 1/* $OpenBSD: rsa_pss.c,v 1.11 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 */
@@ -57,12 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
61 62
62#include <openssl/bn.h> 63#include <openssl/bn.h>
63#include <openssl/err.h> 64#include <openssl/err.h>
64#include <openssl/evp.h> 65#include <openssl/evp.h>
65#include <openssl/rand.h>
66#include <openssl/rsa.h> 66#include <openssl/rsa.h>
67#include <openssl/sha.h> 67#include <openssl/sha.h>
68 68
@@ -243,8 +243,7 @@ RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,
243 ERR_R_MALLOC_FAILURE); 243 ERR_R_MALLOC_FAILURE);
244 goto err; 244 goto err;
245 } 245 }
246 if (RAND_bytes(salt, sLen) <= 0) 246 arc4random_buf(salt, sLen);
247 goto err;
248 } 247 }
249 maskedDBLen = emLen - hLen - 1; 248 maskedDBLen = emLen - hLen - 1;
250 H = EM + maskedDBLen; 249 H = EM + maskedDBLen;