1
0
mirror of https://github.com/wolfSSL/wolfssl.git synced 2026-10-24 04:09:07 +03:00

Provide XATOI under STRING_USER and in the platform templates

This commit is contained in:
David Garske
2026-10-01 16:35:46 -07:00
parent 910b7fb7ad
commit 84c4b409cb
11 changed files with 43 additions and 1 deletions

View File

@@ -537,6 +537,9 @@ extern unsigned int my_rng_seed_gen(void);
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -454,6 +454,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -531,6 +531,9 @@ extern unsigned int my_rng_seed_gen(void);
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -662,6 +662,9 @@ C149F3285397DFBD0C6720E14818475C3A50B10880EF9619463173A6D5ED15E7
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -528,6 +528,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -539,6 +539,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -540,6 +540,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -621,6 +621,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -681,6 +681,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -487,6 +487,9 @@ extern "C" {
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
#define XSNPRINTF snprintf
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif

View File

@@ -1305,7 +1305,6 @@ binding for XSNPRINTF
#define XSTRTOK(s1,d,ptr) strtok_r((s1),(d),(ptr))
#endif
#endif
#if defined(WOLFSSL_CERT_EXT) || defined(HAVE_OCSP) || \
defined(HAVE_CRL_IO) || defined(HAVE_HTTP_CLIENT) || \
!defined(NO_CRYPT_BENCHMARK) || defined(OPENSSL_EXTRA)
@@ -1317,6 +1316,19 @@ binding for XSNPRINTF
#endif
#endif /* STRING_USER */
/* The STRING_USER platform templates override the string and memory macros
* but not XATOI, which the certificate policy OID parser and the benchmark
* need. Same features as the case above, so a platform that set STRING_USER
* to keep the standard library out only reaches <stdlib.h> through one that
* cannot work without XATOI, and one that supplies its own still wins. */
#if defined(STRING_USER) && !defined(XATOI) && \
(defined(WOLFSSL_CERT_EXT) || defined(HAVE_OCSP) || \
defined(HAVE_CRL_IO) || defined(HAVE_HTTP_CLIENT) || \
!defined(NO_CRYPT_BENCHMARK) || defined(OPENSSL_EXTRA))
#include <stdlib.h>
#define XATOI(s) atoi((s))
#endif
#ifdef WOLFSSL_WIDE_BYTE
/* Packed octet stream -> one octet per byte cell. All sizes are in byte cells;
* out needs octetSz, in needs WC_PACKED_CELLS(octetSz), and they must not