Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion crypto/fipsmodule/service_indicator/service_indicator.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ int is_fips_build(void) {

#if defined(AWSLC_FIPS)

// Trampoline function to avoid ARM64 ADR range issues in large FIPS module.
// This function is intentionally not inlined to ensure the __FILE__ string
// literal reference stays close to the call site, avoiding the ±1MB PC-relative
// addressing limit of the ARM64 ADR instruction.
#if defined(_MSC_VER)
__declspec(noinline)
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: this line is not strictly necessary since the delocator is not used on Windows; but I think it's fine for consistency.

#else
__attribute__((noinline))
#endif
static void put_set_thread_local_error(void) {
OPENSSL_PUT_ERROR(CRYPTO, ERR_R_INTERNAL_ERROR);
}

#define STATE_UNLOCKED 0
#define TLS_MD_EXTENDED_MASTER_SECRET_CONST "extended master secret"
#define TLS_MD_EXTENDED_MASTER_SECRET_CONST_SIZE 22
Expand Down Expand Up @@ -56,7 +69,7 @@ static struct fips_service_indicator_state *service_indicator_get(void) {

if (!CRYPTO_set_thread_local(
AWSLC_THREAD_LOCAL_FIPS_SERVICE_INDICATOR_STATE, indicator, free)) {
OPENSSL_PUT_ERROR(CRYPTO, ERR_R_INTERNAL_ERROR);
put_set_thread_local_error();
return NULL;
}
}
Expand Down
Loading