From 8e1f60fdf07f86961da4f938c75fd708ac77f1a7 Mon Sep 17 00:00:00 2001 From: Igor Abdrakhimov Date: Fri, 15 Sep 2023 17:02:36 -0700 Subject: [PATCH] Enable pkcs11 in sanitizer jobs --- tests/pkcs11_test.c | 14 -------------- tests/tls_handler_test.c | 3 +-- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/tests/pkcs11_test.c b/tests/pkcs11_test.c index 352b1d245..0a6a10bc7 100644 --- a/tests/pkcs11_test.c +++ b/tests/pkcs11_test.c @@ -577,24 +577,10 @@ static int s_test_pkcs11_session_tests(struct aws_allocator *allocator, void *ct /* Reset PKCS#11 tokens and load library */ ASSERT_SUCCESS(s_pkcs11_tester_init(allocator)); - /* Assert that creating a session for an invalid slot fails. - * - * NOTE: We omit this part of the test when AddressSanitizer is being used, - * because SoftHSM v2.2 triggers it in this scenario. I've tried using a - * suppression file to ignore the issue, but the suppression isn't - * working and I still don't understand why after 1+ hours of effort. - * But this ifdef does the trick so that's what I'm doing. */ -#if defined(__has_feature) -# if __has_feature(address_sanitizer) -# define ADDRESS_SANITIZER_ENABLED 1 -# endif -#endif -#if !ADDRESS_SANITIZER_ENABLED CK_SESSION_HANDLE session = CK_INVALID_HANDLE; /* we haven't created any slots and we are starting from a clean softhsm, so any slot value is invalid. */ CK_SLOT_ID slot = 1; ASSERT_FAILS(aws_pkcs11_lib_open_session(s_pkcs11_tester.lib, slot, &session /*out*/)); -#endif /* Create a new slot, this reloads the softhsm library but the labels/slots remain intact */ CK_SLOT_ID created_slot = 0; diff --git a/tests/tls_handler_test.c b/tests/tls_handler_test.c index b44bc70fa..f6e3bb51f 100644 --- a/tests/tls_handler_test.c +++ b/tests/tls_handler_test.c @@ -2128,8 +2128,7 @@ static void s_import_cert(void *ctx) { static int s_test_concurrent_cert_import(struct aws_allocator *allocator, void *ctx) { (void)ctx; /* temporarily disable this on apple until we can fix importing to be more robust */ - /* temporarily disable this on linux until we can make CRYPTO_zalloc behave and stop angering ASan */ -# if defined(__APPLE__) || defined(__linux__) +# if defined(__APPLE__) return AWS_OP_SUCCESS; # endif