Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/sniffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -7866,13 +7866,13 @@ int ssl_PollSniffer(WOLF_EVENT** events, int maxEvents, WOLF_EVENT_FLAG flags,
#if defined(WOLFSSL_SNIFFER_KEYLOGFILE)

/* Maximum length of the NSS Keylog prefix string */
#define MAX_PREFIX_LENGTH (31)
#define MAX_PREFIX_LENGTH 31
/* Maximum length (in bytes) required to store the binary representation of
* the "client random" value parsed from keylog file */
#define CLIENT_RANDOM_LENGTH (32)
#define CLIENT_RANDOM_LENGTH 32
/* Maximum length (in bytes) required to store the binary representation of the
* "secret" value parsed from keylog file */
#define SECRET_LENGTH (48)
#define SECRET_LENGTH 48

typedef struct SecretNode {
unsigned char clientRandom[CLIENT_RANDOM_LENGTH];
Expand Down
2 changes: 1 addition & 1 deletion src/wolfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,7 @@ int GNRC_ReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *_ctx)
/* GNRC DTLS Generate Cookie callback
* return : number of bytes copied into buf, or error
*/
#define GNRC_MAX_TOKEN_SIZE (32)
#define GNRC_MAX_TOKEN_SIZE 32
#if defined(NO_SHA) && !defined(NO_SHA256)
#define GNRC_COOKIE_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
#elif !defined(NO_SHA)
Expand Down
6 changes: 3 additions & 3 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,12 @@
#if (defined(HAVE_ECC) && !defined(ALT_ECC_SIZE)) || \
defined(SESSION_CERTS) || defined(WOLFSSL_HAVE_MLKEM)
#ifdef OPENSSL_EXTRA
#define TEST_TLS_STATIC_MEMSZ (400000)
#define TEST_TLS_STATIC_MEMSZ 400000
#else
#define TEST_TLS_STATIC_MEMSZ (320000)
#define TEST_TLS_STATIC_MEMSZ 320000
#endif
#else
#define TEST_TLS_STATIC_MEMSZ (80000)
#define TEST_TLS_STATIC_MEMSZ 80000
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -15793,7 +15793,7 @@ static WC_INLINE int ecc_is_gcm(byte encAlgo)
}
#else
/* Compile GCM branches out entirely when AES-GCM isn't available. */
#define ecc_is_gcm(encAlgo) (0)
#define ecc_is_gcm(encAlgo) 0
#endif

static int ecc_get_key_sizes(ecEncCtx* ctx, int* encKeySz, int* ivSz,
Expand Down
16 changes: 8 additions & 8 deletions wolfcrypt/src/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ static WC_MAYBE_UNUSED int rng_entropy_event_propagate(WC_RNG* rng);
#ifdef HAVE_HASHDRBG

#define OUTPUT_BLOCK_LEN (WC_SHA256_DIGEST_SIZE)
#define MAX_REQUEST_LEN (0x10000)
#define MAX_REQUEST_LEN 0x10000

#ifdef WC_RNG_SEED_CB

Expand Down Expand Up @@ -10679,32 +10679,32 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
/* See: https://github.com/avrxml/asf/tree/master/sam/utils/cmsis/sam3x/include */
#if defined(__SAM3A4C__)
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#elif defined(__SAM3A8C__)
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#elif defined(__SAM3X4C__)
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#elif defined(__SAM3X4E__)
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#elif defined(__SAM3X8C__)
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#elif defined(__SAM3X8E__)
/* This is the Arduino Due */
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#elif defined(__SAM3A8H__)
#ifndef TRNG
#define TRNG (0x400BC000U)
#define TRNG 0x400BC000U
#endif
#else
#ifndef TRNG
Expand Down
14 changes: 7 additions & 7 deletions wolfcrypt/test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -59287,7 +59287,7 @@ static wc_test_ret_t ecc_ctx_apply_devid(ecEncCtx* ctx)
return (ret == 0) ? 0 : WC_TEST_RET_ENC_EC(ret);
}
#else
#define ecc_ctx_apply_devid(ctx) (0)
#define ecc_ctx_apply_devid(ctx) 0
#endif

#if !defined(WOLFSSL_NO_MALLOC)
Expand Down Expand Up @@ -78876,13 +78876,13 @@ static int lms_read_key_mem(byte * priv, word32 privSz, void *context)
* that has it: SHA-256/256, then SHA-256/192, then SHAKE-256/256, then
* SHAKE-256/192. A 32-byte hash gives 8688 bytes and a 24-byte one 4960. */
#if !defined(WOLFSSL_NO_LMS_SHA256_256)
#define WC_TEST_LMS_SIG_LEN (8688)
#define WC_TEST_LMS_SIG_LEN 8688
#elif defined(WOLFSSL_LMS_SHA256_192)
#define WC_TEST_LMS_SIG_LEN (4960)
#define WC_TEST_LMS_SIG_LEN 4960
#elif defined(WOLFSSL_LMS_SHAKE256) && !defined(WOLFSSL_NO_LMS_SHAKE256_256)
#define WC_TEST_LMS_SIG_LEN (8688)
#define WC_TEST_LMS_SIG_LEN 8688
#else
#define WC_TEST_LMS_SIG_LEN (4960)
#define WC_TEST_LMS_SIG_LEN 4960
#endif

WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test(void)
Expand Down Expand Up @@ -79174,7 +79174,7 @@ static const byte lms_L1H10W8_pub[HSS_MAX_PUBLIC_KEY_LEN] =
0xC5,0xB4,0x8F,0x23
};

#define LMS_L1H10W8_SIGLEN (1456)
#define LMS_L1H10W8_SIGLEN 1456

static byte lms_L1H10W8_sig[LMS_L1H10W8_SIGLEN] =
{
Expand Down Expand Up @@ -84574,7 +84574,7 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t cmac_test(void)
0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17,
0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10
};
#define MLEN_0 (0)
#define MLEN_0 0
#define MLEN_128 (128/8)
#define MLEN_320 (320/8)
#define MLEN_319 (MLEN_320 - 1)
Expand Down
4 changes: 2 additions & 2 deletions wolfssl/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,7 @@ struct CRL_Monitor {
#endif

/* PEM and DER possible */
#define WOLFSSL_CRL_MONITORS_LEN (2)
#define WOLFSSL_CRL_MONITORS_LEN 2

#if defined(__MACH__) || defined(__FreeBSD__) || defined(__linux__)
typedef int wolfSSL_CRL_mfd_t; /* monitor fd, -1 if no init yet */
Expand Down Expand Up @@ -8517,7 +8517,7 @@ WOLFSSL_TEST_VIS int Dtls13HandshakeRecv(WOLFSSL* ssl, byte* input,
word32* inOutIdx, word32 totalSz);
WOLFSSL_LOCAL int Dtls13HandshakeAddHeader(WOLFSSL* ssl, byte* output,
enum HandShakeType msg_type, word32 length);
#define EE_MASK (0x3)
#define EE_MASK 0x3
WOLFSSL_LOCAL int Dtls13FragmentsContinue(WOLFSSL* ssl);
WOLFSSL_LOCAL int DoDtls13KeyUpdateAck(WOLFSSL* ssl);
#ifdef WOLFSSL_DTLS_CID
Expand Down
16 changes: 8 additions & 8 deletions wolfssl/openssl/ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1934,14 +1934,14 @@ typedef WOLFSSL_SRTP_PROTECTION_PROFILE SRTP_PROTECTION_PROFILE;
#endif /* OPENSSL_EXTRA */

/* cipher suites for compatibility */
#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)
#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
#define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)
#define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8)
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
#define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9)
#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xc013
#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xc014
#define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xc02f
#define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xcca8
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xc009
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xc00a
#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xc02b
#define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xcca9

#define X509_LU_NONE WOLFSSL_X509_LU_NONE
#define X509_LU_X509 WOLFSSL_X509_LU_X509
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/openssl/x509.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)

#define WOLFSSL_X509_FLAG_COMPAT (0UL)
#define WOLFSSL_X509_FLAG_COMPAT 0UL
#define WOLFSSL_X509_FLAG_NO_HEADER (1UL << 0)
#define WOLFSSL_X509_FLAG_NO_VERSION (1UL << 1)
#define WOLFSSL_X509_FLAG_NO_SERIAL (1UL << 2)
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/quic.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ int wolfSSL_quic_hkdf(uint8_t* dest, size_t destlen,
* read from the wire sane */
#ifndef WOLFSSL_QUIC_MAX_RECORD_CAPACITY
/* 1024*1024 -- 1 MB */
#define WOLFSSL_QUIC_MAX_RECORD_CAPACITY (1048576)
#define WOLFSSL_QUIC_MAX_RECORD_CAPACITY 1048576
#endif

#endif /* WOLFSSL_QUIC */
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/aes.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ WOLFSSL_LOCAL void WC_ARG_NOT_NULL(1) GHASH(Gcm* gcm, const byte* a,
#ifdef WOLFSSL_AES_REQUIRE_KEY_SET
#define WC_AES_KEY_IS_SET(aes) ((aes)->keyInstalled != 0)
#else
#define WC_AES_KEY_IS_SET(aes) (1)
#define WC_AES_KEY_IS_SET(aes) 1
#endif

/* Set when wc_AesEncryptDirect/DecryptDirect try the crypto callback first. */
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/async.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ WOLFSSL_API int wc_AsyncSleep(word32 ms);

typedef void* (*AsyncThreadFunc_t) (void *);

#define THREAD_DEFAULT_PRIORITY (0)
#define THREAD_DEFAULT_PRIORITY 0
#define THREAD_DEFAULT_POLICY SCHED_OTHER

WOLFSSL_API int wc_AsyncGetNumberOfCpus(void);
Expand Down
14 changes: 7 additions & 7 deletions wolfssl/wolfcrypt/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@
/* Maximum generate block length */
#ifndef RNG_MAX_BLOCK_LEN
#ifdef HAVE_INTEL_QA
#define RNG_MAX_BLOCK_LEN (0xFFFFl)
#define RNG_MAX_BLOCK_LEN 0xFFFFL
#else
#define RNG_MAX_BLOCK_LEN (0x10000l)
#define RNG_MAX_BLOCK_LEN 0x10000L
#endif
#endif

Expand Down Expand Up @@ -339,7 +339,7 @@ struct OS_Seed {
/* RNG_SECURITY_STRENGTH is unprefixed for backward compat. */
#ifndef RNG_SECURITY_STRENGTH
/* SHA-256 requires a minimum of 256-bits of entropy. */
#define RNG_SECURITY_STRENGTH (256)
#define RNG_SECURITY_STRENGTH 256
#endif

/* wolfentropy.h will define for HAVE_ENTROPY_MEMUSE */
Expand All @@ -362,7 +362,7 @@ struct OS_Seed {
* 2024 specifies 0.656 to 1.312 bits of entropy per 128 bit block of
* RDSEED output, depending on CPU family.
*/
#define ENTROPY_SCALE_FACTOR (512)
#define ENTROPY_SCALE_FACTOR 512
#elif defined(HAVE_INTEL_RDSEED) || defined(HAVE_INTEL_RDRAND)
/* The value of 2 applies to Intel's RDSEED which provides about
* 0.5 bits minimum of entropy per bit. The value of 4 gives a
Expand All @@ -372,17 +372,17 @@ struct OS_Seed {
#define ENTROPY_SCALE_FACTOR (2*4)
#else
/* Not FIPS, but Intel RDSEED, only double. */
#define ENTROPY_SCALE_FACTOR (2)
#define ENTROPY_SCALE_FACTOR 2
#endif
#elif defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && \
(HAVE_FIPS_VERSION >= 2)
/* If doing a FIPS build without a specific scale factor, default
* to 4. This will give 1024 bits of entropy. More is better, but
* more is also slower. */
#define ENTROPY_SCALE_FACTOR (4)
#define ENTROPY_SCALE_FACTOR 4
#else
/* Setting the default to 1. */
#define ENTROPY_SCALE_FACTOR (1)
#define ENTROPY_SCALE_FACTOR 1
#endif
/* tells test.c the seed-callback known answers apply */
#define WC_DRBG_ENTROPY_SCALE_FACTOR_DEFAULTED
Expand Down
10 changes: 5 additions & 5 deletions wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2428,13 +2428,13 @@
#ifdef FREESCALE_KSDK_1_3
#include "fsl_rnga_driver.h"
#define FREESCALE_RNGA
#define RNGA_INSTANCE (0)
#define RNGA_INSTANCE 0
#else
#define FREESCALE_KSDK_2_0_RNGA
#endif
#elif !defined(FREESCALE_KSDK_BM) && !defined(FREESCALE_FREE_RTOS) && !defined(FREESCALE_KSDK_FREERTOS)
#define FREESCALE_RNGA
#define RNGA_INSTANCE (0)
#define RNGA_INSTANCE 0
/* defaulting to K70 RNGA, user should change if different */
/* #define FREESCALE_K53_RNGB */
#define FREESCALE_K70_RNGA
Expand Down Expand Up @@ -2528,7 +2528,7 @@
the LTC_MAX_ECC_BITS defines the size of local variables that hold ECC parameters
and point coordinates */
#ifndef LTC_MAX_ECC_BITS
#define LTC_MAX_ECC_BITS (384)
#define LTC_MAX_ECC_BITS 384
#endif

/* Enable curves up to 384 bits */
Expand Down Expand Up @@ -2571,9 +2571,9 @@
#undef USE_CERT_BUFFERS_4096
#define USE_CERT_BUFFERS_4096
#undef FP_MAX_BITS
#define FP_MAX_BITS (8192)
#define FP_MAX_BITS 8192
#undef SP_INT_BITS
#define SP_INT_BITS (4096)
#define SP_INT_BITS 4096

#undef NO_DH
#define NO_DH
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/sp_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ typedef struct sp_dh_ctx {
* @param [in] d SP integer digit.
* @return 0 indicating not negative always.
*/
#define sp_isneg(a) (0)
#define sp_isneg(a) 0
/* Sets the multi-precision number negative.
*
* Negative support not compiled in, so does nothing. */
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,7 @@ WOLFSSL_API word32 CheckRunTimeSettings(void);
#define __GNUC_PREREQ(maj, min) \
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
#define __GNUC_PREREQ(maj, min) (0) /* not GNUC */
#define __GNUC_PREREQ(maj, min) 0 /* not GNUC */
#endif
#endif

Expand Down
4 changes: 2 additions & 2 deletions wolfssl/wolfcrypt/wc_port.h
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
#include "dc_rtc_api.h" /* to get current time */

/* uses partial <time.h> structures */
#define XTIME(tl) (0)
#define XTIME(tl) 0
#define XGMTIME(c, t) rtpsys_gmtime((c))

#elif defined(WOLFSSL_DEOS) || defined(WOLFSSL_DEOS_RTEMS)
Expand Down Expand Up @@ -1959,7 +1959,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void);
/* Map default time functions */
#if !defined(XTIME) && !defined(TIME_OVERRIDES) && !defined(USER_TIME)
#ifdef TEST_BEFORE_DATE
#define XTIME(tl) (946681200UL) /* Jan 1, 2000 */
#define XTIME(tl) 946681200UL /* Jan 1, 2000 */
#else
#define XTIME(tl) time((tl))
#endif
Expand Down
8 changes: 4 additions & 4 deletions wolfssl/wolfcrypt/wc_xmss.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
* - Table 2 of Kampanakis, Fluhrer, IACR, 2017.
* */

#define XMSS_SHA256_PUBLEN (68)
#define XMSS_SHA256_PUBLEN 68

/* Supported XMSS/XMSS^MT parameter set names:
* We are supporting all SHA256 parameter sets with n=32 and
Expand Down Expand Up @@ -102,9 +102,9 @@
* 2. RFC 8391
* */

#define XMSS_NAME_LEN (16) /* strlen("XMSS-SHA2_10_256") */
#define XMSSMT_NAME_MIN_LEN (20) /* strlen("XMSSMT-SHA2_20/2_256") */
#define XMSSMT_NAME_MAX_LEN (21) /* strlen("XMSSMT-SHA2_60/12_256") */
#define XMSS_NAME_LEN 16 /* strlen("XMSS-SHA2_10_256") */
#define XMSSMT_NAME_MIN_LEN 20 /* strlen("XMSSMT-SHA2_20/2_256") */
#define XMSSMT_NAME_MAX_LEN 21 /* strlen("XMSSMT-SHA2_60/12_256") */

#if defined(HAVE_FIPS)
#undef WOLFSSL_WC_XMSS_NO_SHA512
Expand Down
4 changes: 2 additions & 2 deletions wolfssl/wolfcrypt/wolfentropy.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
/* Full strength, conditioned entropy is requested of MemUse Entropy. */
#if defined(HAVE_FIPS) && defined(HAVE_FIPS_VERSION) && \
(HAVE_FIPS_VERSION >= 2)
#define ENTROPY_SCALE_FACTOR (4)
#define ENTROPY_SCALE_FACTOR 4
#else
#define ENTROPY_SCALE_FACTOR (1)
#define ENTROPY_SCALE_FACTOR 1
#endif
#endif

Expand Down
Loading