diff options
Diffstat (limited to 'src/lib/libcrypto/rsa/rsa_ssl.c')
| -rw-r--r-- | src/lib/libcrypto/rsa/rsa_ssl.c | 13 | 
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c index a5fe5004b1..73262f29c1 100644 --- a/src/lib/libcrypto/rsa/rsa_ssl.c +++ b/src/lib/libcrypto/rsa/rsa_ssl.c  | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: rsa_ssl.c,v 1.13 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_ssl.c,v 1.14 2014/10/22 13:02:04 jsing Exp $ */ | 
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 
| 3 | * All rights reserved. | 3 | * All rights reserved. | 
| 4 | * | 4 | * | 
| @@ -57,11 +57,11 @@ | |||
| 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/rand.h> | ||
| 65 | #include <openssl/rsa.h> | 65 | #include <openssl/rsa.h> | 
| 66 | 66 | ||
| 67 | int | 67 | int | 
| @@ -85,13 +85,10 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from, | |||
| 85 | /* pad out with non-zero random data */ | 85 | /* pad out with non-zero random data */ | 
| 86 | j = tlen - 3 - 8 - flen; | 86 | j = tlen - 3 - 8 - flen; | 
| 87 | 87 | ||
| 88 | if (RAND_bytes(p, j) <= 0) | 88 | arc4random_buf(p, j); | 
| 89 | return 0; | ||
| 90 | for (i = 0; i < j; i++) { | 89 | for (i = 0; i < j; i++) { | 
| 91 | while (*p == '\0') { | 90 | while (*p == '\0') | 
| 92 | if (RAND_bytes(p, 1) <= 0) | 91 | arc4random_buf(p, 1); | 
| 93 | return 0; | ||
| 94 | } | ||
| 95 | p++; | 92 | p++; | 
| 96 | } | 93 | } | 
| 97 | 94 | ||
