summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-11-23 10:40:06 +1100
committerDamien Miller <djm@mindrot.org>2018-11-23 10:42:05 +1100
commit42c5ec4b97b6a1bae70f323952d0646af16ce710 (patch)
tree6d85f7daebb7241b80bc91126f433dca62e850e8 /ssh-keygen.c
parent5b60b6c02009547a3e2a99d4886965de2a4719da (diff)
refactor libcrypto initialisation
Don't call OpenSSL_add_all_algorithms() unless OpenSSL actually supports it. Move all libcrypto initialisation to a single function, and call that from seed_rng() that is called early in each tool's main(). Prompted by patch from Rosen Penev
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 416d25be0..a67737350 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -2459,13 +2459,10 @@ main(int argc, char **argv)
2459 2459
2460 __progname = ssh_get_progname(argv[0]); 2460 __progname = ssh_get_progname(argv[0]);
2461 2461
2462#ifdef WITH_OPENSSL
2463 OpenSSL_add_all_algorithms();
2464#endif
2465 log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
2466
2467 seed_rng(); 2462 seed_rng();
2468 2463
2464 log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
2465
2469 msetlocale(); 2466 msetlocale();
2470 2467
2471 /* we need this for the home * directory. */ 2468 /* we need this for the home * directory. */