diff options
author | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2019-06-05 06:41:44 +0100 |
commit | 102062f825fb26a74295a1c089c00c4c4c76b68a (patch) | |
tree | 3db66bc8c8483cce66516dff36f6ef56065143d9 /regress/unittests/test_helper/test_helper.c | |
parent | 3d246f10429fc9a37b98eabef94fe8dc7c61002b (diff) | |
parent | fd0fa130ecf06d7d092932adcd5d77f1549bfc8d (diff) |
Import openssh_8.0p1.orig.tar.gz
Diffstat (limited to 'regress/unittests/test_helper/test_helper.c')
-rw-r--r-- | regress/unittests/test_helper/test_helper.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/regress/unittests/test_helper/test_helper.c b/regress/unittests/test_helper/test_helper.c index 4cc70852c..e7a47b265 100644 --- a/regress/unittests/test_helper/test_helper.c +++ b/regress/unittests/test_helper/test_helper.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: test_helper.c,v 1.8 2018/02/08 08:46:20 djm Exp $ */ | 1 | /* $OpenBSD: test_helper.c,v 1.11 2018/11/23 02:53:57 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> | 3 | * Copyright (c) 2011 Damien Miller <djm@mindrot.org> |
4 | * | 4 | * |
@@ -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 | ||
@@ -115,12 +117,17 @@ static test_onerror_func_t *test_onerror = NULL; | |||
115 | static void *onerror_ctx = NULL; | 117 | static void *onerror_ctx = NULL; |
116 | static const char *data_dir = NULL; | 118 | static const char *data_dir = NULL; |
117 | static char subtest_info[512]; | 119 | static char subtest_info[512]; |
120 | static int fast = 0; | ||
121 | static int slow = 0; | ||
118 | 122 | ||
119 | int | 123 | int |
120 | main(int argc, char **argv) | 124 | main(int argc, char **argv) |
121 | { | 125 | { |
122 | int ch; | 126 | int ch; |
123 | 127 | ||
128 | seed_rng(); | ||
129 | ERR_load_CRYPTO_strings(); | ||
130 | |||
124 | /* Handle systems without __progname */ | 131 | /* Handle systems without __progname */ |
125 | if (__progname == NULL) { | 132 | if (__progname == NULL) { |
126 | __progname = strrchr(argv[0], '/'); | 133 | __progname = strrchr(argv[0], '/'); |
@@ -134,8 +141,14 @@ main(int argc, char **argv) | |||
134 | } | 141 | } |
135 | } | 142 | } |
136 | 143 | ||
137 | while ((ch = getopt(argc, argv, "vqd:")) != -1) { | 144 | while ((ch = getopt(argc, argv, "Ffvqd:")) != -1) { |
138 | switch (ch) { | 145 | switch (ch) { |
146 | case 'F': | ||
147 | slow = 1; | ||
148 | break; | ||
149 | case 'f': | ||
150 | fast = 1; | ||
151 | break; | ||
139 | case 'd': | 152 | case 'd': |
140 | data_dir = optarg; | 153 | data_dir = optarg; |
141 | break; | 154 | break; |
@@ -167,17 +180,29 @@ main(int argc, char **argv) | |||
167 | } | 180 | } |
168 | 181 | ||
169 | int | 182 | int |
170 | test_is_verbose() | 183 | test_is_verbose(void) |
171 | { | 184 | { |
172 | return verbose_mode; | 185 | return verbose_mode; |
173 | } | 186 | } |
174 | 187 | ||
175 | int | 188 | int |
176 | test_is_quiet() | 189 | test_is_quiet(void) |
177 | { | 190 | { |
178 | return quiet_mode; | 191 | return quiet_mode; |
179 | } | 192 | } |
180 | 193 | ||
194 | int | ||
195 | test_is_fast(void) | ||
196 | { | ||
197 | return fast; | ||
198 | } | ||
199 | |||
200 | int | ||
201 | test_is_slow(void) | ||
202 | { | ||
203 | return slow; | ||
204 | } | ||
205 | |||
181 | const char * | 206 | const char * |
182 | test_data_file(const char *name) | 207 | test_data_file(const char *name) |
183 | { | 208 | { |