Skip to content

Commit

Permalink
Fix hard coded values in TSIP ECC verify. Fix issues with tab indenta…
Browse files Browse the repository at this point in the history
…tion and spelling.
  • Loading branch information
dgarske committed Jul 18, 2024
1 parent 945a24e commit 4eab0f1
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ Turn on timer debugging (used when CPU cycles not available)
#define WOLFSSL_BASE16
#else
#if defined(USE_CERT_BUFFERS_2048)
/* Be sure to include in app when using example certs: */
/* Be sure to include in app when using example certs: */
/* #include <wolfssl/certs_test.h> */
#define CTX_CA_CERT ca_cert_der_2048
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
Expand All @@ -605,7 +605,7 @@ Turn on timer debugging (used when CPU cycles not available)
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1

#elif defined(USE_CERT_BUFFERS_1024)
/* Be sure to include in app when using example certs: */
/* Be sure to include in app when using example certs: */
/* #include <wolfssl/certs_test.h> */
#define CTX_CA_CERT ca_cert_der_1024
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_1024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ Turn on timer debugging (used when CPU cycles not available)
#define WOLFSSL_BASE16
#else
#if defined(USE_CERT_BUFFERS_2048)
/* Be sure to include in app when using example certs: */
/* Be sure to include in app when using example certs: */
/* #include <wolfssl/certs_test.h> */
#define CTX_CA_CERT ca_cert_der_2048
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
Expand All @@ -726,7 +726,7 @@ Turn on timer debugging (used when CPU cycles not available)
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1

#elif defined(USE_CERT_BUFFERS_1024)
/* Be sure to include in app when using example certs: */
/* Be sure to include in app when using example certs: */
/* #include <wolfssl/certs_test.h> */
#define CTX_CA_CERT ca_cert_der_1024
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_1024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@
#define WOLFSSL_SHA384

#if defined(CONFIG_IDF_TARGET_ESP8266)
/* Some known low-memory devices have features not enabled by default. */
/* Some known low-memory devices have features not enabled by default. */
#else
/* when you want to use SHA512 */
#define WOLFSSL_SHA512
/* when you want to use SHA3 */
#define WOLFSSL_SHA3

/* ED25519 requires SHA512 */
/* ED25519 requires SHA512 */
#define HAVE_ED25519

#define HAVE_ECC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ Turn on timer debugging (used when CPU cycles not available)
#define WOLFSSL_BASE16
#else
#if defined(USE_CERT_BUFFERS_2048)
/* Be sure to include in app when using example certs: */
/* Be sure to include in app when using example certs: */
/* #include <wolfssl/certs_test.h> */
#define CTX_CA_CERT ca_cert_der_2048
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_2048
Expand All @@ -726,7 +726,7 @@ Turn on timer debugging (used when CPU cycles not available)
#define CTX_CLIENT_KEY_TYPE WOLFSSL_FILETYPE_ASN1

#elif defined(USE_CERT_BUFFERS_1024)
/* Be sure to include in app when using example certs: */
/* Be sure to include in app when using example certs: */
/* #include <wolfssl/certs_test.h> */
#define CTX_CA_CERT ca_cert_der_1024
#define CTX_CA_CERT_SIZE sizeof_ca_cert_der_1024
Expand Down
6 changes: 3 additions & 3 deletions IDE/GCC-ARM/Header/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ extern "C" {
/* AES */
#undef NO_AES
#if 1
#undef HAVE_AES_CBC
#define HAVE_AES_CBC
#undef HAVE_AES_CBC
#define HAVE_AES_CBC

#undef HAVE_AESGCM
#undef HAVE_AESGCM
#define HAVE_AESGCM
/* GCM Method: GCM_SMALL, GCM_WORD32 or GCM_TABLE */
Expand Down
26 changes: 13 additions & 13 deletions IDE/HEXAGON/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#ifdef HAVE_ECC
#define ECC_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#endif
#ifndef NO_RSA
#define WC_RSA_BLINDING
#define WC_RSA_BLINDING
#endif

#if 1
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_MATH
#define WOLFSSL_HAVE_SP_RSA
#define WOLFSSL_HAVE_SP_ECC
#define WOLFSSL_SP_MATH

#if 1
/* ARM NEON instructions */
#define WOLFSSL_SP_ARM64_ASM
#endif
#if 1
/* Use DSP */
#define WOLFSSL_DSP
#endif
#if 1
/* ARM NEON instructions */
#define WOLFSSL_SP_ARM64_ASM
#endif
#if 1
/* Use DSP */
#define WOLFSSL_DSP
#endif
#endif

#endif
2 changes: 1 addition & 1 deletion IDE/M68K/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ BUILD_C
RSA 2048 public 7.619 ops/sec
RSA 2048 private 0.276 ops/sec

###Building testwolfcryt/benchmark
###Building testwolfcrypt/benchmark
To build either testwolfcrypt or benchmark first build wolfssl.a, place it in
$(NBROOT)/lib and then cd into the respective directory. Running "make" will
then create a .s19 application that can be ran on the board.
Expand Down
22 changes: 11 additions & 11 deletions IDE/MCUEXPRESSO/RT1170/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/* using the RTC */
//#define NO_ASN_TIME
#ifndef NO_ASN_TIME
#define FREESCALE_SNVS_RTC
#define FREESCALE_SNVS_RTC
#endif

#define NO_CRYPT_TEST
Expand All @@ -64,19 +64,19 @@
#include <stdarg.h>
static void myPrintf(const char* fmt, ...)
{
int ret;
char line[150];
va_list ap;
int ret;
char line[150];
va_list ap;

va_start(ap, fmt);
ret = vsnprintf(line, sizeof(line), fmt, ap);
line[sizeof(line)-1] = '\0';
va_start(ap, fmt);
ret = vsnprintf(line, sizeof(line), fmt, ap);
line[sizeof(line)-1] = '\0';

DbgConsole_Printf("%s", line);
DbgConsole_Printf("%s", line);

/* add CR on newlines */
if (ret > 0 && line[ret-1] == '\n') {
DbgConsole_Printf("\r");
/* add CR on newlines */
if (ret > 0 && line[ret-1] == '\n') {
DbgConsole_Printf("\r");
}
}
#define XPRINTF myPrintf
Expand Down
26 changes: 13 additions & 13 deletions IDE/MCUEXPRESSO/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@
#include <stdarg.h>
static void myPrintf(const char* fmt, ...)
{
int ret;
char line[150];
va_list ap;
int ret;
char line[150];
va_list ap;

va_start(ap, fmt);
ret = vsnprintf(line, sizeof(line), fmt, ap);
line[sizeof(line)-1] = '\0';
va_start(ap, fmt);
ret = vsnprintf(line, sizeof(line), fmt, ap);
line[sizeof(line)-1] = '\0';

DbgConsole_Printf("%s", line);
DbgConsole_Printf("%s", line);

/* add CR on newlines */
if (ret > 0 && line[ret-1] == '\n') {
DbgConsole_Printf("\r");
/* add CR on newlines */
if (ret > 0 && line[ret-1] == '\n') {
DbgConsole_Printf("\r");
}
}
#define XPRINTF myPrintf
Expand All @@ -70,9 +70,9 @@
#define USE_FAST_MATH
#ifdef USE_FAST_MATH
/* big enough for even 4096 bit RSA key */
#define FP_MAX_BITS 8192
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define FP_MAX_BITS 8192
#define TFM_TIMING_RESISTANT
#define ECC_TIMING_RESISTANT
#define ALT_ECC_SIZE
#endif

Expand Down
2 changes: 1 addition & 1 deletion IDE/MDK-ARM/MDK-ARM/wolfSSL/wolfssl_MDK_ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ typedef int socklen_t ;
#define tcp_listen wolfssl_tcp_listen
#define tcp_select wolfssl_tcp_select

extern int wolfssl_connect(int sd, const struct sockaddr* sa, int sz) ;
extern int wolfssl_connect(int sd, const struct sockaddr* sa, int sz) ;
extern int wolfssl_accept(int sd, struct sockaddr*addr, socklen_t *addrlen);
extern int wolfssl_recv(int sd, void *buf, size_t len, int flags);
extern int wolfssl_send(int sd, const void *buf, size_t len, int flags);
Expand Down
12 changes: 6 additions & 6 deletions IDE/MSVS-2019-AZSPHERE/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
#ifndef SERVER_IP
#define SERVER_IP "192.168.1.200" /* Local Test Server IP */
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 11111
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 11111
#endif
#define CERT ca_cert_der_2048
#define SIZEOF_CERT sizeof_ca_cert_der_2048
static const char msg[] = "Are you listening wolfSSL Server?";
#else
#ifndef SERVER_IP
#define SERVER_IP "www.wolfssl.com"
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 443
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 443
#endif
#define CERT wolfssl_website_root_ca
#define SIZEOF_CERT sizeof_wolfssl_website_root_ca
static const char msg[] = "GET /index.html HTTP/1.1\r\n\r\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
*/
#define WOLFSSL_RENESAS_TSIP_TLS

#if !defined(NO_RENESAS_TSIP_CRYPT)
#if !defined(NO_RENESAS_TSIP_CRYPT)
#define HAVE_PK_CALLBACKS
#define WOLF_CRYPTO_CB
#if defined(WOLFSSL_RENESAS_TSIP_TLS)
Expand Down
2 changes: 1 addition & 1 deletion IDE/STM32Cube/wolfssl_example.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#endif

#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/ssl.h>
Expand Down
12 changes: 6 additions & 6 deletions IDE/VS-AZURE-SPHERE/user_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
#ifndef SERVER_IP
#define SERVER_IP "192.168.1.200" /* Local Test Server IP */
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 11111
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 11111
#endif
#define CERT ca_cert_der_2048
#define SIZEOF_CERT sizeof_ca_cert_der_2048
static const char msg[] = "Are you listening wolfSSL Server?";
#else
#ifndef SERVER_IP
#define SERVER_IP "www.wolfssl.com"
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 443
#endif
#ifndef DEFAULT_PORT
#define DEFAULT_PORT 443
#endif
#define CERT wolfssl_website_root_ca
#define SIZEOF_CERT sizeof_wolfssl_website_root_ca
static const char msg[] = "GET /index.html HTTP/1.1\r\n\r\n";
Expand Down
10 changes: 5 additions & 5 deletions IDE/iotsafe/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@
#define FLASH_ACR_LATENCY_MASK (0x03)

/* RCC: Periph enable flags */
#define USART1_APB2_CLOCK_ER_VAL (1 << 14)
#define USART2_APB1_CLOCK_ER_VAL (1 << 17)
#define USART1_APB2_CLOCK_ER_VAL (1 << 14)
#define USART2_APB1_CLOCK_ER_VAL (1 << 17)
#define PWR_APB1_CLOCK_ER_VAL (1 << 28)
#define GPIOA_AHB2_CLOCK_ER_VAL (1 << 0)
#define GPIOB_AHB2_CLOCK_ER_VAL (1 << 1)
Expand Down Expand Up @@ -208,11 +208,11 @@
#define SYSTICK_CALIB (*(volatile uint32_t *)(SYSTICK_BASE + 0x0C))


/* STMod+ connector pinout
/* STMod+ connector pinout
*
* Connector STM32L4
* pins pins
*
*
* 1 11 PG11 PH2
* 2 12 PB6 PB2
* 3 13 PG10 PA4
Expand Down Expand Up @@ -243,7 +243,7 @@ void stmod_modem_disable(void);
/* inline functions for GPIO */
static inline void gpio_set(uint32_t port, uint32_t pin)
{
GPIO_BSSR(port) |= (1 << pin);
GPIO_BSSR(port) |= (1 << pin);
}

static inline void gpio_clear(uint32_t port, uint32_t pin)
Expand Down
8 changes: 4 additions & 4 deletions mqx/wolfssl_client/Sources/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include <wolfssl/ssl.h>

#define MAIN_TASK 1
#define MAIN_TASK 1

extern void Main_task(uint32_t);
extern void setup_ethernet(void);
Expand All @@ -34,10 +34,10 @@ static inline void err_sys(const char* msg)
_mqx_exit(1);
}

/* PPP device must be set manually and
/* PPP device must be set manually and
* must be different from the default IO channel (BSP_DEFAULT_IO_CHANNEL)
*/
#define PPP_DEVICE "ittyb:"
#define PPP_DEVICE "ittyb:"

/*
* Define PPP_DEVICE_DUN only when using PPP to communicate
Expand All @@ -54,7 +54,7 @@ static inline void err_sys(const char* msg)
#define ENET_IPMASK IPADDR(255,255,255,0)
#endif

#define GATE_IPADDR IPADDR(192,168,1,1)
#define GATE_IPADDR IPADDR(192,168,1,1)

#endif /* __main_h_ */

Loading

0 comments on commit 4eab0f1

Please sign in to comment.