Skip to content

Commit

Permalink
limit all tests to oqsprovider only
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Baentsch <57787676+baentsch@users.noreply.github.com>
  • Loading branch information
baentsch committed Jan 3, 2025
1 parent bda919b commit 2c81a50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions test/oqs_test_signatures.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ static int test_oqs_signatures(const char *sigalg_name) {
// TBD revisit when hybrids are activated: They always need default
// provider
if (OSSL_PROVIDER_available(libctx, "default")) {
// XXX testing omits passing propq limited to oqsprovider for now
// as sig key formats area reasonably stable; revisit as and when
// this changes to only test against itself
testresult &=
(ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name, NULL)) !=
NULL &&
(ctx = EVP_PKEY_CTX_new_from_name(
libctx, sigalg_name, "provider=oqsprovider")) != NULL &&
EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key) &&
(mdctx = EVP_MD_CTX_new()) != NULL &&
EVP_DigestSignInit_ex(mdctx, NULL, "SHA512", libctx, NULL, key,
Expand All @@ -66,13 +63,10 @@ static int test_oqs_signatures(const char *sigalg_name) {
mdctx = NULL;
key = NULL;

// XXX testing omits passing propq limited to oqsprovider for now
// as sig key formats area reasonably stable; revisit as and when
// this changes to only test against itself

// this test must work also with default provider inactive:
testresult &=
(ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name, NULL)) != NULL &&
(ctx = EVP_PKEY_CTX_new_from_name(libctx, sigalg_name,
"provider=oqsprovider")) != NULL &&
EVP_PKEY_keygen_init(ctx) && EVP_PKEY_generate(ctx, &key) &&
(mdctx = EVP_MD_CTX_new()) != NULL &&
EVP_DigestSignInit_ex(mdctx, NULL, NULL, libctx, NULL, key, NULL) &&
Expand Down
4 changes: 2 additions & 2 deletions test/tlstest_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/* Stolen from openssl/tests/sslapitest.c: */
int create_cert_key(OSSL_LIB_CTX *libctx, char *algname, char *certfilename,
char *privkeyfilename) {
// do test against any provider as handshaking should work with any provider
EVP_PKEY_CTX *evpctx = EVP_PKEY_CTX_new_from_name(libctx, algname, NULL);
EVP_PKEY_CTX *evpctx =
EVP_PKEY_CTX_new_from_name(libctx, algname, "provider=oqsprovider");
EVP_PKEY *pkey = NULL;
X509 *x509 = X509_new();
X509_NAME *name = NULL;
Expand Down

0 comments on commit 2c81a50

Please sign in to comment.