Skip to content

Commit

Permalink
Disbling AES-NI on FreeBSD as the feature checke does not work well
Browse files Browse the repository at this point in the history
and it enables it by mistake on IntelB. Coreb" i3-3240 Processor
  • Loading branch information
lucaderi committed Oct 29, 2023
1 parent 9fb7a63 commit 8769a22
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/third_party/src/gcrypt/aesni.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,17 @@ int mbedtls_aesni_has_support( unsigned int what )
return 0;
# endif
#endif

#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
if(force_no_aesni == 1)
return 0;
#endif

#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
/* In FreeBSD we don't have a reliable way to check AES-NI so better disable it */
return(0);
#endif

#if defined(linux) || defined(__linux__)
if(has_aesni_checked == 0) {
/*
Expand Down Expand Up @@ -114,6 +119,7 @@ int mbedtls_aesni_has_support( unsigned int what )

return ( (ecx & what) != 0 );
#endif

#elif defined(WIN32) || defined(WIN64)
int cpuInfo[4];

Expand Down

0 comments on commit 8769a22

Please sign in to comment.