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 /regress/unittests/test_helper/test_helper.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 'regress/unittests/test_helper/test_helper.c')
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index cd08b5778..6b4f343a8 100644 --- a/regress/unittests/test_helper/test_helper.c +++ b/regress/unittests/test_helper/test_helper.c | |||
@@ -35,11 +35,13 @@ | |||
35 | #include <signal.h> | 35 | #include <signal.h> |
36 | 36 | ||
37 | #include <openssl/bn.h> | 37 | #include <openssl/bn.h> |
38 | #include <openssl/err.h> | ||
38 | 39 | ||
39 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) | 40 | #if defined(HAVE_STRNVIS) && defined(HAVE_VIS_H) && !defined(BROKEN_STRNVIS) |
40 | # include <vis.h> | 41 | # include <vis.h> |
41 | #endif | 42 | #endif |
42 | 43 | ||
44 | #include "entropy.h" | ||
43 | #include "test_helper.h" | 45 | #include "test_helper.h" |
44 | #include "atomicio.h" | 46 | #include "atomicio.h" |
45 | 47 | ||
@@ -123,6 +125,9 @@ main(int argc, char **argv) | |||
123 | { | 125 | { |
124 | int ch; | 126 | int ch; |
125 | 127 | ||
128 | seed_rng(); | ||
129 | ERR_load_CRYPTO_strings(); | ||
130 | |||
126 | /* Handle systems without __progname */ | 131 | /* Handle systems without __progname */ |
127 | if (__progname == NULL) { | 132 | if (__progname == NULL) { |
128 | __progname = strrchr(argv[0], '/'); | 133 | __progname = strrchr(argv[0], '/'); |