Skip to content

Commit

Permalink
Merge pull request #7975 from douzzer/20240913-fixes
Browse files Browse the repository at this point in the history
20240913-fixes
  • Loading branch information
dgarske authored Sep 14, 2024
2 parents 4fa20cb + 84f0800 commit 0d5659f
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 14 deletions.
7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,9 @@ if test "$enable_all_crypto" = "yes" &&
test "$HAVE_GNUC" = "yes" &&
test "$enable_sp_asm" != "no" &&
test "$enable_intelasm" != "no" &&
test "$enable_armasm" != "no"
test "$enable_armasm" != "no" &&
test "$enable_afalg" != "yes" &&
test "$ENABLED_32BIT" = "no"
then
DEFAULT_ENABLED_ALL_ASM=yes
else
Expand Down Expand Up @@ -1187,7 +1189,8 @@ then
test "$enable_shake128" = "" && enable_shake128=yes
test "$enable_shake256" = "" && enable_shake256=yes
test "$enable_compkey" = "" && test "$ENABLED_LINUXKM_DEFAULTS" != "yes" && enable_compkey=yes
test "$enable_srtp_kdf" = "" && enable_srtp_kdf=yes
# AFALG lacks AES-ECB
test "$enable_srtp_kdf" = "" && test "$enable_afalg" != "yes" && enable_srtp_kdf=yes
fi

if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -le 5; then
Expand Down
12 changes: 12 additions & 0 deletions linuxkm/linuxkm_wc_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,12 @@
#ifdef HAVE_OCSP
struct Signer* GetCAByKeyHash(void* vp, const unsigned char* keyHash);
#endif /* HAVE_OCSP */
#ifdef WOLFSSL_AKID_NAME
struct Signer* GetCAByAKID(void* vp, const unsigned char* issuer,
unsigned int issuerSz,
const unsigned char* serial,
unsigned int serialSz);
#endif
#endif /* NO_SKID */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

Expand Down Expand Up @@ -636,6 +642,9 @@
typeof(GetCAByKeyHash) *GetCAByKeyHash;
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#ifdef WOLFSSL_AKID_NAME
typeof(GetCAByAKID) *GetCAByAKID;
#endif /* WOLFSSL_AKID_NAME */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
Expand Down Expand Up @@ -788,6 +797,9 @@
#define GetCAByKeyHash (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByKeyHash)
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#ifdef WOLFSSL_AKID_NAME
#define GetCAByAKID (wolfssl_linuxkm_get_pie_redirect_table()->GetCAByAKID)
#endif
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
Expand Down
5 changes: 4 additions & 1 deletion linuxkm/module_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,12 @@ static int set_up_wolfssl_linuxkm_pie_redirect_table(void) {
#ifndef NO_SKID
wolfssl_linuxkm_pie_redirect_table.GetCAByName = GetCAByName;
#ifdef HAVE_OCSP
wolfssl_linuxkm_pie_redirect_table.GetCAByKeyHash = GetCAByKeyHash;
wolfssl_linuxkm_pie_redirect_table.GetCAByKeyHash = GetCAByKeyHash;
#endif /* HAVE_OCSP */
#endif /* NO_SKID */
#ifdef WOLFSSL_AKID_NAME
wolfssl_linuxkm_pie_redirect_table.GetCAByAKID = GetCAByAKID;
#endif /* WOLFSSL_AKID_NAME */
#endif /* !WOLFCRYPT_ONLY && !NO_CERTS */

#ifdef WOLFSSL_DEBUG_BACKTRACE_ERROR_CODES
Expand Down
2 changes: 1 addition & 1 deletion src/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -14230,7 +14230,7 @@ int wolfSSL_X509_set_version(WOLFSSL_X509* x509, long v)

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

#if defined(OPENSSL_ALL) && \
#if (defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)) && \
defined(WOLFSSL_CERT_GEN) && defined(WOLFSSL_CERT_REQ)

void wolfSSL_X509V3_set_ctx(WOLFSSL_X509V3_CTX* ctx, WOLFSSL_X509* issuer,
Expand Down
4 changes: 3 additions & 1 deletion wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -13370,7 +13370,7 @@ static int GenerateDNSEntryIPString(DNS_entry* entry, void* heap)
{
int ret = 0;
size_t nameSz = 0;
char tmpName[WOLFSSL_MAX_IPSTR] = {0};
char tmpName[WOLFSSL_MAX_IPSTR];
unsigned char* ip;

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

XMEMSET(tmpName, 0, sizeof(tmpName));

/* store IP addresses as a string */
if (entry->len == WOLFSSL_IP4_ADDR_LEN) {
if (XSNPRINTF(tmpName, sizeof(tmpName), "%u.%u.%u.%u", 0xFFU & ip[0],
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -6462,7 +6462,7 @@ WOLFSSL_LOCAL WC_RNG* WOLFSSL_RSA_GetRNG(WOLFSSL_RSA *rsa, WC_RNG **tmpRNG,
#ifndef GetCA
WOLFSSL_LOCAL Signer* GetCA(void* vp, byte* hash);
#endif
#ifdef WOLFSSL_AKID_NAME
#if defined(WOLFSSL_AKID_NAME) && !defined(GetCAByAKID)
WOLFSSL_LOCAL Signer* GetCAByAKID(void* vp, const byte* issuer,
word32 issuerSz, const byte* serial, word32 serialSz);
#endif
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/openssl/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;
#define SSL_SESSION_get_master_key_length wolfSSL_SESSION_get_master_key_length
#define SSL_SESSION_get_max_early_data wolfSSL_SESSION_get_max_early_data

#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL)
#if defined(WOLFSSL_QT) || defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
#define SSL_MODE_RELEASE_BUFFERS 0x00000010U
#define ASN1_BOOLEAN WOLFSSL_ASN1_BOOLEAN
#define X509_get_ext wolfSSL_X509_get_ext
Expand Down
6 changes: 6 additions & 0 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2320,6 +2320,12 @@ extern void uITRON4_free(void *p) ;
#define HAVE_AESGCM
#endif

/* Detect Cortex M3 (no UMAAL) */
#if defined(WOLFSSL_SP_ARM_CORTEX_M_ASM) && defined(__ARM_ARCH_7M__)
#undef WOLFSSL_SP_NO_UMAAL
#define WOLFSSL_SP_NO_UMAAL
#endif

#if defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_AFALG_XILINX)
#if defined(WOLFSSL_ARMASM)
#error can not use both ARMv8 instructions and XILINX hardened crypto
Expand Down
7 changes: 0 additions & 7 deletions wolfssl/wolfcrypt/sp_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ extern "C" {
#define WOLFSSL_SP_DIV_WORD_HALF
#endif

/* Detect Cortex M3 (no UMAAL) */
#if defined(WOLFSSL_SP_ARM_CORTEX_M_ASM) && defined(__ARM_ARCH_7M__)
#undef WOLFSSL_SP_NO_UMAAL
#define WOLFSSL_SP_NO_UMAAL
#endif


/* Make sure WOLFSSL_SP_ASM build option defined when requested */
#if !defined(WOLFSSL_SP_ASM) && ( \
defined(WOLFSSL_SP_X86_64_ASM) || defined(WOLFSSL_SP_ARM32_ASM) || \
Expand Down

0 comments on commit 0d5659f

Please sign in to comment.