diff --git a/CMakeLists.txt b/CMakeLists.txt index db024f5e..097238b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.13.0) include(CheckIncludeFile) project(SymCrypt-OpenSSL - VERSION 1.11.0 + VERSION 1.11.1 DESCRIPTION "The SymCrypt engine and provider for OpenSSL (SCOSSL)" HOMEPAGE_URL "https://github.com/microsoft/SymCrypt-OpenSSL") diff --git a/test/KeysInUseTest/KeysInUseTest.cpp b/test/KeysInUseTest/KeysInUseTest.cpp index ed8932d1..7a13f728 100644 --- a/test/KeysInUseTest/KeysInUseTest.cpp +++ b/test/KeysInUseTest/KeysInUseTest.cpp @@ -13,6 +13,7 @@ #include "scossl_helpers.h" #include "keysinuse.h" +#include #include #if OPENSSL_VERSION_MAJOR == 3 #include @@ -91,9 +92,7 @@ static KEYSINUSE_TEST_KEY testKeys[] = { {EVP_PKEY_RSA, 2048, nullptr, nullptr, 0, {}}, {EVP_PKEY_RSA, 3072, nullptr, nullptr, 0, {}}, {EVP_PKEY_RSA, 4096, nullptr, nullptr, 0, {}}, -#ifdef NID_X9_62_prime192v1 // This curve is not available on Azure Linux 3 {EVP_PKEY_EC, NID_X9_62_prime192v1, nullptr, nullptr, 0, {}}, -#endif {EVP_PKEY_EC, NID_secp224r1, nullptr, nullptr, 0, {}}, {EVP_PKEY_EC, NID_X9_62_prime256v1, nullptr, nullptr, 0, {}}, {EVP_PKEY_EC, NID_secp384r1, nullptr, nullptr, 0, {}}, @@ -1624,6 +1623,18 @@ SCOSSL_STATUS keysinuse_test_generate_keys() } else if (testKeys[i].keyType == EVP_PKEY_EC) { + EC_GROUP *ecGroup = EC_GROUP_new_by_curve_name(testKeys[i].keygenParams); + if (ecGroup == NULL) + { + const char *curveName = OBJ_nid2sn(testKeys[i].keygenParams); + printf("Skipping unsupported curve %s\n", curveName != NULL ? curveName : ""); + ERR_clear_error(); + EVP_PKEY_CTX_free(ctx); + ctx = NULL; + continue; + } + EC_GROUP_free(ecGroup); + if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, testKeys[i].keygenParams) <= 0) { TEST_LOG_OPENSSL_ERROR("EVP_PKEY_CTX_set_ec_paramgen_curve_nid failed") @@ -1963,6 +1974,12 @@ int main(int argc, char** argv) for (KEYSINUSE_TEST_KEY testKey : testKeys) { + if (testKey.pkey == NULL) + { + // Key generation was skipped for this entry (unsupported curve). + continue; + } + if (testKey.keyType == EVP_PKEY_RSA) { printf("Testing RSA sign with size %d\n", testKey.keygenParams);