diff options
author | Michael Baentsch <info@baentsch.ch> | 2021-12-20 11:01:00 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-09 15:30:08 +0100 |
commit | 9316125febb5351c1ec791fe173fa42c20aac98a (patch) | |
tree | 7d83fa1a281552d22270d5f12e1bf87afcc72623 /test | |
parent | 25136fcf1b056c93cc8d88f2a93b76fda53bbaa2 (diff) |
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)
(cherry picked from commit 2080da84a49b0c52fc8c6e6caef5d373235bd3e4)
Diffstat (limited to 'test')
-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); |