Skip to content

Commit 84f0800

Browse files
committed
configure.ac:
* set DEFAULT_ENABLED_ALL_ASM=no if enable_afalg or ENABLED_32BIT; * omit enable_srtp_kdf from enable-all-crypto if enable_afalg. linuxkm: add GetCAByAKID to wolfssl_linuxkm_pie_redirect_table. src/x509.c: in GenerateDNSEntryIPString(), use XMEMSET() to initialize tmpName, not = {0}, to avoid unmaskable compiler emission of memset() call. wolfssl/openssl/ssl.h: add OPENSSL_EXTRA to an existing OPENSSL_ALL-gated section, consistent with gating of correspinding section in wolfssl/ssl.h. wolfssl/wolfcrypt/settings.h: adopt setup for WOLFSSL_SP_NO_UMAAL from wolfssl/wolfcrypt/sp_int.h now that it's used by wolfcrypt/src/port/arm/thumb2-poly1305-asm.S.
1 parent 4fa20cb commit 84f0800

9 files changed

Lines changed: 33 additions & 14 deletions

File tree

configure.ac

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,9 @@ if test "$enable_all_crypto" = "yes" &&
10211021
test "$HAVE_GNUC" = "yes" &&
10221022
test "$enable_sp_asm" != "no" &&
10231023
test "$enable_intelasm" != "no" &&
1024-
test "$enable_armasm" != "no"
1024+
test "$enable_armasm" != "no" &&
1025+
test "$enable_afalg" != "yes" &&
1026+
test "$ENABLED_32BIT" = "no"
10251027
then
10261028
DEFAULT_ENABLED_ALL_ASM=yes
10271029
else
@@ -1187,7 +1189,8 @@ then
11871189
test "$enable_shake128" = "" && enable_shake128=yes
11881190
test "$enable_shake256" = "" && enable_shake256=yes
11891191
test "$enable_compkey" = "" && test "$ENABLED_LINUXKM_DEFAULTS" != "yes" && enable_compkey=yes
1190-
test "$enable_srtp_kdf" = "" && enable_srtp_kdf=yes
1192+
# AFALG lacks AES-ECB
1193+
test "$enable_srtp_kdf" = "" && test "$enable_afalg" != "yes" && enable_srtp_kdf=yes
11911194
fi
11921195

11931196
if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -le 5; then

linuxkm/linuxkm_wc_port.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,12 @@
464464
#ifdef HAVE_OCSP
465465
struct Signer* GetCAByKeyHash(void* vp, const unsigned char* keyHash);
466466
#endif /* HAVE_OCSP */
467+
#ifdef WOLFSSL_AKID_NAME
468+
struct Signer* GetCAByAKID(void* vp, const unsigned char* issuer,
469+
unsigned int issuerSz,
470+
const unsigned char* serial,
471+
unsigned int serialSz);
472+
#endif
467473
#endif /* NO_SKID */
468474
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
469475

@@ -636,6 +642,9 @@
636642
typeof(GetCAByKeyHash) *GetCAByKeyHash;
637643
#endif /* HAVE_OCSP */
638644
#endif /* NO_SKID */
645+
#ifdef WOLFSSL_AKID_NAME
646+
typeof(GetCAByAKID) *GetCAByAKID;
647+
#endif /* WOLFSSL_AKID_NAME */
639648
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
640649

641650
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
@@ -788,6 +797,9 @@
788797
#define GetCAByKeyHash (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByKeyHash)
789798
#endif /* HAVE_OCSP */
790799
#endif /* NO_SKID */
800+
#ifdef WOLFSSL_AKID_NAME
801+
#define GetCAByAKID (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByAKID)
802+
#endif
791803
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
792804

793805
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES

linuxkm/module_hooks.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,12 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
578578
#ifndef NO_SKID
579579
wolfssl_linuxkm_pie_redirect_table.GetCAByName = GetCAByName;
580580
#ifdef HAVE_OCSP
581-
wolfssl_linuxkm_pie_redirect_table.GetCAByKeyHash = GetCAByKeyHash;
581+
wolfssl_linuxkm_pie_redirect_table.GetCAByKeyHash = GetCAByKeyHash;
582582
#endif /* HAVE_OCSP */
583583
#endif /* NO_SKID */
584+
#ifdef WOLFSSL_AKID_NAME
585+
wolfssl_linuxkm_pie_redirect_table.GetCAByAKID = GetCAByAKID;
586+
#endif /* WOLFSSL_AKID_NAME */
584587
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */
585588

586589
#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES

src/x509.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14230,7 +14230,7 @@ int wolfSSL_X509_set_version(WOLFSSL_X509* x509, long v)
1423014230

1423114231
#endif /* (OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL) && WOLFSSL_CERT_GEN */
1423214232

14233-
#if defined(OPENSSL_ALL) && \
14233+
#if (defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)) && \
1423414234
defined(WOLFSSL_CERT_GEN) && defined(WOLFSSL_CERT_REQ)
1423514235

1423614236
void wolfSSL_X509V3_set_ctx(WOLFSSL_X509V3_CTX* ctx, WOLFSSL_X509* issuer,

wolfcrypt/src/asn.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13370,7 +13370,7 @@ static int GenerateDNSEntryIPString(DNS_entry* entry, void* heap)
1337013370
{
1337113371
int ret = 0;
1337213372
size_t nameSz = 0;
13373-
char tmpName[WOLFSSL_MAX_IPSTR] = {0};
13373+
char tmpName[WOLFSSL_MAX_IPSTR];
1337413374
unsigned char* ip;
1337513375

1337613376
if (entry == NULL || entry->type != ASN_IP_TYPE) {
@@ -13384,6 +13384,8 @@ static int GenerateDNSEntryIPString(DNS_entry* entry, void* heap)
1338413384
}
1338513385
ip = (unsigned char*)entry->name;
1338613386

13387+
XMEMSET(tmpName, 0, sizeof(tmpName));
13388+
1338713389
/* store IP addresses as a string */
1338813390
if (entry->len == WOLFSSL_IP4_ADDR_LEN) {
1338913391
if (XSNPRINTF(tmpName, sizeof(tmpName), "%u.%u.%u.%u", 0xFFU & ip[0],

wolfssl/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6462,7 +6462,7 @@ WOLFSSL_LOCAL WC_RNG* WOLFSSL_RSA_GetRNG(WOLFSSL_RSA *rsa, WC_RNG **tmpRNG,
64626462
#ifndef GetCA
64636463
WOLFSSL_LOCAL Signer* GetCA(void* vp, byte* hash);
64646464
#endif
6465-
#ifdef WOLFSSL_AKID_NAME
6465+
#if defined(WOLFSSL_AKID_NAME) && !defined(GetCAByAKID)
64666466
WOLFSSL_LOCAL Signer* GetCAByAKID(void* vp, const byte* issuer,
64676467
word32 issuerSz, const byte* serial, word32 serialSz);
64686468
#endif

wolfssl/openssl/ssl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
398398
#define SSL_SESSION_get_master_key_length wolfSSL_SESSION_get_master_key_length
399399
#define SSL_SESSION_get_max_early_data wolfSSL_SESSION_get_max_early_data
400400

401-
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
401+
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
402402
#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
403403
#define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
404404
#define X509_get_ext wolfSSL_X509_get_ext

wolfssl/wolfcrypt/settings.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,6 +2320,12 @@ extern void uITRON4_free(void *p) ;
23202320
#define HAVE_AESGCM
23212321
#endif
23222322

2323+
/* Detect Cortex M3 (no UMAAL) */
2324+
#if defined(WOLFSSL_SP_ARM_CORTEX_M_ASM) && defined(__ARM_ARCH_7M__)
2325+
#undef WOLFSSL_SP_NO_UMAAL
2326+
#define WOLFSSL_SP_NO_UMAAL
2327+
#endif
2328+
23232329
#if defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_AFALG_XILINX)
23242330
#if defined(WOLFSSL_ARMASM)
23252331
#error can not use both ARMv8 instructions and XILINX hardened crypto

wolfssl/wolfcrypt/sp_int.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,6 @@ extern "C" {
178178
#define WOLFSSL_SP_DIV_WORD_HALF
179179
#endif
180180

181-
/* Detect Cortex M3 (no UMAAL) */
182-
#if defined(WOLFSSL_SP_ARM_CORTEX_M_ASM) && defined(__ARM_ARCH_7M__)
183-
#undef WOLFSSL_SP_NO_UMAAL
184-
#define WOLFSSL_SP_NO_UMAAL
185-
#endif
186-
187-
188181
/* Make sure WOLFSSL_SP_ASM build option defined when requested */
189182
#if !defined(WOLFSSL_SP_ASM) && ( \
190183
defined(WOLFSSL_SP_X86_64_ASM) || defined(WOLFSSL_SP_ARM32_ASM) || \

0 commit comments

Comments
 (0)