diff options
Diffstat (limited to 'test/endecoder_legacy_test.c')
-rw-r--r-- | test/endecoder_legacy_test.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/test/endecoder_legacy_test.c b/test/endecoder_legacy_test.c index 9e54f1f03b..b3bd4f5872 100644 --- a/test/endecoder_legacy_test.c +++ b/test/endecoder_legacy_test.c @@ -674,19 +674,48 @@ static int test_key(int idx) return ok; } +#define USAGE "rsa-key.pem dh-key.pem\n" +OPT_TEST_DECLARE_USAGE(USAGE) + int setup_tests(void) { size_t i; + if (!test_skip_common_options()) { + TEST_error("Error parsing test options\n"); + return 0; + } + if (test_get_argument_count() != 2) { + TEST_error("usage: endecoder_legacy_test %s", USAGE); + return 0; + } + TEST_info("Generating keys..."); for (i = 0; i < OSSL_NELEM(keys); i++) { +#ifndef OPENSSL_NO_DH + if (strcmp(keys[i].keytype, "DH") == 0) { + if (!TEST_ptr(keys[i].key = + load_pkey_pem(test_get_argument(1), NULL))) + return 0; + continue; + } +#endif +#ifndef OPENSSL_NO_DEPRECATED_3_0 + if (strcmp(keys[i].keytype, "RSA") == 0) { + if (!TEST_ptr(keys[i].key = + load_pkey_pem(test_get_argument(0), NULL))) + return 0; + continue; + } +#endif + TEST_info("Generating %s key...", keys[i].keytype); if (!TEST_ptr(keys[i].key = make_key(keys[i].keytype, keys[i].template_params))) return 0; } - TEST_info("Generating key... done"); + TEST_info("Generating keys done"); ADD_ALL_TESTS(test_key, OSSL_NELEM(test_stanzas)); return 1; |