mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-03 11:29:42 +08:00
feat(wolfssl): Add wolfssl commercial library V3.14.0
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Component Makefile
|
||||
#
|
||||
COMPONENT_ADD_INCLUDEDIRS += include
|
||||
COMPONENT_ADD_INCLUDEDIRS += include include/freertos
|
||||
|
||||
COMPONENT_SRCDIRS := library
|
||||
|
@ -12,6 +12,8 @@ config SSL_USING_MBEDTLS
|
||||
bool "mbedTLS"
|
||||
config SSL_USING_AXTLS
|
||||
bool "axTLS"
|
||||
config SSL_USING_WOLFSSL
|
||||
bool "wolfSSL"
|
||||
endchoice
|
||||
|
||||
endmenu
|
||||
|
@ -2,6 +2,15 @@
|
||||
# Component Makefile
|
||||
#
|
||||
|
||||
ifdef CONFIG_SSL_USING_WOLFSSL
|
||||
COMPONENT_ADD_INCLUDEDIRS := wolfssl/include
|
||||
|
||||
WOLFSSLLIB = wolfssl
|
||||
COMPONENT_ADD_LDFLAGS := -L $(COMPONENT_PATH)/wolfssl/lib -lwolfssl
|
||||
|
||||
# re-link program if wolfssl library change
|
||||
COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/wolfssl/lib/lib%.a,$(WOLFSSLLIB))
|
||||
else
|
||||
ifdef CONFIG_SSL_USING_MBEDTLS
|
||||
COMPONENT_ADD_INCLUDEDIRS := openssl/include
|
||||
COMPONENT_PRIV_INCLUDEDIRS := openssl/include/internal openssl/include/openssl openssl/include/platform
|
||||
@ -14,3 +23,4 @@ else
|
||||
COMPONENT_ADD_INCLUDEDIRS := axtls/include
|
||||
COMPONENT_SRCDIRS := axtls/source/ssl axtls/source/crypto
|
||||
endif
|
||||
endif
|
59
components/ssl/wolfssl/include/user_settings.h
Executable file
59
components/ssl/wolfssl/include/user_settings.h
Executable file
@ -0,0 +1,59 @@
|
||||
/* user_settings.h
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
* Additions Copyright 2018 Espressif Systems (Shanghai) PTE LTD.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __USER_SETTINGS_H__
|
||||
#define __USER_SETTINGS_H__
|
||||
|
||||
#define WOLFSSL_LWIP
|
||||
#define NO_WRITEV
|
||||
#define NO_WOLFSSL_DIR
|
||||
#define NO_INLINE
|
||||
#define NO_WOLFSSL_MEMORY
|
||||
#define HAVE_PK_CALLBACKS
|
||||
#define WOLFSSL_KEY_GEN
|
||||
#define WOLFSSL_RIPEMD
|
||||
#define ESP_PLATFORM
|
||||
#define DEBUG_ESP_PLATFORM
|
||||
#define USE_WOLFSSL_IO
|
||||
#define WOLFSSL_STATIC_RSA
|
||||
#define NO_DH
|
||||
#define NO_MD4
|
||||
#define NO_MD5
|
||||
#define NO_DES3
|
||||
#define NO_DSA
|
||||
#define NO_OLD_TLS
|
||||
#define HAVE_ECC
|
||||
#define WC_NO_HARDEN
|
||||
#define FREERTOS
|
||||
#define WOLFSSL_TYPES
|
||||
#define NO_FILESYSTEM
|
||||
|
||||
#ifdef WOLFSSL_TYPES
|
||||
#ifndef byte
|
||||
typedef unsigned char byte;
|
||||
#endif
|
||||
typedef unsigned short word16;
|
||||
typedef unsigned int word32;
|
||||
typedef byte word24[3];
|
||||
#endif
|
||||
|
||||
#ifndef CUSTOM_RAND_GENERATE_BLOCK
|
||||
|
||||
/* To use define the following:*/
|
||||
#define CUSTOM_RAND_GENERATE_BLOCK myRngFunc
|
||||
extern int myRngFunc(byte* output, word32 sz);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
2851
components/ssl/wolfssl/include/wolfssl/ssl.h
Normal file
2851
components/ssl/wolfssl/include/wolfssl/ssl.h
Normal file
File diff suppressed because it is too large
Load Diff
31
components/ssl/wolfssl/include/wolfssl/version.h
Normal file
31
components/ssl/wolfssl/include/wolfssl/version.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* wolfssl_version.h.in
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef WOLFSSL_VERSION_H
|
||||
#define WOLFSSL_VERSION_H
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define LIBWOLFSSL_VERSION_STRING "3.14.0"
|
||||
#define LIBWOLFSSL_VERSION_HEX 0x03014000
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* WOLFSSL_VERSION_H */
|
||||
|
117
components/ssl/wolfssl/include/wolfssl/wolfcrypt/logging.h
Normal file
117
components/ssl/wolfssl/include/wolfssl/wolfcrypt/logging.h
Normal file
@ -0,0 +1,117 @@
|
||||
/* logging.h
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* submitted by eof */
|
||||
|
||||
|
||||
#ifndef WOLFSSL_LOGGING_H
|
||||
#define WOLFSSL_LOGGING_H
|
||||
|
||||
#include <wolfssl/wolfcrypt/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum wc_LogLevels {
|
||||
ERROR_LOG = 0,
|
||||
INFO_LOG,
|
||||
ENTER_LOG,
|
||||
LEAVE_LOG,
|
||||
OTHER_LOG
|
||||
};
|
||||
|
||||
typedef void (*wolfSSL_Logging_cb)(const int logLevel,
|
||||
const char *const logMessage);
|
||||
|
||||
WOLFSSL_API int wolfSSL_SetLoggingCb(wolfSSL_Logging_cb log_function);
|
||||
|
||||
/* turn logging on, only if compiled in */
|
||||
WOLFSSL_API int wolfSSL_Debugging_ON(void);
|
||||
/* turn logging off */
|
||||
WOLFSSL_API void wolfSSL_Debugging_OFF(void);
|
||||
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
|
||||
WOLFSSL_LOCAL int wc_LoggingInit(void);
|
||||
WOLFSSL_LOCAL int wc_LoggingCleanup(void);
|
||||
WOLFSSL_LOCAL int wc_AddErrorNode(int error, int line, char* buf,
|
||||
char* file);
|
||||
WOLFSSL_LOCAL int wc_PeekErrorNode(int index, const char **file,
|
||||
const char **reason, int *line);
|
||||
WOLFSSL_LOCAL void wc_RemoveErrorNode(int index);
|
||||
WOLFSSL_LOCAL void wc_ClearErrorNodes(void);
|
||||
WOLFSSL_LOCAL int wc_PullErrorNode(const char **file, const char **reason,
|
||||
int *line);
|
||||
WOLFSSL_API int wc_SetLoggingHeap(void* h);
|
||||
WOLFSSL_API int wc_ERR_remove_state(void);
|
||||
#if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
|
||||
WOLFSSL_API void wc_ERR_print_errors_fp(FILE* fp);
|
||||
#endif
|
||||
#endif /* OPENSSL_EXTRA || DEBUG_WOLFSSL_VERBOSE */
|
||||
|
||||
|
||||
#if defined(DEBUG_WOLFSSL) && !defined(WOLFSSL_DEBUG_ERRORS_ONLY)
|
||||
#if defined(_WIN32)
|
||||
#if defined(INTIME_RTOS)
|
||||
#define __func__ NULL
|
||||
#else
|
||||
#define __func__ __FUNCTION__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* a is prepended to m and b is appended, creating a log msg a + m + b */
|
||||
#define WOLFSSL_LOG_CAT(a, m, b) #a " " m " " #b
|
||||
|
||||
WOLFSSL_API void WOLFSSL_ENTER(const char* msg);
|
||||
WOLFSSL_API void WOLFSSL_LEAVE(const char* msg, int ret);
|
||||
#define WOLFSSL_STUB(m) \
|
||||
WOLFSSL_MSG(WOLFSSL_LOG_CAT(wolfSSL Stub, m, not implemented))
|
||||
|
||||
WOLFSSL_API void WOLFSSL_MSG(const char* msg);
|
||||
WOLFSSL_API void WOLFSSL_BUFFER(const byte* buffer, word32 length);
|
||||
|
||||
#else
|
||||
|
||||
#define WOLFSSL_ENTER(m)
|
||||
#define WOLFSSL_LEAVE(m, r)
|
||||
#define WOLFSSL_STUB(m)
|
||||
|
||||
#define WOLFSSL_MSG(m)
|
||||
#define WOLFSSL_BUFFER(b, l)
|
||||
|
||||
#endif /* DEBUG_WOLFSSL && !WOLFSSL_DEBUG_ERRORS_ONLY */
|
||||
|
||||
#if defined(DEBUG_WOLFSSL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
|
||||
|
||||
#if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
|
||||
WOLFSSL_API void WOLFSSL_ERROR_LINE(int err, const char* func, unsigned int line,
|
||||
const char* file, void* ctx);
|
||||
#define WOLFSSL_ERROR(x) \
|
||||
WOLFSSL_ERROR_LINE((x), __func__, __LINE__, __FILE__, NULL)
|
||||
#else
|
||||
WOLFSSL_API void WOLFSSL_ERROR(int err);
|
||||
#endif
|
||||
WOLFSSL_API void WOLFSSL_ERROR_MSG(const char* msg);
|
||||
|
||||
#else
|
||||
#define WOLFSSL_ERROR(e)
|
||||
#define WOLFSSL_ERROR_MSG(m)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* WOLFSSL_LOGGING_H */
|
||||
|
1646
components/ssl/wolfssl/include/wolfssl/wolfcrypt/settings.h
Normal file
1646
components/ssl/wolfssl/include/wolfssl/wolfcrypt/settings.h
Normal file
File diff suppressed because it is too large
Load Diff
625
components/ssl/wolfssl/include/wolfssl/wolfcrypt/types.h
Executable file
625
components/ssl/wolfssl/include/wolfssl/wolfcrypt/types.h
Executable file
@ -0,0 +1,625 @@
|
||||
/* types.h
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef WOLF_CRYPT_TYPES_H
|
||||
#define WOLF_CRYPT_TYPES_H
|
||||
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/wc_port.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(WORDS_BIGENDIAN)
|
||||
#define BIG_ENDIAN_ORDER
|
||||
#endif
|
||||
|
||||
#ifndef BIG_ENDIAN_ORDER
|
||||
#define LITTLE_ENDIAN_ORDER
|
||||
#endif
|
||||
|
||||
#ifndef WOLFSSL_TYPES
|
||||
#ifndef byte
|
||||
typedef unsigned char byte;
|
||||
#endif
|
||||
typedef unsigned short word16;
|
||||
typedef unsigned int word32;
|
||||
typedef byte word24[3];
|
||||
#endif
|
||||
|
||||
|
||||
/* try to set SIZEOF_LONG or LONG_LONG if user didn't */
|
||||
#if !defined(_MSC_VER) && !defined(__BCPLUSPLUS__) && !defined(__EMSCRIPTEN__)
|
||||
#if !defined(SIZEOF_LONG_LONG) && !defined(SIZEOF_LONG)
|
||||
#if (defined(__alpha__) || defined(__ia64__) || \
|
||||
defined(_ARCH_PPC64) || defined(__mips64) || \
|
||||
defined(__x86_64__) || \
|
||||
((defined(sun) || defined(__sun)) && \
|
||||
(defined(LP64) || defined(_LP64))))
|
||||
/* long should be 64bit */
|
||||
#define SIZEOF_LONG 8
|
||||
#elif defined(__i386__) || defined(__CORTEX_M3__)
|
||||
/* long long should be 64bit */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##ui64
|
||||
typedef unsigned __int64 word64;
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##ull
|
||||
typedef unsigned long long word64;
|
||||
#elif defined(SIZEOF_LONG) && SIZEOF_LONG == 8
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##LL
|
||||
typedef unsigned long word64;
|
||||
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG == 8
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##LL
|
||||
typedef unsigned long long word64;
|
||||
#elif defined(__SIZEOF_LONG_LONG__) && __SIZEOF_LONG_LONG__ == 8
|
||||
#define WORD64_AVAILABLE
|
||||
#define W64LIT(x) x##LL
|
||||
typedef unsigned long long word64;
|
||||
#endif
|
||||
|
||||
#if !defined(NO_64BIT) && defined(WORD64_AVAILABLE)
|
||||
/* These platforms have 64-bit CPU registers. */
|
||||
#if (defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || \
|
||||
defined(__mips64) || defined(__x86_64__) || defined(_M_X64)) || \
|
||||
defined(__aarch64__) || defined(__sparc64__)
|
||||
typedef word64 wolfssl_word;
|
||||
#define WC_64BIT_CPU
|
||||
#elif (defined(sun) || defined(__sun)) && \
|
||||
(defined(LP64) || defined(_LP64))
|
||||
/* LP64 with GNU GCC compiler is reserved for when long int is 64 bits
|
||||
* and int uses 32 bits. When using Solaris Studio sparc and __sparc are
|
||||
* avialable for 32 bit detection but __sparc64__ could be missed. This
|
||||
* uses LP64 for checking 64 bit CPU arch. */
|
||||
typedef word64 wolfssl_word;
|
||||
#define WC_64BIT_CPU
|
||||
#else
|
||||
typedef word32 wolfssl_word;
|
||||
#ifdef WORD64_AVAILABLE
|
||||
#define WOLFCRYPT_SLOW_WORD64
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#undef WORD64_AVAILABLE
|
||||
typedef word32 wolfssl_word;
|
||||
#define MP_16BIT /* for mp_int, mp_word needs to be twice as big as
|
||||
mp_digit, no 64 bit type so make mp_digit 16 bit */
|
||||
#endif
|
||||
|
||||
enum {
|
||||
WOLFSSL_WORD_SIZE = sizeof(wolfssl_word),
|
||||
WOLFSSL_BIT_SIZE = 8,
|
||||
WOLFSSL_WORD_BITS = WOLFSSL_WORD_SIZE * WOLFSSL_BIT_SIZE
|
||||
};
|
||||
|
||||
#define WOLFSSL_MAX_16BIT 0xffffU
|
||||
|
||||
/* use inlining if compiler allows */
|
||||
#ifndef INLINE
|
||||
#ifndef NO_INLINE
|
||||
#ifdef _MSC_VER
|
||||
#define INLINE __inline
|
||||
#elif defined(__GNUC__)
|
||||
#ifdef WOLFSSL_VXWORKS
|
||||
#define INLINE __inline__
|
||||
#else
|
||||
#define INLINE inline
|
||||
#endif
|
||||
#elif defined(__IAR_SYSTEMS_ICC__)
|
||||
#define INLINE inline
|
||||
#elif defined(THREADX)
|
||||
#define INLINE _Inline
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#else
|
||||
#define INLINE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* set up rotate style */
|
||||
#if (defined(_MSC_VER) || defined(__BCPLUSPLUS__)) && \
|
||||
!defined(WOLFSSL_SGX) && !defined(INTIME_RTOS)
|
||||
#define INTEL_INTRINSICS
|
||||
#define FAST_ROTATE
|
||||
#elif defined(__MWERKS__) && TARGET_CPU_PPC
|
||||
#define PPC_INTRINSICS
|
||||
#define FAST_ROTATE
|
||||
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
/* GCC does peephole optimizations which should result in using rotate
|
||||
instructions */
|
||||
#define FAST_ROTATE
|
||||
#endif
|
||||
|
||||
|
||||
/* set up thread local storage if available */
|
||||
#ifdef HAVE_THREAD_LS
|
||||
#if defined(_MSC_VER)
|
||||
#define THREAD_LS_T __declspec(thread)
|
||||
/* Thread local storage only in FreeRTOS v8.2.1 and higher */
|
||||
#elif defined(FREERTOS)
|
||||
#define THREAD_LS_T
|
||||
#else
|
||||
#define THREAD_LS_T __thread
|
||||
#endif
|
||||
#else
|
||||
#define THREAD_LS_T
|
||||
#endif
|
||||
|
||||
/* GCC 7 has new switch() fall-through detection */
|
||||
#if defined(__GNUC__)
|
||||
#if ((__GNUC__ > 7) || ((__GNUC__ == 7) && (__GNUC_MINOR__ >= 1)))
|
||||
#define FALL_THROUGH __attribute__ ((fallthrough));
|
||||
#endif
|
||||
#endif
|
||||
#ifndef FALL_THROUGH
|
||||
#define FALL_THROUGH
|
||||
#endif
|
||||
|
||||
/* Micrium will use Visual Studio for compilation but not the Win32 API */
|
||||
#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \
|
||||
!defined(FREERTOS_TCP) && !defined(EBSNET) && \
|
||||
!defined(WOLFSSL_UTASKER) && !defined(INTIME_RTOS)
|
||||
#define USE_WINDOWS_API
|
||||
#endif
|
||||
|
||||
|
||||
/* idea to add global alloc override by Moises Guimaraes */
|
||||
/* default to libc stuff */
|
||||
/* XREALLOC is used once in normal math lib, not in fast math lib */
|
||||
/* XFREE on some embeded systems doesn't like free(0) so test */
|
||||
#if defined(HAVE_IO_POOL)
|
||||
WOLFSSL_API void* XMALLOC(size_t n, void* heap, int type);
|
||||
WOLFSSL_API void* XREALLOC(void *p, size_t n, void* heap, int type);
|
||||
WOLFSSL_API void XFREE(void *p, void* heap, int type);
|
||||
#elif defined(WOLFSSL_ASYNC_CRYPT) && defined(HAVE_INTEL_QA)
|
||||
#include <wolfssl/wolfcrypt/port/intel/quickassist_mem.h>
|
||||
#undef USE_WOLFSSL_MEMORY
|
||||
#ifdef WOLFSSL_DEBUG_MEMORY
|
||||
#define XMALLOC(s, h, t) IntelQaMalloc((s), (h), (t), __func__, __LINE__)
|
||||
#define XFREE(p, h, t) IntelQaFree((p), (h), (t), __func__, __LINE__)
|
||||
#define XREALLOC(p, n, h, t) IntelQaRealloc((p), (n), (h), (t), __func__, __LINE__)
|
||||
#else
|
||||
#define XMALLOC(s, h, t) IntelQaMalloc((s), (h), (t))
|
||||
#define XFREE(p, h, t) IntelQaFree((p), (h), (t))
|
||||
#define XREALLOC(p, n, h, t) IntelQaRealloc((p), (n), (h), (t))
|
||||
#endif /* WOLFSSL_DEBUG_MEMORY */
|
||||
#elif defined(XMALLOC_USER)
|
||||
/* prototypes for user heap override functions */
|
||||
#include <stddef.h> /* for size_t */
|
||||
extern void *XMALLOC(size_t n, void* heap, int type);
|
||||
extern void *XREALLOC(void *p, size_t n, void* heap, int type);
|
||||
extern void XFREE(void *p, void* heap, int type);
|
||||
#elif defined(XMALLOC_OVERRIDE)
|
||||
/* override the XMALLOC, XFREE and XREALLOC macros */
|
||||
#elif defined(NO_WOLFSSL_MEMORY)
|
||||
/* just use plain C stdlib stuff if desired */
|
||||
#include <stdlib.h>
|
||||
#define XMALLOC(s, h, t) ((void)h, (void)t, malloc((s)))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) free((xp));}
|
||||
#define XREALLOC(p, n, h, t) realloc((p), (n))
|
||||
#elif !defined(MICRIUM_MALLOC) && !defined(EBSNET) \
|
||||
&& !defined(WOLFSSL_SAFERTOS) && !defined(FREESCALE_MQX) \
|
||||
&& !defined(FREESCALE_KSDK_MQX) && !defined(FREESCALE_FREE_RTOS) \
|
||||
&& !defined(WOLFSSL_LEANPSK) && !defined(WOLFSSL_uITRON4)
|
||||
/* default C runtime, can install different routines at runtime via cbs */
|
||||
#include <wolfssl/wolfcrypt/memory.h>
|
||||
#ifdef WOLFSSL_STATIC_MEMORY
|
||||
#ifdef WOLFSSL_DEBUG_MEMORY
|
||||
#define XMALLOC(s, h, t) wolfSSL_Malloc((s), (h), (t), __func__, __LINE__)
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp), (h), (t), __func__, __LINE__);}
|
||||
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), (h), (t), __func__, __LINE__)
|
||||
#else
|
||||
#define XMALLOC(s, h, t) wolfSSL_Malloc((s), (h), (t))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp), (h), (t));}
|
||||
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), (h), (t))
|
||||
#endif /* WOLFSSL_DEBUG_MEMORY */
|
||||
#elif !defined(FREERTOS) && !defined(FREERTOS_TCP)
|
||||
#ifdef WOLFSSL_DEBUG_MEMORY
|
||||
#define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s), __func__, __LINE__))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp), __func__, __LINE__);}
|
||||
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n), __func__, __LINE__)
|
||||
#else
|
||||
#define XMALLOC(s, h, t) ((void)h, (void)t, wolfSSL_Malloc((s)))
|
||||
#define XFREE(p, h, t) {void* xp = (p); if((xp)) wolfSSL_Free((xp));}
|
||||
#define XREALLOC(p, n, h, t) wolfSSL_Realloc((p), (n))
|
||||
#endif /* WOLFSSL_DEBUG_MEMORY */
|
||||
#endif /* WOLFSSL_STATIC_MEMORY */
|
||||
#endif
|
||||
|
||||
/* declare/free variable handling for async */
|
||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||
#define DECLARE_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
||||
VAR_TYPE* VAR_NAME = (VAR_TYPE*)XMALLOC(sizeof(VAR_TYPE) * VAR_SIZE, HEAP, DYNAMIC_TYPE_WOLF_BIGINT);
|
||||
#define DECLARE_VAR_INIT(VAR_NAME, VAR_TYPE, VAR_SIZE, INIT_VALUE, HEAP) \
|
||||
VAR_TYPE* VAR_NAME = ({ \
|
||||
VAR_TYPE* ptr = (VAR_TYPE*)XMALLOC(sizeof(VAR_TYPE) * VAR_SIZE, HEAP, DYNAMIC_TYPE_WOLF_BIGINT); \
|
||||
if (ptr && INIT_VALUE) { \
|
||||
XMEMCPY(ptr, INIT_VALUE, sizeof(VAR_TYPE) * VAR_SIZE); \
|
||||
} \
|
||||
ptr; \
|
||||
})
|
||||
#define DECLARE_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
||||
VAR_TYPE* VAR_NAME[VAR_ITEMS]; \
|
||||
int idx##VAR_NAME; \
|
||||
for (idx##VAR_NAME=0; idx##VAR_NAME<VAR_ITEMS; idx##VAR_NAME++) { \
|
||||
VAR_NAME[idx##VAR_NAME] = (VAR_TYPE*)XMALLOC(VAR_SIZE, HEAP, DYNAMIC_TYPE_WOLF_BIGINT); \
|
||||
}
|
||||
#define FREE_VAR(VAR_NAME, HEAP) \
|
||||
XFREE(VAR_NAME, HEAP, DYNAMIC_TYPE_WOLF_BIGINT);
|
||||
#define FREE_ARRAY(VAR_NAME, VAR_ITEMS, HEAP) \
|
||||
for (idx##VAR_NAME=0; idx##VAR_NAME<VAR_ITEMS; idx##VAR_NAME++) { \
|
||||
XFREE(VAR_NAME[idx##VAR_NAME], HEAP, DYNAMIC_TYPE_WOLF_BIGINT); \
|
||||
}
|
||||
#else
|
||||
#define DECLARE_VAR(VAR_NAME, VAR_TYPE, VAR_SIZE, HEAP) \
|
||||
VAR_TYPE VAR_NAME[VAR_SIZE]
|
||||
#define DECLARE_VAR_INIT(VAR_NAME, VAR_TYPE, VAR_SIZE, INIT_VALUE, HEAP) \
|
||||
VAR_TYPE* VAR_NAME = (VAR_TYPE*)INIT_VALUE
|
||||
#define DECLARE_ARRAY(VAR_NAME, VAR_TYPE, VAR_ITEMS, VAR_SIZE, HEAP) \
|
||||
VAR_TYPE VAR_NAME[VAR_ITEMS][VAR_SIZE]
|
||||
#define FREE_VAR(VAR_NAME, HEAP) /* nothing to free, its stack */
|
||||
#define FREE_ARRAY(VAR_NAME, VAR_ITEMS, HEAP) /* nothing to free, its stack */
|
||||
#endif
|
||||
|
||||
#ifndef WOLFSSL_LEANPSK
|
||||
char* mystrnstr(const char* s1, const char* s2, unsigned int n);
|
||||
#endif
|
||||
|
||||
#ifndef STRING_USER
|
||||
#include <string.h>
|
||||
#define XMEMCPY(d,s,l) memcpy((d),(s),(l))
|
||||
#define XMEMSET(b,c,l) memset((b),(c),(l))
|
||||
#define XMEMCMP(s1,s2,n) memcmp((s1),(s2),(n))
|
||||
#define XMEMMOVE(d,s,l) memmove((d),(s),(l))
|
||||
|
||||
#define XSTRLEN(s1) strlen((s1))
|
||||
#define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
|
||||
/* strstr, strncmp, and strncat only used by wolfSSL proper,
|
||||
* not required for wolfCrypt only */
|
||||
#define XSTRSTR(s1,s2) strstr((s1),(s2))
|
||||
#define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
|
||||
#define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
|
||||
#define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
|
||||
|
||||
#if defined(MICROCHIP_PIC32) || defined(WOLFSSL_TIRTOS)
|
||||
/* XC32 does not support strncasecmp, so use case sensitive one */
|
||||
#define XSTRNCASECMP(s1,s2,n) strncmp((s1),(s2),(n))
|
||||
#elif defined(USE_WINDOWS_API)
|
||||
#define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n))
|
||||
#else
|
||||
#define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n))
|
||||
#endif
|
||||
|
||||
/* snprintf is used in asn.c for GetTimeString, PKCS7 test, and when
|
||||
debugging is turned on */
|
||||
#ifndef USE_WINDOWS_API
|
||||
#if defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) && \
|
||||
!defined(NO_STDIO_FILESYSTEM)
|
||||
/* case where stdio is not included else where but is needed for
|
||||
* snprintf */
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#define XSNPRINTF snprintf
|
||||
#else
|
||||
#define XSNPRINTF _snprintf
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN)
|
||||
/* use only Thread Safe version of strtok */
|
||||
#if defined(__MINGW32__) || defined(WOLFSSL_TIRTOS) || \
|
||||
defined(USE_WOLF_STRTOK)
|
||||
#ifndef USE_WOLF_STRTOK
|
||||
#define USE_WOLF_STRTOK
|
||||
#endif
|
||||
#define XSTRTOK wc_strtok
|
||||
#elif defined(USE_WINDOWS_API) || defined(INTIME_RTOS)
|
||||
#define XSTRTOK strtok_s
|
||||
#else
|
||||
#define XSTRTOK strtok_r
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) && \
|
||||
!defined(NO_STDIO_FILESYSTEM)
|
||||
#ifndef XGETENV
|
||||
#include <stdlib.h>
|
||||
#define XGETENV getenv
|
||||
#endif
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
|
||||
#ifndef CTYPE_USER
|
||||
#include <ctype.h>
|
||||
#if defined(HAVE_ECC) || defined(HAVE_OCSP) || \
|
||||
defined(WOLFSSL_KEY_GEN) || !defined(NO_DSA)
|
||||
#define XTOUPPER(c) toupper((c))
|
||||
#define XISALPHA(c) isalpha((c))
|
||||
#endif
|
||||
/* needed by wolfSSL_check_domain_name() */
|
||||
#define XTOLOWER(c) tolower((c))
|
||||
#endif
|
||||
|
||||
|
||||
/* memory allocation types for user hints */
|
||||
enum {
|
||||
DYNAMIC_TYPE_CA = 1,
|
||||
DYNAMIC_TYPE_CERT = 2,
|
||||
DYNAMIC_TYPE_KEY = 3,
|
||||
DYNAMIC_TYPE_FILE = 4,
|
||||
DYNAMIC_TYPE_SUBJECT_CN = 5,
|
||||
DYNAMIC_TYPE_PUBLIC_KEY = 6,
|
||||
DYNAMIC_TYPE_SIGNER = 7,
|
||||
DYNAMIC_TYPE_NONE = 8,
|
||||
DYNAMIC_TYPE_BIGINT = 9,
|
||||
DYNAMIC_TYPE_RSA = 10,
|
||||
DYNAMIC_TYPE_METHOD = 11,
|
||||
DYNAMIC_TYPE_OUT_BUFFER = 12,
|
||||
DYNAMIC_TYPE_IN_BUFFER = 13,
|
||||
DYNAMIC_TYPE_INFO = 14,
|
||||
DYNAMIC_TYPE_DH = 15,
|
||||
DYNAMIC_TYPE_DOMAIN = 16,
|
||||
DYNAMIC_TYPE_SSL = 17,
|
||||
DYNAMIC_TYPE_CTX = 18,
|
||||
DYNAMIC_TYPE_WRITEV = 19,
|
||||
DYNAMIC_TYPE_OPENSSL = 20,
|
||||
DYNAMIC_TYPE_DSA = 21,
|
||||
DYNAMIC_TYPE_CRL = 22,
|
||||
DYNAMIC_TYPE_REVOKED = 23,
|
||||
DYNAMIC_TYPE_CRL_ENTRY = 24,
|
||||
DYNAMIC_TYPE_CERT_MANAGER = 25,
|
||||
DYNAMIC_TYPE_CRL_MONITOR = 26,
|
||||
DYNAMIC_TYPE_OCSP_STATUS = 27,
|
||||
DYNAMIC_TYPE_OCSP_ENTRY = 28,
|
||||
DYNAMIC_TYPE_ALTNAME = 29,
|
||||
DYNAMIC_TYPE_SUITES = 30,
|
||||
DYNAMIC_TYPE_CIPHER = 31,
|
||||
DYNAMIC_TYPE_RNG = 32,
|
||||
DYNAMIC_TYPE_ARRAYS = 33,
|
||||
DYNAMIC_TYPE_DTLS_POOL = 34,
|
||||
DYNAMIC_TYPE_SOCKADDR = 35,
|
||||
DYNAMIC_TYPE_LIBZ = 36,
|
||||
DYNAMIC_TYPE_ECC = 37,
|
||||
DYNAMIC_TYPE_TMP_BUFFER = 38,
|
||||
DYNAMIC_TYPE_DTLS_MSG = 39,
|
||||
DYNAMIC_TYPE_X509 = 40,
|
||||
DYNAMIC_TYPE_TLSX = 41,
|
||||
DYNAMIC_TYPE_OCSP = 42,
|
||||
DYNAMIC_TYPE_SIGNATURE = 43,
|
||||
DYNAMIC_TYPE_HASHES = 44,
|
||||
DYNAMIC_TYPE_SRP = 45,
|
||||
DYNAMIC_TYPE_COOKIE_PWD = 46,
|
||||
DYNAMIC_TYPE_USER_CRYPTO = 47,
|
||||
DYNAMIC_TYPE_OCSP_REQUEST = 48,
|
||||
DYNAMIC_TYPE_X509_EXT = 49,
|
||||
DYNAMIC_TYPE_X509_STORE = 50,
|
||||
DYNAMIC_TYPE_X509_CTX = 51,
|
||||
DYNAMIC_TYPE_URL = 52,
|
||||
DYNAMIC_TYPE_DTLS_FRAG = 53,
|
||||
DYNAMIC_TYPE_DTLS_BUFFER = 54,
|
||||
DYNAMIC_TYPE_SESSION_TICK = 55,
|
||||
DYNAMIC_TYPE_PKCS = 56,
|
||||
DYNAMIC_TYPE_MUTEX = 57,
|
||||
DYNAMIC_TYPE_PKCS7 = 58,
|
||||
DYNAMIC_TYPE_AES_BUFFER = 59,
|
||||
DYNAMIC_TYPE_WOLF_BIGINT = 60,
|
||||
DYNAMIC_TYPE_ASN1 = 61,
|
||||
DYNAMIC_TYPE_LOG = 62,
|
||||
DYNAMIC_TYPE_WRITEDUP = 63,
|
||||
DYNAMIC_TYPE_PRIVATE_KEY = 64,
|
||||
DYNAMIC_TYPE_HMAC = 65,
|
||||
DYNAMIC_TYPE_ASYNC = 66,
|
||||
DYNAMIC_TYPE_ASYNC_NUMA = 67,
|
||||
DYNAMIC_TYPE_ASYNC_NUMA64 = 68,
|
||||
DYNAMIC_TYPE_CURVE25519 = 69,
|
||||
DYNAMIC_TYPE_ED25519 = 70,
|
||||
DYNAMIC_TYPE_SECRET = 71,
|
||||
DYNAMIC_TYPE_DIGEST = 72,
|
||||
DYNAMIC_TYPE_RSA_BUFFER = 73,
|
||||
DYNAMIC_TYPE_DCERT = 74,
|
||||
DYNAMIC_TYPE_STRING = 75,
|
||||
DYNAMIC_TYPE_PEM = 76,
|
||||
DYNAMIC_TYPE_DER = 77,
|
||||
DYNAMIC_TYPE_CERT_EXT = 78,
|
||||
DYNAMIC_TYPE_ALPN = 79,
|
||||
DYNAMIC_TYPE_ENCRYPTEDINFO= 80,
|
||||
DYNAMIC_TYPE_DIRCTX = 81,
|
||||
DYNAMIC_TYPE_HASHCTX = 82,
|
||||
DYNAMIC_TYPE_SEED = 83,
|
||||
DYNAMIC_TYPE_SYMETRIC_KEY = 84,
|
||||
DYNAMIC_TYPE_ECC_BUFFER = 85,
|
||||
DYNAMIC_TYPE_QSH = 86,
|
||||
DYNAMIC_TYPE_SALT = 87,
|
||||
DYNAMIC_TYPE_HASH_TMP = 88,
|
||||
DYNAMIC_TYPE_BLOB = 89,
|
||||
DYNAMIC_TYPE_NAME_ENTRY = 90,
|
||||
};
|
||||
|
||||
/* max error buffer string size */
|
||||
#ifndef WOLFSSL_MAX_ERROR_SZ
|
||||
#define WOLFSSL_MAX_ERROR_SZ 80
|
||||
#endif
|
||||
|
||||
/* stack protection */
|
||||
enum {
|
||||
MIN_STACK_BUFFER = 8
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* settings detection for compile vs runtime math incompatibilities */
|
||||
enum {
|
||||
#if !defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
|
||||
CTC_SETTINGS = 0x0
|
||||
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
||||
CTC_SETTINGS = 0x1
|
||||
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
||||
CTC_SETTINGS = 0x2
|
||||
#elif !defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
|
||||
CTC_SETTINGS = 0x4
|
||||
#elif defined(USE_FAST_MATH) && !defined(SIZEOF_LONG) && !defined(SIZEOF_LONG_LONG)
|
||||
CTC_SETTINGS = 0x8
|
||||
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
||||
CTC_SETTINGS = 0x10
|
||||
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 8)
|
||||
CTC_SETTINGS = 0x20
|
||||
#elif defined(USE_FAST_MATH) && defined(SIZEOF_LONG_LONG) && (SIZEOF_LONG_LONG == 4)
|
||||
CTC_SETTINGS = 0x40
|
||||
#else
|
||||
#error "bad math long / long long settings"
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
WOLFSSL_API word32 CheckRunTimeSettings(void);
|
||||
|
||||
/* If user uses RSA, DH, DSA, or ECC math lib directly then fast math and long
|
||||
types need to match at compile time and run time, CheckCtcSettings will
|
||||
return 1 if a match otherwise 0 */
|
||||
#define CheckCtcSettings() (CTC_SETTINGS == CheckRunTimeSettings())
|
||||
|
||||
/* invalid device id */
|
||||
#define INVALID_DEVID -2
|
||||
|
||||
|
||||
/* AESNI requires alignment and ARMASM gains some performance from it */
|
||||
#if defined(WOLFSSL_AESNI) || defined(WOLFSSL_ARMASM) || defined(USE_INTEL_SPEEDUP)
|
||||
#if !defined(ALIGN16)
|
||||
#if defined(__GNUC__)
|
||||
#define ALIGN16 __attribute__ ( (aligned (16)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN16 __declspec (align (16))
|
||||
#else
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#endif /* !ALIGN16 */
|
||||
|
||||
#if !defined (ALIGN32)
|
||||
#if defined (__GNUC__)
|
||||
#define ALIGN32 __attribute__ ( (aligned (32)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN32 __declspec (align (32))
|
||||
#else
|
||||
#define ALIGN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(ALIGN32)
|
||||
#if defined(__GNUC__)
|
||||
#define ALIGN32 __attribute__ ( (aligned (32)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN32 __declspec (align (32))
|
||||
#else
|
||||
#define ALIGN32
|
||||
#endif
|
||||
#endif /* !ALIGN32 */
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define ALIGN128 __attribute__ ( (aligned (128)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN128 __declspec (align (128))
|
||||
#else
|
||||
#define ALIGN128
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define ALIGN256 __attribute__ ( (aligned (256)))
|
||||
#elif defined(_MSC_VER)
|
||||
/* disable align warning, we want alignment ! */
|
||||
#pragma warning(disable: 4324)
|
||||
#define ALIGN256 __declspec (align (256))
|
||||
#else
|
||||
#define ALIGN256
|
||||
#endif
|
||||
|
||||
#else
|
||||
#ifndef ALIGN16
|
||||
#define ALIGN16
|
||||
#endif
|
||||
#ifndef ALIGN32
|
||||
#define ALIGN32
|
||||
#endif
|
||||
#ifndef ALIGN128
|
||||
#define ALIGN128
|
||||
#endif
|
||||
#ifndef ALIGN256
|
||||
#define ALIGN256
|
||||
#endif
|
||||
#endif /* WOLFSSL_AESNI || WOLFSSL_ARMASM */
|
||||
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef WOLFSSL_RIOT_OS
|
||||
#define EXIT_TEST(ret) exit(ret)
|
||||
#elif defined(HAVE_STACK_SIZE)
|
||||
#define EXIT_TEST(ret) return (void*)((size_t)(ret))
|
||||
#else
|
||||
#define EXIT_TEST(ret) return ret
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define WOLFSSL_PACK __attribute__ ((packed))
|
||||
#else
|
||||
#define WOLFSSL_PACK
|
||||
#endif
|
||||
|
||||
#ifndef __GNUC_PREREQ
|
||||
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||
#define __GNUC_PREREQ(maj, min) \
|
||||
((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
|
||||
#else
|
||||
#define __GNUC_PREREQ(maj, min) (0) /* not GNUC */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define WC_NORETURN __attribute__((noreturn))
|
||||
#else
|
||||
#define WC_NORETURN
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* WOLF_CRYPT_TYPES_H */
|
@ -0,0 +1,67 @@
|
||||
/* visibility.h
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Visibility control macros */
|
||||
|
||||
#ifndef WOLF_CRYPT_VISIBILITY_H
|
||||
#define WOLF_CRYPT_VISIBILITY_H
|
||||
|
||||
|
||||
/* for compatibility and so that fips is using same name of macro @wc_fips */
|
||||
#ifdef HAVE_FIPS
|
||||
#include <cyassl/ctaocrypt/visibility.h>
|
||||
#define WOLFSSL_API CYASSL_API
|
||||
#define WOLFSSL_LOCAL CYASSL_LOCAL
|
||||
#else
|
||||
|
||||
/* WOLFSSL_API is used for the public API symbols.
|
||||
It either imports or exports (or does nothing for static builds)
|
||||
|
||||
WOLFSSL_LOCAL is used for non-API symbols (private).
|
||||
*/
|
||||
|
||||
#if defined(BUILDING_WOLFSSL)
|
||||
#if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY
|
||||
#define WOLFSSL_API __attribute__ ((visibility("default")))
|
||||
#define WOLFSSL_LOCAL __attribute__ ((visibility("hidden")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
||||
#define WOLFSSL_API __global
|
||||
#define WOLFSSL_LOCAL __hidden
|
||||
#elif defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(WOLFSSL_DLL)
|
||||
#define WOLFSSL_API __declspec(dllexport)
|
||||
#else
|
||||
#define WOLFSSL_API
|
||||
#endif
|
||||
#define WOLFSSL_LOCAL
|
||||
#else
|
||||
#define WOLFSSL_API
|
||||
#define WOLFSSL_LOCAL
|
||||
#endif /* HAVE_VISIBILITY */
|
||||
#else /* BUILDING_WOLFSSL */
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(WOLFSSL_DLL)
|
||||
#define WOLFSSL_API __declspec(dllimport)
|
||||
#else
|
||||
#define WOLFSSL_API
|
||||
#endif
|
||||
#define WOLFSSL_LOCAL
|
||||
#else
|
||||
#define WOLFSSL_API
|
||||
#define WOLFSSL_LOCAL
|
||||
#endif
|
||||
#endif /* BUILDING_WOLFSSL */
|
||||
|
||||
#endif /* HAVE_FIPS */
|
||||
#endif /* WOLF_CRYPT_VISIBILITY_H */
|
||||
|
473
components/ssl/wolfssl/include/wolfssl/wolfcrypt/wc_port.h
Normal file
473
components/ssl/wolfssl/include/wolfssl/wolfcrypt/wc_port.h
Normal file
@ -0,0 +1,473 @@
|
||||
/* wc_port.h
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef WOLF_CRYPT_PORT_H
|
||||
#define WOLF_CRYPT_PORT_H
|
||||
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/visibility.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_WINDOWS_API
|
||||
#ifdef WOLFSSL_GAME_BUILD
|
||||
#include "system/xtl.h"
|
||||
#else
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#ifndef WOLFSSL_SGX
|
||||
#if defined(_WIN32_WCE) || defined(WIN32_LEAN_AND_MEAN)
|
||||
/* On WinCE winsock2.h must be included before windows.h */
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif /* WOLFSSL_SGX */
|
||||
#endif
|
||||
#elif defined(THREADX)
|
||||
#ifndef SINGLE_THREADED
|
||||
#ifdef NEED_THREADX_TYPES
|
||||
#include <types.h>
|
||||
#endif
|
||||
#include <tx_api.h>
|
||||
#endif
|
||||
#elif defined(MICRIUM)
|
||||
/* do nothing, just don't pick Unix */
|
||||
#elif defined(FREERTOS) || defined(FREERTOS_TCP) || defined(WOLFSSL_SAFERTOS)
|
||||
/* do nothing */
|
||||
#elif defined(EBSNET)
|
||||
/* do nothing */
|
||||
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
|
||||
/* do nothing */
|
||||
#elif defined(FREESCALE_FREE_RTOS)
|
||||
#include "fsl_os_abstraction.h"
|
||||
#elif defined(WOLFSSL_uITRON4)
|
||||
#include "stddef.h"
|
||||
#include "kernel.h"
|
||||
#elif defined(WOLFSSL_uTKERNEL2)
|
||||
#include "tk/tkernel.h"
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
#include "cmsis_os.h"
|
||||
#elif defined(WOLFSSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#else
|
||||
#include <rtl.h>
|
||||
#endif
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
#include "cmsis_os.h"
|
||||
#elif defined(WOLFSSL_TIRTOS)
|
||||
#include <ti/sysbios/BIOS.h>
|
||||
#include <ti/sysbios/knl/Semaphore.h>
|
||||
#elif defined(WOLFSSL_FROSTED)
|
||||
#include <semaphore.h>
|
||||
#elif defined(INTIME_RTOS)
|
||||
#include <rt.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#ifndef SINGLE_THREADED
|
||||
#define WOLFSSL_PTHREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
|
||||
#include <unistd.h> /* for close of BIO */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* For FIPS keep the function names the same */
|
||||
#ifdef HAVE_FIPS
|
||||
#define wc_InitMutex InitMutex
|
||||
#define wc_FreeMutex FreeMutex
|
||||
#define wc_LockMutex LockMutex
|
||||
#define wc_UnLockMutex UnLockMutex
|
||||
#endif /* HAVE_FIPS */
|
||||
|
||||
#ifdef SINGLE_THREADED
|
||||
typedef int wolfSSL_Mutex;
|
||||
#else /* MULTI_THREADED */
|
||||
/* FREERTOS comes first to enable use of FreeRTOS Windows simulator only */
|
||||
#if defined(FREERTOS)
|
||||
typedef xSemaphoreHandle wolfSSL_Mutex;
|
||||
#elif defined(FREERTOS_TCP)
|
||||
#include "FreeRTOS.h"
|
||||
#include "semphr.h"
|
||||
typedef SemaphoreHandle_t wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_SAFERTOS)
|
||||
typedef struct wolfSSL_Mutex {
|
||||
signed char mutexBuffer[portQUEUE_OVERHEAD_BYTES];
|
||||
xSemaphoreHandle mutex;
|
||||
} wolfSSL_Mutex;
|
||||
#elif defined(USE_WINDOWS_API)
|
||||
typedef CRITICAL_SECTION wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_PTHREADS)
|
||||
typedef pthread_mutex_t wolfSSL_Mutex;
|
||||
#elif defined(THREADX)
|
||||
typedef TX_MUTEX wolfSSL_Mutex;
|
||||
#elif defined(MICRIUM)
|
||||
typedef OS_MUTEX wolfSSL_Mutex;
|
||||
#elif defined(EBSNET)
|
||||
typedef RTP_MUTEX wolfSSL_Mutex;
|
||||
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
|
||||
typedef MUTEX_STRUCT wolfSSL_Mutex;
|
||||
#elif defined(FREESCALE_FREE_RTOS)
|
||||
typedef mutex_t wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_uITRON4)
|
||||
typedef struct wolfSSL_Mutex {
|
||||
T_CSEM sem ;
|
||||
ID id ;
|
||||
} wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_uTKERNEL2)
|
||||
typedef struct wolfSSL_Mutex {
|
||||
T_CSEM sem ;
|
||||
ID id ;
|
||||
} wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_CMSIS_RTOS)
|
||||
typedef osMutexId wolfSSL_Mutex;
|
||||
#else
|
||||
typedef OS_MUT wolfSSL_Mutex;
|
||||
#endif
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
typedef osMutexId wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_TIRTOS)
|
||||
typedef ti_sysbios_knl_Semaphore_Handle wolfSSL_Mutex;
|
||||
#elif defined(WOLFSSL_FROSTED)
|
||||
typedef mutex_t * wolfSSL_Mutex;
|
||||
#elif defined(INTIME_RTOS)
|
||||
typedef RTHANDLE wolfSSL_Mutex;
|
||||
#else
|
||||
#error Need a mutex type in multithreaded mode
|
||||
#endif /* USE_WINDOWS_API */
|
||||
#endif /* SINGLE_THREADED */
|
||||
|
||||
/* Enable crypt HW mutex for Freescale MMCAU or PIC32MZ */
|
||||
#if defined(FREESCALE_MMCAU) || defined(WOLFSSL_MICROCHIP_PIC32MZ)
|
||||
#ifndef WOLFSSL_CRYPT_HW_MUTEX
|
||||
#define WOLFSSL_CRYPT_HW_MUTEX 1
|
||||
#endif
|
||||
#endif /* FREESCALE_MMCAU */
|
||||
|
||||
#ifndef WOLFSSL_CRYPT_HW_MUTEX
|
||||
#define WOLFSSL_CRYPT_HW_MUTEX 0
|
||||
#endif
|
||||
|
||||
#if WOLFSSL_CRYPT_HW_MUTEX
|
||||
/* wolfSSL_CryptHwMutexInit is called on first wolfSSL_CryptHwMutexLock,
|
||||
however it's recommended to call this directly on Hw init to avoid possible
|
||||
race condition where two calls to wolfSSL_CryptHwMutexLock are made at
|
||||
the same time. */
|
||||
int wolfSSL_CryptHwMutexInit(void);
|
||||
int wolfSSL_CryptHwMutexLock(void);
|
||||
int wolfSSL_CryptHwMutexUnLock(void);
|
||||
#else
|
||||
/* Define stubs, since HW mutex is disabled */
|
||||
#define wolfSSL_CryptHwMutexInit() 0 /* Success */
|
||||
#define wolfSSL_CryptHwMutexLock() 0 /* Success */
|
||||
#define wolfSSL_CryptHwMutexUnLock() (void)0 /* Success */
|
||||
#endif /* WOLFSSL_CRYPT_HW_MUTEX */
|
||||
|
||||
/* Mutex functions */
|
||||
WOLFSSL_API int wc_InitMutex(wolfSSL_Mutex*);
|
||||
WOLFSSL_API wolfSSL_Mutex* wc_InitAndAllocMutex(void);
|
||||
WOLFSSL_API int wc_FreeMutex(wolfSSL_Mutex*);
|
||||
WOLFSSL_API int wc_LockMutex(wolfSSL_Mutex*);
|
||||
WOLFSSL_API int wc_UnLockMutex(wolfSSL_Mutex*);
|
||||
#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER)
|
||||
/* dynamiclly set which mutex to use. unlock / lock is controlled by flag */
|
||||
typedef void (mutex_cb)(int flag, int type, const char* file, int line);
|
||||
|
||||
WOLFSSL_API int wc_LockMutex_ex(int flag, int type, const char* file, int line);
|
||||
WOLFSSL_API int wc_SetMutexCb(mutex_cb* cb);
|
||||
#endif
|
||||
|
||||
/* main crypto initialization function */
|
||||
WOLFSSL_API int wolfCrypt_Init(void);
|
||||
WOLFSSL_API int wolfCrypt_Cleanup(void);
|
||||
|
||||
/* filesystem abstraction layer, used by ssl.c */
|
||||
#ifndef NO_FILESYSTEM
|
||||
|
||||
#if defined(EBSNET)
|
||||
#include "vfapi.h"
|
||||
#include "vfile.h"
|
||||
|
||||
#define XFILE int
|
||||
#define XFOPEN(NAME, MODE) vf_open((const char *)NAME, VO_RDONLY, 0);
|
||||
#define XFSEEK vf_lseek
|
||||
#define XFTELL vf_tell
|
||||
#define XREWIND vf_rewind
|
||||
#define XFREAD(BUF, SZ, AMT, FD) vf_read(FD, BUF, SZ*AMT)
|
||||
#define XFWRITE(BUF, SZ, AMT, FD) vf_write(FD, BUF, SZ*AMT)
|
||||
#define XFCLOSE vf_close
|
||||
#define XSEEK_END VSEEK_END
|
||||
#define XBADFILE -1
|
||||
#define XFGETS(b,s,f) -2 /* Not ported yet */
|
||||
#elif defined(LSR_FS)
|
||||
#include <fs.h>
|
||||
#define XFILE struct fs_file*
|
||||
#define XFOPEN(NAME, MODE) fs_open((char*)NAME);
|
||||
#define XFSEEK(F, O, W) (void)F
|
||||
#define XFTELL(F) (F)->len
|
||||
#define XREWIND(F) (void)F
|
||||
#define XFREAD(BUF, SZ, AMT, F) fs_read(F, (char*)BUF, SZ*AMT)
|
||||
#define XFWRITE(BUF, SZ, AMT, F) fs_write(F, (char*)BUF, SZ*AMT)
|
||||
#define XFCLOSE fs_close
|
||||
#define XSEEK_END 0
|
||||
#define XBADFILE NULL
|
||||
#define XFGETS(b,s,f) -2 /* Not ported yet */
|
||||
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
|
||||
#define XFILE MQX_FILE_PTR
|
||||
#define XFOPEN fopen
|
||||
#define XFSEEK fseek
|
||||
#define XFTELL ftell
|
||||
#define XREWIND(F) fseek(F, 0, IO_SEEK_SET)
|
||||
#define XFREAD fread
|
||||
#define XFWRITE fwrite
|
||||
#define XFCLOSE fclose
|
||||
#define XSEEK_END IO_SEEK_END
|
||||
#define XBADFILE NULL
|
||||
#define XFGETS fgets
|
||||
#elif defined(MICRIUM)
|
||||
#include <fs_api.h>
|
||||
#define XFILE FS_FILE*
|
||||
#define XFOPEN fs_fopen
|
||||
#define XFSEEK fs_fseek
|
||||
#define XFTELL fs_ftell
|
||||
#define XREWIND fs_rewind
|
||||
#define XFREAD fs_fread
|
||||
#define XFWRITE fs_fwrite
|
||||
#define XFCLOSE fs_fclose
|
||||
#define XSEEK_END FS_SEEK_END
|
||||
#define XBADFILE NULL
|
||||
#define XFGETS(b,s,f) -2 /* Not ported yet */
|
||||
#else
|
||||
/* stdio, default case */
|
||||
#include <stdio.h>
|
||||
#define XFILE FILE*
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
extern FILE * wolfSSL_fopen(const char *name, const char *mode) ;
|
||||
#define XFOPEN wolfSSL_fopen
|
||||
#else
|
||||
#define XFOPEN fopen
|
||||
#endif
|
||||
#define XFSEEK fseek
|
||||
#define XFTELL ftell
|
||||
#define XREWIND rewind
|
||||
#define XFREAD fread
|
||||
#define XFWRITE fwrite
|
||||
#define XFCLOSE fclose
|
||||
#define XSEEK_END SEEK_END
|
||||
#define XBADFILE NULL
|
||||
#define XFGETS fgets
|
||||
|
||||
#if !defined(USE_WINDOWS_API) && !defined(NO_WOLFSSL_DIR)
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MAX_FILENAME_SZ
|
||||
#define MAX_FILENAME_SZ 256 /* max file name length */
|
||||
#endif
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 256
|
||||
#endif
|
||||
|
||||
#if !defined(NO_WOLFSSL_DIR)
|
||||
typedef struct ReadDirCtx {
|
||||
#ifdef USE_WINDOWS_API
|
||||
WIN32_FIND_DATAA FindFileData;
|
||||
HANDLE hFind;
|
||||
#else
|
||||
struct dirent* entry;
|
||||
DIR* dir;
|
||||
struct stat s;
|
||||
#endif
|
||||
char name[MAX_FILENAME_SZ];
|
||||
} ReadDirCtx;
|
||||
|
||||
WOLFSSL_API int wc_ReadDirFirst(ReadDirCtx* ctx, const char* path, char** name);
|
||||
WOLFSSL_API int wc_ReadDirNext(ReadDirCtx* ctx, const char* path, char** name);
|
||||
WOLFSSL_API void wc_ReadDirClose(ReadDirCtx* ctx);
|
||||
#endif /* !NO_WOLFSSL_DIR */
|
||||
|
||||
#endif /* !NO_FILESYSTEM */
|
||||
|
||||
#ifdef USE_WOLF_STRTOK
|
||||
WOLFSSL_LOCAL char* wc_strtok(char *str, const char *delim, char **nextp);
|
||||
#endif
|
||||
|
||||
/* Windows API defines its own min() macro. */
|
||||
#if defined(USE_WINDOWS_API)
|
||||
#if defined(min) || defined(WOLFSSL_MYSQL_COMPATIBLE)
|
||||
#define WOLFSSL_HAVE_MIN
|
||||
#endif /* min */
|
||||
#if defined(max) || defined(WOLFSSL_MYSQL_COMPATIBLE)
|
||||
#define WOLFSSL_HAVE_MAX
|
||||
#endif /* max */
|
||||
#endif /* USE_WINDOWS_API */
|
||||
|
||||
/* Time functions */
|
||||
#ifndef NO_ASN_TIME
|
||||
#if defined(USER_TIME)
|
||||
/* Use our gmtime and time_t/struct tm types.
|
||||
Only needs seconds since EPOCH using XTIME function.
|
||||
time_t XTIME(time_t * timer) {}
|
||||
*/
|
||||
#define WOLFSSL_GMTIME
|
||||
#define USE_WOLF_TM
|
||||
#define USE_WOLF_TIME_T
|
||||
|
||||
#elif defined(TIME_OVERRIDES)
|
||||
/* Override XTIME() and XGMTIME() functionality.
|
||||
Requires user to provide these functions:
|
||||
time_t XTIME(time_t * timer) {}
|
||||
struct tm* XGMTIME(const time_t* timer, struct tm* tmp) {}
|
||||
*/
|
||||
#ifndef HAVE_TIME_T_TYPE
|
||||
#define USE_WOLF_TIME_T
|
||||
#endif
|
||||
#ifndef HAVE_TM_TYPE
|
||||
#define USE_WOLF_TM
|
||||
#endif
|
||||
#define NEED_TMP_TIME
|
||||
|
||||
#elif defined(HAVE_RTP_SYS)
|
||||
#include "os.h" /* dc_rtc_api needs */
|
||||
#include "dc_rtc_api.h" /* to get current time */
|
||||
|
||||
/* uses parital <time.h> structures */
|
||||
#define XTIME(tl) (0)
|
||||
#define XGMTIME(c, t) rtpsys_gmtime((c))
|
||||
|
||||
#elif defined(MICRIUM)
|
||||
#include <clk.h>
|
||||
#include <time.h>
|
||||
#define XTIME(t1) micrium_time((t1))
|
||||
#define WOLFSSL_GMTIME
|
||||
|
||||
#elif defined(MICROCHIP_TCPIP_V5) || defined(MICROCHIP_TCPIP)
|
||||
#include <time.h>
|
||||
#define XTIME(t1) pic32_time((t1))
|
||||
#define XGMTIME(c, t) gmtime((c))
|
||||
|
||||
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
|
||||
#define XTIME(t1) mqx_time((t1))
|
||||
#define HAVE_GMTIME_R
|
||||
|
||||
#elif defined(FREESCALE_KSDK_BM) || defined(FREESCALE_FREE_RTOS) || defined(FREESCALE_KSDK_FREERTOS)
|
||||
#include <time.h>
|
||||
#ifndef XTIME
|
||||
/*extern time_t ksdk_time(time_t* timer);*/
|
||||
#define XTIME(t1) ksdk_time((t1))
|
||||
#endif
|
||||
#define XGMTIME(c, t) gmtime((c))
|
||||
|
||||
#elif defined(WOLFSSL_ATMEL)
|
||||
#define XTIME(t1) atmel_get_curr_time_and_date((t1))
|
||||
#define WOLFSSL_GMTIME
|
||||
#define USE_WOLF_TM
|
||||
#define USE_WOLF_TIME_T
|
||||
|
||||
#elif defined(IDIRECT_DEV_TIME)
|
||||
/*Gets the timestamp from cloak software owned by VT iDirect
|
||||
in place of time() from <time.h> */
|
||||
#include <time.h>
|
||||
#define XTIME(t1) idirect_time((t1))
|
||||
#define XGMTIME(c, t) gmtime((c))
|
||||
|
||||
#elif defined(_WIN32_WCE)
|
||||
#include <windows.h>
|
||||
#define XTIME(t1) windows_time((t1))
|
||||
#define WOLFSSL_GMTIME
|
||||
|
||||
#else
|
||||
/* default */
|
||||
/* uses complete <time.h> facility */
|
||||
#include <time.h>
|
||||
|
||||
/* PowerPC time_t is int */
|
||||
#ifdef __PPC__
|
||||
#define TIME_T_NOT_LONG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Map default time functions */
|
||||
#if !defined(XTIME) && !defined(TIME_OVERRIDES) && !defined(USER_TIME)
|
||||
#define XTIME(tl) time((tl))
|
||||
#endif
|
||||
#if !defined(XGMTIME) && !defined(TIME_OVERRIDES)
|
||||
#if defined(WOLFSSL_GMTIME) || !defined(HAVE_GMTIME_R)
|
||||
#define XGMTIME(c, t) gmtime((c))
|
||||
#else
|
||||
#define XGMTIME(c, t) gmtime_r((c), (t))
|
||||
#define NEED_TMP_TIME
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(XVALIDATE_DATE) && !defined(HAVE_VALIDATE_DATE)
|
||||
#define USE_WOLF_VALIDDATE
|
||||
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
||||
#endif
|
||||
|
||||
/* wolf struct tm and time_t */
|
||||
#if defined(USE_WOLF_TM)
|
||||
struct tm {
|
||||
int tm_sec; /* seconds after the minute [0-60] */
|
||||
int tm_min; /* minutes after the hour [0-59] */
|
||||
int tm_hour; /* hours since midnight [0-23] */
|
||||
int tm_mday; /* day of the month [1-31] */
|
||||
int tm_mon; /* months since January [0-11] */
|
||||
int tm_year; /* years since 1900 */
|
||||
int tm_wday; /* days since Sunday [0-6] */
|
||||
int tm_yday; /* days since January 1 [0-365] */
|
||||
int tm_isdst; /* Daylight Savings Time flag */
|
||||
long tm_gmtoff; /* offset from CUT in seconds */
|
||||
char *tm_zone; /* timezone abbreviation */
|
||||
};
|
||||
#endif /* USE_WOLF_TM */
|
||||
#if defined(USE_WOLF_TIME_T)
|
||||
typedef long time_t;
|
||||
#endif
|
||||
|
||||
/* forward declarations */
|
||||
#if defined(USER_TIME)
|
||||
struct tm* gmtime(const time_t* timer);
|
||||
extern time_t XTIME(time_t * timer);
|
||||
|
||||
#ifdef STACK_TRAP
|
||||
/* for stack trap tracking, don't call os gmtime on OS X/linux,
|
||||
uses a lot of stack spce */
|
||||
extern time_t time(time_t * timer);
|
||||
#define XTIME(tl) time((tl))
|
||||
#endif /* STACK_TRAP */
|
||||
|
||||
#elif defined(TIME_OVERRIDES)
|
||||
extern time_t XTIME(time_t * timer);
|
||||
extern struct tm* XGMTIME(const time_t* timer, struct tm* tmp);
|
||||
#elif defined(WOLFSSL_GMTIME)
|
||||
struct tm* gmtime(const time_t* timer);
|
||||
#endif
|
||||
#endif /* NO_ASN_TIME */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* WOLF_CRYPT_PORT_H */
|
||||
|
420
components/ssl/wolfssl/include/wolfssl/wolfio.h
Normal file
420
components/ssl/wolfssl/include/wolfssl/wolfio.h
Normal file
@ -0,0 +1,420 @@
|
||||
/* io.h
|
||||
*
|
||||
* Copyright (C) 2006-2017 wolfSSL Inc. All rights reserved.
|
||||
*
|
||||
* This file is part of wolfSSL.
|
||||
*
|
||||
* Contact licensing@wolfssl.com with any questions or comments.
|
||||
*
|
||||
* http://www.wolfssl.com
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef WOLFSSL_IO_H
|
||||
#define WOLFSSL_IO_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* OCSP and CRL_IO require HTTP client */
|
||||
#if defined(HAVE_OCSP) || defined(HAVE_CRL_IO)
|
||||
#ifndef HAVE_HTTP_CLIENT
|
||||
#define HAVE_HTTP_CLIENT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(WOLFSSL_USER_IO)
|
||||
/* Micrium uses NetSock I/O callbacks in wolfio.c */
|
||||
#if !defined(USE_WOLFSSL_IO) && !defined(MICRIUM)
|
||||
#define USE_WOLFSSL_IO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(USE_WOLFSSL_IO) || defined(HAVE_HTTP_CLIENT)
|
||||
|
||||
#ifdef HAVE_LIBZ
|
||||
#include "zlib.h"
|
||||
#endif
|
||||
|
||||
#ifndef USE_WINDOWS_API
|
||||
#ifdef WOLFSSL_LWIP
|
||||
/* lwIP needs to be configured to use sockets API in this mode */
|
||||
/* LWIP_SOCKET 1 in lwip/opt.h or in build */
|
||||
#include "lwip/sockets.h"
|
||||
#ifndef LWIP_PROVIDE_ERRNO
|
||||
#include <errno.h>
|
||||
#define LWIP_PROVIDE_ERRNO 1
|
||||
#endif
|
||||
#elif defined(FREESCALE_MQX)
|
||||
#include <posix.h>
|
||||
#include <rtcs.h>
|
||||
#elif defined(FREESCALE_KSDK_MQX)
|
||||
#include <rtcs.h>
|
||||
#elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET))
|
||||
#include "cmsis_os.h"
|
||||
#include "rl_net.h"
|
||||
#include "errno.h"
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
#include "cmsis_os.h"
|
||||
#elif defined(WOLFSSL_TIRTOS)
|
||||
#include <sys/socket.h>
|
||||
#elif defined(FREERTOS_TCP)
|
||||
#include "FreeRTOS_Sockets.h"
|
||||
#elif defined(WOLFSSL_IAR_ARM)
|
||||
/* nothing */
|
||||
#elif defined(WOLFSSL_VXWORKS)
|
||||
#include <sockLib.h>
|
||||
#include <errno.h>
|
||||
#elif defined(WOLFSSL_ATMEL)
|
||||
#include "socket/include/socket.h"
|
||||
#elif defined(INTIME_RTOS)
|
||||
#undef MIN
|
||||
#undef MAX
|
||||
#include <rt.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <io.h>
|
||||
/* <sys/socket.h> defines these, to avoid conflict, do undef */
|
||||
#undef SOCKADDR
|
||||
#undef SOCKADDR_IN
|
||||
#elif defined(WOLFSSL_PRCONNECT_PRO)
|
||||
#include <prconnect_pro/prconnect_pro.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/ioctl.h>
|
||||
#elif defined(WOLFSSL_SGX)
|
||||
#include <errno.h>
|
||||
#elif !defined(WOLFSSL_NO_SOCK)
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#ifndef EBSNET
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
#if defined(HAVE_RTP_SYS)
|
||||
#include <socket.h>
|
||||
#elif defined(EBSNET)
|
||||
#include "rtipapi.h" /* errno */
|
||||
#include "socket.h"
|
||||
#elif !defined(DEVKITPRO) && !defined(WOLFSSL_PICOTCP)
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#ifdef __PPU
|
||||
#include <netex/errno.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* USE_WINDOWS_API */
|
||||
|
||||
#ifdef __sun
|
||||
#include <sys/filio.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_WINDOWS_API
|
||||
/* no epipe yet */
|
||||
#ifndef WSAEPIPE
|
||||
#define WSAEPIPE -12345
|
||||
#endif
|
||||
#define SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define SOCKET_EAGAIN WSAETIMEDOUT
|
||||
#define SOCKET_ECONNRESET WSAECONNRESET
|
||||
#define SOCKET_EINTR WSAEINTR
|
||||
#define SOCKET_EPIPE WSAEPIPE
|
||||
#define SOCKET_ECONNREFUSED WSAENOTCONN
|
||||
#define SOCKET_ECONNABORTED WSAECONNABORTED
|
||||
#define close(s) closesocket(s)
|
||||
#elif defined(__PPU)
|
||||
#define SOCKET_EWOULDBLOCK SYS_NET_EWOULDBLOCK
|
||||
#define SOCKET_EAGAIN SYS_NET_EAGAIN
|
||||
#define SOCKET_ECONNRESET SYS_NET_ECONNRESET
|
||||
#define SOCKET_EINTR SYS_NET_EINTR
|
||||
#define SOCKET_EPIPE SYS_NET_EPIPE
|
||||
#define SOCKET_ECONNREFUSED SYS_NET_ECONNREFUSED
|
||||
#define SOCKET_ECONNABORTED SYS_NET_ECONNABORTED
|
||||
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
|
||||
#if MQX_USE_IO_OLD
|
||||
/* RTCS old I/O doesn't have an EWOULDBLOCK */
|
||||
#define SOCKET_EWOULDBLOCK EAGAIN
|
||||
#define SOCKET_EAGAIN EAGAIN
|
||||
#define SOCKET_ECONNRESET RTCSERR_TCP_CONN_RESET
|
||||
#define SOCKET_EINTR EINTR
|
||||
#define SOCKET_EPIPE EPIPE
|
||||
#define SOCKET_ECONNREFUSED RTCSERR_TCP_CONN_REFUSED
|
||||
#define SOCKET_ECONNABORTED RTCSERR_TCP_CONN_ABORTED
|
||||
#else
|
||||
#define SOCKET_EWOULDBLOCK NIO_EWOULDBLOCK
|
||||
#define SOCKET_EAGAIN NIO_EAGAIN
|
||||
#define SOCKET_ECONNRESET NIO_ECONNRESET
|
||||
#define SOCKET_EINTR NIO_EINTR
|
||||
#define SOCKET_EPIPE NIO_EPIPE
|
||||
#define SOCKET_ECONNREFUSED NIO_ECONNREFUSED
|
||||
#define SOCKET_ECONNABORTED NIO_ECONNABORTED
|
||||
#endif
|
||||
#elif defined(WOLFSSL_MDK_ARM)|| defined(WOLFSSL_KEIL_TCP_NET)
|
||||
#define SOCKET_EWOULDBLOCK BSD_ERROR_WOULDBLOCK
|
||||
#define SOCKET_EAGAIN BSD_ERROR_LOCKED
|
||||
#define SOCKET_ECONNRESET BSD_ERROR_CLOSED
|
||||
#define SOCKET_EINTR BSD_ERROR
|
||||
#define SOCKET_EPIPE BSD_ERROR
|
||||
#define SOCKET_ECONNREFUSED BSD_ERROR
|
||||
#define SOCKET_ECONNABORTED BSD_ERROR
|
||||
#elif defined(WOLFSSL_PICOTCP)
|
||||
#define SOCKET_EWOULDBLOCK PICO_ERR_EAGAIN
|
||||
#define SOCKET_EAGAIN PICO_ERR_EAGAIN
|
||||
#define SOCKET_ECONNRESET PICO_ERR_ECONNRESET
|
||||
#define SOCKET_EINTR PICO_ERR_EINTR
|
||||
#define SOCKET_EPIPE PICO_ERR_EIO
|
||||
#define SOCKET_ECONNREFUSED PICO_ERR_ECONNREFUSED
|
||||
#define SOCKET_ECONNABORTED PICO_ERR_ESHUTDOWN
|
||||
#elif defined(FREERTOS_TCP)
|
||||
#define SOCKET_EWOULDBLOCK FREERTOS_EWOULDBLOCK
|
||||
#define SOCKET_EAGAIN FREERTOS_EWOULDBLOCK
|
||||
#define SOCKET_ECONNRESET FREERTOS_SOCKET_ERROR
|
||||
#define SOCKET_EINTR FREERTOS_SOCKET_ERROR
|
||||
#define SOCKET_EPIPE FREERTOS_SOCKET_ERROR
|
||||
#define SOCKET_ECONNREFUSED FREERTOS_SOCKET_ERROR
|
||||
#define SOCKET_ECONNABORTED FREERTOS_SOCKET_ERROR
|
||||
#else
|
||||
#define SOCKET_EWOULDBLOCK EWOULDBLOCK
|
||||
#define SOCKET_EAGAIN EAGAIN
|
||||
#define SOCKET_ECONNRESET ECONNRESET
|
||||
#define SOCKET_EINTR EINTR
|
||||
#define SOCKET_EPIPE EPIPE
|
||||
#define SOCKET_ECONNREFUSED ECONNREFUSED
|
||||
#define SOCKET_ECONNABORTED ECONNABORTED
|
||||
#endif /* USE_WINDOWS_API */
|
||||
|
||||
|
||||
#ifdef DEVKITPRO
|
||||
/* from network.h */
|
||||
int net_send(int, const void*, int, unsigned int);
|
||||
int net_recv(int, void*, int, unsigned int);
|
||||
#define SEND_FUNCTION net_send
|
||||
#define RECV_FUNCTION net_recv
|
||||
#elif defined(WOLFSSL_LWIP)
|
||||
#define SEND_FUNCTION lwip_send
|
||||
#define RECV_FUNCTION lwip_recv
|
||||
#elif defined(WOLFSSL_PICOTCP)
|
||||
#define SEND_FUNCTION pico_send
|
||||
#define RECV_FUNCTION pico_recv
|
||||
#elif defined(FREERTOS_TCP)
|
||||
#define RECV_FUNCTION(a,b,c,d) FreeRTOS_recv((Socket_t)(a),(void*)(b), (size_t)(c), (BaseType_t)(d))
|
||||
#define SEND_FUNCTION(a,b,c,d) FreeRTOS_send((Socket_t)(a),(void*)(b), (size_t)(c), (BaseType_t)(d))
|
||||
#elif defined(WOLFSSL_VXWORKS)
|
||||
#define SEND_FUNCTION send
|
||||
#define RECV_FUNCTION recv
|
||||
#else
|
||||
#define SEND_FUNCTION send
|
||||
#define RECV_FUNCTION recv
|
||||
#if !defined(HAVE_SOCKADDR) && !defined(WOLFSSL_NO_SOCK)
|
||||
#define HAVE_SOCKADDR
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_WINDOWS_API
|
||||
typedef unsigned int SOCKET_T;
|
||||
#else
|
||||
typedef int SOCKET_T;
|
||||
#endif
|
||||
|
||||
#ifndef WOLFSSL_NO_SOCK
|
||||
#ifndef XSOCKLENT
|
||||
#ifdef USE_WINDOWS_API
|
||||
#define XSOCKLENT int
|
||||
#else
|
||||
#define XSOCKLENT socklen_t
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Socket Addr Support */
|
||||
#ifdef HAVE_SOCKADDR
|
||||
typedef struct sockaddr SOCKADDR;
|
||||
typedef struct sockaddr_storage SOCKADDR_S;
|
||||
typedef struct sockaddr_in SOCKADDR_IN;
|
||||
#ifdef WOLFSSL_IPV6
|
||||
typedef struct sockaddr_in6 SOCKADDR_IN6;
|
||||
#endif
|
||||
typedef struct hostent HOSTENT;
|
||||
#endif /* HAVE_SOCKADDR */
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
typedef struct addrinfo ADDRINFO;
|
||||
#endif
|
||||
#endif /* WOLFSSL_NO_SOCK */
|
||||
|
||||
|
||||
/* IO API's */
|
||||
#ifdef HAVE_IO_TIMEOUT
|
||||
WOLFSSL_API int wolfIO_SetBlockingMode(SOCKET_T sockfd, int non_blocking);
|
||||
WOLFSSL_API void wolfIO_SetTimeout(int to_sec);;
|
||||
WOLFSSL_API int wolfIO_Select(SOCKET_T sockfd, int to_sec);
|
||||
#endif
|
||||
WOLFSSL_API int wolfIO_TcpConnect(SOCKET_T* sockfd, const char* ip,
|
||||
unsigned short port, int to_sec);
|
||||
WOLFSSL_API int wolfIO_Send(SOCKET_T sd, char *buf, int sz, int wrFlags);
|
||||
WOLFSSL_API int wolfIO_Recv(SOCKET_T sd, char *buf, int sz, int rdFlags);
|
||||
|
||||
#endif /* USE_WOLFSSL_IO || HAVE_HTTP_CLIENT */
|
||||
|
||||
|
||||
WOLFSSL_API int BioSend(WOLFSSL* ssl, char *buf, int sz, void *ctx);
|
||||
WOLFSSL_API int BioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||
#if defined(USE_WOLFSSL_IO)
|
||||
/* default IO callbacks */
|
||||
WOLFSSL_API int EmbedReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||
WOLFSSL_API int EmbedSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||
|
||||
#ifdef WOLFSSL_DTLS
|
||||
WOLFSSL_API int EmbedReceiveFrom(WOLFSSL* ssl, char* buf, int sz, void*);
|
||||
WOLFSSL_API int EmbedSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||
WOLFSSL_API int EmbedGenerateCookie(WOLFSSL* ssl, unsigned char* buf,
|
||||
int sz, void*);
|
||||
#ifdef WOLFSSL_MULTICAST
|
||||
WOLFSSL_API int EmbedReceiveFromMcast(WOLFSSL* ssl,
|
||||
char* buf, int sz, void*);
|
||||
#endif /* WOLFSSL_MULTICAST */
|
||||
#ifdef WOLFSSL_SESSION_EXPORT
|
||||
WOLFSSL_API int EmbedGetPeer(WOLFSSL* ssl, char* ip, int* ipSz,
|
||||
unsigned short* port, int* fam);
|
||||
WOLFSSL_API int EmbedSetPeer(WOLFSSL* ssl, char* ip, int ipSz,
|
||||
unsigned short port, int fam);
|
||||
#endif /* WOLFSSL_SESSION_EXPORT */
|
||||
#endif /* WOLFSSL_DTLS */
|
||||
#endif /* USE_WOLFSSL_IO */
|
||||
|
||||
#ifdef HAVE_OCSP
|
||||
WOLFSSL_API int wolfIO_HttpBuildRequestOcsp(const char* domainName,
|
||||
const char* path, int ocspReqSz, unsigned char* buf, int bufSize);
|
||||
WOLFSSL_API int wolfIO_HttpProcessResponseOcsp(int sfd,
|
||||
unsigned char** respBuf, unsigned char* httpBuf, int httpBufSz,
|
||||
void* heap);
|
||||
|
||||
WOLFSSL_API int EmbedOcspLookup(void*, const char*, int, unsigned char*,
|
||||
int, unsigned char**);
|
||||
WOLFSSL_API void EmbedOcspRespFree(void*, unsigned char*);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CRL_IO
|
||||
WOLFSSL_API int wolfIO_HttpBuildRequestCrl(const char* url, int urlSz,
|
||||
const char* domainName, unsigned char* buf, int bufSize);
|
||||
WOLFSSL_API int wolfIO_HttpProcessResponseCrl(WOLFSSL_CRL* crl, int sfd,
|
||||
unsigned char* httpBuf, int httpBufSz);
|
||||
|
||||
WOLFSSL_API int EmbedCrlLookup(WOLFSSL_CRL* crl, const char* url,
|
||||
int urlSz);
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_HTTP_CLIENT)
|
||||
WOLFSSL_API int wolfIO_DecodeUrl(const char* url, int urlSz, char* outName,
|
||||
char* outPath, unsigned short* outPort);
|
||||
|
||||
WOLFSSL_API int wolfIO_HttpBuildRequest(const char* reqType,
|
||||
const char* domainName, const char* path, int pathLen, int reqSz,
|
||||
const char* contentType, unsigned char* buf, int bufSize);
|
||||
WOLFSSL_API int wolfIO_HttpProcessResponse(int sfd, const char** appStrList,
|
||||
unsigned char** respBuf, unsigned char* httpBuf, int httpBufSz,
|
||||
int dynType, void* heap);
|
||||
#endif /* HAVE_HTTP_CLIENT */
|
||||
|
||||
|
||||
/* I/O callbacks */
|
||||
typedef int (*CallbackIORecv)(WOLFSSL *ssl, char *buf, int sz, void *ctx);
|
||||
typedef int (*CallbackIOSend)(WOLFSSL *ssl, char *buf, int sz, void *ctx);
|
||||
WOLFSSL_API void wolfSSL_SetIORecv(WOLFSSL_CTX*, CallbackIORecv);
|
||||
WOLFSSL_API void wolfSSL_SetIOSend(WOLFSSL_CTX*, CallbackIOSend);
|
||||
|
||||
WOLFSSL_API void wolfSSL_SetIOReadCtx( WOLFSSL* ssl, void *ctx);
|
||||
WOLFSSL_API void wolfSSL_SetIOWriteCtx(WOLFSSL* ssl, void *ctx);
|
||||
|
||||
WOLFSSL_API void* wolfSSL_GetIOReadCtx( WOLFSSL* ssl);
|
||||
WOLFSSL_API void* wolfSSL_GetIOWriteCtx(WOLFSSL* ssl);
|
||||
|
||||
WOLFSSL_API void wolfSSL_SetIOReadFlags( WOLFSSL* ssl, int flags);
|
||||
WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags);
|
||||
|
||||
|
||||
#ifdef HAVE_NETX
|
||||
WOLFSSL_LOCAL int NetX_Receive(WOLFSSL *ssl, char *buf, int sz, void *ctx);
|
||||
WOLFSSL_LOCAL int NetX_Send(WOLFSSL *ssl, char *buf, int sz, void *ctx);
|
||||
|
||||
WOLFSSL_API void wolfSSL_SetIO_NetX(WOLFSSL* ssl, NX_TCP_SOCKET* nxsocket,
|
||||
ULONG waitoption);
|
||||
#endif /* HAVE_NETX */
|
||||
|
||||
#ifdef MICRIUM
|
||||
WOLFSSL_LOCAL int MicriumSend(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||
WOLFSSL_LOCAL int MicriumReceive(WOLFSSL* ssl, char* buf, int sz,
|
||||
void* ctx);
|
||||
WOLFSSL_LOCAL int MicriumReceiveFrom(WOLFSSL* ssl, char* buf, int sz,
|
||||
void* ctx);
|
||||
WOLFSSL_LOCAL int MicriumSendTo(WOLFSSL* ssl, char* buf, int sz, void* ctx);
|
||||
#endif /* MICRIUM */
|
||||
|
||||
#ifdef WOLFSSL_DTLS
|
||||
typedef int (*CallbackGenCookie)(WOLFSSL* ssl, unsigned char* buf, int sz,
|
||||
void* ctx);
|
||||
WOLFSSL_API void wolfSSL_CTX_SetGenCookie(WOLFSSL_CTX*, CallbackGenCookie);
|
||||
WOLFSSL_API void wolfSSL_SetCookieCtx(WOLFSSL* ssl, void *ctx);
|
||||
WOLFSSL_API void* wolfSSL_GetCookieCtx(WOLFSSL* ssl);
|
||||
|
||||
#ifdef WOLFSSL_SESSION_EXPORT
|
||||
typedef int (*CallbackGetPeer)(WOLFSSL* ssl, char* ip, int* ipSz,
|
||||
unsigned short* port, int* fam);
|
||||
typedef int (*CallbackSetPeer)(WOLFSSL* ssl, char* ip, int ipSz,
|
||||
unsigned short port, int fam);
|
||||
|
||||
WOLFSSL_API void wolfSSL_CTX_SetIOGetPeer(WOLFSSL_CTX*, CallbackGetPeer);
|
||||
WOLFSSL_API void wolfSSL_CTX_SetIOSetPeer(WOLFSSL_CTX*, CallbackSetPeer);
|
||||
#endif /* WOLFSSL_SESSION_EXPORT */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef XINET_NTOP
|
||||
#define XINET_NTOP(a,b,c,d) inet_ntop((a),(b),(c),(d))
|
||||
#ifdef USE_WINDOWS_API /* Windows-friendly definition */
|
||||
#undef XINET_NTOP
|
||||
#define XINET_NTOP(a,b,c,d) InetNtop((a),(b),(c),(d))
|
||||
#endif
|
||||
#endif
|
||||
#ifndef XINET_PTON
|
||||
#define XINET_PTON(a,b,c) inet_pton((a),(b),(c))
|
||||
#ifdef USE_WINDOWS_API /* Windows-friendly definition */
|
||||
#undef XINET_PTON
|
||||
#define XINET_PTON(a,b,c) InetPton((a),(b),(c))
|
||||
#endif
|
||||
#endif
|
||||
#ifndef XHTONS
|
||||
#define XHTONS(a) htons((a))
|
||||
#endif
|
||||
#ifndef XNTOHS
|
||||
#define XNTOHS(a) ntohs((a))
|
||||
#endif
|
||||
|
||||
#ifndef WOLFSSL_IP4
|
||||
#define WOLFSSL_IP4 AF_INET
|
||||
#endif
|
||||
#ifndef WOLFSSL_IP6
|
||||
#define WOLFSSL_IP6 AF_INET6
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* WOLFSSL_IO_H */
|
BIN
components/ssl/wolfssl/lib/libwolfssl.a
Normal file
BIN
components/ssl/wolfssl/lib/libwolfssl.a
Normal file
Binary file not shown.
Reference in New Issue
Block a user