diff options
author | Damien Miller <djm@mindrot.org> | 2018-11-23 10:40:06 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2018-11-23 10:42:05 +1100 |
commit | 42c5ec4b97b6a1bae70f323952d0646af16ce710 (patch) | |
tree | 6d85f7daebb7241b80bc91126f433dca62e850e8 /ssh-keysign.c | |
parent | 5b60b6c02009547a3e2a99d4886965de2a4719da (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-keysign.c')
-rw-r--r-- | ssh-keysign.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/ssh-keysign.c b/ssh-keysign.c index bcd1508c0..8f487b8c5 100644 --- a/ssh-keysign.c +++ b/ssh-keysign.c | |||
@@ -174,9 +174,6 @@ main(int argc, char **argv) | |||
174 | u_char *signature, *data, rver; | 174 | u_char *signature, *data, rver; |
175 | char *host, *fp; | 175 | char *host, *fp; |
176 | size_t slen, dlen; | 176 | size_t slen, dlen; |
177 | #ifdef WITH_OPENSSL | ||
178 | u_int32_t rnd[256]; | ||
179 | #endif | ||
180 | 177 | ||
181 | ssh_malloc_init(); /* must be called before any mallocs */ | 178 | ssh_malloc_init(); /* must be called before any mallocs */ |
182 | if (pledge("stdio rpath getpw dns id", NULL) != 0) | 179 | if (pledge("stdio rpath getpw dns id", NULL) != 0) |
@@ -224,12 +221,6 @@ main(int argc, char **argv) | |||
224 | if (found == 0) | 221 | if (found == 0) |
225 | fatal("could not open any host key"); | 222 | fatal("could not open any host key"); |
226 | 223 | ||
227 | #ifdef WITH_OPENSSL | ||
228 | OpenSSL_add_all_algorithms(); | ||
229 | arc4random_buf(rnd, sizeof(rnd)); | ||
230 | RAND_seed(rnd, sizeof(rnd)); | ||
231 | #endif | ||
232 | |||
233 | found = 0; | 224 | found = 0; |
234 | for (i = 0; i < NUM_KEYTYPES; i++) { | 225 | for (i = 0; i < NUM_KEYTYPES; i++) { |
235 | keys[i] = NULL; | 226 | keys[i] = NULL; |