Skip to content

Commit

Permalink
Enable pkcs11 in sanitizer jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
sfodagain committed Sep 16, 2023
1 parent f7d9318 commit 8e1f60f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 0 additions & 14 deletions tests/pkcs11_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions tests/tls_handler_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8e1f60f

Please sign in to comment.