diff options
author | Michael Baentsch <info@baentsch.ch> | 2021-12-20 11:01:00 +0100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-12-23 02:55:15 +0100 |
commit | 2080da84a49b0c52fc8c6e6caef5d373235bd3e4 (patch) | |
tree | 9b1fd2393a800d7905e8df588523ba4635a278bc /test/upcallstest.c | |
parent | Add static check in BN_hex2bn (diff) | |
download | openssl-2080da84a49b0c52fc8c6e6caef5d373235bd3e4.tar.xz openssl-2080da84a49b0c52fc8c6e6caef5d373235bd3e4.zip |
improving tests for adding sigalg with empty digest
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17315)
Diffstat (limited to 'test/upcallstest.c')
-rw-r--r-- | test/upcallstest.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/upcallstest.c b/test/upcallstest.c index 76899fee3d..c4ef714713 100644 --- a/test/upcallstest.c +++ b/test/upcallstest.c @@ -71,11 +71,12 @@ static int obj_provider_init(const OSSL_CORE_HANDLE *handle, /* additional tests checking empty digest algs are accepted, too */ if (!c_obj_add_sigid(handle, SIGALG_OID, "", SIG_LN)) return 0; - if (!c_obj_add_sigid(handle, SIGALG_OID, NULL, SIG_LN)) - return 0; /* checking wrong digest alg name is rejected: */ if (c_obj_add_sigid(handle, SIGALG_OID, "NonsenseAlg", SIG_LN)) return 0; + /* Testing actual triplet addition under separate sig alg */ + if (!c_obj_add_sigid(handle, SIG_OID, NULL, SIG_LN)) + return 0; return 1; } @@ -105,6 +106,14 @@ static int obj_create_test(void) || !TEST_int_eq(signid, OBJ_ln2nid(SIG_LN))) goto err; + /* Check empty digest alg storage capability */ + sigalgnid = OBJ_txt2nid(SIG_OID); + if (!TEST_int_ne(sigalgnid, NID_undef) + || !TEST_true(OBJ_find_sigid_algs(sigalgnid, &digestnid, &signid)) + || !TEST_int_eq(digestnid, NID_undef) + || !TEST_int_ne(signid, NID_undef)) + goto err; + testresult = 1; err: OSSL_PROVIDER_unload(objprov); |