| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dd28596 commit 5682e50
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -124,7 +124,16 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn) | |||
| 124 | 124 | char buffer[200]; | |
| 125 | 125 | ||
| 126 | 126 | #ifdef OPENSSL_SYS_WINDOWS | |
| 127 | - RAND_screen(); | ||
| 127 | + /* | ||
| 128 | + * allocate 2 to dont_warn not to use RAND_screen() via | ||
| 129 | + * -no_rand_screen option in s_client | ||
| 130 | + */ | ||
| 131 | + if (dont_warn != 2) { | ||
| 132 | + BIO_printf(bio_e, "Loading 'screen' into random state -"); | ||
| 133 | + BIO_flush(bio_e); | ||
| 134 | + RAND_screen(); | ||
| 135 | + BIO_printf(bio_e, " done\n"); | ||
| 136 | + } | ||
| 128 | 137 | #endif | |
| 129 | 138 | ||
| 130 | 139 | if (file == NULL) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -236,6 +236,7 @@ static BIO *bio_c_msg = NULL; | |||
| 236 | 236 | static int c_quiet = 0; | |
| 237 | 237 | static int c_ign_eof = 0; | |
| 238 | 238 | static int c_brief = 0; | |
| 239 | + static int c_no_rand_screen = 0; | ||
| 239 | 240 | ||
| 240 | 241 | #ifndef OPENSSL_NO_PSK | |
| 241 | 242 | /* Default PSK identity and key */ | |
@@ -451,6 +452,10 @@ static void sc_usage(void) | |||
| 451 | 452 | " -keymatexport label - Export keying material using label\n"); | |
| 452 | 453 | BIO_printf(bio_err, | |
| 453 | 454 | " -keymatexportlen len - Export len bytes of keying material (default 20)\n"); | |
| 455 | + #ifdef OPENSSL_SYS_WINDOWS | ||
| 456 | + BIO_printf(bio_err, | ||
| 457 | + " -no_rand_screen - Do not use RAND_screen() to initialize random state\n"); | ||
| 458 | + #endif | ||
| 454 | 459 | } | |
| 455 | 460 | ||
| 456 | 461 | #ifndef OPENSSL_NO_TLSEXT | |
@@ -1144,6 +1149,10 @@ int MAIN(int argc, char **argv) | |||
| 1144 | 1149 | keymatexportlen = atoi(*(++argv)); | |
| 1145 | 1150 | if (keymatexportlen == 0) | |
| 1146 | 1151 | goto bad; | |
| 1152 | + #ifdef OPENSSL_SYS_WINDOWS | ||
| 1153 | + } else if (strcmp(*argv, "-no_rand_screen") == 0) { | ||
| 1154 | + c_no_rand_screen = 1; | ||
| 1155 | + #endif | ||
| 1147 | 1156 | } else { | |
| 1148 | 1157 | BIO_printf(bio_err, "unknown option %s\n", *argv); | |
| 1149 | 1158 | badop = 1; | |
@@ -1260,7 +1269,7 @@ int MAIN(int argc, char **argv) | |||
| 1260 | 1269 | if (!load_excert(&exc, bio_err)) | |
| 1261 | 1270 | goto end; | |
| 1262 | 1271 | ||
| 1263 | - if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL | ||
| 1272 | + if (!app_RAND_load_file(NULL, bio_err, ++c_no_rand_screen) && inrand == NULL | ||
| 1264 | 1273 | && !RAND_status()) { | |
| 1265 | 1274 | BIO_printf(bio_err, | |
| 1266 | 1275 | "warning, not much extra random data, consider using the -rand option\n"); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments