diff --git a/Makefile.am b/Makefile.am index 8688d878e..06fb29cfd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,6 +60,7 @@ EXTRA_DIST+= README.md EXTRA_DIST+= LICENSING include cyassl/include.am +include wolfssl/include.am include certs/include.am include certs/1024/include.am include certs/crl/include.am diff --git a/ctaocrypt/benchmark/benchmark.c b/ctaocrypt/benchmark/benchmark.c index 4f39614ad..6aff3fd5e 100644 --- a/ctaocrypt/benchmark/benchmark.c +++ b/ctaocrypt/benchmark/benchmark.c @@ -21,6 +21,11 @@ /* CTaoCrypt benchmark */ + +/* wolfssl_cyassl compatibility layer */ +#include + + #ifdef HAVE_CONFIG_H #include #endif diff --git a/ctaocrypt/test/test.c b/ctaocrypt/test/test.c index d85d30f87..d207761ef 100644 --- a/ctaocrypt/test/test.c +++ b/ctaocrypt/test/test.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/* wolfssl_cyassl compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include #endif diff --git a/cyassl/ctaocrypt/settings.h b/cyassl/ctaocrypt/settings.h index 5cc4e7aba..e5d76d84b 100644 --- a/cyassl/ctaocrypt/settings.h +++ b/cyassl/ctaocrypt/settings.h @@ -26,6 +26,718 @@ #ifndef CTAO_CRYPT_SETTINGS_H #define CTAO_CRYPT_SETTINGS_H +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using PIC32MZ Crypto Engine */ +/* #define CYASSL_MICROCHIP_PIC32MZ */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + +/* Uncomment next line if building for EROAD */ +/* #define CYASSL_EROAD */ + +/* Uncomment next line if building for IAR EWARM */ +/* #define CYASSL_IAR_ARM */ + +/* Uncomment next line if using TI-RTOS settings */ +/* #define CYASSL_TIRTOS */ + +/* Uncomment next line if building with PicoTCP */ +/* #define CYASSL_PICOTCP */ + +/* Uncomment next line if building for PicoTCP demo bundle */ +/* #define CYASSL_PICOTCP_DEMO */ + +#include #include +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 #endif + + +#ifdef CYASSL_USER_SETTINGS + #include +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ + #define CYASSL_LWIP + #define NO_WRITEV + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_FILESYSTEM +#endif + +#if defined(CYASSL_IAR_ARM) + #define NO_MAIN_DRIVER + #define SINGLE_THREADED + #define USE_CERT_BUFFERS_1024 + #define BENCH_EMBEDDED + #define NO_FILESYSTEM + #define NO_WRITEV + #define CYASSL_USER_IO + #define BENCH_EMBEDDED +#endif + +#ifdef MICROCHIP_PIC32 + /* #define CYASSL_MICROCHIP_PIC32MZ */ + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef CYASSL_MICROCHIP_PIC32MZ + #define CYASSL_PIC32MZ_CE + #define CYASSL_PIC32MZ_CRYPT + #define HAVE_AES_ENGINE + #define CYASSL_PIC32MZ_RNG + /* #define CYASSL_PIC32MZ_HASH */ + #define CYASSL_AES_COUNTER + #define HAVE_AESGCM + #define NO_BIG_INT + +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "system/system_services.h" + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define CYASSL_USER_IO + #define NO_FILESYSTEM + #define NO_CERT + #define USE_CERT_BUFFERS_1024 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define HAVE_ECC + #define NO_SESSION_CACHE + #define CYASSL_CMSIS_RTOS +#endif + + +#ifdef CYASSL_EROAD + #define FREESCALE_MQX + #define FREESCALE_MMCAU + #define SINGLE_THREADED + #define NO_STDIO_FILESYSTEM + #define CYASSL_LEANPSK + #define HAVE_NULL_CIPHER + #define NO_OLD_TLS + #define NO_ASN + #define NO_BIG_INT + #define NO_RSA + #define NO_DSA + #define NO_DH + #define NO_CERTS + #define NO_PWDBASED + #define NO_DES3 + #define NO_MD4 + #define NO_RC4 + #define NO_MD5 + #define NO_SESSION_CACHE + #define NO_MAIN_DRIVER +#endif + +#ifdef CYASSL_PICOTCP + #define errno pico_err + #include "pico_defines.h" + #include "pico_stack.h" + #include "pico_constants.h" + #define CUSTOM_RAND_GENERATE pico_rand +#endif + +#ifdef CYASSL_PICOTCP_DEMO + #define CYASSL_STM32 + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define XMALLOC(s, h, type) PICO_ZALLOC((s)) + #define XFREE(p, h, type) PICO_FREE((p)) + #define SINGLE_THREADED + #define NO_WRITEV + #define CYASSL_USER_IO + #define NO_DEV_RANDOM + #define NO_FILESYSTEM +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) && !defined(CYASSL_EROAD) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef CYASSL_TIRTOS + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_CERT_BUFFERS_2048 + #define NO_ERROR_STRINGS + #define USER_TIME + + #ifdef __IAR_SYSTEMS_ICC__ + #pragma diag_suppress=Pa089 + #elif !defined(__GNUC__) + /* Suppress the sslpro warning */ + #pragma diag_suppress=11 + #endif + + #include +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* FreeScale MMCAU hardware crypto has 4 byte alignment */ +#ifdef FREESCALE_MMCAU + #define CYASSL_MMCAU_ALIGNMENT 4 +#endif + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #elif defined(FREESCALE_MMCAU) + #define CYASSL_GENERAL_ALIGNMENT CYASSL_MMCAU_ALIGNMENT + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + + +#ifdef __INTEL_COMPILER + #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */ +#endif + + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ diff --git a/cyassl/ctaocrypt/visibility.h b/cyassl/ctaocrypt/visibility.h index 4fd6fb82f..ed9f1a09f 100644 --- a/cyassl/ctaocrypt/visibility.h +++ b/cyassl/ctaocrypt/visibility.h @@ -21,9 +21,9 @@ /* Visibility control macros */ - -#ifndef CTAO_CRYPT_VISIBILITY_H -#define CTAO_CRYPT_VISIBILITY_H +#include +// #ifndef CTAO_CRYPT_VISIBILITY_H +// #define CTAO_CRYPT_VISIBILITY_H /* CYASSL_API is used for the public API symbols. @@ -32,40 +32,39 @@ CYASSL_LOCAL is used for non-API symbols (private). */ -#if defined(BUILDING_CYASSL) - #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY - #define CYASSL_API __attribute__ ((visibility("default"))) - #define CYASSL_LOCAL __attribute__ ((visibility("hidden"))) - #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) - #define CYASSL_API __global - #define CYASSL_LOCAL __hidden - #elif defined(_MSC_VER) - #ifdef CYASSL_DLL - #define CYASSL_API extern __declspec(dllexport) - #else - //#define CYASSL_API - #define WOLFSSL_API - #define CYASSL_API WOLFSSL_API - #endif - #define CYASSL_LOCAL - #else - #define CYASSL_API - #define CYASSL_LOCAL - #endif /* HAVE_VISIBILITY */ -#else /* BUILDING_CYASSL */ - #if defined(_MSC_VER) - #ifdef CYASSL_DLL - #define CYASSL_API extern __declspec(dllimport) - #else - #define CYASSL_API - #endif - #define CYASSL_LOCAL - #else - #define CYASSL_API - #define CYASSL_LOCAL - #endif -#endif /* BUILDING_CYASSL */ +// #if defined(BUILDING_CYASSL) +// #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY +// #define CYASSL_API __attribute__ ((visibility("default"))) +// #define CYASSL_LOCAL __attribute__ ((visibility("hidden"))) +// #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) +// #define CYASSL_API __global +// #define CYASSL_LOCAL __hidden +// #elif defined(_MSC_VER) +// #ifdef CYASSL_DLL +// #define CYASSL_API extern __declspec(dllexport) +// #else +// //#define CYASSL_API +// #define CYASSL_API: +// #endif +// #define CYASSL_LOCAL +// #else +// #define CYASSL_API +// #define CYASSL_LOCAL +// #endif /* HAVE_VISIBILITY */ +// #else /* BUILDING_CYASSL */ +// #if defined(_MSC_VER) +// #ifdef CYASSL_DLL +// #define CYASSL_API extern __declspec(dllimport) +// #else +// #define CYASSL_API +// #endif +// #define CYASSL_LOCAL +// #else +// #define CYASSL_API +// #define CYASSL_LOCAL +// #endif +// #endif /* BUILDING_CYASSL */ -#endif /* CTAO_CRYPT_VISIBILITY_H */ +// #endif /* CTAO_CRYPT_VISIBILITY_H */ diff --git a/cyassl/openssl/asn1.h b/cyassl/openssl/asn1.h index 3f34d7d2c..35be23f7d 100644 --- a/cyassl/openssl/asn1.h +++ b/cyassl/openssl/asn1.h @@ -1,2 +1,3 @@ /* asn1.h for openssl */ +#include diff --git a/cyassl/openssl/bio.h b/cyassl/openssl/bio.h index aba1935f1..8f5298355 100644 --- a/cyassl/openssl/bio.h +++ b/cyassl/openssl/bio.h @@ -1,23 +1,4 @@ /* bio.h for openssl */ - -#ifndef CYASSL_BIO_H_ -#define CYASSL_BIO_H_ - -#include - - -#ifdef __cplusplus - extern "C" { -#endif - - - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_BIO_H_ */ +#include diff --git a/cyassl/openssl/bn.h b/cyassl/openssl/bn.h index 0796bab27..e14f4e28c 100644 --- a/cyassl/openssl/bn.h +++ b/cyassl/openssl/bn.h @@ -1,115 +1,3 @@ /* bn.h for openssl */ - -#ifndef CYASSL_BN_H_ -#define CYASSL_BN_H_ - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -typedef struct CYASSL_BIGNUM { - int neg; /* openssh deference */ - void* internal; /* our big num */ -} CYASSL_BIGNUM; - - -typedef struct CYASSL_BN_CTX CYASSL_BN_CTX; - - -CYASSL_API CYASSL_BN_CTX* CyaSSL_BN_CTX_new(void); -CYASSL_API void CyaSSL_BN_CTX_init(CYASSL_BN_CTX*); -CYASSL_API void CyaSSL_BN_CTX_free(CYASSL_BN_CTX*); - -CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_new(void); -CYASSL_API void CyaSSL_BN_free(CYASSL_BIGNUM*); -CYASSL_API void CyaSSL_BN_clear_free(CYASSL_BIGNUM*); - - -CYASSL_API int CyaSSL_BN_sub(CYASSL_BIGNUM*, const CYASSL_BIGNUM*, - const CYASSL_BIGNUM*); -CYASSL_API int CyaSSL_BN_mod(CYASSL_BIGNUM*, const CYASSL_BIGNUM*, - const CYASSL_BIGNUM*, const CYASSL_BN_CTX*); - -CYASSL_API const CYASSL_BIGNUM* CyaSSL_BN_value_one(void); - - -CYASSL_API int CyaSSL_BN_num_bytes(const CYASSL_BIGNUM*); -CYASSL_API int CyaSSL_BN_num_bits(const CYASSL_BIGNUM*); - -CYASSL_API int CyaSSL_BN_is_zero(const CYASSL_BIGNUM*); -CYASSL_API int CyaSSL_BN_is_one(const CYASSL_BIGNUM*); -CYASSL_API int CyaSSL_BN_is_odd(const CYASSL_BIGNUM*); - -CYASSL_API int CyaSSL_BN_cmp(const CYASSL_BIGNUM*, const CYASSL_BIGNUM*); - -CYASSL_API int CyaSSL_BN_bn2bin(const CYASSL_BIGNUM*, unsigned char*); -CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_bin2bn(const unsigned char*, int len, - CYASSL_BIGNUM* ret); - -CYASSL_API int CyaSSL_mask_bits(CYASSL_BIGNUM*, int n); - -CYASSL_API int CyaSSL_BN_rand(CYASSL_BIGNUM*, int bits, int top, int bottom); -CYASSL_API int CyaSSL_BN_is_bit_set(const CYASSL_BIGNUM*, int n); -CYASSL_API int CyaSSL_BN_hex2bn(CYASSL_BIGNUM**, const char* str); - -CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_dup(const CYASSL_BIGNUM*); -CYASSL_API CYASSL_BIGNUM* CyaSSL_BN_copy(CYASSL_BIGNUM*, const CYASSL_BIGNUM*); - -CYASSL_API int CyaSSL_BN_set_word(CYASSL_BIGNUM*, unsigned long w); - -CYASSL_API int CyaSSL_BN_dec2bn(CYASSL_BIGNUM**, const char* str); -CYASSL_API char* CyaSSL_BN_bn2dec(const CYASSL_BIGNUM*); - - -typedef CYASSL_BIGNUM BIGNUM; -typedef CYASSL_BN_CTX BN_CTX; - -#define BN_CTX_new CyaSSL_BN_CTX_new -#define BN_CTX_init CyaSSL_BN_CTX_init -#define BN_CTX_free CyaSSL_BN_CTX_free - -#define BN_new CyaSSL_BN_new -#define BN_free CyaSSL_BN_free -#define BN_clear_free CyaSSL_BN_clear_free - -#define BN_num_bytes CyaSSL_BN_num_bytes -#define BN_num_bits CyaSSL_BN_num_bits - -#define BN_is_zero CyaSSL_BN_is_zero -#define BN_is_one CyaSSL_BN_is_one -#define BN_is_odd CyaSSL_BN_is_odd - -#define BN_cmp CyaSSL_BN_cmp - -#define BN_bn2bin CyaSSL_BN_bn2bin -#define BN_bin2bn CyaSSL_BN_bin2bn - -#define BN_mod CyaSSL_BN_mod -#define BN_sub CyaSSL_BN_sub -#define BN_value_one CyaSSL_BN_value_one - -#define BN_mask_bits CyaSSL_mask_bits - -#define BN_rand CyaSSL_BN_rand -#define BN_is_bit_set CyaSSL_BN_is_bit_set -#define BN_hex2bn CyaSSL_BN_hex2bn - -#define BN_dup CyaSSL_BN_dup -#define BN_copy CyaSSL_BN_copy - -#define BN_set_word CyaSSL_BN_set_word - -#define BN_dec2bn CyaSSL_BN_dec2bn -#define BN_bn2dec CyaSSL_BN_bn2dec - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL__H_ */ - +#include diff --git a/cyassl/openssl/conf.h b/cyassl/openssl/conf.h index 1e328cf47..4005ea9d7 100644 --- a/cyassl/openssl/conf.h +++ b/cyassl/openssl/conf.h @@ -1,2 +1,3 @@ /* conf.h for openssl */ +#include diff --git a/cyassl/openssl/crypto.h b/cyassl/openssl/crypto.h index f7d5337c2..32e110826 100644 --- a/cyassl/openssl/crypto.h +++ b/cyassl/openssl/crypto.h @@ -1,26 +1,4 @@ /* crypto.h for openSSL */ -#ifndef CYASSL_CRYPTO_H_ -#define CYASSL_CRYPTO_H_ - - -#include - -#ifdef YASSL_PREFIX -#include "prefix_crypto.h" -#endif - - -CYASSL_API const char* CyaSSLeay_version(int type); -CYASSL_API unsigned long CyaSSLeay(void); - -#define SSLeay_version CyaSSLeay_version -#define SSLeay CyaSSLeay - - -#define SSLEAY_VERSION 0x0090600fL -#define SSLEAY_VERSION_NUMBER SSLEAY_VERSION - - -#endif /* header */ +#include diff --git a/cyassl/openssl/des.h b/cyassl/openssl/des.h index 848bc28b0..ad00be23b 100644 --- a/cyassl/openssl/des.h +++ b/cyassl/openssl/des.h @@ -24,64 +24,4 @@ * */ - -#ifndef CYASSL_DES_H_ -#define CYASSL_DES_H_ - -#include - -#ifdef YASSL_PREFIX -#include "prefix_des.h" -#endif - - -#ifdef __cplusplus - extern "C" { -#endif - -typedef unsigned char CYASSL_DES_cblock[8]; -typedef /* const */ CYASSL_DES_cblock CYASSL_const_DES_cblock; -typedef CYASSL_DES_cblock CYASSL_DES_key_schedule; - - -enum { - DES_ENCRYPT = 1, - DES_DECRYPT = 0 -}; - - -CYASSL_API void CyaSSL_DES_set_key_unchecked(CYASSL_const_DES_cblock*, - CYASSL_DES_key_schedule*); -CYASSL_API int CyaSSL_DES_key_sched(CYASSL_const_DES_cblock* key, - CYASSL_DES_key_schedule* schedule); -CYASSL_API void CyaSSL_DES_cbc_encrypt(const unsigned char* input, - unsigned char* output, long length, - CYASSL_DES_key_schedule* schedule, CYASSL_DES_cblock* ivec, - int enc); -CYASSL_API void CyaSSL_DES_ncbc_encrypt(const unsigned char* input, - unsigned char* output, long length, - CYASSL_DES_key_schedule* schedule, - CYASSL_DES_cblock* ivec, int enc); - -CYASSL_API void CyaSSL_DES_set_odd_parity(CYASSL_DES_cblock*); -CYASSL_API void CyaSSL_DES_ecb_encrypt(CYASSL_DES_cblock*, CYASSL_DES_cblock*, - CYASSL_DES_key_schedule*, int); - - -typedef CYASSL_DES_cblock DES_cblock; -typedef CYASSL_const_DES_cblock const_DES_cblock; -typedef CYASSL_DES_key_schedule DES_key_schedule; - -#define DES_set_key_unchecked CyaSSL_DES_set_key_unchecked -#define DES_key_sched CyaSSL_DES_key_sched -#define DES_cbc_encrypt CyaSSL_DES_cbc_encrypt -#define DES_ncbc_encrypt CyaSSL_DES_ncbc_encrypt -#define DES_set_odd_parity CyaSSL_DES_set_odd_parity -#define DES_ecb_encrypt CyaSSL_DES_ecb_encrypt - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_DES_H_ */ +#include diff --git a/cyassl/openssl/dh.h b/cyassl/openssl/dh.h index 2faccbca4..6fd8e36e9 100644 --- a/cyassl/openssl/dh.h +++ b/cyassl/openssl/dh.h @@ -1,52 +1,4 @@ /* dh.h for openSSL */ -#ifndef CYASSL_DH_H_ -#define CYASSL_DH_H_ - - -#include -#include - - -#ifdef __cplusplus - extern "C" { -#endif - - - - -typedef struct CYASSL_DH { - CYASSL_BIGNUM* p; - CYASSL_BIGNUM* g; - CYASSL_BIGNUM* pub_key; /* openssh deference g^x */ - CYASSL_BIGNUM* priv_key; /* openssh deference x */ - void* internal; /* our DH */ - char inSet; /* internal set from external ? */ - char exSet; /* external set from internal ? */ -} CYASSL_DH; - - -CYASSL_API CYASSL_DH* CyaSSL_DH_new(void); -CYASSL_API void CyaSSL_DH_free(CYASSL_DH*); - -CYASSL_API int CyaSSL_DH_size(CYASSL_DH*); -CYASSL_API int CyaSSL_DH_generate_key(CYASSL_DH*); -CYASSL_API int CyaSSL_DH_compute_key(unsigned char* key, CYASSL_BIGNUM* pub, - CYASSL_DH*); - -typedef CYASSL_DH DH; - -#define DH_new CyaSSL_DH_new -#define DH_free CyaSSL_DH_free - -#define DH_size CyaSSL_DH_size -#define DH_generate_key CyaSSL_DH_generate_key -#define DH_compute_key CyaSSL_DH_compute_key - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - -#endif /* header */ +#include diff --git a/cyassl/openssl/dsa.h b/cyassl/openssl/dsa.h index 817f1fa14..2bb476bbd 100644 --- a/cyassl/openssl/dsa.h +++ b/cyassl/openssl/dsa.h @@ -1,53 +1,3 @@ /* dsa.h for openSSL */ - -#ifndef CYASSL_DSA_H_ -#define CYASSL_DSA_H_ - - -#include -#include - - -#ifdef __cplusplus - extern "C" { -#endif - - - -struct CYASSL_DSA { - CYASSL_BIGNUM* p; - CYASSL_BIGNUM* q; - CYASSL_BIGNUM* g; - CYASSL_BIGNUM* pub_key; /* our y */ - CYASSL_BIGNUM* priv_key; /* our x */ - void* internal; /* our Dsa Key */ - char inSet; /* internal set from external ? */ - char exSet; /* external set from internal ? */ -}; - - -CYASSL_API CYASSL_DSA* CyaSSL_DSA_new(void); -CYASSL_API void CyaSSL_DSA_free(CYASSL_DSA*); - -CYASSL_API int CyaSSL_DSA_generate_key(CYASSL_DSA*); -CYASSL_API int CyaSSL_DSA_generate_parameters_ex(CYASSL_DSA*, int bits, - unsigned char* seed, int seedLen, int* counterRet, - unsigned long* hRet, void* cb); - -CYASSL_API int CyaSSL_DSA_LoadDer(CYASSL_DSA*, const unsigned char*, int sz); -CYASSL_API int CyaSSL_DSA_do_sign(const unsigned char* d, unsigned char* sigRet, - CYASSL_DSA* dsa); - -#define DSA_new CyaSSL_DSA_new -#define DSA_free CyaSSL_DSA_free - -#define DSA_generate_key CyaSSL_DSA_generate_key -#define DSA_generate_parameters_ex CyaSSL_DSA_generate_parameters_ex - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - -#endif /* header */ +#include diff --git a/cyassl/openssl/ec.h b/cyassl/openssl/ec.h index 5ffdaf6e5..1ce8aa948 100644 --- a/cyassl/openssl/ec.h +++ b/cyassl/openssl/ec.h @@ -1,2 +1,3 @@ /* ec.h for openssl */ +#include diff --git a/cyassl/openssl/ecdsa.h b/cyassl/openssl/ecdsa.h index f3cf0de35..9a1c02b35 100644 --- a/cyassl/openssl/ecdsa.h +++ b/cyassl/openssl/ecdsa.h @@ -1,2 +1,3 @@ /* ecdsa.h for openssl */ +#include \ No newline at end of file diff --git a/cyassl/openssl/engine.h b/cyassl/openssl/engine.h index 39952fcae..fcce4bdb9 100644 --- a/cyassl/openssl/engine.h +++ b/cyassl/openssl/engine.h @@ -1,5 +1,5 @@ /* engine.h for libcurl */ -#undef HAVE_OPENSSL_ENGINE_H +#include diff --git a/cyassl/openssl/err.h b/cyassl/openssl/err.h index 7e7f1eb78..361111708 100644 --- a/cyassl/openssl/err.h +++ b/cyassl/openssl/err.h @@ -1,2 +1,3 @@ /* err.h for openssl */ +#include diff --git a/cyassl/openssl/evp.h b/cyassl/openssl/evp.h index ee2873c59..ae8bff792 100644 --- a/cyassl/openssl/evp.h +++ b/cyassl/openssl/evp.h @@ -24,218 +24,4 @@ * */ - -#ifndef CYASSL_EVP_H_ -#define CYASSL_EVP_H_ - -#include - -#ifdef YASSL_PREFIX -#include "prefix_evp.h" -#endif - -#include -#include -#include -#include -#include - -#include -#include -#include - - -#ifdef __cplusplus - extern "C" { -#endif - -typedef char CYASSL_EVP_MD; -typedef char CYASSL_EVP_CIPHER; - -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_md5(void); -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha1(void); -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha256(void); -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha384(void); -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_sha512(void); -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_ripemd160(void); - -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_cbc(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_cbc(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_cbc(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_128_ctr(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_192_ctr(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_aes_256_ctr(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_cbc(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_des_ede3_cbc(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_rc4(void); -CYASSL_API const CYASSL_EVP_CIPHER* CyaSSL_EVP_enc_null(void); - - -typedef union { - CYASSL_MD5_CTX md5; - CYASSL_SHA_CTX sha; - CYASSL_SHA256_CTX sha256; - #ifdef CYASSL_SHA384 - CYASSL_SHA384_CTX sha384; - #endif - #ifdef CYASSL_SHA512 - CYASSL_SHA512_CTX sha512; - #endif - #ifdef CYASSL_RIPEMD - CYASSL_RIPEMD_CTX ripemd; - #endif -} CYASSL_Hasher; - - -typedef struct CYASSL_EVP_MD_CTX { - unsigned char macType; - CYASSL_Hasher hash; -} CYASSL_EVP_MD_CTX; - - -typedef union { - Aes aes; -#ifndef NO_DES3 - Des des; - Des3 des3; -#endif - Arc4 arc4; -} CYASSL_Cipher; - - -enum { - AES_128_CBC_TYPE = 1, - AES_192_CBC_TYPE = 2, - AES_256_CBC_TYPE = 3, - AES_128_CTR_TYPE = 4, - AES_192_CTR_TYPE = 5, - AES_256_CTR_TYPE = 6, - DES_CBC_TYPE = 7, - DES_EDE3_CBC_TYPE = 8, - ARC4_TYPE = 9, - NULL_CIPHER_TYPE = 10, - EVP_PKEY_RSA = 11, - EVP_PKEY_DSA = 12, - NID_sha1 = 64, - NID_md5 = 4 -}; - - -typedef struct CYASSL_EVP_CIPHER_CTX { - int keyLen; /* user may set for variable */ - unsigned char enc; /* if encrypt side, then true */ - unsigned char cipherType; - unsigned char iv[AES_BLOCK_SIZE]; /* working iv pointer into cipher */ - CYASSL_Cipher cipher; -} CYASSL_EVP_CIPHER_CTX; - - -CYASSL_API int CyaSSL_EVP_MD_size(const CYASSL_EVP_MD* md); -CYASSL_API void CyaSSL_EVP_MD_CTX_init(CYASSL_EVP_MD_CTX* ctx); -CYASSL_API int CyaSSL_EVP_MD_CTX_cleanup(CYASSL_EVP_MD_CTX* ctx); - -CYASSL_API int CyaSSL_EVP_DigestInit(CYASSL_EVP_MD_CTX* ctx, - const CYASSL_EVP_MD* type); -CYASSL_API int CyaSSL_EVP_DigestUpdate(CYASSL_EVP_MD_CTX* ctx, const void* data, - unsigned long sz); -CYASSL_API int CyaSSL_EVP_DigestFinal(CYASSL_EVP_MD_CTX* ctx, unsigned char* md, - unsigned int* s); -CYASSL_API int CyaSSL_EVP_DigestFinal_ex(CYASSL_EVP_MD_CTX* ctx, - unsigned char* md, unsigned int* s); -CYASSL_API int CyaSSL_EVP_BytesToKey(const CYASSL_EVP_CIPHER*, - const CYASSL_EVP_MD*, const unsigned char*, - const unsigned char*, int, int, unsigned char*, - unsigned char*); - -CYASSL_API void CyaSSL_EVP_CIPHER_CTX_init(CYASSL_EVP_CIPHER_CTX* ctx); -CYASSL_API int CyaSSL_EVP_CIPHER_CTX_cleanup(CYASSL_EVP_CIPHER_CTX* ctx); - -CYASSL_API int CyaSSL_EVP_CIPHER_CTX_iv_length(const CYASSL_EVP_CIPHER_CTX*); - - -CYASSL_API int CyaSSL_EVP_CipherInit(CYASSL_EVP_CIPHER_CTX* ctx, - const CYASSL_EVP_CIPHER* type, - unsigned char* key, unsigned char* iv, - int enc); -CYASSL_API int CyaSSL_EVP_CIPHER_CTX_key_length(CYASSL_EVP_CIPHER_CTX* ctx); -CYASSL_API int CyaSSL_EVP_CIPHER_CTX_set_key_length(CYASSL_EVP_CIPHER_CTX* ctx, - int keylen); -CYASSL_API int CyaSSL_EVP_Cipher(CYASSL_EVP_CIPHER_CTX* ctx, - unsigned char* dst, unsigned char* src, - unsigned int len); - -CYASSL_API const CYASSL_EVP_MD* CyaSSL_EVP_get_digestbynid(int); - -CYASSL_API CYASSL_RSA* CyaSSL_EVP_PKEY_get1_RSA(CYASSL_EVP_PKEY*); -CYASSL_API CYASSL_DSA* CyaSSL_EVP_PKEY_get1_DSA(CYASSL_EVP_PKEY*); - -/* these next ones don't need real OpenSSL type, for OpenSSH compat only */ -CYASSL_API void* CyaSSL_EVP_X_STATE(const CYASSL_EVP_CIPHER_CTX* ctx); -CYASSL_API int CyaSSL_EVP_X_STATE_LEN(const CYASSL_EVP_CIPHER_CTX* ctx); - -CYASSL_API void CyaSSL_3des_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset, - unsigned char* iv, int len); -CYASSL_API void CyaSSL_aes_ctr_iv(CYASSL_EVP_CIPHER_CTX* ctx, int doset, - unsigned char* iv, int len); - -CYASSL_API int CyaSSL_StoreExternalIV(CYASSL_EVP_CIPHER_CTX* ctx); -CYASSL_API int CyaSSL_SetInternalIV(CYASSL_EVP_CIPHER_CTX* ctx); - - -/* end OpenSSH compat */ - -typedef CYASSL_EVP_MD EVP_MD; -typedef CYASSL_EVP_CIPHER EVP_CIPHER; -typedef CYASSL_EVP_MD_CTX EVP_MD_CTX; -typedef CYASSL_EVP_CIPHER_CTX EVP_CIPHER_CTX; - -#define EVP_md5 CyaSSL_EVP_md5 -#define EVP_sha1 CyaSSL_EVP_sha1 -#define EVP_sha256 CyaSSL_EVP_sha256 -#define EVP_sha384 CyaSSL_EVP_sha384 -#define EVP_sha512 CyaSSL_EVP_sha512 -#define EVP_ripemd160 CyaSSL_EVP_ripemd160 - -#define EVP_aes_128_cbc CyaSSL_EVP_aes_128_cbc -#define EVP_aes_192_cbc CyaSSL_EVP_aes_192_cbc -#define EVP_aes_256_cbc CyaSSL_EVP_aes_256_cbc -#define EVP_aes_128_ctr CyaSSL_EVP_aes_128_ctr -#define EVP_aes_192_ctr CyaSSL_EVP_aes_192_ctr -#define EVP_aes_256_ctr CyaSSL_EVP_aes_256_ctr -#define EVP_des_cbc CyaSSL_EVP_des_cbc -#define EVP_des_ede3_cbc CyaSSL_EVP_des_ede3_cbc -#define EVP_rc4 CyaSSL_EVP_rc4 -#define EVP_enc_null CyaSSL_EVP_enc_null - -#define EVP_MD_size CyaSSL_EVP_MD_size -#define EVP_MD_CTX_init CyaSSL_EVP_MD_CTX_init -#define EVP_MD_CTX_cleanup CyaSSL_EVP_MD_CTX_cleanup -#define EVP_DigestInit CyaSSL_EVP_DigestInit -#define EVP_DigestUpdate CyaSSL_EVP_DigestUpdate -#define EVP_DigestFinal CyaSSL_EVP_DigestFinal -#define EVP_DigestFinal_ex CyaSSL_EVP_DigestFinal_ex -#define EVP_BytesToKey CyaSSL_EVP_BytesToKey - -#define EVP_CIPHER_CTX_init CyaSSL_EVP_CIPHER_CTX_init -#define EVP_CIPHER_CTX_cleanup CyaSSL_EVP_CIPHER_CTX_cleanup -#define EVP_CIPHER_CTX_iv_length CyaSSL_EVP_CIPHER_CTX_iv_length -#define EVP_CIPHER_CTX_key_length CyaSSL_EVP_CIPHER_CTX_key_length -#define EVP_CIPHER_CTX_set_key_length CyaSSL_EVP_CIPHER_CTX_set_key_length -#define EVP_CipherInit CyaSSL_EVP_CipherInit -#define EVP_Cipher CyaSSL_EVP_Cipher - -#define EVP_get_digestbynid CyaSSL_EVP_get_digestbynid - -#define EVP_PKEY_get1_RSA CyaSSL_EVP_PKEY_get1_RSA -#define EVP_PKEY_get1_DSA CyaSSL_EVP_PKEY_get1_DSA - -#ifndef EVP_MAX_MD_SIZE - #define EVP_MAX_MD_SIZE 64 /* sha512 */ -#endif - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_EVP_H_ */ +#include diff --git a/cyassl/openssl/hmac.h b/cyassl/openssl/hmac.h index 4482d1099..55a6dd816 100644 --- a/cyassl/openssl/hmac.h +++ b/cyassl/openssl/hmac.h @@ -24,58 +24,4 @@ * */ - -#ifndef CYASSL_HMAC_H_ -#define CYASSL_HMAC_H_ - -#include - -#ifdef YASSL_PREFIX -#include "prefix_hmac.h" -#endif - -#include -#include - -#ifdef __cplusplus - extern "C" { -#endif - - -CYASSL_API unsigned char* CyaSSL_HMAC(const CYASSL_EVP_MD* evp_md, - const void* key, int key_len, - const unsigned char* d, int n, unsigned char* md, - unsigned int* md_len); - - -typedef struct CYASSL_HMAC_CTX { - Hmac hmac; - int type; -} CYASSL_HMAC_CTX; - - -CYASSL_API void CyaSSL_HMAC_Init(CYASSL_HMAC_CTX* ctx, const void* key, - int keylen, const EVP_MD* type); -CYASSL_API void CyaSSL_HMAC_Update(CYASSL_HMAC_CTX* ctx, - const unsigned char* data, int len); -CYASSL_API void CyaSSL_HMAC_Final(CYASSL_HMAC_CTX* ctx, unsigned char* hash, - unsigned int* len); -CYASSL_API void CyaSSL_HMAC_cleanup(CYASSL_HMAC_CTX* ctx); - - -typedef struct CYASSL_HMAC_CTX HMAC_CTX; - -#define HMAC(a,b,c,d,e,f,g) CyaSSL_HMAC((a),(b),(c),(d),(e),(f),(g)) - -#define HMAC_Init CyaSSL_HMAC_Init -#define HMAC_Update CyaSSL_HMAC_Update -#define HMAC_Final CyaSSL_HMAC_Final -#define HMAC_cleanup CyaSSL_HMAC_cleanup - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_HMAC_H_ */ +#include diff --git a/cyassl/openssl/lhash.h b/cyassl/openssl/lhash.h index 01f8535f8..6285f6a5f 100644 --- a/cyassl/openssl/lhash.h +++ b/cyassl/openssl/lhash.h @@ -1,2 +1,3 @@ /* lhash.h for openSSL */ +#include \ No newline at end of file diff --git a/cyassl/openssl/md4.h b/cyassl/openssl/md4.h index 2e99f977f..fb0d437ab 100644 --- a/cyassl/openssl/md4.h +++ b/cyassl/openssl/md4.h @@ -1 +1,3 @@ /* md4.h for libcurl */ + +#include diff --git a/cyassl/openssl/md5.h b/cyassl/openssl/md5.h index 0fddb517e..f3dd4e4b2 100644 --- a/cyassl/openssl/md5.h +++ b/cyassl/openssl/md5.h @@ -1,39 +1,5 @@ /* md5.h for openssl */ -#ifndef CYASSL_MD5_H_ -#define CYASSL_MD5_H_ - -#include - -#ifdef YASSL_PREFIX -#include "prefix_md5.h" -#endif - -#ifdef __cplusplus - extern "C" { -#endif - - -typedef struct CYASSL_MD5_CTX { - int holder[24]; /* big enough to hold ctaocrypt md5, but check on init */ -} CYASSL_MD5_CTX; - -CYASSL_API void CyaSSL_MD5_Init(CYASSL_MD5_CTX*); -CYASSL_API void CyaSSL_MD5_Update(CYASSL_MD5_CTX*, const void*, unsigned long); -CYASSL_API void CyaSSL_MD5_Final(unsigned char*, CYASSL_MD5_CTX*); - - -typedef CYASSL_MD5_CTX MD5_CTX; - -#define MD5_Init CyaSSL_MD5_Init -#define MD5_Update CyaSSL_MD5_Update -#define MD5_Final CyaSSL_MD5_Final - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_MD5_H_ */ +#include diff --git a/cyassl/openssl/ocsp.h b/cyassl/openssl/ocsp.h index 7463eec96..8c0f46805 100644 --- a/cyassl/openssl/ocsp.h +++ b/cyassl/openssl/ocsp.h @@ -1 +1,3 @@ /* ocsp.h for libcurl */ + +#include diff --git a/cyassl/openssl/opensslconf.h b/cyassl/openssl/opensslconf.h index ac6b55bc7..7f21cd950 100644 --- a/cyassl/openssl/opensslconf.h +++ b/cyassl/openssl/opensslconf.h @@ -1,8 +1,3 @@ /* opensslconf.h for openSSL */ - -#ifndef OPENSSL_THREADS - #define OPENSSL_THREADS -#endif - - +#include diff --git a/cyassl/openssl/opensslv.h b/cyassl/openssl/opensslv.h index bdcc805ee..d119f82e1 100644 --- a/cyassl/openssl/opensslv.h +++ b/cyassl/openssl/opensslv.h @@ -1,12 +1,3 @@ /* opensslv.h compatibility */ -#ifndef CYASSL_OPENSSLV_H_ -#define CYASSL_OPENSSLV_H_ - - -/* api version compatibility */ -#define OPENSSL_VERSION_NUMBER 0x0090410fL - - -#endif /* header */ - +#include diff --git a/cyassl/openssl/ossl_typ.h b/cyassl/openssl/ossl_typ.h index 65b00c728..5e6e627de 100644 --- a/cyassl/openssl/ossl_typ.h +++ b/cyassl/openssl/ossl_typ.h @@ -1,2 +1,3 @@ /* ossl_typ.h for openssl */ +#include diff --git a/cyassl/openssl/pem.h b/cyassl/openssl/pem.h index b727862b9..a07b91203 100644 --- a/cyassl/openssl/pem.h +++ b/cyassl/openssl/pem.h @@ -1,41 +1,3 @@ /* pem.h for openssl */ - -#ifndef CYASSL_PEM_H_ -#define CYASSL_PEM_H_ - -#include -#include -#include -#include - -#ifdef __cplusplus - extern "C" { -#endif - - -CYASSL_API int CyaSSL_PEM_write_bio_RSAPrivateKey(CYASSL_BIO* bio, RSA* rsa, - const EVP_CIPHER* cipher, - unsigned char* passwd, int len, - pem_password_cb cb, void* arg); - -CYASSL_API int CyaSSL_PEM_write_bio_DSAPrivateKey(CYASSL_BIO* bio, DSA* rsa, - const EVP_CIPHER* cipher, - unsigned char* passwd, int len, - pem_password_cb cb, void* arg); - -CYASSL_API CYASSL_EVP_PKEY* CyaSSL_PEM_read_bio_PrivateKey(CYASSL_BIO* bio, - CYASSL_EVP_PKEY**, pem_password_cb cb, void* arg); - -#define PEM_write_bio_RSAPrivateKey CyaSSL_PEM_write_bio_RSAPrivateKey -#define PEM_write_bio_DSAPrivateKey CyaSSL_PEM_write_bio_DSAPrivateKey -#define PEM_read_bio_PrivateKey CyaSSL_PEM_read_bio_PrivateKey - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_PEM_H_ */ - +#include diff --git a/cyassl/openssl/pkcs12.h b/cyassl/openssl/pkcs12.h index 544b6f092..1fb089fbb 100644 --- a/cyassl/openssl/pkcs12.h +++ b/cyassl/openssl/pkcs12.h @@ -1,2 +1,3 @@ /* pkcs12.h for openssl */ +#include diff --git a/cyassl/openssl/rand.h b/cyassl/openssl/rand.h index a5534e1a0..5bd77b6c6 100644 --- a/cyassl/openssl/rand.h +++ b/cyassl/openssl/rand.h @@ -1,4 +1,3 @@ /* rand.h for openSSL */ -#include - +#include diff --git a/cyassl/openssl/ripemd.h b/cyassl/openssl/ripemd.h index 2d4d01466..b25de783e 100644 --- a/cyassl/openssl/ripemd.h +++ b/cyassl/openssl/ripemd.h @@ -1,37 +1,3 @@ /* ripemd.h for openssl */ - -#ifndef CYASSL_RIPEMD_H_ -#define CYASSL_RIPEMD_H_ - -#include - -#ifdef __cplusplus - extern "C" { -#endif - - -typedef struct CYASSL_RIPEMD_CTX { - int holder[32]; /* big enough to hold ctaocrypt, but check on init */ -} CYASSL_RIPEMD_CTX; - -CYASSL_API void CyaSSL_RIPEMD_Init(CYASSL_RIPEMD_CTX*); -CYASSL_API void CyaSSL_RIPEMD_Update(CYASSL_RIPEMD_CTX*, const void*, - unsigned long); -CYASSL_API void CyaSSL_RIPEMD_Final(unsigned char*, CYASSL_RIPEMD_CTX*); - - -typedef CYASSL_RIPEMD_CTX RIPEMD_CTX; - -#define RIPEMD_Init CyaSSL_RIPEMD_Init -#define RIPEMD_Update CyaSSL_RIPEMD_Update -#define RIPEMD_Final CyaSSL_RIPEMD_Final - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_MD5_H_ */ - +#include diff --git a/cyassl/openssl/rsa.h b/cyassl/openssl/rsa.h index 149ad46ca..06f10a573 100644 --- a/cyassl/openssl/rsa.h +++ b/cyassl/openssl/rsa.h @@ -1,75 +1,3 @@ /* rsa.h for openSSL */ - -#ifndef CYASSL_RSA_H_ -#define CYASSL_RSA_H_ - -#include -#include - - -#ifdef __cplusplus - extern "C" { -#endif - - -enum { - RSA_PKCS1_PADDING = 1 - }; - -struct CYASSL_RSA { - CYASSL_BIGNUM* n; - CYASSL_BIGNUM* e; - CYASSL_BIGNUM* d; - CYASSL_BIGNUM* p; - CYASSL_BIGNUM* q; - CYASSL_BIGNUM* dmp1; /* dP */ - CYASSL_BIGNUM* dmq1; /* dQ */ - CYASSL_BIGNUM* iqmp; /* u */ - void* internal; /* our RSA */ - char inSet; /* internal set from external ? */ - char exSet; /* external set from internal ? */ -}; - - -CYASSL_API CYASSL_RSA* CyaSSL_RSA_new(void); -CYASSL_API void CyaSSL_RSA_free(CYASSL_RSA*); - -CYASSL_API int CyaSSL_RSA_generate_key_ex(CYASSL_RSA*, int bits, CYASSL_BIGNUM*, - void* cb); - -CYASSL_API int CyaSSL_RSA_blinding_on(CYASSL_RSA*, CYASSL_BN_CTX*); -CYASSL_API int CyaSSL_RSA_public_encrypt(int len, unsigned char* fr, - unsigned char* to, CYASSL_RSA*, int padding); -CYASSL_API int CyaSSL_RSA_private_decrypt(int len, unsigned char* fr, - unsigned char* to, CYASSL_RSA*, int padding); - -CYASSL_API int CyaSSL_RSA_size(const CYASSL_RSA*); -CYASSL_API int CyaSSL_RSA_sign(int type, const unsigned char* m, - unsigned int mLen, unsigned char* sigRet, - unsigned int* sigLen, CYASSL_RSA*); -CYASSL_API int CyaSSL_RSA_public_decrypt(int flen, unsigned char* from, - unsigned char* to, CYASSL_RSA*, int padding); -CYASSL_API int CyaSSL_RSA_GenAdd(CYASSL_RSA*); -CYASSL_API int CyaSSL_RSA_LoadDer(CYASSL_RSA*, const unsigned char*, int sz); - - -#define RSA_new CyaSSL_RSA_new -#define RSA_free CyaSSL_RSA_free - -#define RSA_generate_key_ex CyaSSL_RSA_generate_key_ex - -#define RSA_blinding_on CyaSSL_RSA_blinding_on -#define RSA_public_encrypt CyaSSL_RSA_public_encrypt -#define RSA_private_decrypt CyaSSL_RSA_private_decrypt - -#define RSA_size CyaSSL_RSA_size -#define RSA_sign CyaSSL_RSA_sign -#define RSA_public_decrypt CyaSSL_RSA_public_decrypt - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - -#endif /* header */ +#include diff --git a/cyassl/openssl/sha.h b/cyassl/openssl/sha.h index 9545795e2..ced3ca19b 100644 --- a/cyassl/openssl/sha.h +++ b/cyassl/openssl/sha.h @@ -1,125 +1,3 @@ /* sha.h for openssl */ - -#ifndef CYASSL_SHA_H_ -#define CYASSL_SHA_H_ - -#include - -#ifdef YASSL_PREFIX -#include "prefix_sha.h" -#endif - -#ifdef __cplusplus - extern "C" { -#endif - - -typedef struct CYASSL_SHA_CTX { - int holder[24]; /* big enough to hold ctaocrypt sha, but check on init */ -} CYASSL_SHA_CTX; - -CYASSL_API void CyaSSL_SHA_Init(CYASSL_SHA_CTX*); -CYASSL_API void CyaSSL_SHA_Update(CYASSL_SHA_CTX*, const void*, unsigned long); -CYASSL_API void CyaSSL_SHA_Final(unsigned char*, CYASSL_SHA_CTX*); - -/* SHA1 points to above, shouldn't use SHA0 ever */ -CYASSL_API void CyaSSL_SHA1_Init(CYASSL_SHA_CTX*); -CYASSL_API void CyaSSL_SHA1_Update(CYASSL_SHA_CTX*, const void*, unsigned long); -CYASSL_API void CyaSSL_SHA1_Final(unsigned char*, CYASSL_SHA_CTX*); - -enum { - SHA_DIGEST_LENGTH = 20 -}; - - -typedef CYASSL_SHA_CTX SHA_CTX; - -#define SHA_Init CyaSSL_SHA_Init -#define SHA_Update CyaSSL_SHA_Update -#define SHA_Final CyaSSL_SHA_Final - -#define SHA1_Init CyaSSL_SHA1_Init -#define SHA1_Update CyaSSL_SHA1_Update -#define SHA1_Final CyaSSL_SHA1_Final - - -typedef struct CYASSL_SHA256_CTX { - int holder[28]; /* big enough to hold ctaocrypt sha, but check on init */ -} CYASSL_SHA256_CTX; - -CYASSL_API void CyaSSL_SHA256_Init(CYASSL_SHA256_CTX*); -CYASSL_API void CyaSSL_SHA256_Update(CYASSL_SHA256_CTX*, const void*, - unsigned long); -CYASSL_API void CyaSSL_SHA256_Final(unsigned char*, CYASSL_SHA256_CTX*); - -enum { - SHA256_DIGEST_LENGTH = 32 -}; - - -typedef CYASSL_SHA256_CTX SHA256_CTX; - -#define SHA256_Init CyaSSL_SHA256_Init -#define SHA256_Update CyaSSL_SHA256_Update -#define SHA256_Final CyaSSL_SHA256_Final - - -#ifdef CYASSL_SHA384 - -typedef struct CYASSL_SHA384_CTX { - long long holder[32]; /* big enough, but check on init */ -} CYASSL_SHA384_CTX; - -CYASSL_API void CyaSSL_SHA384_Init(CYASSL_SHA384_CTX*); -CYASSL_API void CyaSSL_SHA384_Update(CYASSL_SHA384_CTX*, const void*, - unsigned long); -CYASSL_API void CyaSSL_SHA384_Final(unsigned char*, CYASSL_SHA384_CTX*); - -enum { - SHA384_DIGEST_LENGTH = 48 -}; - - -typedef CYASSL_SHA384_CTX SHA384_CTX; - -#define SHA384_Init CyaSSL_SHA384_Init -#define SHA384_Update CyaSSL_SHA384_Update -#define SHA384_Final CyaSSL_SHA384_Final - -#endif /* CYASSL_SHA384 */ - -#ifdef CYASSL_SHA512 - -typedef struct CYASSL_SHA512_CTX { - long long holder[36]; /* big enough, but check on init */ -} CYASSL_SHA512_CTX; - -CYASSL_API void CyaSSL_SHA512_Init(CYASSL_SHA512_CTX*); -CYASSL_API void CyaSSL_SHA512_Update(CYASSL_SHA512_CTX*, const void*, - unsigned long); -CYASSL_API void CyaSSL_SHA512_Final(unsigned char*, CYASSL_SHA512_CTX*); - -enum { - SHA512_DIGEST_LENGTH = 64 -}; - - -typedef CYASSL_SHA512_CTX SHA512_CTX; - -#define SHA512_Init CyaSSL_SHA512_Init -#define SHA512_Update CyaSSL_SHA512_Update -#define SHA512_Final CyaSSL_SHA512_Final - -#endif /* CYASSL_SHA512 */ - - - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CYASSL_SHA_H_ */ - +#include diff --git a/cyassl/openssl/ssl.h b/cyassl/openssl/ssl.h index 5d7a0b1ed..88554dec2 100644 --- a/cyassl/openssl/ssl.h +++ b/cyassl/openssl/ssl.h @@ -24,359 +24,4 @@ * */ - -#ifndef CYASSL_OPENSSL_H_ -#define CYASSL_OPENSSL_H_ - -#include -#include - -#ifdef __cplusplus - extern "C" { -#endif - -#ifdef _WIN32 - /* wincrypt.h clashes */ - #undef X509_NAME -#endif - - -typedef CYASSL SSL; -typedef CYASSL_SESSION SSL_SESSION; -typedef CYASSL_METHOD SSL_METHOD; -typedef CYASSL_CTX SSL_CTX; - -typedef CYASSL_X509 X509; -typedef CYASSL_X509_NAME X509_NAME; -typedef CYASSL_X509_CHAIN X509_CHAIN; - - -/* redeclare guard */ -#define CYASSL_TYPES_DEFINED - - -typedef CYASSL_EVP_PKEY EVP_PKEY; -typedef CYASSL_RSA RSA; -typedef CYASSL_DSA DSA; -typedef CYASSL_BIO BIO; -typedef CYASSL_BIO_METHOD BIO_METHOD; -typedef CYASSL_CIPHER SSL_CIPHER; -typedef CYASSL_X509_LOOKUP X509_LOOKUP; -typedef CYASSL_X509_LOOKUP_METHOD X509_LOOKUP_METHOD; -typedef CYASSL_X509_CRL X509_CRL; -typedef CYASSL_X509_EXTENSION X509_EXTENSION; -typedef CYASSL_ASN1_TIME ASN1_TIME; -typedef CYASSL_ASN1_INTEGER ASN1_INTEGER; -typedef CYASSL_ASN1_OBJECT ASN1_OBJECT; -typedef CYASSL_ASN1_STRING ASN1_STRING; -typedef CYASSL_dynlock_value CRYPTO_dynlock_value; - -#define ASN1_UTCTIME CYASSL_ASN1_TIME - -typedef CYASSL_MD4_CTX MD4_CTX; -typedef CYASSL_COMP_METHOD COMP_METHOD; -typedef CYASSL_X509_STORE X509_STORE; -typedef CYASSL_X509_REVOKED X509_REVOKED; -typedef CYASSL_X509_OBJECT X509_OBJECT; -typedef CYASSL_X509_STORE_CTX X509_STORE_CTX; - - -#define SSLv3_server_method wolfSSLv3_server_method -#define SSLv3_client_method wolfSSLv3_client_method -#define TLSv1_server_method wolfTLSv1_server_method -#define TLSv1_client_method wolfTLSv1_client_method -#define TLSv1_1_server_method wolfTLSv1_1_server_method -#define TLSv1_1_client_method wolfTLSv1_1_client_method -#define TLSv1_2_server_method wolfTLSv1_2_server_method -#define TLSv1_2_client_method wolfTLSv1_2_client_method - -#ifdef CYASSL_DTLS - #define DTLSv1_client_method wolfDTLSv1_client_method - #define DTLSv1_server_method wolfDTLSv1_server_method - #define DTLSv1_2_client_method wolfDTLSv1_2_client_method - #define DTLSv1_2_server_method wolfDTLSv1_2_server_method -#endif - - -#ifndef NO_FILESYSTEM - #define SSL_CTX_use_certificate_file CyaSSL_CTX_use_certificate_file - #define SSL_CTX_use_PrivateKey_file CyaSSL_CTX_use_PrivateKey_file - #define SSL_CTX_load_verify_locations CyaSSL_CTX_load_verify_locations - #define SSL_CTX_use_certificate_chain_file CyaSSL_CTX_use_certificate_chain_file - #define SSL_CTX_use_RSAPrivateKey_file CyaSSL_CTX_use_RSAPrivateKey_file - - #define SSL_use_certificate_file CyaSSL_use_certificate_file - #define SSL_use_PrivateKey_file CyaSSL_use_PrivateKey_file - #define SSL_use_certificate_chain_file CyaSSL_use_certificate_chain_file - #define SSL_use_RSAPrivateKey_file CyaSSL_use_RSAPrivateKey_file -#endif - -#define SSL_CTX_new CyaSSL_CTX_new -#define SSL_new CyaSSL_new -#define SSL_set_fd CyaSSL_set_fd -#define SSL_get_fd CyaSSL_get_fd -#define SSL_connect CyaSSL_connect - -#define SSL_write CyaSSL_write -#define SSL_read CyaSSL_read -#define SSL_peek CyaSSL_peek -#define SSL_accept CyaSSL_accept -#define SSL_CTX_free CyaSSL_CTX_free -#define SSL_free CyaSSL_free -#define SSL_shutdown CyaSSL_shutdown - -#define SSL_CTX_set_quiet_shutdown CyaSSL_CTX_set_quiet_shutdown -#define SSL_set_quiet_shutdown CyaSSL_set_quiet_shutdown -#define SSL_get_error CyaSSL_get_error -#define SSL_set_session CyaSSL_set_session -#define SSL_get_session CyaSSL_get_session -#define SSL_flush_sessions CyaSSL_flush_sessions - -#define SSL_CTX_set_verify CyaSSL_CTX_set_verify -#define SSL_set_verify CyaSSL_set_verify -#define SSL_pending CyaSSL_pending -#define SSL_load_error_strings CyaSSL_load_error_strings -#define SSL_library_init CyaSSL_library_init -#define SSL_CTX_set_session_cache_mode CyaSSL_CTX_set_session_cache_mode -#define SSL_CTX_set_cipher_list CyaSSL_CTX_set_cipher_list -#define SSL_set_cipher_list CyaSSL_set_cipher_list - -#define ERR_error_string CyaSSL_ERR_error_string -#define ERR_error_string_n CyaSSL_ERR_error_string_n -#define ERR_reason_error_string CyaSSL_ERR_reason_error_string - -#define SSL_set_ex_data CyaSSL_set_ex_data -#define SSL_get_shutdown CyaSSL_get_shutdown -#define SSL_set_rfd CyaSSL_set_rfd -#define SSL_set_wfd CyaSSL_set_wfd -#define SSL_set_shutdown CyaSSL_set_shutdown -#define SSL_set_session_id_context CyaSSL_set_session_id_context -#define SSL_set_connect_state CyaSSL_set_connect_state -#define SSL_set_accept_state CyaSSL_set_accept_state -#define SSL_session_reused CyaSSL_session_reused -#define SSL_SESSION_free CyaSSL_SESSION_free -#define SSL_is_init_finished CyaSSL_is_init_finished - -#define SSL_get_version CyaSSL_get_version -#define SSL_get_current_cipher CyaSSL_get_current_cipher -#define SSL_get_cipher CyaSSL_get_cipher -#define SSL_CIPHER_description CyaSSL_CIPHER_description -#define SSL_CIPHER_get_name CyaSSL_CIPHER_get_name -#define SSL_get1_session CyaSSL_get1_session - -#define SSL_get_keyblock_size CyaSSL_get_keyblock_size -#define SSL_get_keys CyaSSL_get_keys - -#define X509_free CyaSSL_X509_free -#define OPENSSL_free CyaSSL_OPENSSL_free - -#define OCSP_parse_url CyaSSL_OCSP_parse_url -#define SSLv23_client_method CyaSSLv23_client_method -#define SSLv2_client_method CyaSSLv2_client_method -#define SSLv2_server_method CyaSSLv2_server_method - -#define MD4_Init CyaSSL_MD4_Init -#define MD4_Update CyaSSL_MD4_Update -#define MD4_Final CyaSSL_MD4_Final - -#define BIO_new CyaSSL_BIO_new -#define BIO_free CyaSSL_BIO_free -#define BIO_free_all CyaSSL_BIO_free_all -#define BIO_read CyaSSL_BIO_read -#define BIO_write CyaSSL_BIO_write -#define BIO_push CyaSSL_BIO_push -#define BIO_pop CyaSSL_BIO_pop -#define BIO_flush CyaSSL_BIO_flush -#define BIO_pending CyaSSL_BIO_pending - -#define BIO_get_mem_data CyaSSL_BIO_get_mem_data -#define BIO_new_mem_buf CyaSSL_BIO_new_mem_buf - -#define BIO_f_buffer CyaSSL_BIO_f_buffer -#define BIO_set_write_buffer_size CyaSSL_BIO_set_write_buffer_size -#define BIO_f_ssl CyaSSL_BIO_f_ssl -#define BIO_new_socket CyaSSL_BIO_new_socket -#define SSL_set_bio CyaSSL_set_bio -#define BIO_eof CyaSSL_BIO_eof -#define BIO_set_ss CyaSSL_BIO_set_ss - -#define BIO_s_mem CyaSSL_BIO_s_mem -#define BIO_f_base64 CyaSSL_BIO_f_base64 -#define BIO_set_flags CyaSSL_BIO_set_flags - -#define OpenSSL_add_all_algorithms CyaSSL_add_all_algorithms -#define SSLeay_add_ssl_algorithms CyaSSL_add_all_algorithms -#define SSLeay_add_all_algorithms CyaSSL_add_all_algorithms - -#define RAND_screen CyaSSL_RAND_screen -#define RAND_file_name CyaSSL_RAND_file_name -#define RAND_write_file CyaSSL_RAND_write_file -#define RAND_load_file CyaSSL_RAND_load_file -#define RAND_egd CyaSSL_RAND_egd -#define RAND_seed CyaSSL_RAND_seed -#define RAND_add CyaSSL_RAND_add - -#define COMP_zlib CyaSSL_COMP_zlib -#define COMP_rle CyaSSL_COMP_rle -#define SSL_COMP_add_compression_method CyaSSL_COMP_add_compression_method - -#define SSL_get_ex_new_index CyaSSL_get_ex_new_index - -#define CRYPTO_set_id_callback CyaSSL_set_id_callback -#define CRYPTO_set_locking_callback CyaSSL_set_locking_callback -#define CRYPTO_set_dynlock_create_callback CyaSSL_set_dynlock_create_callback -#define CRYPTO_set_dynlock_lock_callback CyaSSL_set_dynlock_lock_callback -#define CRYPTO_set_dynlock_destroy_callback CyaSSL_set_dynlock_destroy_callback -#define CRYPTO_num_locks CyaSSL_num_locks - -#define X509_STORE_CTX_get_current_cert CyaSSL_X509_STORE_CTX_get_current_cert -#define X509_STORE_CTX_get_error CyaSSL_X509_STORE_CTX_get_error -#define X509_STORE_CTX_get_error_depth CyaSSL_X509_STORE_CTX_get_error_depth - -#define X509_NAME_oneline CyaSSL_X509_NAME_oneline -#define X509_get_issuer_name CyaSSL_X509_get_issuer_name -#define X509_get_subject_name CyaSSL_X509_get_subject_name -#define X509_verify_cert_error_string CyaSSL_X509_verify_cert_error_string - -#define X509_LOOKUP_add_dir CyaSSL_X509_LOOKUP_add_dir -#define X509_LOOKUP_load_file CyaSSL_X509_LOOKUP_load_file -#define X509_LOOKUP_hash_dir CyaSSL_X509_LOOKUP_hash_dir -#define X509_LOOKUP_file CyaSSL_X509_LOOKUP_file - -#define X509_STORE_add_lookup CyaSSL_X509_STORE_add_lookup -#define X509_STORE_new CyaSSL_X509_STORE_new -#define X509_STORE_get_by_subject CyaSSL_X509_STORE_get_by_subject -#define X509_STORE_CTX_init CyaSSL_X509_STORE_CTX_init -#define X509_STORE_CTX_cleanup CyaSSL_X509_STORE_CTX_cleanup - -#define X509_CRL_get_lastUpdate CyaSSL_X509_CRL_get_lastUpdate -#define X509_CRL_get_nextUpdate CyaSSL_X509_CRL_get_nextUpdate - -#define X509_get_pubkey CyaSSL_X509_get_pubkey -#define X509_CRL_verify CyaSSL_X509_CRL_verify -#define X509_STORE_CTX_set_error CyaSSL_X509_STORE_CTX_set_error -#define X509_OBJECT_free_contents CyaSSL_X509_OBJECT_free_contents -#define EVP_PKEY_free CyaSSL_EVP_PKEY_free -#define X509_cmp_current_time CyaSSL_X509_cmp_current_time -#define sk_X509_REVOKED_num CyaSSL_sk_X509_REVOKED_num -#define X509_CRL_get_REVOKED CyaSSL_X509_CRL_get_REVOKED -#define sk_X509_REVOKED_value CyaSSL_sk_X509_REVOKED_value - -#define X509_get_serialNumber CyaSSL_X509_get_serialNumber - -#define ASN1_TIME_pr CyaSSL_ASN1_TIME_pr - -#define ASN1_INTEGER_cmp CyaSSL_ASN1_INTEGER_cmp -#define ASN1_INTEGER_get CyaSSL_ASN1_INTEGER_get - -#define SSL_load_client_CA_file CyaSSL_load_client_CA_file - -#define SSL_CTX_set_client_CA_list CyaSSL_CTX_set_client_CA_list -#define X509_STORE_CTX_get_ex_data CyaSSL_X509_STORE_CTX_get_ex_data -#define SSL_get_ex_data_X509_STORE_CTX_idx CyaSSL_get_ex_data_X509_STORE_CTX_idx -#define SSL_get_ex_data CyaSSL_get_ex_data - -#define SSL_CTX_set_default_passwd_cb_userdata CyaSSL_CTX_set_default_passwd_cb_userdata -#define SSL_CTX_set_default_passwd_cb CyaSSL_CTX_set_default_passwd_cb - -#define SSL_CTX_set_timeout CyaSSL_CTX_set_timeout -#define SSL_CTX_set_info_callback CyaSSL_CTX_set_info_callback - -#define ERR_peek_error CyaSSL_ERR_peek_error -#define ERR_GET_REASON CyaSSL_ERR_GET_REASON - -#define SSL_alert_type_string CyaSSL_alert_type_string -#define SSL_alert_desc_string CyaSSL_alert_desc_string -#define SSL_state_string CyaSSL_state_string - -#define RSA_free CyaSSL_RSA_free -#define RSA_generate_key CyaSSL_RSA_generate_key -#define SSL_CTX_set_tmp_rsa_callback CyaSSL_CTX_set_tmp_rsa_callback - -#define PEM_def_callback CyaSSL_PEM_def_callback - -#define SSL_CTX_sess_accept CyaSSL_CTX_sess_accept -#define SSL_CTX_sess_connect CyaSSL_CTX_sess_connect -#define SSL_CTX_sess_accept_good CyaSSL_CTX_sess_accept_good -#define SSL_CTX_sess_connect_good CyaSSL_CTX_sess_connect_good -#define SSL_CTX_sess_accept_renegotiate CyaSSL_CTX_sess_accept_renegotiate -#define SSL_CTX_sess_connect_renegotiate CyaSSL_CTX_sess_connect_renegotiate -#define SSL_CTX_sess_hits CyaSSL_CTX_sess_hits -#define SSL_CTX_sess_cb_hits CyaSSL_CTX_sess_cb_hits -#define SSL_CTX_sess_cache_full CyaSSL_CTX_sess_cache_full -#define SSL_CTX_sess_misses CyaSSL_CTX_sess_misses -#define SSL_CTX_sess_timeouts CyaSSL_CTX_sess_timeouts -#define SSL_CTX_sess_number CyaSSL_CTX_sess_number -#define SSL_CTX_sess_get_cache_size CyaSSL_CTX_sess_get_cache_size - - -#define SSL_DEFAULT_CIPHER_LIST CYASSL_DEFAULT_CIPHER_LIST -#define RSA_F4 CYASSL_RSA_F4 - -#define SSL_CTX_set_psk_client_callback CyaSSL_CTX_set_psk_client_callback -#define SSL_set_psk_client_callback CyaSSL_set_psk_client_callback - -#define SSL_get_psk_identity_hint CyaSSL_get_psk_identity_hint -#define SSL_get_psk_identity CyaSSL_get_psk_identity - -#define SSL_CTX_use_psk_identity_hint CyaSSL_CTX_use_psk_identity_hint -#define SSL_use_psk_identity_hint CyaSSL_use_psk_identity_hint - -#define SSL_CTX_set_psk_server_callback CyaSSL_CTX_set_psk_server_callback -#define SSL_set_psk_server_callback CyaSSL_set_psk_server_callback - -#define ERR_get_error_line_data CyaSSL_ERR_get_error_line_data - -#define ERR_get_error CyaSSL_ERR_get_error -#define ERR_clear_error CyaSSL_ERR_clear_error - -#define RAND_status CyaSSL_RAND_status -#define RAND_bytes CyaSSL_RAND_bytes -#define SSLv23_server_method CyaSSLv23_server_method -#define SSL_CTX_set_options CyaSSL_CTX_set_options -#define SSL_CTX_check_private_key CyaSSL_CTX_check_private_key - -#define ERR_free_strings CyaSSL_ERR_free_strings -#define ERR_remove_state CyaSSL_ERR_remove_state -#define EVP_cleanup CyaSSL_EVP_cleanup - -#define CRYPTO_cleanup_all_ex_data CyaSSL_cleanup_all_ex_data -#define SSL_CTX_set_mode CyaSSL_CTX_set_mode -#define SSL_CTX_get_mode CyaSSL_CTX_get_mode -#define SSL_CTX_set_default_read_ahead CyaSSL_CTX_set_default_read_ahead - -#define SSL_CTX_sess_set_cache_size CyaSSL_CTX_sess_set_cache_size -#define SSL_CTX_set_default_verify_paths CyaSSL_CTX_set_default_verify_paths - -#define SSL_CTX_set_session_id_context CyaSSL_CTX_set_session_id_context -#define SSL_get_peer_certificate CyaSSL_get_peer_certificate - -#define SSL_want_read CyaSSL_want_read -#define SSL_want_write CyaSSL_want_write - -#define BIO_prf CyaSSL_BIO_prf -#define ASN1_UTCTIME_pr CyaSSL_ASN1_UTCTIME_pr - -#define sk_num CyaSSL_sk_num -#define sk_value CyaSSL_sk_value - -#define SSL_CTX_get_ex_data CyaSSL_CTX_get_ex_data -#define SSL_CTX_set_ex_data CyaSSL_CTX_set_ex_data -#define SSL_CTX_sess_set_get_cb CyaSSL_CTX_sess_set_get_cb -#define SSL_CTX_sess_set_new_cb CyaSSL_CTX_sess_set_new_cb -#define SSL_CTX_sess_set_remove_cb CyaSSL_CTX_sess_set_remove_cb - -#define i2d_SSL_SESSION CyaSSL_i2d_SSL_SESSION -#define d2i_SSL_SESSION CyaSSL_d2i_SSL_SESSION -#define SSL_SESSION_get_timeout CyaSSL_SESSION_get_timeout -#define SSL_SESSION_get_time CyaSSL_SESSION_get_time -#define SSL_CTX_get_ex_new_index CyaSSL_CTX_get_ex_new_index - - - -#ifdef __cplusplus - } /* extern "C" */ -#endif - - -#endif /* CyaSSL_openssl_h__ */ +#include diff --git a/cyassl/openssl/stack.h b/cyassl/openssl/stack.h index 374c1fcda..831502f50 100644 --- a/cyassl/openssl/stack.h +++ b/cyassl/openssl/stack.h @@ -1,2 +1,3 @@ /* stack.h for openssl */ +#include diff --git a/cyassl/openssl/ui.h b/cyassl/openssl/ui.h index a25393031..b1f4042e2 100644 --- a/cyassl/openssl/ui.h +++ b/cyassl/openssl/ui.h @@ -1,2 +1,3 @@ /* ui.h for openssl */ +#include diff --git a/cyassl/openssl/x509.h b/cyassl/openssl/x509.h index 645b3b5fb..9d1300284 100644 --- a/cyassl/openssl/x509.h +++ b/cyassl/openssl/x509.h @@ -1,3 +1,3 @@ /* x509.h for openssl */ -#include +#include diff --git a/cyassl/openssl/x509v3.h b/cyassl/openssl/x509v3.h index 77828a33b..2a5240d99 100644 --- a/cyassl/openssl/x509v3.h +++ b/cyassl/openssl/x509v3.h @@ -1,2 +1,3 @@ /* x509v3.h for openssl */ +#include diff --git a/cyassl/sniffer.h b/cyassl/sniffer.h index 167fd2ac0..881916fbd 100644 --- a/cyassl/sniffer.h +++ b/cyassl/sniffer.h @@ -20,4 +20,3 @@ */ #include - diff --git a/cyassl/ssl.h b/cyassl/ssl.h index 773ce6e38..595278ae6 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -42,74 +42,104 @@ /* wincrypt.h clashes */ #undef X509_NAME #endif -// typedef CYASSL WOLFSSL; -// typedef CYASSL_SESSION WOLFSSL_SESSION; -// typedef CYASSL_METHOD WOLFSSL_METHOD; -// typedef CYASSL_CTX WOLFSSL_CTX; - -// typedef CYASSL_X509 WOLFSSL_X509; -// typedef CYASSL_X509_NAME WOLFSSL_X509_NAME; -// typedef CYASSL_X509_CHAIN WOLFSSL_X509_CHAIN; +#define CYASSL WOLFSSL +#define CYASSL_SESSION WOLFSSL_SESSION +#define CYASSL_METHOD WOLFSSL_METHOD +#define CYASSL_CTX WOLFSSL_CTX +#define CYASSL_X509 WOLFSSL_X509 +#define CYASSL_X509_NAME WOLFSSL_X509_NAME +#define CYASSL_X509_CHAIN WOLFSSL_X509_CHAIN /* redeclare guard */ -// #define CYASSL_TYPES_DEFINED +#define CYASSL_TYPES_DEFINED WOLFSSL_TYPES_DEFINED -// typedef CYASSL_EVP_PKEY WOLFSSL_EVP_PKEY; -// typedef CYASSL_RSA WOLFSSL_RSA; -// typedef CYASSL_DSA WOLFSSL_DSA; -// typedef CYASSL_BIO WOLFSSL_BIO; -// typedef CYASSL_BIO_METHOD WOLFSSL_BIO_METHOD; -// typedef CYASSL_CIPHER WOLFSSL_SSL_CIPHER; -// typedef CYASSL_X509_LOOKUP WOLFSSL_X509_LOOKUP; -// typedef CYASSL_X509_CRL WOLFSSL_X509_CRL; -// typedef CYASSL_X509_EXTENSION WOLFSSL_X509_EXTENSION; -// typedef CYASSL_ASN1_TIME WOLFSSL_ASN1_TIME; -// typedef CYASSL_ASN1_INTEGER WOLFSSL_ASN1_INTEGER; -// typedef CYASSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT; -// typedef CYASSL_ASN1_STRING WOLFSSL_ASN1_STRING; -// typedef CYASSL_dynlock_value WOLFSSL_dynlock_value; -// typedef CYASSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD; +#define CYASSL_EVP_PKEY WOLFSSL_EVP_PKEY +#define CYASSL_RSA WOLFSSL_RSA +#define CYASSL_DSA WOLFSSL_DSA +#define CYASSL_BIO WOLFSSL_BIO +#define CYASSL_BIO_METHOD WOLFSSL_BIO_METHOD +#define CYASSL_CIPHER WOLFSSL_SSL_CIPHER +#define CYASSL_X509_LOOKUP WOLFSSL_X509_LOOKUP +#define CYASSL_X509_CRL WOLFSSL_X509_CRL +#define CYASSL_X509_EXTENSION WOLFSSL_X509_EXTENSION +#define CYASSL_ASN1_TIME WOLFSSL_ASN1_TIME +#define CYASSL_ASN1_INTEGER WOLFSSL_ASN1_INTEGER +#define CYASSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT +#define CYASSL_ASN1_STRING WOLFSSL_ASN1_STRING +#define CYASSL_dynlock_value WOLFSSL_dynlock_value +#define CYASSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD -// #define ASN1_UTCTIME CYASSL_ASN1_TIME +#define CYASSL_ASN1_TIME WOLFSSL_ASN1_TIME -// typedef CYASSL_MD4_CTX WOLFSSL_MD4_CTX; -// typedef CYASSL_COMP_METHOD WOLFSSL_COMP_METHOD; -// typedef CYASSL_X509_STORE WOLFSSL_X509_STORE; -// typedef CYASSL_X509_REVOKED WOLFSSL_X509_REVOKED; -// typedef CYASSL_X509_OBJECT WOLFSSL_X509_OBJECT; -// typedef CYASSL_X509_STORE_CTX WOLFSSL_X509_STORE_CTX; +#define CYASSL_MD4_CTX WOLFSSL_MD4_CTX +#define CYASSL_COMP_METHOD WOLFSSL_COMP_METHOD +#define CYASSL_X509_STORE WOLFSSL_X509_STORE +#define CYASSL_X509_REVOKED WOLFSSL_X509_REVOKED +#define CYASSL_X509_OBJECT WOLFSSL_X509_OBJECT +#define CYASSL_X509_STORE_CTX WOLFSSL_X509_STORE_CTX + +/* ssl.c */ +#define CYASSL_CLIENT_END WOLFSSL_CLIENT_END +#define CYASSL_CERT_MANAGER WOLFSSL_CERT_MANAGER +#define CYASSL_USER_CA WOLFSSL_USER_CA +#define CYASSL_TLSV1 WOLFSSL_TLSV1 +#define CYASSL_TLSV1_1 WOLFSSL_TLSV1_1 +#define CYASSL_TLSV1_2 WOLFSSL_TLSV1_2 +#define CYASSL_SSLV3 WOLFSSL_SSLV3 +#define CyaSSL_session_reused wolfSSL_session_reused + + +/* io.c */ +#define CYASSL_CBIO_ERR_CONN_CLOSE WOLFSSL_CBIO_ERR_CONN_CLOSE +#define CyaSSL_GetIOReadCtx wolfSSL_GetIOReadCtx +#define CyaSSL_GetIOWriteCtx wolfSSL_GetIOWriteCtx +#define CYASSL_CBIO_ERR_GENERAL WOLFSSL_CBIO_ERR_GENERAL +#define CYASSL_CBIO_ERR_ISR WOLFSSL_CBIO_ERR_ISR +#define CYASSL_CBIO_ERR_WANT_READ WOLFSSL_CBIO_ERR_WANT_READ +#define CYASSL_CBIO_ERR_WANT_WRITE WOLFSSL_CBIO_ERR_WANT_WRITE +#define CYASSL_CBIO_ERR_TIMEOUT WOLFSSL_CBIO_ERR_TIMEOUT + +/* tls.c */ +#define CYASSL_SERVER_END WOLFSSL_SERVER_END +#define CYASSL_TLS_HMAC_INNER_SZ WOLFSSL_TLS_HMAC_INNER_SZ + +/* internal.c */ +#define CyaSSL_ERR_reason_error_string wolfSSL_ERR_reason_error_string +#define CYASSL_CHAIN_CA WOLFSSL_CHAIN_CA +#define CYASSL_CBIO_ERR_CONN_RST WOLFSSL_CBIO_ERR_CONN_RST +#define CYASSL_ALERT_HISTORY WOLFSSL_ALERT_HISTORY /* Initialization and Shutdown */ -// #define CyaSSL_Init wolfSSL_Init -// #define CyaSSL_library_init wolfSSL_library_init -// #define CyaSSL_Cleanup wolfSSL_Cleanup -// #define CyaSSL_shutdown wolfSSL_shutdown +#define CyaSSL_Init wolfSSL_Init +#define CyaSSL_library_init wolfSSL_library_init +#define CyaSSL_Cleanup wolfSSL_Cleanup +#define CyaSSL_shutdown wolfSSL_shutdown /* Certs and keys */ -// #define CyaSSL_CTX_load_verify_buffer wolfSSL_CTX_load_verify_buffer -// #define CyaSSL_CTX_use_PrivateKey_buffer wolfSSL_CTX_use_PrivateKey_buffer -// #define CyaSSL_CTX_use_PrivateKey_buffer wolfSSL_CTX_use_PrivateKey_buffer -// #define CyaSSL_CTX_use_PrivateKey_file wolfSSL_CTX_use_PrivateKey_file -// #define CyaSSL_CTX_use_certificate_buffer wolfSSL_CTX_use_certificate_buffer -// #define CyaSSL_CTX_use_certificate_chain_buffer wolfSSL_CTX_use_certificate_chain_buffer -// #define CyaSSL_CTX_use_certificate_chain_file wolfSSL_CTX_use_certificate_chain_file -// #define CyaSSL_CTX_use_certificate_file wolfSSL_CTX_use_certificate_file -// #define CyaSSL_SetTmpDH wolfSSL_SetTmpDH -// #define CyaSSL_use_PrivateKey_buffer wolfSSL_use_PrivateKey_buffer -// #define CyaSSL_use_certificate_buffer wolfSSL_use_certificate_buffer -// #define CyaSSL_use_certificate_chain_buffer wolfSSL_use_certificate_chain_buffer -// #define CyaSSL_CTX_der_load_verify_locations wolfSSL_CTX_der_load_verify_locations -// #define CyaSSL_CTX_use_NTRUPrivateKey_file wolfSSL_CTX_use_NTRUPrivateKey_file -// #define CyaSSL_KeepArrays wolfSSL_KeepArrays -// #define CyaSSL_FreeArrays wolfSSL_FreeArrays +#define CyaSSL_CTX_load_verify_buffer wolfSSL_CTX_load_verify_buffer +#define CyaSSL_CTX_use_PrivateKey_buffer wolfSSL_CTX_use_PrivateKey_buffer +#define CyaSSL_CTX_use_PrivateKey_buffer wolfSSL_CTX_use_PrivateKey_buffer +#define CyaSSL_CTX_use_PrivateKey_file wolfSSL_CTX_use_PrivateKey_file +#define CyaSSL_CTX_use_certificate_buffer wolfSSL_CTX_use_certificate_buffer +#define CyaSSL_CTX_use_certificate_chain_buffer wolfSSL_CTX_use_certificate_chain_buffer +#define CyaSSL_CTX_use_certificate_chain_file wolfSSL_CTX_use_certificate_chain_file +#define CyaSSL_CTX_use_certificate_file wolfSSL_CTX_use_certificate_file +#define CyaSSL_SetTmpDH wolfSSL_SetTmpDH +#define CyaSSL_use_PrivateKey_buffer wolfSSL_use_PrivateKey_buffer +#define CyaSSL_use_certificate_buffer wolfSSL_use_certificate_buffer +#define CyaSSL_use_certificate_chain_buffer wolfSSL_use_certificate_chain_buffer +#define CyaSSL_CTX_der_load_verify_locations wolfSSL_CTX_der_load_verify_locations +#define CyaSSL_CTX_use_NTRUPrivateKey_file wolfSSL_CTX_use_NTRUPrivateKey_file +#define CyaSSL_KeepArrays wolfSSL_KeepArrays +#define CyaSSL_FreeArrays wolfSSL_FreeArrays /* Context and Session Setup*/ #define CyaSSLv3_client_method wolfSSLv3_client_method #define CyaSSLv3_server_method wolfSSLv3_server_method -// #define CyaSSLv23_client_method wolfSSLv23_client_method -// #define CyaSSLv23_server_method wolfSSLv23_server_method +#define CyaSSLv23_client_method wolfSSLv23_client_method +#define CyaSSLv23_server_method wolfSSLv23_server_method #define CyaTLSv1_client_method wolfTLSv1_client_method #define CyaTLSv1_server_method wolfTLSv1_server_method #define CyaTLSv1_1_client_method wolfTLSv1_1_client_method @@ -120,162 +150,162 @@ #define CyaDTLSv1_server_method wolfDTLSv1_server_method #define CyaDTLSv1_2_client_method wolfDTLSv1_2_client_method #define CyaDTLSv1_2_server_method wolfDTLSv1_2_server_method -// #define CyaSSL_new wolfSSL_new -// #define CyaSSL_free wolfSSL_free -// #define CyaSSL_CTX_new wolfSSL_CTX_new -// #define CyaSSL_CTX_free wolfSSL_CTX_free -// #define CyaSSL_SetVersion wolfSSL_SetVersion -// #define CyaSSL_check_domain_name wolfSSL_check_domain_name -// #define CyaSSL_set_cipher_list wolfSSL_set_cipher_list -// #define CyaSSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list -// #define CyaSSL_set_compression wolfSSL_set_compression -// #define CyaSSL_set_fd wolfSSL_set_fd -// #define CyaSSL_set_group_messages wolfSSL_set_group_messages -// #define CyaSSL_CTX_set_group_messages wolfSSL_CTX_set_group_messages -// #define CyaSSL_set_session wolfSSL_set_session -// #define CyaSSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode -// #define CyaSSL_set_timeout wolfSSL_set_timeout -// #define CyaSSL_CTX_set_timeout wolfSSL_CTX_set_timeout -// #define CyaSSL_set_using_nonblock wolfSSL_set_using_nonblock -// #define CyaSSL_set_verify wolfSSL_set_verify -// #define CyaSSL_CTX_set_verify wolfSSL_CTX_set_verify +#define CyaSSL_new wolfSSL_new +#define CyaSSL_free wolfSSL_free +#define CyaSSL_CTX_new wolfSSL_CTX_new +#define CyaSSL_CTX_free wolfSSL_CTX_free +#define CyaSSL_SetVersion wolfSSL_SetVersion +#define CyaSSL_check_domain_name wolfSSL_check_domain_name +#define CyaSSL_set_cipher_list wolfSSL_set_cipher_list +#define CyaSSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list +#define CyaSSL_set_compression wolfSSL_set_compression +#define CyaSSL_set_fd wolfSSL_set_fd +#define CyaSSL_set_group_messages wolfSSL_set_group_messages +#define CyaSSL_CTX_set_group_messages wolfSSL_CTX_set_group_messages +#define CyaSSL_set_session wolfSSL_set_session +#define CyaSSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode +#define CyaSSL_set_timeout wolfSSL_set_timeout +#define CyaSSL_CTX_set_timeout wolfSSL_CTX_set_timeout +#define CyaSSL_set_using_nonblock wolfSSL_set_using_nonblock +#define CyaSSL_set_verify wolfSSL_set_verify +#define CyaSSL_CTX_set_verify wolfSSL_CTX_set_verify /* Callbacks */ -// #define CyaSSL_SetIOReadCtx wolfSSL_SetIOReadCtx -// #define CyaSSL_SetIOWriteCtx wolfSSL_SetIOWriteCtx -// #define CyaSSL_SetIOReadFlags wolfSSL_SetIOReadFlags -// #define CyaSSL_SetIOWriteFlags wolfSSL_SetIOWriteFlags -// #define CyaSSL_SetIORecv wolfSSL_SetIORecv -// #define CyaSSL_SetIOSend wolfSSL_SetIOSend -// #define CyaSSL_CTX_SetCACb wolfSSL_CTX_SetCACb -// #define CyaSSL_connect_ex wolfSSL_connect_ex -// #define CyaSSL_accept_ex wolfSSL_accept_ex -// #define CyaSSL_SetLoggingCb wolfSSL_SetLoggingCb -// #define CyaSSL_SetTlsHmacInner wolfSSL_SetTlsHmacInner -// #define CyaSSL_CTX_SetMacEncryptCb wolfSSL_CTX_SetMacEncryptCb -// #define CyaSSL_SetMacEncryptCtx wolfSSL_SetMacEncryptCtx -// #define CyaSSL_GetMacEncryptCtx wolfSSL_GetMacEncryptCtx -// #define CyaSSL_CTX_SetDecryptVerifyCb wolfSSL_CTX_SetDecryptVerifyCb -// #define CyaSSL_SetDecryptVerifyCtx wolfSSL_SetDecryptVerifyCtx -// #define CyaSSL_GetDecryptVerifyCtx wolfSSL_GetDecryptVerifyCtx -// #define CyaSSL_CTX_SetEccSignCb wolfSSL_CTX_SetEccSignCb -// #define CyaSSL_SetEccSignCtx wolfSSL_SetEccSignCtx -// #define CyaSSL_GetEccSignCtx wolfSSL_GetEccSignCtx -// #define CyaSSL_CTX_SetEccVerifyCb wolfSSL_CTX_SetEccVerifyCb -// #define CyaSSL_SetEccVerifyCtx wolfSSL_SetEccVerifyCtx -// #define CyaSSL_GetEccVerifyCtx wolfSSL_GetEccVerifyCtx -// #define CyaSSL_CTX_SetRsaSignCb wolfSSL_CTX_SetRsaSignCb -// #define CyaSSL_SetRsaSignCtx wolfSSL_SetRsaSignCtx -// #define CyaSSL_GetRsaSignCtx wolfSSL_GetRsaSignCtx -// #define CyaSSL_CTX_SetRsaVerifyCb wolfSSL_CTX_SetRsaVerifyCb -// #define CyaSSL_SetRsaVerifyCtx wolfSSL_SetRsaVerifyCtx -// #define CyaSSL_GetRsaVerifyCtx wolfSSL_GetRsaVerifyCtx -// #define CyaSSL_CTX_SetRsaEncCb wolfSSL_CTX_SetRsaEncCb -// #define CyaSSL_SetRsaEncCtx wolfSSL_SetRsaEncCtx -// #define CyaSSL_GetRsaEncCtx wolfSSL_GetRsaEncCtx -// #define CyaSSL_CTX_SetRsaDecCb wolfSSL_CTX_SetRsaDecCb -// #define CyaSSL_SetRsaDecCtx wolfSSL_SetRsaDecCtx -// #define CyaSSL_GetRsaDecCtx wolfSSL_GetRsaDecCtx +#define CyaSSL_SetIOReadCtx wolfSSL_SetIOReadCtx +#define CyaSSL_SetIOWriteCtx wolfSSL_SetIOWriteCtx +#define CyaSSL_SetIOReadFlags wolfSSL_SetIOReadFlags +#define CyaSSL_SetIOWriteFlags wolfSSL_SetIOWriteFlags +#define CyaSSL_SetIORecv wolfSSL_SetIORecv +#define CyaSSL_SetIOSend wolfSSL_SetIOSend +#define CyaSSL_CTX_SetCACb wolfSSL_CTX_SetCACb +#define CyaSSL_connect_ex wolfSSL_connect_ex +#define CyaSSL_accept_ex wolfSSL_accept_ex +#define CyaSSL_SetLoggingCb wolfSSL_SetLoggingCb +#define CyaSSL_SetTlsHmacInner wolfSSL_SetTlsHmacInner +#define CyaSSL_CTX_SetMacEncryptCb wolfSSL_CTX_SetMacEncryptCb +#define CyaSSL_SetMacEncryptCtx wolfSSL_SetMacEncryptCtx +#define CyaSSL_GetMacEncryptCtx wolfSSL_GetMacEncryptCtx +#define CyaSSL_CTX_SetDecryptVerifyCb wolfSSL_CTX_SetDecryptVerifyCb +#define CyaSSL_SetDecryptVerifyCtx wolfSSL_SetDecryptVerifyCtx +#define CyaSSL_GetDecryptVerifyCtx wolfSSL_GetDecryptVerifyCtx +#define CyaSSL_CTX_SetEccSignCb wolfSSL_CTX_SetEccSignCb +#define CyaSSL_SetEccSignCtx wolfSSL_SetEccSignCtx +#define CyaSSL_GetEccSignCtx wolfSSL_GetEccSignCtx +#define CyaSSL_CTX_SetEccVerifyCb wolfSSL_CTX_SetEccVerifyCb +#define CyaSSL_SetEccVerifyCtx wolfSSL_SetEccVerifyCtx +#define CyaSSL_GetEccVerifyCtx wolfSSL_GetEccVerifyCtx +#define CyaSSL_CTX_SetRsaSignCb wolfSSL_CTX_SetRsaSignCb +#define CyaSSL_SetRsaSignCtx wolfSSL_SetRsaSignCtx +#define CyaSSL_GetRsaSignCtx wolfSSL_GetRsaSignCtx +#define CyaSSL_CTX_SetRsaVerifyCb wolfSSL_CTX_SetRsaVerifyCb +#define CyaSSL_SetRsaVerifyCtx wolfSSL_SetRsaVerifyCtx +#define CyaSSL_GetRsaVerifyCtx wolfSSL_GetRsaVerifyCtx +#define CyaSSL_CTX_SetRsaEncCb wolfSSL_CTX_SetRsaEncCb +#define CyaSSL_SetRsaEncCtx wolfSSL_SetRsaEncCtx +#define CyaSSL_GetRsaEncCtx wolfSSL_GetRsaEncCtx +#define CyaSSL_CTX_SetRsaDecCb wolfSSL_CTX_SetRsaDecCb +#define CyaSSL_SetRsaDecCtx wolfSSL_SetRsaDecCtx +#define CyaSSL_GetRsaDecCtx wolfSSL_GetRsaDecCtx /* Error Handling and Debugging*/ -// #define CyaSSL_ERR_error_string wolfSSL_ERR_error_string -// #define CyaSSL_ERR_error_string_n wolfSSL_ERR_error_string_n -// #define CyaSSL_ERR_print_errors_fp wolfSSL_ERR_print_errors_fp -// #define CyaSSL_get_error wolfSSL_get_error -// #define CyaSSL_load_error_strings wolfSSL_load_error_strings -// #define CyaSSL_want_read wolfSSL_want_read -// #define CyaSSL_want_write wolfSSL_want_write -// #define CyaSSL_Debugging_ON wolfSSL_Debugging_ON -// #define CyaSSL_Debugging_OFF wolfSSL_Debugging_OFF +#define CyaSSL_ERR_error_string wolfSSL_ERR_error_string +#define CyaSSL_ERR_error_string_n wolfSSL_ERR_error_string_n +#define CyaSSL_ERR_print_errors_fp wolfSSL_ERR_print_errors_fp +#define CyaSSL_get_error wolfSSL_get_error +#define CyaSSL_load_error_strings wolfSSL_load_error_strings +#define CyaSSL_want_read wolfSSL_want_read +#define CyaSSL_want_write wolfSSL_want_write +#define CyaSSL_Debugging_ON wolfSSL_Debugging_ON +#define CyaSSL_Debugging_OFF wolfSSL_Debugging_OFF /* OCSP and CRL */ -// #define CyaSSL_CTX_OCSP_set_options wolfSSL_CTX_OCSP_set_options -// #define CyaSSL_CTX_OCSP_set_override_url wolfSSL_CTX_OCSP_set_override_url +#define CyaSSL_CTX_OCSP_set_options wolfSSL_CTX_OCSP_set_options +#define CyaSSL_CTX_OCSP_set_override_url wolfSSL_CTX_OCSP_set_override_url /* Informational */ -// #define CyaSSL_GetObjectSize wolfSSL_GetObjectSize -// #define CyaSSL_GetMacSecret wolfSSL_GetMacSecret -// #define CyaSSL_GetClientWriteKey wolfSSL_GetClientWriteKey -// #define CyaSSL_GetClientWriteIV wolfSSL_GetClientWriteIV -// #define CyaSSL_GetServerWriteKey wolfSSL_GetServerWriteKey -// #define CyaSSL_GetServerWriteIV wolfSSL_GetServerWriteIV -// #define CyaSSL_GetKeySize wolfSSL_GetKeySize -// #define CyaSSL_GetSide wolfSSL_GetSide -// #define CyaSSL_IsTLSv1_1 wolfSSL_IsTLSv1_1 -// #define CyaSSL_GetBulkCipher wolfSSL_GetBulkCipher -// #define CyaSSL_GetCipherBlockSize wolfSSL_GetCipherBlockSize -// #define CyaSSL_GetAeadMacSize wolfSSL_GetAeadMacSize -// #define CyaSSL_GetHmacSize wolfSSL_GetHmacSize -// #define CyaSSL_GetHmacType wolfSSL_GetHmacType -// #define CyaSSL_GetCipherType wolfSSL_GetCipherType +#define CyaSSL_GetObjectSize wolfSSL_GetObjectSize +#define CyaSSL_GetMacSecret wolfSSL_GetMacSecret +#define CyaSSL_GetClientWriteKey wolfSSL_GetClientWriteKey +#define CyaSSL_GetClientWriteIV wolfSSL_GetClientWriteIV +#define CyaSSL_GetServerWriteKey wolfSSL_GetServerWriteKey +#define CyaSSL_GetServerWriteIV wolfSSL_GetServerWriteIV +#define CyaSSL_GetKeySize wolfSSL_GetKeySize +#define CyaSSL_GetSide wolfSSL_GetSide +#define CyaSSL_IsTLSv1_1 wolfSSL_IsTLSv1_1 +#define CyaSSL_GetBulkCipher wolfSSL_GetBulkCipher +#define CyaSSL_GetCipherBlockSize wolfSSL_GetCipherBlockSize +#define CyaSSL_GetAeadMacSize wolfSSL_GetAeadMacSize +#define CyaSSL_GetHmacSize wolfSSL_GetHmacSize +#define CyaSSL_GetHmacType wolfSSL_GetHmacType +#define CyaSSL_GetCipherType wolfSSL_GetCipherType /* Connection, Session, and I/O */ -// #define CyaSSL_accept wolfSSL_accept -// #define CyaSSL_connect wolfSSL_connect -// #define CyaSSL_connect_cert wolfSSL_connect_cert -// #define CyaSSL_get_fd wolfSSL_get_fd -// #define CyaSSL_get_session wolfSSL_get_session -// #define CyaSSL_get_using_nonblock wolfSSL_get_using_nonblock -// #define CyaSSL_flush_sessions wolfSSL_flush_sessions -// #define CyaSSL_negotiate wolfSSL_negotiate -// #define CyaSSL_peek wolfSSL_peek -// #define CyaSSL_pending wolfSSL_pending -// #define CyaSSL_read wolfSSL_read -// #define CyaSSL_recv wolfSSL_recv -// #define CyaSSL_send wolfSSL_send -// #define CyaSSL_write wolfSSL_write -// #define CyaSSL_writev wolfSSL_writev +#define CyaSSL_accept wolfSSL_accept +#define CyaSSL_connect wolfSSL_connect +#define CyaSSL_connect_cert wolfSSL_connect_cert +#define CyaSSL_get_fd wolfSSL_get_fd +#define CyaSSL_get_session wolfSSL_get_session +#define CyaSSL_get_using_nonblock wolfSSL_get_using_nonblock +#define CyaSSL_flush_sessions wolfSSL_flush_sessions +#define CyaSSL_negotiate wolfSSL_negotiate +#define CyaSSL_peek wolfSSL_peek +#define CyaSSL_pending wolfSSL_pending +#define CyaSSL_read wolfSSL_read +#define CyaSSL_recv wolfSSL_recv +#define CyaSSL_send wolfSSL_send +#define CyaSSL_write wolfSSL_write +#define CyaSSL_writev wolfSSL_writev /* DTLS Specific */ -// #define CyaSSL_dtls wolfSSL_dtls -// #define CyaSSL_dtls_get_current_timeout wolfSSL_dtls_get_current_timeout -// #define CyaSSL_dtls_get_peer wolfSSL_dtls_get_peer -// #define CyaSSL_dtls_got_timeout wolfSSL_dtls_got_timeout -// #define CyaSSL_dtls_set_peer wolfSSL_dtls_set_peer +#define CyaSSL_dtls wolfSSL_dtls +#define CyaSSL_dtls_get_current_timeout wolfSSL_dtls_get_current_timeout +#define CyaSSL_dtls_get_peer wolfSSL_dtls_get_peer +#define CyaSSL_dtls_got_timeout wolfSSL_dtls_got_timeout +#define CyaSSL_dtls_set_peer wolfSSL_dtls_set_peer /* Memory Abstraction Layer */ -// #define CyaSSL_Malloc wolfSSL_Malloc -// #define CyaSSL_Realloc wolfSSL_Realloc -// #define CyaSSL_Free wolfSSL_Free -// #define CyaSSL_SetAllocators wolfSSL_SetAllocators +#define CyaSSL_Malloc wolfSSL_Malloc +#define CyaSSL_Realloc wolfSSL_Realloc +#define CyaSSL_Free wolfSSL_Free +#define CyaSSL_SetAllocators wolfSSL_SetAllocators /* Certificate Manager */ -// #define CyaSSL_CertManagerDisableCRL wolfSSL_CertManagerDisableCRL -// #define CyaSSL_CertManagerEnableCRL wolfSSL_CertManagerEnableCRL -// #define CyaSSL_CertManagerFree wolfSSL_CertManagerFree -// #define CyaSSL_CertManagerLoadCA wolfSSL_CertManagerLoadCA -// #define CyaSSL_CertManagerNew wolfSSL_CertManagerNew -// #define CyaSSL_CertManagerVerify wolfSSL_CertManagerVerify -// #define CyaSSL_CertManagerVerifyBuffer wolfSSL_CertManagerVerifyBuffer +#define CyaSSL_CertManagerDisableCRL wolfSSL_CertManagerDisableCRL +#define CyaSSL_CertManagerEnableCRL wolfSSL_CertManagerEnableCRL +#define CyaSSL_CertManagerFree wolfSSL_CertManagerFree +#define CyaSSL_CertManagerLoadCA wolfSSL_CertManagerLoadCA +#define CyaSSL_CertManagerNew wolfSSL_CertManagerNew +#define CyaSSL_CertManagerVerify wolfSSL_CertManagerVerify +#define CyaSSL_CertManagerVerifyBuffer wolfSSL_CertManagerVerifyBuffer /* OpenSSL Compatibility Layer */ -// #define CyaSSL_X509_get_serial_number wolfSSL_X509_get_serial_number -// #define CyaSSL_get_sessionID wolfSSL_get_sessionID -// #define CyaSSL_get_peer_chain wolfSSL_get_peer_chain -// #define CyaSSL_get_peer_count wolfSSL_get_peer_count -// #define CyaSSL_get_peer_length wolfSSL_get_peer_length -// #define CyaSSL_get_chain_cert wolfSSL_get_chain_cert -// #define CyaSSL_get_chain_cert_pem wolfSSL_get_chain_cert_pem -// #define CyaSSL_PemCertToDer wolfSSL_PemCertToDer -// #define CyaSSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file -// #define CyaSSL_use_certificate_file wolfSSL_use_certificate_file -// #define CyaSSL_use_PrivateKey_file wolfSSL_use_PrivateKey_file -// #define CyaSSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file -// #define CyaSSL_use_RSAPrivateKey_file wolfSSL_use_RSAPrivateKey_file +#define CyaSSL_X509_get_serial_number wolfSSL_X509_get_serial_number +#define CyaSSL_get_sessionID wolfSSL_get_sessionID +#define CyaSSL_get_peer_chain wolfSSL_get_peer_chain +#define CyaSSL_get_peer_count wolfSSL_get_peer_count +#define CyaSSL_get_peer_length wolfSSL_get_peer_length +#define CyaSSL_get_chain_cert wolfSSL_get_chain_cert +#define CyaSSL_get_chain_cert_pem wolfSSL_get_chain_cert_pem +#define CyaSSL_PemCertToDer wolfSSL_PemCertToDer +#define CyaSSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file +#define CyaSSL_use_certificate_file wolfSSL_use_certificate_file +#define CyaSSL_use_PrivateKey_file wolfSSL_use_PrivateKey_file +#define CyaSSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file +#define CyaSSL_use_RSAPrivateKey_file wolfSSL_use_RSAPrivateKey_file /* TLS Extensions */ -// #define CyaSSL_CTX_UseSNI wolfSSL_CTX_UseSNI -// #define CyaSSL_UseSNI wolfSSL_UseSNI -// #define CyaSSL_CTX_SNI_SetOptions wolfSSL_CTX_SNI_SetOptions -// #define CyaSSL_SNI_SetOptions wolfSSL_SNI_SetOptions -// #define CyaSSL_SNI_GetRequest wolfSSL_SNI_GetRequest -// #define CyaSSL_SNI_GetFromBuffer wolfSSL_SNI_GetFromBuffer -// #define CyaSSL_CTX_UseMaxFragment wolfSSL_CTX_UseMaxFragment -// #define CyaSSL_UseMaxFragment wolfSSL_UseMaxFragment -// #define CyaSSL_CTX_UseTruncatedHMAC wolfSSL_CTX_UseTruncatedHMAC -// #define CyaSSL_UseTruncatedHMAC wolfSSL_UseTruncatedHMAC -// #define CyaSSL_CTX_UseSupportedCurve wolfSSL_CTX_UseSupportedCurve -// #define CyaSSL_UseSupportedCurve wolfSSL_UseSupportedCurve +#define CyaSSL_CTX_UseSNI wolfSSL_CTX_UseSNI +#define CyaSSL_UseSNI wolfSSL_UseSNI +#define CyaSSL_CTX_SNI_SetOptions wolfSSL_CTX_SNI_SetOptions +#define CyaSSL_SNI_SetOptions wolfSSL_SNI_SetOptions +#define CyaSSL_SNI_GetRequest wolfSSL_SNI_GetRequest +#define CyaSSL_SNI_GetFromBuffer wolfSSL_SNI_GetFromBuffer +#define CyaSSL_CTX_UseMaxFragment wolfSSL_CTX_UseMaxFragment +#define CyaSSL_UseMaxFragment wolfSSL_UseMaxFragment +#define CyaSSL_CTX_UseTruncatedHMAC wolfSSL_CTX_UseTruncatedHMAC +#define CyaSSL_UseTruncatedHMAC wolfSSL_UseTruncatedHMAC +#define CyaSSL_CTX_UseSupportedCurve wolfSSL_CTX_UseSupportedCurve +#define CyaSSL_UseSupportedCurve wolfSSL_UseSupportedCurve @@ -304,6 +334,8 @@ #define Arc4FreeCavium wc_Arc4FreeCavium #endif +/**/ + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfcrypt/src/include.am b/wolfcrypt/src/include.am new file mode 100644 index 000000000..6664dab22 --- /dev/null +++ b/wolfcrypt/src/include.am @@ -0,0 +1,40 @@ +# vim:ft=automake +# All paths should be given relative to the root + +EXTRA_DIST += ctaocrypt/src/misc.c +EXTRA_DIST += ctaocrypt/src/asm.c +EXTRA_DIST += ctaocrypt/src/aes_asm.asm + +EXTRA_DIST += \ + ctaocrypt/src/ecc_fp.c \ + ctaocrypt/src/fp_mont_small.i \ + ctaocrypt/src/fp_mul_comba_12.i \ + ctaocrypt/src/fp_mul_comba_17.i \ + ctaocrypt/src/fp_mul_comba_20.i \ + ctaocrypt/src/fp_mul_comba_24.i \ + ctaocrypt/src/fp_mul_comba_28.i \ + ctaocrypt/src/fp_mul_comba_32.i \ + ctaocrypt/src/fp_mul_comba_3.i \ + ctaocrypt/src/fp_mul_comba_48.i \ + ctaocrypt/src/fp_mul_comba_4.i \ + ctaocrypt/src/fp_mul_comba_64.i \ + ctaocrypt/src/fp_mul_comba_6.i \ + ctaocrypt/src/fp_mul_comba_7.i \ + ctaocrypt/src/fp_mul_comba_8.i \ + ctaocrypt/src/fp_mul_comba_9.i \ + ctaocrypt/src/fp_mul_comba_small_set.i \ + ctaocrypt/src/fp_sqr_comba_12.i \ + ctaocrypt/src/fp_sqr_comba_17.i \ + ctaocrypt/src/fp_sqr_comba_20.i \ + ctaocrypt/src/fp_sqr_comba_24.i \ + ctaocrypt/src/fp_sqr_comba_28.i \ + ctaocrypt/src/fp_sqr_comba_32.i \ + ctaocrypt/src/fp_sqr_comba_3.i \ + ctaocrypt/src/fp_sqr_comba_48.i \ + ctaocrypt/src/fp_sqr_comba_4.i \ + ctaocrypt/src/fp_sqr_comba_64.i \ + ctaocrypt/src/fp_sqr_comba_6.i \ + ctaocrypt/src/fp_sqr_comba_7.i \ + ctaocrypt/src/fp_sqr_comba_8.i \ + ctaocrypt/src/fp_sqr_comba_9.i \ + ctaocrypt/src/fp_sqr_comba_small_set.i diff --git a/wolfssl/include.am b/wolfssl/include.am index db1f089ee..a02488fc8 100644 --- a/wolfssl/include.am +++ b/wolfssl/include.am @@ -2,24 +2,24 @@ # All paths should be given relative to the root # -include cyassl/ctaocrypt/include.am -include cyassl/openssl/include.am +include wolfssl/wolfcrypt/include.am +include wolfssl/openssl/include.am -EXTRA_DIST+= cyassl/sniffer_error.rc +EXTRA_DIST+= wolfssl/sniffer_error.rc nobase_include_HEADERS+= \ - cyassl/error-ssl.h \ - cyassl/ssl.h \ - cyassl/sniffer_error.h \ - cyassl/sniffer.h \ - cyassl/callbacks.h \ - cyassl/certs_test.h \ - cyassl/test.h \ - cyassl/version.h \ - cyassl/options.h \ - cyassl/ocsp.h \ - cyassl/crl.h + wolfssl/error-ssl.h \ + wolfssl/ssl.h \ + wolfssl/sniffer_error.h \ + wolfssl/sniffer.h \ + wolfssl/callbacks.h \ + wolfssl/certs_test.h \ + wolfssl/test.h \ + wolfssl/version.h \ + wolfssl/options.h \ + wolfssl/ocsp.h \ + wolfssl/crl.h noinst_HEADERS+= \ - cyassl/internal.h + wolfssl/internal.h diff --git a/wolfssl/openssl/include.am b/wolfssl/openssl/include.am index e531f767a..05b509bcc 100644 --- a/wolfssl/openssl/include.am +++ b/wolfssl/openssl/include.am @@ -2,35 +2,35 @@ # All paths should be given relative to the root nobase_include_HEADERS+= \ - cyassl/openssl/asn1.h \ - cyassl/openssl/bio.h \ - cyassl/openssl/bn.h \ - cyassl/openssl/conf.h \ - cyassl/openssl/crypto.h \ - cyassl/openssl/des.h \ - cyassl/openssl/dh.h \ - cyassl/openssl/dsa.h \ - cyassl/openssl/ecdsa.h \ - cyassl/openssl/ec.h \ - cyassl/openssl/engine.h \ - cyassl/openssl/err.h \ - cyassl/openssl/evp.h \ - cyassl/openssl/hmac.h \ - cyassl/openssl/lhash.h \ - cyassl/openssl/md4.h \ - cyassl/openssl/md5.h \ - cyassl/openssl/ripemd.h \ - cyassl/openssl/ocsp.h \ - cyassl/openssl/opensslconf.h \ - cyassl/openssl/opensslv.h \ - cyassl/openssl/ossl_typ.h \ - cyassl/openssl/pem.h \ - cyassl/openssl/pkcs12.h \ - cyassl/openssl/rand.h \ - cyassl/openssl/rsa.h \ - cyassl/openssl/sha.h \ - cyassl/openssl/ssl.h \ - cyassl/openssl/stack.h \ - cyassl/openssl/ui.h \ - cyassl/openssl/x509.h \ - cyassl/openssl/x509v3.h + wolfssl/openssl/asn1.h \ + wolfssl/openssl/bio.h \ + wolfssl/openssl/bn.h \ + wolfssl/openssl/conf.h \ + wolfssl/openssl/crypto.h \ + wolfssl/openssl/des.h \ + wolfssl/openssl/dh.h \ + wolfssl/openssl/dsa.h \ + wolfssl/openssl/ecdsa.h \ + wolfssl/openssl/ec.h \ + wolfssl/openssl/engine.h \ + wolfssl/openssl/err.h \ + wolfssl/openssl/evp.h \ + wolfssl/openssl/hmac.h \ + wolfssl/openssl/lhash.h \ + wolfssl/openssl/md4.h \ + wolfssl/openssl/md5.h \ + wolfssl/openssl/ripemd.h \ + wolfssl/openssl/ocsp.h \ + wolfssl/openssl/opensslconf.h \ + wolfssl/openssl/opensslv.h \ + wolfssl/openssl/ossl_typ.h \ + wolfssl/openssl/pem.h \ + wolfssl/openssl/pkcs12.h \ + wolfssl/openssl/rand.h \ + wolfssl/openssl/rsa.h \ + wolfssl/openssl/sha.h \ + wolfssl/openssl/ssl.h \ + wolfssl/openssl/stack.h \ + wolfssl/openssl/ui.h \ + wolfssl/openssl/x509.h \ + wolfssl/openssl/x509v3.h diff --git a/wolfssl/openssl/ssl.h b/wolfssl/openssl/ssl.h index 5d7a0b1ed..f5515aa9e 100644 --- a/wolfssl/openssl/ssl.h +++ b/wolfssl/openssl/ssl.h @@ -2,14 +2,14 @@ * * Copyright (C) 2006-2014 wolfSSL Inc. * - * This file is part of CyaSSL. + * This file is part of wolfSSL. * - * CyaSSL is free software; you can redistribute it and/or modify + * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * CyaSSL is distributed in the hope that it will be useful, + * wolfSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -20,15 +20,18 @@ */ -/* ssl.h defines openssl compatibility layer +/* ssl.h defines wolfssl_openssl compatibility layer * */ -#ifndef CYASSL_OPENSSL_H_ -#define CYASSL_OPENSSL_H_ +#ifndef WOLFSSL_OPENSSL_H_ +#define WOLFSSL_OPENSSL_H_ +/* wolfssl_cyassl compatibility layer */ #include + + /* wolfssl ssl.h */ #include #ifdef __cplusplus @@ -41,44 +44,44 @@ #endif -typedef CYASSL SSL; -typedef CYASSL_SESSION SSL_SESSION; -typedef CYASSL_METHOD SSL_METHOD; -typedef CYASSL_CTX SSL_CTX; +typedef WOLFSSL SSL; +typedef WOLFSSL_SESSION SSL_SESSION; +typedef WOLFSSL_METHOD SSL_METHOD; +typedef WOLFSSL_CTX SSL_CTX; -typedef CYASSL_X509 X509; -typedef CYASSL_X509_NAME X509_NAME; -typedef CYASSL_X509_CHAIN X509_CHAIN; +typedef WOLFSSL_X509 X509; +typedef WOLFSSL_X509_NAME X509_NAME; +typedef WOLFSSL_X509_CHAIN X509_CHAIN; /* redeclare guard */ -#define CYASSL_TYPES_DEFINED +#define WOLFSSL_TYPES_DEFINED -typedef CYASSL_EVP_PKEY EVP_PKEY; -typedef CYASSL_RSA RSA; -typedef CYASSL_DSA DSA; -typedef CYASSL_BIO BIO; -typedef CYASSL_BIO_METHOD BIO_METHOD; -typedef CYASSL_CIPHER SSL_CIPHER; -typedef CYASSL_X509_LOOKUP X509_LOOKUP; -typedef CYASSL_X509_LOOKUP_METHOD X509_LOOKUP_METHOD; -typedef CYASSL_X509_CRL X509_CRL; -typedef CYASSL_X509_EXTENSION X509_EXTENSION; -typedef CYASSL_ASN1_TIME ASN1_TIME; -typedef CYASSL_ASN1_INTEGER ASN1_INTEGER; -typedef CYASSL_ASN1_OBJECT ASN1_OBJECT; -typedef CYASSL_ASN1_STRING ASN1_STRING; -typedef CYASSL_dynlock_value CRYPTO_dynlock_value; +typedef WOLFSSL_EVP_PKEY EVP_PKEY; +typedef WOLFSSL_RSA RSA; +typedef WOLFSSL_DSA DSA; +typedef WOLFSSL_BIO BIO; +typedef WOLFSSL_BIO_METHOD BIO_METHOD; +typedef WOLFSSL_CIPHER SSL_CIPHER; +typedef WOLFSSL_X509_LOOKUP X509_LOOKUP; +typedef WOLFSSL_X509_LOOKUP_METHOD X509_LOOKUP_METHOD; +typedef WOLFSSL_X509_CRL X509_CRL; +typedef WOLFSSL_X509_EXTENSION X509_EXTENSION; +typedef WOLFSSL_ASN1_TIME ASN1_TIME; +typedef WOLFSSL_ASN1_INTEGER ASN1_INTEGER; +typedef WOLFSSL_ASN1_OBJECT ASN1_OBJECT; +typedef WOLFSSL_ASN1_STRING ASN1_STRING; +typedef WOLFSSL_dynlock_value CRYPTO_dynlock_value; -#define ASN1_UTCTIME CYASSL_ASN1_TIME +#define ASN1_UTCTIME WOLFSSL_ASN1_TIME -typedef CYASSL_MD4_CTX MD4_CTX; -typedef CYASSL_COMP_METHOD COMP_METHOD; -typedef CYASSL_X509_STORE X509_STORE; -typedef CYASSL_X509_REVOKED X509_REVOKED; -typedef CYASSL_X509_OBJECT X509_OBJECT; -typedef CYASSL_X509_STORE_CTX X509_STORE_CTX; +typedef WOLFSSL_MD4_CTX MD4_CTX; +typedef WOLFSSL_COMP_METHOD COMP_METHOD; +typedef WOLFSSL_X509_STORE X509_STORE; +typedef WOLFSSL_X509_REVOKED X509_REVOKED; +typedef WOLFSSL_X509_OBJECT X509_OBJECT; +typedef WOLFSSL_X509_STORE_CTX X509_STORE_CTX; #define SSLv3_server_method wolfSSLv3_server_method @@ -90,7 +93,7 @@ typedef CYASSL_X509_STORE_CTX X509_STORE_CTX; #define TLSv1_2_server_method wolfTLSv1_2_server_method #define TLSv1_2_client_method wolfTLSv1_2_client_method -#ifdef CYASSL_DTLS +#ifdef WOLFSSL_DTLS #define DTLSv1_client_method wolfDTLSv1_client_method #define DTLSv1_server_method wolfDTLSv1_server_method #define DTLSv1_2_client_method wolfDTLSv1_2_client_method @@ -99,278 +102,278 @@ typedef CYASSL_X509_STORE_CTX X509_STORE_CTX; #ifndef NO_FILESYSTEM - #define SSL_CTX_use_certificate_file CyaSSL_CTX_use_certificate_file - #define SSL_CTX_use_PrivateKey_file CyaSSL_CTX_use_PrivateKey_file - #define SSL_CTX_load_verify_locations CyaSSL_CTX_load_verify_locations - #define SSL_CTX_use_certificate_chain_file CyaSSL_CTX_use_certificate_chain_file - #define SSL_CTX_use_RSAPrivateKey_file CyaSSL_CTX_use_RSAPrivateKey_file + #define SSL_CTX_use_certificate_file wolfSSL_CTX_use_certificate_file + #define SSL_CTX_use_PrivateKey_file wolfSSL_CTX_use_PrivateKey_file + #define SSL_CTX_load_verify_locations wolfSSL_CTX_load_verify_locations + #define SSL_CTX_use_certificate_chain_file wolfSSL_CTX_use_certificate_chain_file + #define SSL_CTX_use_RSAPrivateKey_file wolfSSL_CTX_use_RSAPrivateKey_file - #define SSL_use_certificate_file CyaSSL_use_certificate_file - #define SSL_use_PrivateKey_file CyaSSL_use_PrivateKey_file - #define SSL_use_certificate_chain_file CyaSSL_use_certificate_chain_file - #define SSL_use_RSAPrivateKey_file CyaSSL_use_RSAPrivateKey_file + #define SSL_use_certificate_file wolfSSL_use_certificate_file + #define SSL_use_PrivateKey_file wolfSSL_use_PrivateKey_file + #define SSL_use_certificate_chain_file wolfSSL_use_certificate_chain_file + #define SSL_use_RSAPrivateKey_file wolfSSL_use_RSAPrivateKey_file #endif -#define SSL_CTX_new CyaSSL_CTX_new -#define SSL_new CyaSSL_new -#define SSL_set_fd CyaSSL_set_fd -#define SSL_get_fd CyaSSL_get_fd -#define SSL_connect CyaSSL_connect +#define SSL_CTX_new wolfSSL_CTX_new +#define SSL_new wolfSSL_new +#define SSL_set_fd wolfSSL_set_fd +#define SSL_get_fd wolfSSL_get_fd +#define SSL_connect wolfSSL_connect -#define SSL_write CyaSSL_write -#define SSL_read CyaSSL_read -#define SSL_peek CyaSSL_peek -#define SSL_accept CyaSSL_accept -#define SSL_CTX_free CyaSSL_CTX_free -#define SSL_free CyaSSL_free -#define SSL_shutdown CyaSSL_shutdown +#define SSL_write wolfSSL_write +#define SSL_read wolfSSL_read +#define SSL_peek wolfSSL_peek +#define SSL_accept wolfSSL_accept +#define SSL_CTX_free wolfSSL_CTX_free +#define SSL_free wolfSSL_free +#define SSL_shutdown wolfSSL_shutdown -#define SSL_CTX_set_quiet_shutdown CyaSSL_CTX_set_quiet_shutdown -#define SSL_set_quiet_shutdown CyaSSL_set_quiet_shutdown -#define SSL_get_error CyaSSL_get_error -#define SSL_set_session CyaSSL_set_session -#define SSL_get_session CyaSSL_get_session -#define SSL_flush_sessions CyaSSL_flush_sessions +#define SSL_CTX_set_quiet_shutdown wolfSSL_CTX_set_quiet_shutdown +#define SSL_set_quiet_shutdown wolfSSL_set_quiet_shutdown +#define SSL_get_error wolfSSL_get_error +#define SSL_set_session wolfSSL_set_session +#define SSL_get_session wolfSSL_get_session +#define SSL_flush_sessions wolfSSL_flush_sessions -#define SSL_CTX_set_verify CyaSSL_CTX_set_verify -#define SSL_set_verify CyaSSL_set_verify -#define SSL_pending CyaSSL_pending -#define SSL_load_error_strings CyaSSL_load_error_strings -#define SSL_library_init CyaSSL_library_init -#define SSL_CTX_set_session_cache_mode CyaSSL_CTX_set_session_cache_mode -#define SSL_CTX_set_cipher_list CyaSSL_CTX_set_cipher_list -#define SSL_set_cipher_list CyaSSL_set_cipher_list +#define SSL_CTX_set_verify wolfSSL_CTX_set_verify +#define SSL_set_verify wolfSSL_set_verify +#define SSL_pending wolfSSL_pending +#define SSL_load_error_strings wolfSSL_load_error_strings +#define SSL_library_init wolfSSL_library_init +#define SSL_CTX_set_session_cache_mode wolfSSL_CTX_set_session_cache_mode +#define SSL_CTX_set_cipher_list wolfSSL_CTX_set_cipher_list +#define SSL_set_cipher_list wolfSSL_set_cipher_list -#define ERR_error_string CyaSSL_ERR_error_string -#define ERR_error_string_n CyaSSL_ERR_error_string_n -#define ERR_reason_error_string CyaSSL_ERR_reason_error_string +#define ERR_error_string wolfSSL_ERR_error_string +#define ERR_error_string_n wolfSSL_ERR_error_string_n +#define ERR_reason_error_string wolfSSL_ERR_reason_error_string -#define SSL_set_ex_data CyaSSL_set_ex_data -#define SSL_get_shutdown CyaSSL_get_shutdown -#define SSL_set_rfd CyaSSL_set_rfd -#define SSL_set_wfd CyaSSL_set_wfd -#define SSL_set_shutdown CyaSSL_set_shutdown -#define SSL_set_session_id_context CyaSSL_set_session_id_context -#define SSL_set_connect_state CyaSSL_set_connect_state -#define SSL_set_accept_state CyaSSL_set_accept_state -#define SSL_session_reused CyaSSL_session_reused -#define SSL_SESSION_free CyaSSL_SESSION_free -#define SSL_is_init_finished CyaSSL_is_init_finished +#define SSL_set_ex_data wolfSSL_set_ex_data +#define SSL_get_shutdown wolfSSL_get_shutdown +#define SSL_set_rfd wolfSSL_set_rfd +#define SSL_set_wfd wolfSSL_set_wfd +#define SSL_set_shutdown wolfSSL_set_shutdown +#define SSL_set_session_id_context wolfSSL_set_session_id_context +#define SSL_set_connect_state wolfSSL_set_connect_state +#define SSL_set_accept_state wolfSSL_set_accept_state +#define SSL_session_reused wolfSSL_session_reused +#define SSL_SESSION_free wolfSSL_SESSION_free +#define SSL_is_init_finished wolfSSL_is_init_finished -#define SSL_get_version CyaSSL_get_version -#define SSL_get_current_cipher CyaSSL_get_current_cipher -#define SSL_get_cipher CyaSSL_get_cipher -#define SSL_CIPHER_description CyaSSL_CIPHER_description -#define SSL_CIPHER_get_name CyaSSL_CIPHER_get_name -#define SSL_get1_session CyaSSL_get1_session +#define SSL_get_version wolfSSL_get_version +#define SSL_get_current_cipher wolfSSL_get_current_cipher +#define SSL_get_cipher wolfSSL_get_cipher +#define SSL_CIPHER_description wolfSSL_CIPHER_description +#define SSL_CIPHER_get_name wolfSSL_CIPHER_get_name +#define SSL_get1_session wolfSSL_get1_session -#define SSL_get_keyblock_size CyaSSL_get_keyblock_size -#define SSL_get_keys CyaSSL_get_keys +#define SSL_get_keyblock_size wolfSSL_get_keyblock_size +#define SSL_get_keys wolfSSL_get_keys -#define X509_free CyaSSL_X509_free -#define OPENSSL_free CyaSSL_OPENSSL_free +#define X509_free wolfSSL_X509_free +#define OPENSSL_free wolfSSL_OPENSSL_free -#define OCSP_parse_url CyaSSL_OCSP_parse_url -#define SSLv23_client_method CyaSSLv23_client_method -#define SSLv2_client_method CyaSSLv2_client_method -#define SSLv2_server_method CyaSSLv2_server_method +#define OCSP_parse_url wolfSSL_OCSP_parse_url +#define SSLv23_client_method wolfSSLv23_client_method +#define SSLv2_client_method wolfSSLv2_client_method +#define SSLv2_server_method wolfSSLv2_server_method -#define MD4_Init CyaSSL_MD4_Init -#define MD4_Update CyaSSL_MD4_Update -#define MD4_Final CyaSSL_MD4_Final +#define MD4_Init wolfSSL_MD4_Init +#define MD4_Update wolfSSL_MD4_Update +#define MD4_Final wolfSSL_MD4_Final -#define BIO_new CyaSSL_BIO_new -#define BIO_free CyaSSL_BIO_free -#define BIO_free_all CyaSSL_BIO_free_all -#define BIO_read CyaSSL_BIO_read -#define BIO_write CyaSSL_BIO_write -#define BIO_push CyaSSL_BIO_push -#define BIO_pop CyaSSL_BIO_pop -#define BIO_flush CyaSSL_BIO_flush -#define BIO_pending CyaSSL_BIO_pending +#define BIO_new wolfSSL_BIO_new +#define BIO_free wolfSSL_BIO_free +#define BIO_free_all wolfSSL_BIO_free_all +#define BIO_read wolfSSL_BIO_read +#define BIO_write wolfSSL_BIO_write +#define BIO_push wolfSSL_BIO_push +#define BIO_pop wolfSSL_BIO_pop +#define BIO_flush wolfSSL_BIO_flush +#define BIO_pending wolfSSL_BIO_pending -#define BIO_get_mem_data CyaSSL_BIO_get_mem_data -#define BIO_new_mem_buf CyaSSL_BIO_new_mem_buf +#define BIO_get_mem_data wolfSSL_BIO_get_mem_data +#define BIO_new_mem_buf wolfSSL_BIO_new_mem_buf -#define BIO_f_buffer CyaSSL_BIO_f_buffer -#define BIO_set_write_buffer_size CyaSSL_BIO_set_write_buffer_size -#define BIO_f_ssl CyaSSL_BIO_f_ssl -#define BIO_new_socket CyaSSL_BIO_new_socket -#define SSL_set_bio CyaSSL_set_bio -#define BIO_eof CyaSSL_BIO_eof -#define BIO_set_ss CyaSSL_BIO_set_ss +#define BIO_f_buffer wolfSSL_BIO_f_buffer +#define BIO_set_write_buffer_size wolfSSL_BIO_set_write_buffer_size +#define BIO_f_ssl wolfSSL_BIO_f_ssl +#define BIO_new_socket wolfSSL_BIO_new_socket +#define SSL_set_bio wolfSSL_set_bio +#define BIO_eof wolfSSL_BIO_eof +#define BIO_set_ss wolfSSL_BIO_set_ss -#define BIO_s_mem CyaSSL_BIO_s_mem -#define BIO_f_base64 CyaSSL_BIO_f_base64 -#define BIO_set_flags CyaSSL_BIO_set_flags +#define BIO_s_mem wolfSSL_BIO_s_mem +#define BIO_f_base64 wolfSSL_BIO_f_base64 +#define BIO_set_flags wolfSSL_BIO_set_flags -#define OpenSSL_add_all_algorithms CyaSSL_add_all_algorithms -#define SSLeay_add_ssl_algorithms CyaSSL_add_all_algorithms -#define SSLeay_add_all_algorithms CyaSSL_add_all_algorithms +#define OpenSSL_add_all_algorithms wolfSSL_add_all_algorithms +#define SSLeay_add_ssl_algorithms wolfSSL_add_all_algorithms +#define SSLeay_add_all_algorithms wolfSSL_add_all_algorithms -#define RAND_screen CyaSSL_RAND_screen -#define RAND_file_name CyaSSL_RAND_file_name -#define RAND_write_file CyaSSL_RAND_write_file -#define RAND_load_file CyaSSL_RAND_load_file -#define RAND_egd CyaSSL_RAND_egd -#define RAND_seed CyaSSL_RAND_seed -#define RAND_add CyaSSL_RAND_add +#define RAND_screen wolfSSL_RAND_screen +#define RAND_file_name wolfSSL_RAND_file_name +#define RAND_write_file wolfSSL_RAND_write_file +#define RAND_load_file wolfSSL_RAND_load_file +#define RAND_egd wolfSSL_RAND_egd +#define RAND_seed wolfSSL_RAND_seed +#define RAND_add wolfSSL_RAND_add -#define COMP_zlib CyaSSL_COMP_zlib -#define COMP_rle CyaSSL_COMP_rle -#define SSL_COMP_add_compression_method CyaSSL_COMP_add_compression_method +#define COMP_zlib wolfSSL_COMP_zlib +#define COMP_rle wolfSSL_COMP_rle +#define SSL_COMP_add_compression_method wolfSSL_COMP_add_compression_method -#define SSL_get_ex_new_index CyaSSL_get_ex_new_index +#define SSL_get_ex_new_index wolfSSL_get_ex_new_index -#define CRYPTO_set_id_callback CyaSSL_set_id_callback -#define CRYPTO_set_locking_callback CyaSSL_set_locking_callback -#define CRYPTO_set_dynlock_create_callback CyaSSL_set_dynlock_create_callback -#define CRYPTO_set_dynlock_lock_callback CyaSSL_set_dynlock_lock_callback -#define CRYPTO_set_dynlock_destroy_callback CyaSSL_set_dynlock_destroy_callback -#define CRYPTO_num_locks CyaSSL_num_locks +#define CRYPTO_set_id_callback wolfSSL_set_id_callback +#define CRYPTO_set_locking_callback wolfSSL_set_locking_callback +#define CRYPTO_set_dynlock_create_callback wolfSSL_set_dynlock_create_callback +#define CRYPTO_set_dynlock_lock_callback wolfSSL_set_dynlock_lock_callback +#define CRYPTO_set_dynlock_destroy_callback wolfSSL_set_dynlock_destroy_callback +#define CRYPTO_num_locks wolfSSL_num_locks -#define X509_STORE_CTX_get_current_cert CyaSSL_X509_STORE_CTX_get_current_cert -#define X509_STORE_CTX_get_error CyaSSL_X509_STORE_CTX_get_error -#define X509_STORE_CTX_get_error_depth CyaSSL_X509_STORE_CTX_get_error_depth +#define X509_STORE_CTX_get_current_cert wolfSSL_X509_STORE_CTX_get_current_cert +#define X509_STORE_CTX_get_error wolfSSL_X509_STORE_CTX_get_error +#define X509_STORE_CTX_get_error_depth wolfSSL_X509_STORE_CTX_get_error_depth -#define X509_NAME_oneline CyaSSL_X509_NAME_oneline -#define X509_get_issuer_name CyaSSL_X509_get_issuer_name -#define X509_get_subject_name CyaSSL_X509_get_subject_name -#define X509_verify_cert_error_string CyaSSL_X509_verify_cert_error_string +#define X509_NAME_oneline wolfSSL_X509_NAME_oneline +#define X509_get_issuer_name wolfSSL_X509_get_issuer_name +#define X509_get_subject_name wolfSSL_X509_get_subject_name +#define X509_verify_cert_error_string wolfSSL_X509_verify_cert_error_string -#define X509_LOOKUP_add_dir CyaSSL_X509_LOOKUP_add_dir -#define X509_LOOKUP_load_file CyaSSL_X509_LOOKUP_load_file -#define X509_LOOKUP_hash_dir CyaSSL_X509_LOOKUP_hash_dir -#define X509_LOOKUP_file CyaSSL_X509_LOOKUP_file +#define X509_LOOKUP_add_dir wolfSSL_X509_LOOKUP_add_dir +#define X509_LOOKUP_load_file wolfSSL_X509_LOOKUP_load_file +#define X509_LOOKUP_hash_dir wolfSSL_X509_LOOKUP_hash_dir +#define X509_LOOKUP_file wolfSSL_X509_LOOKUP_file -#define X509_STORE_add_lookup CyaSSL_X509_STORE_add_lookup -#define X509_STORE_new CyaSSL_X509_STORE_new -#define X509_STORE_get_by_subject CyaSSL_X509_STORE_get_by_subject -#define X509_STORE_CTX_init CyaSSL_X509_STORE_CTX_init -#define X509_STORE_CTX_cleanup CyaSSL_X509_STORE_CTX_cleanup +#define X509_STORE_add_lookup wolfSSL_X509_STORE_add_lookup +#define X509_STORE_new wolfSSL_X509_STORE_new +#define X509_STORE_get_by_subject wolfSSL_X509_STORE_get_by_subject +#define X509_STORE_CTX_init wolfSSL_X509_STORE_CTX_init +#define X509_STORE_CTX_cleanup wolfSSL_X509_STORE_CTX_cleanup -#define X509_CRL_get_lastUpdate CyaSSL_X509_CRL_get_lastUpdate -#define X509_CRL_get_nextUpdate CyaSSL_X509_CRL_get_nextUpdate +#define X509_CRL_get_lastUpdate wolfSSL_X509_CRL_get_lastUpdate +#define X509_CRL_get_nextUpdate wolfSSL_X509_CRL_get_nextUpdate -#define X509_get_pubkey CyaSSL_X509_get_pubkey -#define X509_CRL_verify CyaSSL_X509_CRL_verify -#define X509_STORE_CTX_set_error CyaSSL_X509_STORE_CTX_set_error -#define X509_OBJECT_free_contents CyaSSL_X509_OBJECT_free_contents -#define EVP_PKEY_free CyaSSL_EVP_PKEY_free -#define X509_cmp_current_time CyaSSL_X509_cmp_current_time -#define sk_X509_REVOKED_num CyaSSL_sk_X509_REVOKED_num -#define X509_CRL_get_REVOKED CyaSSL_X509_CRL_get_REVOKED -#define sk_X509_REVOKED_value CyaSSL_sk_X509_REVOKED_value +#define X509_get_pubkey wolfSSL_X509_get_pubkey +#define X509_CRL_verify wolfSSL_X509_CRL_verify +#define X509_STORE_CTX_set_error wolfSSL_X509_STORE_CTX_set_error +#define X509_OBJECT_free_contents wolfSSL_X509_OBJECT_free_contents +#define EVP_PKEY_free wolfSSL_EVP_PKEY_free +#define X509_cmp_current_time wolfSSL_X509_cmp_current_time +#define sk_X509_REVOKED_num wolfSSL_sk_X509_REVOKED_num +#define X509_CRL_get_REVOKED wolfSSL_X509_CRL_get_REVOKED +#define sk_X509_REVOKED_value wolfSSL_sk_X509_REVOKED_value -#define X509_get_serialNumber CyaSSL_X509_get_serialNumber +#define X509_get_serialNumber wolfSSL_X509_get_serialNumber -#define ASN1_TIME_pr CyaSSL_ASN1_TIME_pr +#define ASN1_TIME_pr wolfSSL_ASN1_TIME_pr -#define ASN1_INTEGER_cmp CyaSSL_ASN1_INTEGER_cmp -#define ASN1_INTEGER_get CyaSSL_ASN1_INTEGER_get +#define ASN1_INTEGER_cmp wolfSSL_ASN1_INTEGER_cmp +#define ASN1_INTEGER_get wolfSSL_ASN1_INTEGER_get -#define SSL_load_client_CA_file CyaSSL_load_client_CA_file +#define SSL_load_client_CA_file wolfSSL_load_client_CA_file -#define SSL_CTX_set_client_CA_list CyaSSL_CTX_set_client_CA_list -#define X509_STORE_CTX_get_ex_data CyaSSL_X509_STORE_CTX_get_ex_data -#define SSL_get_ex_data_X509_STORE_CTX_idx CyaSSL_get_ex_data_X509_STORE_CTX_idx -#define SSL_get_ex_data CyaSSL_get_ex_data +#define SSL_CTX_set_client_CA_list wolfSSL_CTX_set_client_CA_list +#define X509_STORE_CTX_get_ex_data wolfSSL_X509_STORE_CTX_get_ex_data +#define SSL_get_ex_data_X509_STORE_CTX_idx wolfSSL_get_ex_data_X509_STORE_CTX_idx +#define SSL_get_ex_data wolfSSL_get_ex_data -#define SSL_CTX_set_default_passwd_cb_userdata CyaSSL_CTX_set_default_passwd_cb_userdata -#define SSL_CTX_set_default_passwd_cb CyaSSL_CTX_set_default_passwd_cb +#define SSL_CTX_set_default_passwd_cb_userdata wolfSSL_CTX_set_default_passwd_cb_userdata +#define SSL_CTX_set_default_passwd_cb wolfSSL_CTX_set_default_passwd_cb -#define SSL_CTX_set_timeout CyaSSL_CTX_set_timeout -#define SSL_CTX_set_info_callback CyaSSL_CTX_set_info_callback +#define SSL_CTX_set_timeout wolfSSL_CTX_set_timeout +#define SSL_CTX_set_info_callback wolfSSL_CTX_set_info_callback -#define ERR_peek_error CyaSSL_ERR_peek_error -#define ERR_GET_REASON CyaSSL_ERR_GET_REASON +#define ERR_peek_error wolfSSL_ERR_peek_error +#define ERR_GET_REASON wolfSSL_ERR_GET_REASON -#define SSL_alert_type_string CyaSSL_alert_type_string -#define SSL_alert_desc_string CyaSSL_alert_desc_string -#define SSL_state_string CyaSSL_state_string +#define SSL_alert_type_string wolfSSL_alert_type_string +#define SSL_alert_desc_string wolfSSL_alert_desc_string +#define SSL_state_string wolfSSL_state_string -#define RSA_free CyaSSL_RSA_free -#define RSA_generate_key CyaSSL_RSA_generate_key -#define SSL_CTX_set_tmp_rsa_callback CyaSSL_CTX_set_tmp_rsa_callback +#define RSA_free wolfSSL_RSA_free +#define RSA_generate_key wolfSSL_RSA_generate_key +#define SSL_CTX_set_tmp_rsa_callback wolfSSL_CTX_set_tmp_rsa_callback -#define PEM_def_callback CyaSSL_PEM_def_callback +#define PEM_def_callback wolfSSL_PEM_def_callback -#define SSL_CTX_sess_accept CyaSSL_CTX_sess_accept -#define SSL_CTX_sess_connect CyaSSL_CTX_sess_connect -#define SSL_CTX_sess_accept_good CyaSSL_CTX_sess_accept_good -#define SSL_CTX_sess_connect_good CyaSSL_CTX_sess_connect_good -#define SSL_CTX_sess_accept_renegotiate CyaSSL_CTX_sess_accept_renegotiate -#define SSL_CTX_sess_connect_renegotiate CyaSSL_CTX_sess_connect_renegotiate -#define SSL_CTX_sess_hits CyaSSL_CTX_sess_hits -#define SSL_CTX_sess_cb_hits CyaSSL_CTX_sess_cb_hits -#define SSL_CTX_sess_cache_full CyaSSL_CTX_sess_cache_full -#define SSL_CTX_sess_misses CyaSSL_CTX_sess_misses -#define SSL_CTX_sess_timeouts CyaSSL_CTX_sess_timeouts -#define SSL_CTX_sess_number CyaSSL_CTX_sess_number -#define SSL_CTX_sess_get_cache_size CyaSSL_CTX_sess_get_cache_size +#define SSL_CTX_sess_accept wolfSSL_CTX_sess_accept +#define SSL_CTX_sess_connect wolfSSL_CTX_sess_connect +#define SSL_CTX_sess_accept_good wolfSSL_CTX_sess_accept_good +#define SSL_CTX_sess_connect_good wolfSSL_CTX_sess_connect_good +#define SSL_CTX_sess_accept_renegotiate wolfSSL_CTX_sess_accept_renegotiate +#define SSL_CTX_sess_connect_renegotiate wolfSSL_CTX_sess_connect_renegotiate +#define SSL_CTX_sess_hits wolfSSL_CTX_sess_hits +#define SSL_CTX_sess_cb_hits wolfSSL_CTX_sess_cb_hits +#define SSL_CTX_sess_cache_full wolfSSL_CTX_sess_cache_full +#define SSL_CTX_sess_misses wolfSSL_CTX_sess_misses +#define SSL_CTX_sess_timeouts wolfSSL_CTX_sess_timeouts +#define SSL_CTX_sess_number wolfSSL_CTX_sess_number +#define SSL_CTX_sess_get_cache_size wolfSSL_CTX_sess_get_cache_size -#define SSL_DEFAULT_CIPHER_LIST CYASSL_DEFAULT_CIPHER_LIST -#define RSA_F4 CYASSL_RSA_F4 +#define SSL_DEFAULT_CIPHER_LIST WOLFSSL_DEFAULT_CIPHER_LIST +#define RSA_F4 WOLFSSL_RSA_F4 -#define SSL_CTX_set_psk_client_callback CyaSSL_CTX_set_psk_client_callback -#define SSL_set_psk_client_callback CyaSSL_set_psk_client_callback +#define SSL_CTX_set_psk_client_callback wolfSSL_CTX_set_psk_client_callback +#define SSL_set_psk_client_callback wolfSSL_set_psk_client_callback -#define SSL_get_psk_identity_hint CyaSSL_get_psk_identity_hint -#define SSL_get_psk_identity CyaSSL_get_psk_identity +#define SSL_get_psk_identity_hint wolfSSL_get_psk_identity_hint +#define SSL_get_psk_identity wolfSSL_get_psk_identity -#define SSL_CTX_use_psk_identity_hint CyaSSL_CTX_use_psk_identity_hint -#define SSL_use_psk_identity_hint CyaSSL_use_psk_identity_hint +#define SSL_CTX_use_psk_identity_hint wolfSSL_CTX_use_psk_identity_hint +#define SSL_use_psk_identity_hint wolfSSL_use_psk_identity_hint -#define SSL_CTX_set_psk_server_callback CyaSSL_CTX_set_psk_server_callback -#define SSL_set_psk_server_callback CyaSSL_set_psk_server_callback +#define SSL_CTX_set_psk_server_callback wolfSSL_CTX_set_psk_server_callback +#define SSL_set_psk_server_callback wolfSSL_set_psk_server_callback -#define ERR_get_error_line_data CyaSSL_ERR_get_error_line_data +#define ERR_get_error_line_data wolfSSL_ERR_get_error_line_data -#define ERR_get_error CyaSSL_ERR_get_error -#define ERR_clear_error CyaSSL_ERR_clear_error +#define ERR_get_error wolfSSL_ERR_get_error +#define ERR_clear_error wolfSSL_ERR_clear_error -#define RAND_status CyaSSL_RAND_status -#define RAND_bytes CyaSSL_RAND_bytes -#define SSLv23_server_method CyaSSLv23_server_method -#define SSL_CTX_set_options CyaSSL_CTX_set_options -#define SSL_CTX_check_private_key CyaSSL_CTX_check_private_key +#define RAND_status wolfSSL_RAND_status +#define RAND_bytes wolfSSL_RAND_bytes +#define SSLv23_server_method wolfSSLv23_server_method +#define SSL_CTX_set_options wolfSSL_CTX_set_options +#define SSL_CTX_check_private_key wolfSSL_CTX_check_private_key -#define ERR_free_strings CyaSSL_ERR_free_strings -#define ERR_remove_state CyaSSL_ERR_remove_state -#define EVP_cleanup CyaSSL_EVP_cleanup +#define ERR_free_strings wolfSSL_ERR_free_strings +#define ERR_remove_state wolfSSL_ERR_remove_state +#define EVP_cleanup wolfSSL_EVP_cleanup -#define CRYPTO_cleanup_all_ex_data CyaSSL_cleanup_all_ex_data -#define SSL_CTX_set_mode CyaSSL_CTX_set_mode -#define SSL_CTX_get_mode CyaSSL_CTX_get_mode -#define SSL_CTX_set_default_read_ahead CyaSSL_CTX_set_default_read_ahead +#define CRYPTO_cleanup_all_ex_data wolfSSL_cleanup_all_ex_data +#define SSL_CTX_set_mode wolfSSL_CTX_set_mode +#define SSL_CTX_get_mode wolfSSL_CTX_get_mode +#define SSL_CTX_set_default_read_ahead wolfSSL_CTX_set_default_read_ahead -#define SSL_CTX_sess_set_cache_size CyaSSL_CTX_sess_set_cache_size -#define SSL_CTX_set_default_verify_paths CyaSSL_CTX_set_default_verify_paths +#define SSL_CTX_sess_set_cache_size wolfSSL_CTX_sess_set_cache_size +#define SSL_CTX_set_default_verify_paths wolfSSL_CTX_set_default_verify_paths -#define SSL_CTX_set_session_id_context CyaSSL_CTX_set_session_id_context -#define SSL_get_peer_certificate CyaSSL_get_peer_certificate +#define SSL_CTX_set_session_id_context wolfSSL_CTX_set_session_id_context +#define SSL_get_peer_certificate wolfSSL_get_peer_certificate -#define SSL_want_read CyaSSL_want_read -#define SSL_want_write CyaSSL_want_write +#define SSL_want_read wolfSSL_want_read +#define SSL_want_write wolfSSL_want_write -#define BIO_prf CyaSSL_BIO_prf -#define ASN1_UTCTIME_pr CyaSSL_ASN1_UTCTIME_pr +#define BIO_prf wolfSSL_BIO_prf +#define ASN1_UTCTIME_pr wolfSSL_ASN1_UTCTIME_pr -#define sk_num CyaSSL_sk_num -#define sk_value CyaSSL_sk_value +#define sk_num wolfSSL_sk_num +#define sk_value wolfSSL_sk_value -#define SSL_CTX_get_ex_data CyaSSL_CTX_get_ex_data -#define SSL_CTX_set_ex_data CyaSSL_CTX_set_ex_data -#define SSL_CTX_sess_set_get_cb CyaSSL_CTX_sess_set_get_cb -#define SSL_CTX_sess_set_new_cb CyaSSL_CTX_sess_set_new_cb -#define SSL_CTX_sess_set_remove_cb CyaSSL_CTX_sess_set_remove_cb +#define SSL_CTX_get_ex_data wolfSSL_CTX_get_ex_data +#define SSL_CTX_set_ex_data wolfSSL_CTX_set_ex_data +#define SSL_CTX_sess_set_get_cb wolfSSL_CTX_sess_set_get_cb +#define SSL_CTX_sess_set_new_cb wolfSSL_CTX_sess_set_new_cb +#define SSL_CTX_sess_set_remove_cb wolfSSL_CTX_sess_set_remove_cb -#define i2d_SSL_SESSION CyaSSL_i2d_SSL_SESSION -#define d2i_SSL_SESSION CyaSSL_d2i_SSL_SESSION -#define SSL_SESSION_get_timeout CyaSSL_SESSION_get_timeout -#define SSL_SESSION_get_time CyaSSL_SESSION_get_time -#define SSL_CTX_get_ex_new_index CyaSSL_CTX_get_ex_new_index +#define i2d_SSL_SESSION wolfSSL_i2d_SSL_SESSION +#define d2i_SSL_SESSION wolfSSL_d2i_SSL_SESSION +#define SSL_SESSION_get_timeout wolfSSL_SESSION_get_timeout +#define SSL_SESSION_get_time wolfSSL_SESSION_get_time +#define SSL_CTX_get_ex_new_index wolfSSL_CTX_get_ex_new_index @@ -379,4 +382,4 @@ typedef CYASSL_X509_STORE_CTX X509_STORE_CTX; #endif -#endif /* CyaSSL_openssl_h__ */ +#endif /* wolfSSL_openssl_h__ */ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 5b869f326..1d74b9788 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -2,14 +2,14 @@ * * Copyright (C) 2006-2014 wolfSSL Inc. * - * This file is part of CyaSSL. + * This file is part of wolfSSL. * - * CyaSSL is free software; you can redistribute it and/or modify + * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * - * CyaSSL is distributed in the hope that it will be useful, + * wolfSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. @@ -20,10 +20,10 @@ */ -/* CyaSSL API */ +/* wolfSSL API */ -#ifndef CYASSL_SSL_H -#define CYASSL_SSL_H +#ifndef WOLFSSL_SSL_H +#define WOLFSSL_SSL_H /* for users not using preprocessor flags*/ @@ -48,8 +48,8 @@ #include "prefix_ssl.h" #endif -#ifdef LIBCYASSL_VERSION_STRING - #define CYASSL_VERSION LIBCYASSL_VERSION_STRING +#ifdef LIBWOLFSSL_VERSION_STRING + #define WOLFSSL_VERSION LIBWOLFSSL_VERSION_STRING #endif #ifdef _WIN32 @@ -64,40 +64,40 @@ extern "C" { #endif -typedef struct CYASSL CYASSL; -typedef struct CYASSL_SESSION CYASSL_SESSION; -typedef struct CYASSL_METHOD CYASSL_METHOD; -typedef struct CYASSL_CTX CYASSL_CTX; +typedef struct WOLFSSL WOLFSSL; +typedef struct WOLFSSL_SESSION WOLFSSL_SESSION; +typedef struct WOLFSSL_METHOD WOLFSSL_METHOD; +typedef struct WOLFSSL_CTX WOLFSSL_CTX; -typedef struct CYASSL_X509 CYASSL_X509; -typedef struct CYASSL_X509_NAME CYASSL_X509_NAME; -typedef struct CYASSL_X509_CHAIN CYASSL_X509_CHAIN; +typedef struct WOLFSSL_X509 WOLFSSL_X509; +typedef struct WOLFSSL_X509_NAME WOLFSSL_X509_NAME; +typedef struct WOLFSSL_X509_CHAIN WOLFSSL_X509_CHAIN; -typedef struct CYASSL_CERT_MANAGER CYASSL_CERT_MANAGER; -typedef struct CYASSL_SOCKADDR CYASSL_SOCKADDR; +typedef struct WOLFSSL_CERT_MANAGER WOLFSSL_CERT_MANAGER; +typedef struct WOLFSSL_SOCKADDR WOLFSSL_SOCKADDR; /* redeclare guard */ -#define CYASSL_TYPES_DEFINED +#define WOLFSSL_TYPES_DEFINED -typedef struct CYASSL_RSA CYASSL_RSA; -typedef struct CYASSL_DSA CYASSL_DSA; -typedef struct CYASSL_CIPHER CYASSL_CIPHER; -typedef struct CYASSL_X509_LOOKUP CYASSL_X509_LOOKUP; -typedef struct CYASSL_X509_LOOKUP_METHOD CYASSL_X509_LOOKUP_METHOD; -typedef struct CYASSL_X509_CRL CYASSL_X509_CRL; -typedef struct CYASSL_BIO CYASSL_BIO; -typedef struct CYASSL_BIO_METHOD CYASSL_BIO_METHOD; -typedef struct CYASSL_X509_EXTENSION CYASSL_X509_EXTENSION; -typedef struct CYASSL_ASN1_TIME CYASSL_ASN1_TIME; -typedef struct CYASSL_ASN1_INTEGER CYASSL_ASN1_INTEGER; -typedef struct CYASSL_ASN1_OBJECT CYASSL_ASN1_OBJECT; -typedef struct CYASSL_ASN1_STRING CYASSL_ASN1_STRING; -typedef struct CYASSL_dynlock_value CYASSL_dynlock_value; +typedef struct WOLFSSL_RSA WOLFSSL_RSA; +typedef struct WOLFSSL_DSA WOLFSSL_DSA; +typedef struct WOLFSSL_CIPHER WOLFSSL_CIPHER; +typedef struct WOLFSSL_X509_LOOKUP WOLFSSL_X509_LOOKUP; +typedef struct WOLFSSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD; +typedef struct WOLFSSL_X509_CRL WOLFSSL_X509_CRL; +typedef struct WOLFSSL_BIO WOLFSSL_BIO; +typedef struct WOLFSSL_BIO_METHOD WOLFSSL_BIO_METHOD; +typedef struct WOLFSSL_X509_EXTENSION WOLFSSL_X509_EXTENSION; +typedef struct WOLFSSL_ASN1_TIME WOLFSSL_ASN1_TIME; +typedef struct WOLFSSL_ASN1_INTEGER WOLFSSL_ASN1_INTEGER; +typedef struct WOLFSSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT; +typedef struct WOLFSSL_ASN1_STRING WOLFSSL_ASN1_STRING; +typedef struct WOLFSSL_dynlock_value WOLFSSL_dynlock_value; -#define CYASSL_ASN1_UTCTIME CYASSL_ASN1_TIME +#define WOLFSSL_ASN1_UTCTIME WOLFSSL_ASN1_TIME -typedef struct CYASSL_EVP_PKEY { +typedef struct WOLFSSL_EVP_PKEY { int type; /* openssh dereference */ int save_type; /* openssh dereference */ int pkey_sz; @@ -107,56 +107,56 @@ typedef struct CYASSL_EVP_PKEY { #ifdef HAVE_ECC int pkey_curve; #endif -} CYASSL_EVP_PKEY; +} WOLFSSL_EVP_PKEY; -typedef struct CYASSL_MD4_CTX { +typedef struct WOLFSSL_MD4_CTX { int buffer[32]; /* big enough to hold, check size in Init */ -} CYASSL_MD4_CTX; +} WOLFSSL_MD4_CTX; -typedef struct CYASSL_COMP_METHOD { +typedef struct WOLFSSL_COMP_METHOD { int type; /* stunnel dereference */ -} CYASSL_COMP_METHOD; +} WOLFSSL_COMP_METHOD; -typedef struct CYASSL_X509_STORE { +typedef struct WOLFSSL_X509_STORE { int cache; /* stunnel dereference */ - CYASSL_CERT_MANAGER* cm; -} CYASSL_X509_STORE; + WOLFSSL_CERT_MANAGER* cm; +} WOLFSSL_X509_STORE; -typedef struct CYASSL_ALERT { +typedef struct WOLFSSL_ALERT { int code; int level; -} CYASSL_ALERT; +} WOLFSSL_ALERT; -typedef struct CYASSL_ALERT_HISTORY { - CYASSL_ALERT last_rx; - CYASSL_ALERT last_tx; -} CYASSL_ALERT_HISTORY; +typedef struct WOLFSSL_ALERT_HISTORY { + WOLFSSL_ALERT last_rx; + WOLFSSL_ALERT last_tx; +} WOLFSSL_ALERT_HISTORY; -typedef struct CYASSL_X509_REVOKED { - CYASSL_ASN1_INTEGER* serialNumber; /* stunnel dereference */ -} CYASSL_X509_REVOKED; +typedef struct WOLFSSL_X509_REVOKED { + WOLFSSL_ASN1_INTEGER* serialNumber; /* stunnel dereference */ +} WOLFSSL_X509_REVOKED; -typedef struct CYASSL_X509_OBJECT { +typedef struct WOLFSSL_X509_OBJECT { union { char* ptr; - CYASSL_X509_CRL* crl; /* stunnel dereference */ + WOLFSSL_X509_CRL* crl; /* stunnel dereference */ } data; -} CYASSL_X509_OBJECT; +} WOLFSSL_X509_OBJECT; -typedef struct CYASSL_X509_STORE_CTX { - CYASSL_X509_STORE* store; /* Store full of a CA cert chain */ - CYASSL_X509* current_cert; /* stunnel dereference */ +typedef struct WOLFSSL_X509_STORE_CTX { + WOLFSSL_X509_STORE* store; /* Store full of a CA cert chain */ + WOLFSSL_X509* current_cert; /* stunnel dereference */ char* domain; /* subject CN domain name */ void* ex_data; /* external data, for fortress build */ void* userCtx; /* user ctx */ int error; /* current error */ int error_depth; /* cert depth for this error */ int discardSessionCerts; /* so verify callback can flag for discard */ -} CYASSL_X509_STORE_CTX; +} WOLFSSL_X509_STORE_CTX; /* Valid Alert types from page 16/17 */ @@ -187,363 +187,363 @@ enum AlertLevel { }; -CYASSL_API CYASSL_METHOD *wolfSSLv3_server_method(void); -CYASSL_API CYASSL_METHOD *wolfSSLv3_client_method(void); -CYASSL_API CYASSL_METHOD *wolfTLSv1_server_method(void); -CYASSL_API CYASSL_METHOD *wolfTLSv1_client_method(void); -CYASSL_API CYASSL_METHOD *wolfTLSv1_1_server_method(void); -CYASSL_API CYASSL_METHOD *wolfTLSv1_1_client_method(void); -CYASSL_API CYASSL_METHOD *wolfTLSv1_2_server_method(void); -CYASSL_API CYASSL_METHOD *wolfTLSv1_2_client_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method(void); +WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method(void); -#ifdef CYASSL_DTLS - CYASSL_API CYASSL_METHOD *wolfDTLSv1_client_method(void); - CYASSL_API CYASSL_METHOD *wolfDTLSv1_server_method(void); - CYASSL_API CYASSL_METHOD *wolfDTLSv1_2_client_method(void); - CYASSL_API CYASSL_METHOD *wolfDTLSv1_2_server_method(void); +#ifdef WOLFSSL_DTLS + WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method(void); + WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method(void); + WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method(void); + WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method(void); #endif #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) -CYASSL_API int CyaSSL_CTX_use_certificate_file(CYASSL_CTX*, const char*, int); -CYASSL_API int CyaSSL_CTX_use_PrivateKey_file(CYASSL_CTX*, const char*, int); -CYASSL_API int CyaSSL_CTX_load_verify_locations(CYASSL_CTX*, const char*, +WOLFSSL_API int wolfSSL_CTX_use_certificate_file(WOLFSSL_CTX*, const char*, int); +WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX*, const char*, int); +WOLFSSL_API int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX*, const char*, const char*); -CYASSL_API int CyaSSL_CTX_use_certificate_chain_file(CYASSL_CTX *, +WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file(WOLFSSL_CTX *, const char *file); -CYASSL_API int CyaSSL_CTX_use_RSAPrivateKey_file(CYASSL_CTX*, const char*, int); +WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey_file(WOLFSSL_CTX*, const char*, int); -CYASSL_API int CyaSSL_use_certificate_file(CYASSL*, const char*, int); -CYASSL_API int CyaSSL_use_PrivateKey_file(CYASSL*, const char*, int); -CYASSL_API int CyaSSL_use_certificate_chain_file(CYASSL*, const char *file); -CYASSL_API int CyaSSL_use_RSAPrivateKey_file(CYASSL*, const char*, int); +WOLFSSL_API int wolfSSL_use_certificate_file(WOLFSSL*, const char*, int); +WOLFSSL_API int wolfSSL_use_PrivateKey_file(WOLFSSL*, const char*, int); +WOLFSSL_API int wolfSSL_use_certificate_chain_file(WOLFSSL*, const char *file); +WOLFSSL_API int wolfSSL_use_RSAPrivateKey_file(WOLFSSL*, const char*, int); -#ifdef CYASSL_DER_LOAD - CYASSL_API int CyaSSL_CTX_der_load_verify_locations(CYASSL_CTX*, +#ifdef WOLFSSL_DER_LOAD + WOLFSSL_API int wolfSSL_CTX_der_load_verify_locations(WOLFSSL_CTX*, const char*, int); #endif #ifdef HAVE_POLY1305 - CYASSL_API int CyaSSL_use_old_poly(CYASSL*, int); + WOLFSSL_API int wolfSSL_use_old_poly(WOLFSSL*, int); #endif #ifdef HAVE_NTRU - CYASSL_API int CyaSSL_CTX_use_NTRUPrivateKey_file(CYASSL_CTX*, const char*); + WOLFSSL_API int wolfSSL_CTX_use_NTRUPrivateKey_file(WOLFSSL_CTX*, const char*); /* load NTRU private key blob */ #endif -#ifndef CYASSL_PEMCERT_TODER_DEFINED - CYASSL_API int CyaSSL_PemCertToDer(const char*, unsigned char*, int); - #define CYASSL_PEMCERT_TODER_DEFINED +#ifndef WOLFSSL_PEMCERT_TODER_DEFINED + WOLFSSL_API int wolfSSL_PemCertToDer(const char*, unsigned char*, int); + #define WOLFSSL_PEMCERT_TODER_DEFINED #endif #endif /* !NO_FILESYSTEM && !NO_CERTS */ -CYASSL_API CYASSL_CTX* CyaSSL_CTX_new(CYASSL_METHOD*); -CYASSL_API CYASSL* CyaSSL_new(CYASSL_CTX*); -CYASSL_API int CyaSSL_set_fd (CYASSL*, int); -CYASSL_API int CyaSSL_get_ciphers(char*, int); -CYASSL_API int CyaSSL_get_fd(const CYASSL*); -CYASSL_API void CyaSSL_set_using_nonblock(CYASSL*, int); -CYASSL_API int CyaSSL_get_using_nonblock(CYASSL*); -CYASSL_API int CyaSSL_connect(CYASSL*); /* please see note at top of README +WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD*); +WOLFSSL_API WOLFSSL* wolfSSL_new(WOLFSSL_CTX*); +WOLFSSL_API int wolfSSL_set_fd (WOLFSSL*, int); +WOLFSSL_API int wolfSSL_get_ciphers(char*, int); +WOLFSSL_API int wolfSSL_get_fd(const WOLFSSL*); +WOLFSSL_API void wolfSSL_set_using_nonblock(WOLFSSL*, int); +WOLFSSL_API int wolfSSL_get_using_nonblock(WOLFSSL*); +WOLFSSL_API int wolfSSL_connect(WOLFSSL*); /* please see note at top of README if you get an error from connect */ -CYASSL_API int CyaSSL_write(CYASSL*, const void*, int); -CYASSL_API int CyaSSL_read(CYASSL*, void*, int); -CYASSL_API int CyaSSL_peek(CYASSL*, void*, int); -CYASSL_API int CyaSSL_accept(CYASSL*); -CYASSL_API void CyaSSL_CTX_free(CYASSL_CTX*); -CYASSL_API void CyaSSL_free(CYASSL*); -CYASSL_API int CyaSSL_shutdown(CYASSL*); -CYASSL_API int CyaSSL_send(CYASSL*, const void*, int sz, int flags); -CYASSL_API int CyaSSL_recv(CYASSL*, void*, int sz, int flags); +WOLFSSL_API int wolfSSL_write(WOLFSSL*, const void*, int); +WOLFSSL_API int wolfSSL_read(WOLFSSL*, void*, int); +WOLFSSL_API int wolfSSL_peek(WOLFSSL*, void*, int); +WOLFSSL_API int wolfSSL_accept(WOLFSSL*); +WOLFSSL_API void wolfSSL_CTX_free(WOLFSSL_CTX*); +WOLFSSL_API void wolfSSL_free(WOLFSSL*); +WOLFSSL_API int wolfSSL_shutdown(WOLFSSL*); +WOLFSSL_API int wolfSSL_send(WOLFSSL*, const void*, int sz, int flags); +WOLFSSL_API int wolfSSL_recv(WOLFSSL*, void*, int sz, int flags); -CYASSL_API void CyaSSL_CTX_set_quiet_shutdown(CYASSL_CTX*, int); -CYASSL_API void CyaSSL_set_quiet_shutdown(CYASSL*, int); +WOLFSSL_API void wolfSSL_CTX_set_quiet_shutdown(WOLFSSL_CTX*, int); +WOLFSSL_API void wolfSSL_set_quiet_shutdown(WOLFSSL*, int); -CYASSL_API int CyaSSL_get_error(CYASSL*, int); -CYASSL_API int CyaSSL_get_alert_history(CYASSL*, CYASSL_ALERT_HISTORY *); +WOLFSSL_API int wolfSSL_get_error(WOLFSSL*, int); +WOLFSSL_API int wolfSSL_get_alert_history(WOLFSSL*, WOLFSSL_ALERT_HISTORY *); -CYASSL_API int CyaSSL_set_session(CYASSL* ssl,CYASSL_SESSION* session); -CYASSL_API CYASSL_SESSION* CyaSSL_get_session(CYASSL* ssl); -CYASSL_API void CyaSSL_flush_sessions(CYASSL_CTX *ctx, long tm); -CYASSL_API int CyaSSL_SetServerID(CYASSL* ssl, const unsigned char*, +WOLFSSL_API int wolfSSL_set_session(WOLFSSL* ssl,WOLFSSL_SESSION* session); +WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get_session(WOLFSSL* ssl); +WOLFSSL_API void wolfSSL_flush_sessions(WOLFSSL_CTX *ctx, long tm); +WOLFSSL_API int wolfSSL_SetServerID(WOLFSSL* ssl, const unsigned char*, int, int); #ifdef SESSION_INDEX -CYASSL_API int CyaSSL_GetSessionIndex(CYASSL* ssl); -CYASSL_API int CyaSSL_GetSessionAtIndex(int index, CYASSL_SESSION* session); +WOLFSSL_API int wolfSSL_GetSessionIndex(WOLFSSL* ssl); +WOLFSSL_API int wolfSSL_GetSessionAtIndex(int index, WOLFSSL_SESSION* session); #endif /* SESSION_INDEX */ #if defined(SESSION_INDEX) && defined(SESSION_CERTS) -CYASSL_API - CYASSL_X509_CHAIN* CyaSSL_SESSION_get_peer_chain(CYASSL_SESSION* session); +WOLFSSL_API + WOLFSSL_X509_CHAIN* wolfSSL_SESSION_get_peer_chain(WOLFSSL_SESSION* session); #endif /* SESSION_INDEX && SESSION_CERTS */ -typedef int (*VerifyCallback)(int, CYASSL_X509_STORE_CTX*); +typedef int (*VerifyCallback)(int, WOLFSSL_X509_STORE_CTX*); typedef int (*pem_password_cb)(char*, int, int, void*); -CYASSL_API void CyaSSL_CTX_set_verify(CYASSL_CTX*, int, +WOLFSSL_API void wolfSSL_CTX_set_verify(WOLFSSL_CTX*, int, VerifyCallback verify_callback); -CYASSL_API void CyaSSL_set_verify(CYASSL*, int, VerifyCallback verify_callback); -CYASSL_API void CyaSSL_SetCertCbCtx(CYASSL*, void*); +WOLFSSL_API void wolfSSL_set_verify(WOLFSSL*, int, VerifyCallback verify_callback); +WOLFSSL_API void wolfSSL_SetCertCbCtx(WOLFSSL*, void*); -CYASSL_API int CyaSSL_pending(CYASSL*); +WOLFSSL_API int wolfSSL_pending(WOLFSSL*); -CYASSL_API void CyaSSL_load_error_strings(void); -CYASSL_API int CyaSSL_library_init(void); -CYASSL_API long CyaSSL_CTX_set_session_cache_mode(CYASSL_CTX*, long); +WOLFSSL_API void wolfSSL_load_error_strings(void); +WOLFSSL_API int wolfSSL_library_init(void); +WOLFSSL_API long wolfSSL_CTX_set_session_cache_mode(WOLFSSL_CTX*, long); #ifdef HAVE_SECRET_CALLBACK -typedef int (*SessionSecretCb)(CYASSL* ssl, +typedef int (*SessionSecretCb)(WOLFSSL* ssl, void* secret, int* secretSz, void* ctx); -CYASSL_API int CyaSSL_set_session_secret_cb(CYASSL*, SessionSecretCb, void*); +WOLFSSL_API int wolfSSL_set_session_secret_cb(WOLFSSL*, SessionSecretCb, void*); #endif /* HAVE_SECRET_CALLBACK */ /* session cache persistence */ -CYASSL_API int CyaSSL_save_session_cache(const char*); -CYASSL_API int CyaSSL_restore_session_cache(const char*); -CYASSL_API int CyaSSL_memsave_session_cache(void*, int); -CYASSL_API int CyaSSL_memrestore_session_cache(const void*, int); -CYASSL_API int CyaSSL_get_session_cache_memsize(void); +WOLFSSL_API int wolfSSL_save_session_cache(const char*); +WOLFSSL_API int wolfSSL_restore_session_cache(const char*); +WOLFSSL_API int wolfSSL_memsave_session_cache(void*, int); +WOLFSSL_API int wolfSSL_memrestore_session_cache(const void*, int); +WOLFSSL_API int wolfSSL_get_session_cache_memsize(void); /* certificate cache persistence, uses ctx since certs are per ctx */ -CYASSL_API int CyaSSL_CTX_save_cert_cache(CYASSL_CTX*, const char*); -CYASSL_API int CyaSSL_CTX_restore_cert_cache(CYASSL_CTX*, const char*); -CYASSL_API int CyaSSL_CTX_memsave_cert_cache(CYASSL_CTX*, void*, int, int*); -CYASSL_API int CyaSSL_CTX_memrestore_cert_cache(CYASSL_CTX*, const void*, int); -CYASSL_API int CyaSSL_CTX_get_cert_cache_memsize(CYASSL_CTX*); +WOLFSSL_API int wolfSSL_CTX_save_cert_cache(WOLFSSL_CTX*, const char*); +WOLFSSL_API int wolfSSL_CTX_restore_cert_cache(WOLFSSL_CTX*, const char*); +WOLFSSL_API int wolfSSL_CTX_memsave_cert_cache(WOLFSSL_CTX*, void*, int, int*); +WOLFSSL_API int wolfSSL_CTX_memrestore_cert_cache(WOLFSSL_CTX*, const void*, int); +WOLFSSL_API int wolfSSL_CTX_get_cert_cache_memsize(WOLFSSL_CTX*); /* only supports full name from cipher_name[] delimited by : */ -CYASSL_API int CyaSSL_CTX_set_cipher_list(CYASSL_CTX*, const char*); -CYASSL_API int CyaSSL_set_cipher_list(CYASSL*, const char*); +WOLFSSL_API int wolfSSL_CTX_set_cipher_list(WOLFSSL_CTX*, const char*); +WOLFSSL_API int wolfSSL_set_cipher_list(WOLFSSL*, const char*); /* Nonblocking DTLS helper functions */ -CYASSL_API int CyaSSL_dtls_get_current_timeout(CYASSL* ssl); -CYASSL_API int CyaSSL_dtls_set_timeout_init(CYASSL* ssl, int); -CYASSL_API int CyaSSL_dtls_set_timeout_max(CYASSL* ssl, int); -CYASSL_API int CyaSSL_dtls_got_timeout(CYASSL* ssl); -CYASSL_API int CyaSSL_dtls(CYASSL* ssl); +WOLFSSL_API int wolfSSL_dtls_get_current_timeout(WOLFSSL* ssl); +WOLFSSL_API int wolfSSL_dtls_set_timeout_init(WOLFSSL* ssl, int); +WOLFSSL_API int wolfSSL_dtls_set_timeout_max(WOLFSSL* ssl, int); +WOLFSSL_API int wolfSSL_dtls_got_timeout(WOLFSSL* ssl); +WOLFSSL_API int wolfSSL_dtls(WOLFSSL* ssl); -CYASSL_API int CyaSSL_dtls_set_peer(CYASSL*, void*, unsigned int); -CYASSL_API int CyaSSL_dtls_get_peer(CYASSL*, void*, unsigned int*); +WOLFSSL_API int wolfSSL_dtls_set_peer(WOLFSSL*, void*, unsigned int); +WOLFSSL_API int wolfSSL_dtls_get_peer(WOLFSSL*, void*, unsigned int*); -CYASSL_API int CyaSSL_ERR_GET_REASON(int err); -CYASSL_API char* CyaSSL_ERR_error_string(unsigned long,char*); -CYASSL_API void CyaSSL_ERR_error_string_n(unsigned long e, char* buf, +WOLFSSL_API int wolfSSL_ERR_GET_REASON(int err); +WOLFSSL_API char* wolfSSL_ERR_error_string(unsigned long,char*); +WOLFSSL_API void wolfSSL_ERR_error_string_n(unsigned long e, char* buf, unsigned long sz); -CYASSL_API const char* CyaSSL_ERR_reason_error_string(unsigned long); +WOLFSSL_API const char* wolfSSL_ERR_reason_error_string(unsigned long); /* extras */ #define STACK_OF(x) x -CYASSL_API int CyaSSL_set_ex_data(CYASSL*, int, void*); -CYASSL_API int CyaSSL_get_shutdown(const CYASSL*); -CYASSL_API int CyaSSL_set_rfd(CYASSL*, int); -CYASSL_API int CyaSSL_set_wfd(CYASSL*, int); -CYASSL_API void CyaSSL_set_shutdown(CYASSL*, int); -CYASSL_API int CyaSSL_set_session_id_context(CYASSL*, const unsigned char*, +WOLFSSL_API int wolfSSL_set_ex_data(WOLFSSL*, int, void*); +WOLFSSL_API int wolfSSL_get_shutdown(const WOLFSSL*); +WOLFSSL_API int wolfSSL_set_rfd(WOLFSSL*, int); +WOLFSSL_API int wolfSSL_set_wfd(WOLFSSL*, int); +WOLFSSL_API void wolfSSL_set_shutdown(WOLFSSL*, int); +WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL*, const unsigned char*, unsigned int); -CYASSL_API void CyaSSL_set_connect_state(CYASSL*); -CYASSL_API void CyaSSL_set_accept_state(CYASSL*); -CYASSL_API int CyaSSL_session_reused(CYASSL*); -CYASSL_API void CyaSSL_SESSION_free(CYASSL_SESSION* session); -CYASSL_API int CyaSSL_is_init_finished(CYASSL*); +WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL*); +WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL*); +WOLFSSL_API int wolfSSL_session_reused(WOLFSSL*); +WOLFSSL_API void wolfSSL_SESSION_free(WOLFSSL_SESSION* session); +WOLFSSL_API int wolfSSL_is_init_finished(WOLFSSL*); -CYASSL_API const char* CyaSSL_get_version(CYASSL*); -CYASSL_API int CyaSSL_get_current_cipher_suite(CYASSL* ssl); -CYASSL_API CYASSL_CIPHER* CyaSSL_get_current_cipher(CYASSL*); -CYASSL_API char* CyaSSL_CIPHER_description(CYASSL_CIPHER*, char*, int); -CYASSL_API const char* CyaSSL_CIPHER_get_name(const CYASSL_CIPHER* cipher); -CYASSL_API const char* CyaSSL_get_cipher(CYASSL*); -CYASSL_API CYASSL_SESSION* CyaSSL_get1_session(CYASSL* ssl); +WOLFSSL_API const char* wolfSSL_get_version(WOLFSSL*); +WOLFSSL_API int wolfSSL_get_current_cipher_suite(WOLFSSL* ssl); +WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_get_current_cipher(WOLFSSL*); +WOLFSSL_API char* wolfSSL_CIPHER_description(WOLFSSL_CIPHER*, char*, int); +WOLFSSL_API const char* wolfSSL_CIPHER_get_name(const WOLFSSL_CIPHER* cipher); +WOLFSSL_API const char* wolfSSL_get_cipher(WOLFSSL*); +WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get1_session(WOLFSSL* ssl); /* what's ref count */ -CYASSL_API void CyaSSL_X509_free(CYASSL_X509*); -CYASSL_API void CyaSSL_OPENSSL_free(void*); +WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509*); +WOLFSSL_API void wolfSSL_OPENSSL_free(void*); -CYASSL_API int CyaSSL_OCSP_parse_url(char* url, char** host, char** port, +WOLFSSL_API int wolfSSL_OCSP_parse_url(char* url, char** host, char** port, char** path, int* ssl); -CYASSL_API CYASSL_METHOD* CyaSSLv23_client_method(void); -CYASSL_API CYASSL_METHOD* CyaSSLv2_client_method(void); -CYASSL_API CYASSL_METHOD* CyaSSLv2_server_method(void); +WOLFSSL_API WOLFSSL_METHOD* wolfSSLv23_client_method(void); +WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_client_method(void); +WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_server_method(void); -CYASSL_API void CyaSSL_MD4_Init(CYASSL_MD4_CTX*); -CYASSL_API void CyaSSL_MD4_Update(CYASSL_MD4_CTX*, const void*, unsigned long); -CYASSL_API void CyaSSL_MD4_Final(unsigned char*, CYASSL_MD4_CTX*); +WOLFSSL_API void wolfSSL_MD4_Init(WOLFSSL_MD4_CTX*); +WOLFSSL_API void wolfSSL_MD4_Update(WOLFSSL_MD4_CTX*, const void*, unsigned long); +WOLFSSL_API void wolfSSL_MD4_Final(unsigned char*, WOLFSSL_MD4_CTX*); -CYASSL_API CYASSL_BIO* CyaSSL_BIO_new(CYASSL_BIO_METHOD*); -CYASSL_API int CyaSSL_BIO_free(CYASSL_BIO*); -CYASSL_API int CyaSSL_BIO_free_all(CYASSL_BIO*); -CYASSL_API int CyaSSL_BIO_read(CYASSL_BIO*, void*, int); -CYASSL_API int CyaSSL_BIO_write(CYASSL_BIO*, const void*, int); -CYASSL_API CYASSL_BIO* CyaSSL_BIO_push(CYASSL_BIO*, CYASSL_BIO* append); -CYASSL_API CYASSL_BIO* CyaSSL_BIO_pop(CYASSL_BIO*); -CYASSL_API int CyaSSL_BIO_flush(CYASSL_BIO*); -CYASSL_API int CyaSSL_BIO_pending(CYASSL_BIO*); +WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new(WOLFSSL_BIO_METHOD*); +WOLFSSL_API int wolfSSL_BIO_free(WOLFSSL_BIO*); +WOLFSSL_API int wolfSSL_BIO_free_all(WOLFSSL_BIO*); +WOLFSSL_API int wolfSSL_BIO_read(WOLFSSL_BIO*, void*, int); +WOLFSSL_API int wolfSSL_BIO_write(WOLFSSL_BIO*, const void*, int); +WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_push(WOLFSSL_BIO*, WOLFSSL_BIO* append); +WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_pop(WOLFSSL_BIO*); +WOLFSSL_API int wolfSSL_BIO_flush(WOLFSSL_BIO*); +WOLFSSL_API int wolfSSL_BIO_pending(WOLFSSL_BIO*); -CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_buffer(void); -CYASSL_API long CyaSSL_BIO_set_write_buffer_size(CYASSL_BIO*, long size); -CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_ssl(void); -CYASSL_API CYASSL_BIO* CyaSSL_BIO_new_socket(int sfd, int flag); -CYASSL_API int CyaSSL_BIO_eof(CYASSL_BIO*); +WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_buffer(void); +WOLFSSL_API long wolfSSL_BIO_set_write_buffer_size(WOLFSSL_BIO*, long size); +WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_ssl(void); +WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_socket(int sfd, int flag); +WOLFSSL_API int wolfSSL_BIO_eof(WOLFSSL_BIO*); -CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_s_mem(void); -CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_base64(void); -CYASSL_API void CyaSSL_BIO_set_flags(CYASSL_BIO*, int); +WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_s_mem(void); +WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_base64(void); +WOLFSSL_API void wolfSSL_BIO_set_flags(WOLFSSL_BIO*, int); -CYASSL_API int CyaSSL_BIO_get_mem_data(CYASSL_BIO* bio,const unsigned char** p); -CYASSL_API CYASSL_BIO* CyaSSL_BIO_new_mem_buf(void* buf, int len); +WOLFSSL_API int wolfSSL_BIO_get_mem_data(WOLFSSL_BIO* bio,const unsigned char** p); +WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_mem_buf(void* buf, int len); -CYASSL_API long CyaSSL_BIO_set_ssl(CYASSL_BIO*, CYASSL*, int flag); -CYASSL_API void CyaSSL_set_bio(CYASSL*, CYASSL_BIO* rd, CYASSL_BIO* wr); +WOLFSSL_API long wolfSSL_BIO_set_ssl(WOLFSSL_BIO*, WOLFSSL*, int flag); +WOLFSSL_API void wolfSSL_set_bio(WOLFSSL*, WOLFSSL_BIO* rd, WOLFSSL_BIO* wr); -CYASSL_API int CyaSSL_add_all_algorithms(void); +WOLFSSL_API int wolfSSL_add_all_algorithms(void); -CYASSL_API void CyaSSL_RAND_screen(void); -CYASSL_API const char* CyaSSL_RAND_file_name(char*, unsigned long); -CYASSL_API int CyaSSL_RAND_write_file(const char*); -CYASSL_API int CyaSSL_RAND_load_file(const char*, long); -CYASSL_API int CyaSSL_RAND_egd(const char*); -CYASSL_API int CyaSSL_RAND_seed(const void*, int); -CYASSL_API void CyaSSL_RAND_add(const void*, int, double); +WOLFSSL_API void wolfSSL_RAND_screen(void); +WOLFSSL_API const char* wolfSSL_RAND_file_name(char*, unsigned long); +WOLFSSL_API int wolfSSL_RAND_write_file(const char*); +WOLFSSL_API int wolfSSL_RAND_load_file(const char*, long); +WOLFSSL_API int wolfSSL_RAND_egd(const char*); +WOLFSSL_API int wolfSSL_RAND_seed(const void*, int); +WOLFSSL_API void wolfSSL_RAND_add(const void*, int, double); -CYASSL_API CYASSL_COMP_METHOD* CyaSSL_COMP_zlib(void); -CYASSL_API CYASSL_COMP_METHOD* CyaSSL_COMP_rle(void); -CYASSL_API int CyaSSL_COMP_add_compression_method(int, void*); +WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_zlib(void); +WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_rle(void); +WOLFSSL_API int wolfSSL_COMP_add_compression_method(int, void*); -CYASSL_API int CyaSSL_get_ex_new_index(long, void*, void*, void*, void*); +WOLFSSL_API int wolfSSL_get_ex_new_index(long, void*, void*, void*, void*); -CYASSL_API void CyaSSL_set_id_callback(unsigned long (*f)(void)); -CYASSL_API void CyaSSL_set_locking_callback(void (*f)(int, int, const char*, +WOLFSSL_API void wolfSSL_set_id_callback(unsigned long (*f)(void)); +WOLFSSL_API void wolfSSL_set_locking_callback(void (*f)(int, int, const char*, int)); -CYASSL_API void CyaSSL_set_dynlock_create_callback(CYASSL_dynlock_value* (*f) +WOLFSSL_API void wolfSSL_set_dynlock_create_callback(WOLFSSL_dynlock_value* (*f) (const char*, int)); -CYASSL_API void CyaSSL_set_dynlock_lock_callback(void (*f)(int, - CYASSL_dynlock_value*, const char*, int)); -CYASSL_API void CyaSSL_set_dynlock_destroy_callback(void (*f) - (CYASSL_dynlock_value*, const char*, int)); -CYASSL_API int CyaSSL_num_locks(void); +WOLFSSL_API void wolfSSL_set_dynlock_lock_callback(void (*f)(int, + WOLFSSL_dynlock_value*, const char*, int)); +WOLFSSL_API void wolfSSL_set_dynlock_destroy_callback(void (*f) + (WOLFSSL_dynlock_value*, const char*, int)); +WOLFSSL_API int wolfSSL_num_locks(void); -CYASSL_API CYASSL_X509* CyaSSL_X509_STORE_CTX_get_current_cert( - CYASSL_X509_STORE_CTX*); -CYASSL_API int CyaSSL_X509_STORE_CTX_get_error(CYASSL_X509_STORE_CTX*); -CYASSL_API int CyaSSL_X509_STORE_CTX_get_error_depth(CYASSL_X509_STORE_CTX*); +WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_STORE_CTX_get_current_cert( + WOLFSSL_X509_STORE_CTX*); +WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error(WOLFSSL_X509_STORE_CTX*); +WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error_depth(WOLFSSL_X509_STORE_CTX*); -CYASSL_API char* CyaSSL_X509_NAME_oneline(CYASSL_X509_NAME*, char*, int); -CYASSL_API CYASSL_X509_NAME* CyaSSL_X509_get_issuer_name(CYASSL_X509*); -CYASSL_API CYASSL_X509_NAME* CyaSSL_X509_get_subject_name(CYASSL_X509*); -CYASSL_API int CyaSSL_X509_ext_isSet_by_NID(CYASSL_X509*, int); -CYASSL_API int CyaSSL_X509_ext_get_critical_by_NID(CYASSL_X509*, int); -CYASSL_API int CyaSSL_X509_get_isCA(CYASSL_X509*); -CYASSL_API int CyaSSL_X509_get_isSet_pathLength(CYASSL_X509*); -CYASSL_API unsigned int CyaSSL_X509_get_pathLength(CYASSL_X509*); -CYASSL_API unsigned int CyaSSL_X509_get_keyUsage(CYASSL_X509*); -CYASSL_API unsigned char* CyaSSL_X509_get_authorityKeyID( - CYASSL_X509*, unsigned char*, int*); -CYASSL_API unsigned char* CyaSSL_X509_get_subjectKeyID( - CYASSL_X509*, unsigned char*, int*); -CYASSL_API int CyaSSL_X509_NAME_entry_count(CYASSL_X509_NAME*); -CYASSL_API int CyaSSL_X509_NAME_get_text_by_NID( - CYASSL_X509_NAME*, int, char*, int); -CYASSL_API int CyaSSL_X509_verify_cert(CYASSL_X509_STORE_CTX*); -CYASSL_API const char* CyaSSL_X509_verify_cert_error_string(long); -CYASSL_API int CyaSSL_X509_get_signature_type(CYASSL_X509*); -CYASSL_API int CyaSSL_X509_get_signature(CYASSL_X509*, unsigned char*, int*); +WOLFSSL_API char* wolfSSL_X509_NAME_oneline(WOLFSSL_X509_NAME*, char*, int); +WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_issuer_name(WOLFSSL_X509*); +WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_subject_name(WOLFSSL_X509*); +WOLFSSL_API int wolfSSL_X509_ext_isSet_by_NID(WOLFSSL_X509*, int); +WOLFSSL_API int wolfSSL_X509_ext_get_critical_by_NID(WOLFSSL_X509*, int); +WOLFSSL_API int wolfSSL_X509_get_isCA(WOLFSSL_X509*); +WOLFSSL_API int wolfSSL_X509_get_isSet_pathLength(WOLFSSL_X509*); +WOLFSSL_API unsigned int wolfSSL_X509_get_pathLength(WOLFSSL_X509*); +WOLFSSL_API unsigned int wolfSSL_X509_get_keyUsage(WOLFSSL_X509*); +WOLFSSL_API unsigned char* wolfSSL_X509_get_authorityKeyID( + WOLFSSL_X509*, unsigned char*, int*); +WOLFSSL_API unsigned char* wolfSSL_X509_get_subjectKeyID( + WOLFSSL_X509*, unsigned char*, int*); +WOLFSSL_API int wolfSSL_X509_NAME_entry_count(WOLFSSL_X509_NAME*); +WOLFSSL_API int wolfSSL_X509_NAME_get_text_by_NID( + WOLFSSL_X509_NAME*, int, char*, int); +WOLFSSL_API int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX*); +WOLFSSL_API const char* wolfSSL_X509_verify_cert_error_string(long); +WOLFSSL_API int wolfSSL_X509_get_signature_type(WOLFSSL_X509*); +WOLFSSL_API int wolfSSL_X509_get_signature(WOLFSSL_X509*, unsigned char*, int*); -CYASSL_API int CyaSSL_X509_LOOKUP_add_dir(CYASSL_X509_LOOKUP*,const char*,long); -CYASSL_API int CyaSSL_X509_LOOKUP_load_file(CYASSL_X509_LOOKUP*, const char*, +WOLFSSL_API int wolfSSL_X509_LOOKUP_add_dir(WOLFSSL_X509_LOOKUP*,const char*,long); +WOLFSSL_API int wolfSSL_X509_LOOKUP_load_file(WOLFSSL_X509_LOOKUP*, const char*, long); -CYASSL_API CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_hash_dir(void); -CYASSL_API CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_file(void); +WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_hash_dir(void); +WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_file(void); -CYASSL_API CYASSL_X509_LOOKUP* CyaSSL_X509_STORE_add_lookup(CYASSL_X509_STORE*, - CYASSL_X509_LOOKUP_METHOD*); -CYASSL_API CYASSL_X509_STORE* CyaSSL_X509_STORE_new(void); -CYASSL_API void CyaSSL_X509_STORE_free(CYASSL_X509_STORE*); -CYASSL_API int CyaSSL_X509_STORE_add_cert( - CYASSL_X509_STORE*, CYASSL_X509*); -CYASSL_API int CyaSSL_X509_STORE_set_default_paths(CYASSL_X509_STORE*); -CYASSL_API int CyaSSL_X509_STORE_get_by_subject(CYASSL_X509_STORE_CTX*, - int, CYASSL_X509_NAME*, CYASSL_X509_OBJECT*); -CYASSL_API CYASSL_X509_STORE_CTX* CyaSSL_X509_STORE_CTX_new(void); -CYASSL_API int CyaSSL_X509_STORE_CTX_init(CYASSL_X509_STORE_CTX*, - CYASSL_X509_STORE*, CYASSL_X509*, STACK_OF(CYASSL_X509)*); -CYASSL_API void CyaSSL_X509_STORE_CTX_free(CYASSL_X509_STORE_CTX*); -CYASSL_API void CyaSSL_X509_STORE_CTX_cleanup(CYASSL_X509_STORE_CTX*); +WOLFSSL_API WOLFSSL_X509_LOOKUP* wolfSSL_X509_STORE_add_lookup(WOLFSSL_X509_STORE*, + WOLFSSL_X509_LOOKUP_METHOD*); +WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_X509_STORE_new(void); +WOLFSSL_API void wolfSSL_X509_STORE_free(WOLFSSL_X509_STORE*); +WOLFSSL_API int wolfSSL_X509_STORE_add_cert( + WOLFSSL_X509_STORE*, WOLFSSL_X509*); +WOLFSSL_API int wolfSSL_X509_STORE_set_default_paths(WOLFSSL_X509_STORE*); +WOLFSSL_API int wolfSSL_X509_STORE_get_by_subject(WOLFSSL_X509_STORE_CTX*, + int, WOLFSSL_X509_NAME*, WOLFSSL_X509_OBJECT*); +WOLFSSL_API WOLFSSL_X509_STORE_CTX* wolfSSL_X509_STORE_CTX_new(void); +WOLFSSL_API int wolfSSL_X509_STORE_CTX_init(WOLFSSL_X509_STORE_CTX*, + WOLFSSL_X509_STORE*, WOLFSSL_X509*, STACK_OF(WOLFSSL_X509)*); +WOLFSSL_API void wolfSSL_X509_STORE_CTX_free(WOLFSSL_X509_STORE_CTX*); +WOLFSSL_API void wolfSSL_X509_STORE_CTX_cleanup(WOLFSSL_X509_STORE_CTX*); -CYASSL_API CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_lastUpdate(CYASSL_X509_CRL*); -CYASSL_API CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_nextUpdate(CYASSL_X509_CRL*); +WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_lastUpdate(WOLFSSL_X509_CRL*); +WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_nextUpdate(WOLFSSL_X509_CRL*); -CYASSL_API CYASSL_EVP_PKEY* CyaSSL_X509_get_pubkey(CYASSL_X509*); -CYASSL_API int CyaSSL_X509_CRL_verify(CYASSL_X509_CRL*, CYASSL_EVP_PKEY*); -CYASSL_API void CyaSSL_X509_STORE_CTX_set_error(CYASSL_X509_STORE_CTX*, +WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509*); +WOLFSSL_API int wolfSSL_X509_CRL_verify(WOLFSSL_X509_CRL*, WOLFSSL_EVP_PKEY*); +WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_error(WOLFSSL_X509_STORE_CTX*, int); -CYASSL_API void CyaSSL_X509_OBJECT_free_contents(CYASSL_X509_OBJECT*); -CYASSL_API void CyaSSL_EVP_PKEY_free(CYASSL_EVP_PKEY*); -CYASSL_API int CyaSSL_X509_cmp_current_time(const CYASSL_ASN1_TIME*); -CYASSL_API int CyaSSL_sk_X509_REVOKED_num(CYASSL_X509_REVOKED*); +WOLFSSL_API void wolfSSL_X509_OBJECT_free_contents(WOLFSSL_X509_OBJECT*); +WOLFSSL_API void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY*); +WOLFSSL_API int wolfSSL_X509_cmp_current_time(const WOLFSSL_ASN1_TIME*); +WOLFSSL_API int wolfSSL_sk_X509_REVOKED_num(WOLFSSL_X509_REVOKED*); -CYASSL_API CYASSL_X509_REVOKED* CyaSSL_X509_CRL_get_REVOKED(CYASSL_X509_CRL*); -CYASSL_API CYASSL_X509_REVOKED* CyaSSL_sk_X509_REVOKED_value( - CYASSL_X509_REVOKED*,int); -CYASSL_API CYASSL_ASN1_INTEGER* CyaSSL_X509_get_serialNumber(CYASSL_X509*); +WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_X509_CRL_get_REVOKED(WOLFSSL_X509_CRL*); +WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_sk_X509_REVOKED_value( + WOLFSSL_X509_REVOKED*,int); +WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_X509_get_serialNumber(WOLFSSL_X509*); -CYASSL_API int CyaSSL_ASN1_TIME_print(CYASSL_BIO*, const CYASSL_ASN1_TIME*); +WOLFSSL_API int wolfSSL_ASN1_TIME_print(WOLFSSL_BIO*, const WOLFSSL_ASN1_TIME*); -CYASSL_API int CyaSSL_ASN1_INTEGER_cmp(const CYASSL_ASN1_INTEGER*, - const CYASSL_ASN1_INTEGER*); -CYASSL_API long CyaSSL_ASN1_INTEGER_get(const CYASSL_ASN1_INTEGER*); +WOLFSSL_API int wolfSSL_ASN1_INTEGER_cmp(const WOLFSSL_ASN1_INTEGER*, + const WOLFSSL_ASN1_INTEGER*); +WOLFSSL_API long wolfSSL_ASN1_INTEGER_get(const WOLFSSL_ASN1_INTEGER*); -CYASSL_API STACK_OF(CYASSL_X509_NAME)* CyaSSL_load_client_CA_file(const char*); +WOLFSSL_API STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_load_client_CA_file(const char*); -CYASSL_API void CyaSSL_CTX_set_client_CA_list(CYASSL_CTX*, - STACK_OF(CYASSL_X509_NAME)*); -CYASSL_API void* CyaSSL_X509_STORE_CTX_get_ex_data(CYASSL_X509_STORE_CTX*, int); -CYASSL_API int CyaSSL_get_ex_data_X509_STORE_CTX_idx(void); -CYASSL_API void* CyaSSL_get_ex_data(const CYASSL*, int); +WOLFSSL_API void wolfSSL_CTX_set_client_CA_list(WOLFSSL_CTX*, + STACK_OF(WOLFSSL_X509_NAME)*); +WOLFSSL_API void* wolfSSL_X509_STORE_CTX_get_ex_data(WOLFSSL_X509_STORE_CTX*, int); +WOLFSSL_API int wolfSSL_get_ex_data_X509_STORE_CTX_idx(void); +WOLFSSL_API void* wolfSSL_get_ex_data(const WOLFSSL*, int); -CYASSL_API void CyaSSL_CTX_set_default_passwd_cb_userdata(CYASSL_CTX*, +WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX*, void* userdata); -CYASSL_API void CyaSSL_CTX_set_default_passwd_cb(CYASSL_CTX*, pem_password_cb); +WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb(WOLFSSL_CTX*, pem_password_cb); -CYASSL_API void CyaSSL_CTX_set_info_callback(CYASSL_CTX*, void (*)(void)); +WOLFSSL_API void wolfSSL_CTX_set_info_callback(WOLFSSL_CTX*, void (*)(void)); -CYASSL_API unsigned long CyaSSL_ERR_peek_error(void); -CYASSL_API int CyaSSL_GET_REASON(int); +WOLFSSL_API unsigned long wolfSSL_ERR_peek_error(void); +WOLFSSL_API int wolfSSL_GET_REASON(int); -CYASSL_API char* CyaSSL_alert_type_string_long(int); -CYASSL_API char* CyaSSL_alert_desc_string_long(int); -CYASSL_API char* CyaSSL_state_string_long(CYASSL*); +WOLFSSL_API char* wolfSSL_alert_type_string_long(int); +WOLFSSL_API char* wolfSSL_alert_desc_string_long(int); +WOLFSSL_API char* wolfSSL_state_string_long(WOLFSSL*); -CYASSL_API CYASSL_RSA* CyaSSL_RSA_generate_key(int, unsigned long, +WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_generate_key(int, unsigned long, void(*)(int, int, void*), void*); -CYASSL_API void CyaSSL_CTX_set_tmp_rsa_callback(CYASSL_CTX*, - CYASSL_RSA*(*)(CYASSL*, int, int)); +WOLFSSL_API void wolfSSL_CTX_set_tmp_rsa_callback(WOLFSSL_CTX*, + WOLFSSL_RSA*(*)(WOLFSSL*, int, int)); -CYASSL_API int CyaSSL_PEM_def_callback(char*, int num, int w, void* key); +WOLFSSL_API int wolfSSL_PEM_def_callback(char*, int num, int w, void* key); -CYASSL_API long CyaSSL_CTX_sess_accept(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_connect(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_accept_good(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_connect_good(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_accept_renegotiate(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_connect_renegotiate(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_hits(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_cb_hits(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_cache_full(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_misses(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_timeouts(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_number(CYASSL_CTX*); -CYASSL_API long CyaSSL_CTX_sess_get_cache_size(CYASSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_accept(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_connect(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_accept_good(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_connect_good(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_accept_renegotiate(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_connect_renegotiate(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_hits(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_cb_hits(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_cache_full(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_misses(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_timeouts(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_number(WOLFSSL_CTX*); +WOLFSSL_API long wolfSSL_CTX_sess_get_cache_size(WOLFSSL_CTX*); -#define CYASSL_DEFAULT_CIPHER_LIST "" /* default all */ -#define CYASSL_RSA_F4 0x10001L +#define WOLFSSL_DEFAULT_CIPHER_LIST "" /* default all */ +#define WOLFSSL_RSA_F4 0x10001L enum { OCSP_NOCERTS = 1, @@ -564,10 +564,10 @@ enum { OCSP_RESPONSE = 8, OCSP_BASICRESP = 16, - CYASSL_OCSP_URL_OVERRIDE = 1, - CYASSL_OCSP_NO_NONCE = 2, + WOLFSSL_OCSP_URL_OVERRIDE = 1, + WOLFSSL_OCSP_NO_NONCE = 2, - CYASSL_CRL_CHECKALL = 1, + WOLFSSL_CRL_CHECKALL = 1, ASN1_GENERALIZEDTIME = 4, @@ -641,9 +641,9 @@ enum { /* extras end */ #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM) -/* CyaSSL extension, provide last error from SSL_get_error +/* wolfSSL extension, provide last error from SSL_get_error since not using thread storage error queue */ -CYASSL_API void CyaSSL_ERR_print_errors_fp(FILE*, int err); +WOLFSSL_API void wolfSSL_ERR_print_errors_fp(FILE*, int err); #endif enum { /* ssl Constants */ @@ -701,30 +701,30 @@ enum { /* ssl Constants */ #ifndef NO_PSK - typedef unsigned int (*psk_client_callback)(CYASSL*, const char*, char*, + typedef unsigned int (*psk_client_callback)(WOLFSSL*, const char*, char*, unsigned int, unsigned char*, unsigned int); - CYASSL_API void CyaSSL_CTX_set_psk_client_callback(CYASSL_CTX*, + WOLFSSL_API void wolfSSL_CTX_set_psk_client_callback(WOLFSSL_CTX*, psk_client_callback); - CYASSL_API void CyaSSL_set_psk_client_callback(CYASSL*,psk_client_callback); + WOLFSSL_API void wolfSSL_set_psk_client_callback(WOLFSSL*,psk_client_callback); - CYASSL_API const char* CyaSSL_get_psk_identity_hint(const CYASSL*); - CYASSL_API const char* CyaSSL_get_psk_identity(const CYASSL*); + WOLFSSL_API const char* wolfSSL_get_psk_identity_hint(const WOLFSSL*); + WOLFSSL_API const char* wolfSSL_get_psk_identity(const WOLFSSL*); - CYASSL_API int CyaSSL_CTX_use_psk_identity_hint(CYASSL_CTX*, const char*); - CYASSL_API int CyaSSL_use_psk_identity_hint(CYASSL*, const char*); + WOLFSSL_API int wolfSSL_CTX_use_psk_identity_hint(WOLFSSL_CTX*, const char*); + WOLFSSL_API int wolfSSL_use_psk_identity_hint(WOLFSSL*, const char*); - typedef unsigned int (*psk_server_callback)(CYASSL*, const char*, + typedef unsigned int (*psk_server_callback)(WOLFSSL*, const char*, unsigned char*, unsigned int); - CYASSL_API void CyaSSL_CTX_set_psk_server_callback(CYASSL_CTX*, + WOLFSSL_API void wolfSSL_CTX_set_psk_server_callback(WOLFSSL_CTX*, psk_server_callback); - CYASSL_API void CyaSSL_set_psk_server_callback(CYASSL*,psk_server_callback); + WOLFSSL_API void wolfSSL_set_psk_server_callback(WOLFSSL*,psk_server_callback); #define PSK_TYPES_DEFINED #endif /* NO_PSK */ #ifdef HAVE_ANON - CYASSL_API int CyaSSL_CTX_allow_anon_cipher(CYASSL_CTX*); + WOLFSSL_API int wolfSSL_CTX_allow_anon_cipher(WOLFSSL_CTX*); #endif /* HAVE_ANON */ @@ -734,176 +734,176 @@ enum { /* ERR Constants */ ERR_TXT_STRING = 1 }; -CYASSL_API unsigned long CyaSSL_ERR_get_error_line_data(const char**, int*, +WOLFSSL_API unsigned long wolfSSL_ERR_get_error_line_data(const char**, int*, const char**, int *); -CYASSL_API unsigned long CyaSSL_ERR_get_error(void); -CYASSL_API void CyaSSL_ERR_clear_error(void); +WOLFSSL_API unsigned long wolfSSL_ERR_get_error(void); +WOLFSSL_API void wolfSSL_ERR_clear_error(void); -CYASSL_API int CyaSSL_RAND_status(void); -CYASSL_API int CyaSSL_RAND_bytes(unsigned char* buf, int num); -CYASSL_API CYASSL_METHOD *CyaSSLv23_server_method(void); -CYASSL_API long CyaSSL_CTX_set_options(CYASSL_CTX*, long); +WOLFSSL_API int wolfSSL_RAND_status(void); +WOLFSSL_API int wolfSSL_RAND_bytes(unsigned char* buf, int num); +WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method(void); +WOLFSSL_API long wolfSSL_CTX_set_options(WOLFSSL_CTX*, long); #ifndef NO_CERTS - CYASSL_API int CyaSSL_CTX_check_private_key(CYASSL_CTX*); + WOLFSSL_API int wolfSSL_CTX_check_private_key(WOLFSSL_CTX*); #endif /* !NO_CERTS */ -CYASSL_API void CyaSSL_ERR_free_strings(void); -CYASSL_API void CyaSSL_ERR_remove_state(unsigned long); -CYASSL_API void CyaSSL_EVP_cleanup(void); +WOLFSSL_API void wolfSSL_ERR_free_strings(void); +WOLFSSL_API void wolfSSL_ERR_remove_state(unsigned long); +WOLFSSL_API void wolfSSL_EVP_cleanup(void); -CYASSL_API void CyaSSL_cleanup_all_ex_data(void); -CYASSL_API long CyaSSL_CTX_set_mode(CYASSL_CTX* ctx, long mode); -CYASSL_API long CyaSSL_CTX_get_mode(CYASSL_CTX* ctx); -CYASSL_API void CyaSSL_CTX_set_default_read_ahead(CYASSL_CTX* ctx, int m); +WOLFSSL_API void wolfSSL_cleanup_all_ex_data(void); +WOLFSSL_API long wolfSSL_CTX_set_mode(WOLFSSL_CTX* ctx, long mode); +WOLFSSL_API long wolfSSL_CTX_get_mode(WOLFSSL_CTX* ctx); +WOLFSSL_API void wolfSSL_CTX_set_default_read_ahead(WOLFSSL_CTX* ctx, int m); -CYASSL_API long CyaSSL_CTX_sess_set_cache_size(CYASSL_CTX*, long); +WOLFSSL_API long wolfSSL_CTX_sess_set_cache_size(WOLFSSL_CTX*, long); -CYASSL_API int CyaSSL_CTX_set_default_verify_paths(CYASSL_CTX*); -CYASSL_API int CyaSSL_CTX_set_session_id_context(CYASSL_CTX*, +WOLFSSL_API int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX*); +WOLFSSL_API int wolfSSL_CTX_set_session_id_context(WOLFSSL_CTX*, const unsigned char*, unsigned int); -CYASSL_API CYASSL_X509* CyaSSL_get_peer_certificate(CYASSL* ssl); +WOLFSSL_API WOLFSSL_X509* wolfSSL_get_peer_certificate(WOLFSSL* ssl); -CYASSL_API int CyaSSL_want_read(CYASSL*); -CYASSL_API int CyaSSL_want_write(CYASSL*); +WOLFSSL_API int wolfSSL_want_read(WOLFSSL*); +WOLFSSL_API int wolfSSL_want_write(WOLFSSL*); -CYASSL_API int CyaSSL_BIO_printf(CYASSL_BIO*, const char*, ...); -CYASSL_API int CyaSSL_ASN1_UTCTIME_print(CYASSL_BIO*, - const CYASSL_ASN1_UTCTIME*); -CYASSL_API int CyaSSL_sk_num(CYASSL_X509_REVOKED*); -CYASSL_API void* CyaSSL_sk_value(CYASSL_X509_REVOKED*, int); +WOLFSSL_API int wolfSSL_BIO_printf(WOLFSSL_BIO*, const char*, ...); +WOLFSSL_API int wolfSSL_ASN1_UTCTIME_print(WOLFSSL_BIO*, + const WOLFSSL_ASN1_UTCTIME*); +WOLFSSL_API int wolfSSL_sk_num(WOLFSSL_X509_REVOKED*); +WOLFSSL_API void* wolfSSL_sk_value(WOLFSSL_X509_REVOKED*, int); /* stunnel 4.28 needs */ -CYASSL_API void* CyaSSL_CTX_get_ex_data(const CYASSL_CTX*, int); -CYASSL_API int CyaSSL_CTX_set_ex_data(CYASSL_CTX*, int, void*); -CYASSL_API void CyaSSL_CTX_sess_set_get_cb(CYASSL_CTX*, - CYASSL_SESSION*(*f)(CYASSL*, unsigned char*, int, int*)); -CYASSL_API void CyaSSL_CTX_sess_set_new_cb(CYASSL_CTX*, - int (*f)(CYASSL*, CYASSL_SESSION*)); -CYASSL_API void CyaSSL_CTX_sess_set_remove_cb(CYASSL_CTX*, - void (*f)(CYASSL_CTX*, CYASSL_SESSION*)); +WOLFSSL_API void* wolfSSL_CTX_get_ex_data(const WOLFSSL_CTX*, int); +WOLFSSL_API int wolfSSL_CTX_set_ex_data(WOLFSSL_CTX*, int, void*); +WOLFSSL_API void wolfSSL_CTX_sess_set_get_cb(WOLFSSL_CTX*, + WOLFSSL_SESSION*(*f)(WOLFSSL*, unsigned char*, int, int*)); +WOLFSSL_API void wolfSSL_CTX_sess_set_new_cb(WOLFSSL_CTX*, + int (*f)(WOLFSSL*, WOLFSSL_SESSION*)); +WOLFSSL_API void wolfSSL_CTX_sess_set_remove_cb(WOLFSSL_CTX*, + void (*f)(WOLFSSL_CTX*, WOLFSSL_SESSION*)); -CYASSL_API int CyaSSL_i2d_SSL_SESSION(CYASSL_SESSION*,unsigned char**); -CYASSL_API CYASSL_SESSION* CyaSSL_d2i_SSL_SESSION(CYASSL_SESSION**, +WOLFSSL_API int wolfSSL_i2d_SSL_SESSION(WOLFSSL_SESSION*,unsigned char**); +WOLFSSL_API WOLFSSL_SESSION* wolfSSL_d2i_SSL_SESSION(WOLFSSL_SESSION**, const unsigned char**, long); -CYASSL_API long CyaSSL_SESSION_get_timeout(const CYASSL_SESSION*); -CYASSL_API long CyaSSL_SESSION_get_time(const CYASSL_SESSION*); -CYASSL_API int CyaSSL_CTX_get_ex_new_index(long, void*, void*, void*, void*); +WOLFSSL_API long wolfSSL_SESSION_get_timeout(const WOLFSSL_SESSION*); +WOLFSSL_API long wolfSSL_SESSION_get_time(const WOLFSSL_SESSION*); +WOLFSSL_API int wolfSSL_CTX_get_ex_new_index(long, void*, void*, void*, void*); /* extra ends */ -/* CyaSSL extensions */ +/* wolfSSL extensions */ /* call before SSL_connect, if verifying will add name check to date check and signature check */ -CYASSL_API int CyaSSL_check_domain_name(CYASSL* ssl, const char* dn); +WOLFSSL_API int wolfSSL_check_domain_name(WOLFSSL* ssl, const char* dn); /* need to call once to load library (session cache) */ -CYASSL_API int CyaSSL_Init(void); +WOLFSSL_API int wolfSSL_Init(void); /* call when done to cleanup/free session cache mutex / resources */ -CYASSL_API int CyaSSL_Cleanup(void); +WOLFSSL_API int wolfSSL_Cleanup(void); /* turn logging on, only if compiled in */ -CYASSL_API int CyaSSL_Debugging_ON(void); +WOLFSSL_API int wolfSSL_Debugging_ON(void); /* turn logging off */ -CYASSL_API void CyaSSL_Debugging_OFF(void); +WOLFSSL_API void wolfSSL_Debugging_OFF(void); /* do accept or connect depedning on side */ -CYASSL_API int CyaSSL_negotiate(CYASSL* ssl); -/* turn on CyaSSL data compression */ -CYASSL_API int CyaSSL_set_compression(CYASSL* ssl); +WOLFSSL_API int wolfSSL_negotiate(WOLFSSL* ssl); +/* turn on wolfSSL data compression */ +WOLFSSL_API int wolfSSL_set_compression(WOLFSSL* ssl); -CYASSL_API int CyaSSL_set_timeout(CYASSL*, unsigned int); -CYASSL_API int CyaSSL_CTX_set_timeout(CYASSL_CTX*, unsigned int); +WOLFSSL_API int wolfSSL_set_timeout(WOLFSSL*, unsigned int); +WOLFSSL_API int wolfSSL_CTX_set_timeout(WOLFSSL_CTX*, unsigned int); -/* get CyaSSL peer X509_CHAIN */ -CYASSL_API CYASSL_X509_CHAIN* CyaSSL_get_peer_chain(CYASSL* ssl); +/* get wolfSSL peer X509_CHAIN */ +WOLFSSL_API WOLFSSL_X509_CHAIN* wolfSSL_get_peer_chain(WOLFSSL* ssl); /* peer chain count */ -CYASSL_API int CyaSSL_get_chain_count(CYASSL_X509_CHAIN* chain); +WOLFSSL_API int wolfSSL_get_chain_count(WOLFSSL_X509_CHAIN* chain); /* index cert length */ -CYASSL_API int CyaSSL_get_chain_length(CYASSL_X509_CHAIN*, int idx); +WOLFSSL_API int wolfSSL_get_chain_length(WOLFSSL_X509_CHAIN*, int idx); /* index cert */ -CYASSL_API unsigned char* CyaSSL_get_chain_cert(CYASSL_X509_CHAIN*, int idx); +WOLFSSL_API unsigned char* wolfSSL_get_chain_cert(WOLFSSL_X509_CHAIN*, int idx); /* index cert in X509 */ -CYASSL_API CYASSL_X509* CyaSSL_get_chain_X509(CYASSL_X509_CHAIN*, int idx); +WOLFSSL_API WOLFSSL_X509* wolfSSL_get_chain_X509(WOLFSSL_X509_CHAIN*, int idx); /* free X509 */ -CYASSL_API void CyaSSL_FreeX509(CYASSL_X509*); +WOLFSSL_API void wolfSSL_FreeX509(WOLFSSL_X509*); /* get index cert in PEM */ -CYASSL_API int CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN*, int idx, +WOLFSSL_API int wolfSSL_get_chain_cert_pem(WOLFSSL_X509_CHAIN*, int idx, unsigned char* buffer, int inLen, int* outLen); -CYASSL_API const unsigned char* CyaSSL_get_sessionID(const CYASSL_SESSION* s); -CYASSL_API int CyaSSL_X509_get_serial_number(CYASSL_X509*,unsigned char*,int*); -CYASSL_API char* CyaSSL_X509_get_subjectCN(CYASSL_X509*); -CYASSL_API const unsigned char* CyaSSL_X509_get_der(CYASSL_X509*, int*); -CYASSL_API const unsigned char* CyaSSL_X509_notBefore(CYASSL_X509*); -CYASSL_API const unsigned char* CyaSSL_X509_notAfter(CYASSL_X509*); -CYASSL_API int CyaSSL_X509_version(CYASSL_X509*); -CYASSL_API +WOLFSSL_API const unsigned char* wolfSSL_get_sessionID(const WOLFSSL_SESSION* s); +WOLFSSL_API int wolfSSL_X509_get_serial_number(WOLFSSL_X509*,unsigned char*,int*); +WOLFSSL_API char* wolfSSL_X509_get_subjectCN(WOLFSSL_X509*); +WOLFSSL_API const unsigned char* wolfSSL_X509_get_der(WOLFSSL_X509*, int*); +WOLFSSL_API const unsigned char* wolfSSL_X509_notBefore(WOLFSSL_X509*); +WOLFSSL_API const unsigned char* wolfSSL_X509_notAfter(WOLFSSL_X509*); +WOLFSSL_API int wolfSSL_X509_version(WOLFSSL_X509*); +WOLFSSL_API -CYASSL_API int CyaSSL_cmp_peer_cert_to_file(CYASSL*, const char*); +WOLFSSL_API int wolfSSL_cmp_peer_cert_to_file(WOLFSSL*, const char*); -CYASSL_API char* CyaSSL_X509_get_next_altname(CYASSL_X509*); +WOLFSSL_API char* wolfSSL_X509_get_next_altname(WOLFSSL_X509*); -CYASSL_API CYASSL_X509* - CyaSSL_X509_d2i(CYASSL_X509** x509, const unsigned char* in, int len); +WOLFSSL_API WOLFSSL_X509* + wolfSSL_X509_d2i(WOLFSSL_X509** x509, const unsigned char* in, int len); #ifndef NO_FILESYSTEM #ifndef NO_STDIO_FILESYSTEM - CYASSL_API CYASSL_X509* - CyaSSL_X509_d2i_fp(CYASSL_X509** x509, FILE* file); + WOLFSSL_API WOLFSSL_X509* + wolfSSL_X509_d2i_fp(WOLFSSL_X509** x509, FILE* file); #endif -CYASSL_API CYASSL_X509* - CyaSSL_X509_load_certificate_file(const char* fname, int format); +WOLFSSL_API WOLFSSL_X509* + wolfSSL_X509_load_certificate_file(const char* fname, int format); #endif -#ifdef CYASSL_SEP - CYASSL_API unsigned char* - CyaSSL_X509_get_device_type(CYASSL_X509*, unsigned char*, int*); - CYASSL_API unsigned char* - CyaSSL_X509_get_hw_type(CYASSL_X509*, unsigned char*, int*); - CYASSL_API unsigned char* - CyaSSL_X509_get_hw_serial_number(CYASSL_X509*, unsigned char*, int*); +#ifdef WOLFSSL_SEP + WOLFSSL_API unsigned char* + wolfSSL_X509_get_device_type(WOLFSSL_X509*, unsigned char*, int*); + WOLFSSL_API unsigned char* + wolfSSL_X509_get_hw_type(WOLFSSL_X509*, unsigned char*, int*); + WOLFSSL_API unsigned char* + wolfSSL_X509_get_hw_serial_number(WOLFSSL_X509*, unsigned char*, int*); #endif /* connect enough to get peer cert */ -CYASSL_API int CyaSSL_connect_cert(CYASSL* ssl); +WOLFSSL_API int wolfSSL_connect_cert(WOLFSSL* ssl); /* XXX This should be #ifndef NO_DH */ #ifndef NO_CERTS /* server Diffie-Hellman parameters */ -CYASSL_API int CyaSSL_SetTmpDH(CYASSL*, const unsigned char* p, int pSz, +WOLFSSL_API int wolfSSL_SetTmpDH(WOLFSSL*, const unsigned char* p, int pSz, const unsigned char* g, int gSz); -CYASSL_API int CyaSSL_SetTmpDH_buffer(CYASSL*, const unsigned char* b, long sz, +WOLFSSL_API int wolfSSL_SetTmpDH_buffer(WOLFSSL*, const unsigned char* b, long sz, int format); -CYASSL_API int CyaSSL_SetTmpEC_DHE_Sz(CYASSL*, unsigned short); +WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL*, unsigned short); #ifndef NO_FILESYSTEM - CYASSL_API int CyaSSL_SetTmpDH_file(CYASSL*, const char* f, int format); + WOLFSSL_API int wolfSSL_SetTmpDH_file(WOLFSSL*, const char* f, int format); #endif /* server ctx Diffie-Hellman parameters */ -CYASSL_API int CyaSSL_CTX_SetTmpDH(CYASSL_CTX*, const unsigned char* p, +WOLFSSL_API int wolfSSL_CTX_SetTmpDH(WOLFSSL_CTX*, const unsigned char* p, int pSz, const unsigned char* g, int gSz); -CYASSL_API int CyaSSL_CTX_SetTmpDH_buffer(CYASSL_CTX*, const unsigned char* b, +WOLFSSL_API int wolfSSL_CTX_SetTmpDH_buffer(WOLFSSL_CTX*, const unsigned char* b, long sz, int format); -CYASSL_API int CyaSSL_CTX_SetTmpEC_DHE_Sz(CYASSL_CTX*, unsigned short); +WOLFSSL_API int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX*, unsigned short); #ifndef NO_FILESYSTEM - CYASSL_API int CyaSSL_CTX_SetTmpDH_file(CYASSL_CTX*, const char* f, + WOLFSSL_API int wolfSSL_CTX_SetTmpDH_file(WOLFSSL_CTX*, const char* f, int format); #endif #endif /* keyblock size in bytes or -1 */ -/* need to call CyaSSL_KeepArrays before handshake to save keys */ -CYASSL_API int CyaSSL_get_keyblock_size(CYASSL*); -CYASSL_API int CyaSSL_get_keys(CYASSL*,unsigned char** ms, unsigned int* msLen, +/* need to call wolfSSL_KeepArrays before handshake to save keys */ +WOLFSSL_API int wolfSSL_get_keyblock_size(WOLFSSL*); +WOLFSSL_API int wolfSSL_get_keys(WOLFSSL*,unsigned char** ms, unsigned int* msLen, unsigned char** sr, unsigned int* srLen, unsigned char** cr, unsigned int* crLen); /* Computes EAP-TLS and EAP-TTLS keying material from the master_secret. */ -CYASSL_API int CyaSSL_make_eap_keys(CYASSL*, void* key, unsigned int len, +WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, const char* label); @@ -912,11 +912,11 @@ CYASSL_API int CyaSSL_make_eap_keys(CYASSL*, void* key, unsigned int len, #ifdef __PPU #include #include - #elif !defined(CYASSL_MDK_ARM) && !defined(CYASSL_IAR_ARM) + #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) #include #endif /* allow writev style writing */ - CYASSL_API int CyaSSL_writev(CYASSL* ssl, const struct iovec* iov, + WOLFSSL_API int wolfSSL_writev(WOLFSSL* ssl, const struct iovec* iov, int iovcnt); #endif #endif @@ -924,32 +924,32 @@ CYASSL_API int CyaSSL_make_eap_keys(CYASSL*, void* key, unsigned int len, #ifndef NO_CERTS /* SSL_CTX versions */ - CYASSL_API int CyaSSL_CTX_UnloadCAs(CYASSL_CTX*); - CYASSL_API int CyaSSL_CTX_load_verify_buffer(CYASSL_CTX*, + WOLFSSL_API int wolfSSL_CTX_UnloadCAs(WOLFSSL_CTX*); + WOLFSSL_API int wolfSSL_CTX_load_verify_buffer(WOLFSSL_CTX*, const unsigned char*, long, int); - CYASSL_API int CyaSSL_CTX_use_certificate_buffer(CYASSL_CTX*, + WOLFSSL_API int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX*, const unsigned char*, long, int); - CYASSL_API int CyaSSL_CTX_use_PrivateKey_buffer(CYASSL_CTX*, + WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_buffer(WOLFSSL_CTX*, const unsigned char*, long, int); - CYASSL_API int CyaSSL_CTX_use_certificate_chain_buffer(CYASSL_CTX*, + WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer(WOLFSSL_CTX*, const unsigned char*, long); /* SSL versions */ - CYASSL_API int CyaSSL_use_certificate_buffer(CYASSL*, const unsigned char*, + WOLFSSL_API int wolfSSL_use_certificate_buffer(WOLFSSL*, const unsigned char*, long, int); - CYASSL_API int CyaSSL_use_PrivateKey_buffer(CYASSL*, const unsigned char*, + WOLFSSL_API int wolfSSL_use_PrivateKey_buffer(WOLFSSL*, const unsigned char*, long, int); - CYASSL_API int CyaSSL_use_certificate_chain_buffer(CYASSL*, + WOLFSSL_API int wolfSSL_use_certificate_chain_buffer(WOLFSSL*, const unsigned char*, long); - CYASSL_API int CyaSSL_UnloadCertsKeys(CYASSL*); + WOLFSSL_API int wolfSSL_UnloadCertsKeys(WOLFSSL*); #endif -CYASSL_API int CyaSSL_CTX_set_group_messages(CYASSL_CTX*); -CYASSL_API int CyaSSL_set_group_messages(CYASSL*); +WOLFSSL_API int wolfSSL_CTX_set_group_messages(WOLFSSL_CTX*); +WOLFSSL_API int wolfSSL_set_group_messages(WOLFSSL*); /* I/O callbacks */ -typedef int (*CallbackIORecv)(CYASSL *ssl, char *buf, int sz, void *ctx); -typedef int (*CallbackIOSend)(CYASSL *ssl, char *buf, int sz, void *ctx); +typedef int (*CallbackIORecv)(WOLFSSL *ssl, char *buf, int sz, void *ctx); +typedef int (*CallbackIOSend)(WOLFSSL *ssl, char *buf, int sz, void *ctx); #ifdef HAVE_FUZZER enum fuzzer_type { @@ -960,85 +960,85 @@ enum fuzzer_type { FUZZ_HEAD = 4 }; -typedef int (*CallbackFuzzer)(CYASSL* ssl, const unsigned char* buf, int sz, +typedef int (*CallbackFuzzer)(WOLFSSL* ssl, const unsigned char* buf, int sz, int type, void* fuzzCtx); -CYASSL_API void CyaSSL_SetFuzzerCb(CYASSL* ssl, CallbackFuzzer cbf, void* fCtx); +WOLFSSL_API void wolfSSL_SetFuzzerCb(WOLFSSL* ssl, CallbackFuzzer cbf, void* fCtx); #endif -CYASSL_API void CyaSSL_SetIORecv(CYASSL_CTX*, CallbackIORecv); -CYASSL_API void CyaSSL_SetIOSend(CYASSL_CTX*, CallbackIOSend); +WOLFSSL_API void wolfSSL_SetIORecv(WOLFSSL_CTX*, CallbackIORecv); +WOLFSSL_API void wolfSSL_SetIOSend(WOLFSSL_CTX*, CallbackIOSend); -CYASSL_API void CyaSSL_SetIOReadCtx( CYASSL* ssl, void *ctx); -CYASSL_API void CyaSSL_SetIOWriteCtx(CYASSL* ssl, void *ctx); +WOLFSSL_API void wolfSSL_SetIOReadCtx( WOLFSSL* ssl, void *ctx); +WOLFSSL_API void wolfSSL_SetIOWriteCtx(WOLFSSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetIOReadCtx( CYASSL* ssl); -CYASSL_API void* CyaSSL_GetIOWriteCtx(CYASSL* ssl); +WOLFSSL_API void* wolfSSL_GetIOReadCtx( WOLFSSL* ssl); +WOLFSSL_API void* wolfSSL_GetIOWriteCtx(WOLFSSL* ssl); -CYASSL_API void CyaSSL_SetIOReadFlags( CYASSL* ssl, int flags); -CYASSL_API void CyaSSL_SetIOWriteFlags(CYASSL* ssl, int flags); +WOLFSSL_API void wolfSSL_SetIOReadFlags( WOLFSSL* ssl, int flags); +WOLFSSL_API void wolfSSL_SetIOWriteFlags(WOLFSSL* ssl, int flags); -#ifndef CYASSL_USER_IO +#ifndef WOLFSSL_USER_IO /* default IO callbacks */ - CYASSL_API int EmbedReceive(CYASSL* ssl, char* buf, int sz, void* ctx); - CYASSL_API int EmbedSend(CYASSL* ssl, char* buf, int sz, void* ctx); + 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 HAVE_OCSP - CYASSL_API int EmbedOcspLookup(void*, const char*, int, unsigned char*, + WOLFSSL_API int EmbedOcspLookup(void*, const char*, int, unsigned char*, int, unsigned char**); - CYASSL_API void EmbedOcspRespFree(void*, unsigned char*); + WOLFSSL_API void EmbedOcspRespFree(void*, unsigned char*); #endif - #ifdef CYASSL_DTLS - CYASSL_API int EmbedReceiveFrom(CYASSL* ssl, char* buf, int sz, void*); - CYASSL_API int EmbedSendTo(CYASSL* ssl, char* buf, int sz, void* ctx); - CYASSL_API int EmbedGenerateCookie(CYASSL* ssl, unsigned char* buf, + #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*); - #endif /* CYASSL_DTLS */ -#endif /* CYASSL_USER_IO */ + #endif /* WOLFSSL_DTLS */ +#endif /* WOLFSSL_USER_IO */ #ifdef HAVE_NETX - CYASSL_API void CyaSSL_SetIO_NetX(CYASSL* ssl, NX_TCP_SOCKET* nxsocket, + WOLFSSL_API void wolfSSL_SetIO_NetX(WOLFSSL* ssl, NX_TCP_SOCKET* nxsocket, ULONG waitoption); #endif -typedef int (*CallbackGenCookie)(CYASSL* ssl, unsigned char* buf, int sz, +typedef int (*CallbackGenCookie)(WOLFSSL* ssl, unsigned char* buf, int sz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetGenCookie(CYASSL_CTX*, CallbackGenCookie); -CYASSL_API void CyaSSL_SetCookieCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetCookieCtx(CYASSL* ssl); +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); /* I/O Callback default errors */ enum IOerrors { - CYASSL_CBIO_ERR_GENERAL = -1, /* general unexpected err */ - CYASSL_CBIO_ERR_WANT_READ = -2, /* need to call read again */ - CYASSL_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */ - CYASSL_CBIO_ERR_CONN_RST = -3, /* connection reset */ - CYASSL_CBIO_ERR_ISR = -4, /* interrupt */ - CYASSL_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */ - CYASSL_CBIO_ERR_TIMEOUT = -6 /* socket timeout */ + WOLFSSL_CBIO_ERR_GENERAL = -1, /* general unexpected err */ + WOLFSSL_CBIO_ERR_WANT_READ = -2, /* need to call read again */ + WOLFSSL_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */ + WOLFSSL_CBIO_ERR_CONN_RST = -3, /* connection reset */ + WOLFSSL_CBIO_ERR_ISR = -4, /* interrupt */ + WOLFSSL_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */ + WOLFSSL_CBIO_ERR_TIMEOUT = -6 /* socket timeout */ }; /* CA cache callbacks */ enum { - CYASSL_SSLV3 = 0, - CYASSL_TLSV1 = 1, - CYASSL_TLSV1_1 = 2, - CYASSL_TLSV1_2 = 3, - CYASSL_USER_CA = 1, /* user added as trusted */ - CYASSL_CHAIN_CA = 2 /* added to cache from trusted chain */ + WOLFSSL_SSLV3 = 0, + WOLFSSL_TLSV1 = 1, + WOLFSSL_TLSV1_1 = 2, + WOLFSSL_TLSV1_2 = 3, + WOLFSSL_USER_CA = 1, /* user added as trusted */ + WOLFSSL_CHAIN_CA = 2 /* added to cache from trusted chain */ }; -CYASSL_API int CyaSSL_SetMinVersion(CYASSL* ssl, int version); -CYASSL_API int CyaSSL_GetObjectSize(void); /* object size based on build */ -CYASSL_API int CyaSSL_SetVersion(CYASSL* ssl, int version); -CYASSL_API int CyaSSL_KeyPemToDer(const unsigned char*, int sz, unsigned char*, +WOLFSSL_API int wolfSSL_SetMinVersion(WOLFSSL* ssl, int version); +WOLFSSL_API int wolfSSL_GetObjectSize(void); /* object size based on build */ +WOLFSSL_API int wolfSSL_SetVersion(WOLFSSL* ssl, int version); +WOLFSSL_API int wolfSSL_KeyPemToDer(const unsigned char*, int sz, unsigned char*, int, const char*); -CYASSL_API int CyaSSL_CertPemToDer(const unsigned char*, int sz, unsigned char*, +WOLFSSL_API int wolfSSL_CertPemToDer(const unsigned char*, int sz, unsigned char*, int, int); typedef void (*CallbackCACache)(unsigned char* der, int sz, int type); @@ -1048,49 +1048,49 @@ typedef int (*CbOCSPIO)(void*, const char*, int, typedef void (*CbOCSPRespFree)(void*,unsigned char*); /* User Atomic Record Layer CallBacks */ -typedef int (*CallbackMacEncrypt)(CYASSL* ssl, unsigned char* macOut, +typedef int (*CallbackMacEncrypt)(WOLFSSL* ssl, unsigned char* macOut, const unsigned char* macIn, unsigned int macInSz, int macContent, int macVerify, unsigned char* encOut, const unsigned char* encIn, unsigned int encSz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetMacEncryptCb(CYASSL_CTX*, CallbackMacEncrypt); -CYASSL_API void CyaSSL_SetMacEncryptCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetMacEncryptCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetMacEncryptCb(WOLFSSL_CTX*, CallbackMacEncrypt); +WOLFSSL_API void wolfSSL_SetMacEncryptCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetMacEncryptCtx(WOLFSSL* ssl); -typedef int (*CallbackDecryptVerify)(CYASSL* ssl, +typedef int (*CallbackDecryptVerify)(WOLFSSL* ssl, unsigned char* decOut, const unsigned char* decIn, unsigned int decSz, int content, int verify, unsigned int* padSz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetDecryptVerifyCb(CYASSL_CTX*, +WOLFSSL_API void wolfSSL_CTX_SetDecryptVerifyCb(WOLFSSL_CTX*, CallbackDecryptVerify); -CYASSL_API void CyaSSL_SetDecryptVerifyCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetDecryptVerifyCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_SetDecryptVerifyCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetDecryptVerifyCtx(WOLFSSL* ssl); -CYASSL_API const unsigned char* CyaSSL_GetMacSecret(CYASSL*, int); -CYASSL_API const unsigned char* CyaSSL_GetClientWriteKey(CYASSL*); -CYASSL_API const unsigned char* CyaSSL_GetClientWriteIV(CYASSL*); -CYASSL_API const unsigned char* CyaSSL_GetServerWriteKey(CYASSL*); -CYASSL_API const unsigned char* CyaSSL_GetServerWriteIV(CYASSL*); -CYASSL_API int CyaSSL_GetKeySize(CYASSL*); -CYASSL_API int CyaSSL_GetIVSize(CYASSL*); -CYASSL_API int CyaSSL_GetSide(CYASSL*); -CYASSL_API int CyaSSL_IsTLSv1_1(CYASSL*); -CYASSL_API int CyaSSL_GetBulkCipher(CYASSL*); -CYASSL_API int CyaSSL_GetCipherBlockSize(CYASSL*); -CYASSL_API int CyaSSL_GetAeadMacSize(CYASSL*); -CYASSL_API int CyaSSL_GetHmacSize(CYASSL*); -CYASSL_API int CyaSSL_GetHmacType(CYASSL*); -CYASSL_API int CyaSSL_GetCipherType(CYASSL*); -CYASSL_API int CyaSSL_SetTlsHmacInner(CYASSL*, unsigned char*, +WOLFSSL_API const unsigned char* wolfSSL_GetMacSecret(WOLFSSL*, int); +WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteKey(WOLFSSL*); +WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteIV(WOLFSSL*); +WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteKey(WOLFSSL*); +WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteIV(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetKeySize(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetIVSize(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetSide(WOLFSSL*); +WOLFSSL_API int wolfSSL_IsTLSv1_1(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetBulkCipher(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetCipherBlockSize(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetAeadMacSize(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetHmacSize(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetHmacType(WOLFSSL*); +WOLFSSL_API int wolfSSL_GetCipherType(WOLFSSL*); +WOLFSSL_API int wolfSSL_SetTlsHmacInner(WOLFSSL*, unsigned char*, unsigned int, int, int); /* Atomic User Needs */ enum { - CYASSL_SERVER_END = 0, - CYASSL_CLIENT_END = 1, - CYASSL_BLOCK_TYPE = 2, - CYASSL_STREAM_TYPE = 3, - CYASSL_AEAD_TYPE = 4, - CYASSL_TLS_HMAC_INNER_SZ = 13 /* SEQ_SZ + ENUM + VERSION_SZ + LEN_SZ */ + WOLFSSL_SERVER_END = 0, + WOLFSSL_CLIENT_END = 1, + WOLFSSL_BLOCK_TYPE = 2, + WOLFSSL_STREAM_TYPE = 3, + WOLFSSL_AEAD_TYPE = 4, + WOLFSSL_TLS_HMAC_INNER_SZ = 13 /* SEQ_SZ + ENUM + VERSION_SZ + LEN_SZ */ }; /* for GetBulkCipher and internal use */ @@ -1107,7 +1107,7 @@ enum BulkCipherAlgorithm { cyassl_aes_ccm, cyassl_chacha, cyassl_camellia, - cyassl_hc128, /* CyaSSL extensions */ + cyassl_hc128, /* wolfSSL extensions */ cyassl_rabbit }; @@ -1121,125 +1121,125 @@ enum KDF_MacAlgorithm { /* Public Key Callback support */ -typedef int (*CallbackEccSign)(CYASSL* ssl, +typedef int (*CallbackEccSign)(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz, unsigned char* out, unsigned int* outSz, const unsigned char* keyDer, unsigned int keySz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetEccSignCb(CYASSL_CTX*, CallbackEccSign); -CYASSL_API void CyaSSL_SetEccSignCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetEccSignCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetEccSignCb(WOLFSSL_CTX*, CallbackEccSign); +WOLFSSL_API void wolfSSL_SetEccSignCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetEccSignCtx(WOLFSSL* ssl); -typedef int (*CallbackEccVerify)(CYASSL* ssl, +typedef int (*CallbackEccVerify)(WOLFSSL* ssl, const unsigned char* sig, unsigned int sigSz, const unsigned char* hash, unsigned int hashSz, const unsigned char* keyDer, unsigned int keySz, int* result, void* ctx); -CYASSL_API void CyaSSL_CTX_SetEccVerifyCb(CYASSL_CTX*, CallbackEccVerify); -CYASSL_API void CyaSSL_SetEccVerifyCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetEccVerifyCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetEccVerifyCb(WOLFSSL_CTX*, CallbackEccVerify); +WOLFSSL_API void wolfSSL_SetEccVerifyCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetEccVerifyCtx(WOLFSSL* ssl); -typedef int (*CallbackRsaSign)(CYASSL* ssl, +typedef int (*CallbackRsaSign)(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz, unsigned char* out, unsigned int* outSz, const unsigned char* keyDer, unsigned int keySz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetRsaSignCb(CYASSL_CTX*, CallbackRsaSign); -CYASSL_API void CyaSSL_SetRsaSignCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetRsaSignCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetRsaSignCb(WOLFSSL_CTX*, CallbackRsaSign); +WOLFSSL_API void wolfSSL_SetRsaSignCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetRsaSignCtx(WOLFSSL* ssl); -typedef int (*CallbackRsaVerify)(CYASSL* ssl, +typedef int (*CallbackRsaVerify)(WOLFSSL* ssl, unsigned char* sig, unsigned int sigSz, unsigned char** out, const unsigned char* keyDer, unsigned int keySz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetRsaVerifyCb(CYASSL_CTX*, CallbackRsaVerify); -CYASSL_API void CyaSSL_SetRsaVerifyCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetRsaVerifyCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetRsaVerifyCb(WOLFSSL_CTX*, CallbackRsaVerify); +WOLFSSL_API void wolfSSL_SetRsaVerifyCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetRsaVerifyCtx(WOLFSSL* ssl); /* RSA Public Encrypt cb */ -typedef int (*CallbackRsaEnc)(CYASSL* ssl, +typedef int (*CallbackRsaEnc)(WOLFSSL* ssl, const unsigned char* in, unsigned int inSz, unsigned char* out, unsigned int* outSz, const unsigned char* keyDer, unsigned int keySz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetRsaEncCb(CYASSL_CTX*, CallbackRsaEnc); -CYASSL_API void CyaSSL_SetRsaEncCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetRsaEncCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetRsaEncCb(WOLFSSL_CTX*, CallbackRsaEnc); +WOLFSSL_API void wolfSSL_SetRsaEncCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetRsaEncCtx(WOLFSSL* ssl); /* RSA Private Decrypt cb */ -typedef int (*CallbackRsaDec)(CYASSL* ssl, +typedef int (*CallbackRsaDec)(WOLFSSL* ssl, unsigned char* in, unsigned int inSz, unsigned char** out, const unsigned char* keyDer, unsigned int keySz, void* ctx); -CYASSL_API void CyaSSL_CTX_SetRsaDecCb(CYASSL_CTX*, CallbackRsaDec); -CYASSL_API void CyaSSL_SetRsaDecCtx(CYASSL* ssl, void *ctx); -CYASSL_API void* CyaSSL_GetRsaDecCtx(CYASSL* ssl); +WOLFSSL_API void wolfSSL_CTX_SetRsaDecCb(WOLFSSL_CTX*, CallbackRsaDec); +WOLFSSL_API void wolfSSL_SetRsaDecCtx(WOLFSSL* ssl, void *ctx); +WOLFSSL_API void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl); #ifndef NO_CERTS - CYASSL_API void CyaSSL_CTX_SetCACb(CYASSL_CTX*, CallbackCACache); + WOLFSSL_API void wolfSSL_CTX_SetCACb(WOLFSSL_CTX*, CallbackCACache); - CYASSL_API CYASSL_CERT_MANAGER* CyaSSL_CertManagerNew(void); - CYASSL_API void CyaSSL_CertManagerFree(CYASSL_CERT_MANAGER*); + WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void); + WOLFSSL_API void wolfSSL_CertManagerFree(WOLFSSL_CERT_MANAGER*); - CYASSL_API int CyaSSL_CertManagerLoadCA(CYASSL_CERT_MANAGER*, const char* f, + WOLFSSL_API int wolfSSL_CertManagerLoadCA(WOLFSSL_CERT_MANAGER*, const char* f, const char* d); - CYASSL_API int CyaSSL_CertManagerUnloadCAs(CYASSL_CERT_MANAGER* cm); - CYASSL_API int CyaSSL_CertManagerVerify(CYASSL_CERT_MANAGER*, const char* f, + WOLFSSL_API int wolfSSL_CertManagerUnloadCAs(WOLFSSL_CERT_MANAGER* cm); + WOLFSSL_API int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER*, const char* f, int format); - CYASSL_API int CyaSSL_CertManagerVerifyBuffer(CYASSL_CERT_MANAGER* cm, + WOLFSSL_API int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, const unsigned char* buff, long sz, int format); - CYASSL_API int CyaSSL_CertManagerCheckCRL(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerCheckCRL(WOLFSSL_CERT_MANAGER*, unsigned char*, int sz); - CYASSL_API int CyaSSL_CertManagerEnableCRL(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerEnableCRL(WOLFSSL_CERT_MANAGER*, int options); - CYASSL_API int CyaSSL_CertManagerDisableCRL(CYASSL_CERT_MANAGER*); - CYASSL_API int CyaSSL_CertManagerLoadCRL(CYASSL_CERT_MANAGER*, const char*, + WOLFSSL_API int wolfSSL_CertManagerDisableCRL(WOLFSSL_CERT_MANAGER*); + WOLFSSL_API int wolfSSL_CertManagerLoadCRL(WOLFSSL_CERT_MANAGER*, const char*, int, int); - CYASSL_API int CyaSSL_CertManagerSetCRL_Cb(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerSetCRL_Cb(WOLFSSL_CERT_MANAGER*, CbMissingCRL); - CYASSL_API int CyaSSL_CertManagerCheckOCSP(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerCheckOCSP(WOLFSSL_CERT_MANAGER*, unsigned char*, int sz); - CYASSL_API int CyaSSL_CertManagerEnableOCSP(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerEnableOCSP(WOLFSSL_CERT_MANAGER*, int options); - CYASSL_API int CyaSSL_CertManagerDisableOCSP(CYASSL_CERT_MANAGER*); - CYASSL_API int CyaSSL_CertManagerSetOCSPOverrideURL(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerDisableOCSP(WOLFSSL_CERT_MANAGER*); + WOLFSSL_API int wolfSSL_CertManagerSetOCSPOverrideURL(WOLFSSL_CERT_MANAGER*, const char*); - CYASSL_API int CyaSSL_CertManagerSetOCSP_Cb(CYASSL_CERT_MANAGER*, + WOLFSSL_API int wolfSSL_CertManagerSetOCSP_Cb(WOLFSSL_CERT_MANAGER*, CbOCSPIO, CbOCSPRespFree, void*); - CYASSL_API int CyaSSL_EnableCRL(CYASSL* ssl, int options); - CYASSL_API int CyaSSL_DisableCRL(CYASSL* ssl); - CYASSL_API int CyaSSL_LoadCRL(CYASSL*, const char*, int, int); - CYASSL_API int CyaSSL_SetCRL_Cb(CYASSL*, CbMissingCRL); - CYASSL_API int CyaSSL_EnableOCSP(CYASSL*, int options); - CYASSL_API int CyaSSL_DisableOCSP(CYASSL*); - CYASSL_API int CyaSSL_SetOCSP_OverrideURL(CYASSL*, const char*); - CYASSL_API int CyaSSL_SetOCSP_Cb(CYASSL*, CbOCSPIO, CbOCSPRespFree, void*); + WOLFSSL_API int wolfSSL_EnableCRL(WOLFSSL* ssl, int options); + WOLFSSL_API int wolfSSL_DisableCRL(WOLFSSL* ssl); + WOLFSSL_API int wolfSSL_LoadCRL(WOLFSSL*, const char*, int, int); + WOLFSSL_API int wolfSSL_SetCRL_Cb(WOLFSSL*, CbMissingCRL); + WOLFSSL_API int wolfSSL_EnableOCSP(WOLFSSL*, int options); + WOLFSSL_API int wolfSSL_DisableOCSP(WOLFSSL*); + WOLFSSL_API int wolfSSL_SetOCSP_OverrideURL(WOLFSSL*, const char*); + WOLFSSL_API int wolfSSL_SetOCSP_Cb(WOLFSSL*, CbOCSPIO, CbOCSPRespFree, void*); - CYASSL_API int CyaSSL_CTX_EnableCRL(CYASSL_CTX* ctx, int options); - CYASSL_API int CyaSSL_CTX_DisableCRL(CYASSL_CTX* ctx); - CYASSL_API int CyaSSL_CTX_LoadCRL(CYASSL_CTX*, const char*, int, int); - CYASSL_API int CyaSSL_CTX_SetCRL_Cb(CYASSL_CTX*, CbMissingCRL); - CYASSL_API int CyaSSL_CTX_EnableOCSP(CYASSL_CTX*, int options); - CYASSL_API int CyaSSL_CTX_DisableOCSP(CYASSL_CTX*); - CYASSL_API int CyaSSL_CTX_SetOCSP_OverrideURL(CYASSL_CTX*, const char*); - CYASSL_API int CyaSSL_CTX_SetOCSP_Cb(CYASSL_CTX*, + WOLFSSL_API int wolfSSL_CTX_EnableCRL(WOLFSSL_CTX* ctx, int options); + WOLFSSL_API int wolfSSL_CTX_DisableCRL(WOLFSSL_CTX* ctx); + WOLFSSL_API int wolfSSL_CTX_LoadCRL(WOLFSSL_CTX*, const char*, int, int); + WOLFSSL_API int wolfSSL_CTX_SetCRL_Cb(WOLFSSL_CTX*, CbMissingCRL); + WOLFSSL_API int wolfSSL_CTX_EnableOCSP(WOLFSSL_CTX*, int options); + WOLFSSL_API int wolfSSL_CTX_DisableOCSP(WOLFSSL_CTX*); + WOLFSSL_API int wolfSSL_CTX_SetOCSP_OverrideURL(WOLFSSL_CTX*, const char*); + WOLFSSL_API int wolfSSL_CTX_SetOCSP_Cb(WOLFSSL_CTX*, CbOCSPIO, CbOCSPRespFree, void*); #endif /* !NO_CERTS */ /* end of handshake frees temporary arrays, if user needs for get_keys or psk hints, call KeepArrays before handshake and then FreeArrays when done if don't want to wait for object free */ -CYASSL_API void CyaSSL_KeepArrays(CYASSL*); -CYASSL_API void CyaSSL_FreeArrays(CYASSL*); +WOLFSSL_API void wolfSSL_KeepArrays(WOLFSSL*); +WOLFSSL_API void wolfSSL_FreeArrays(WOLFSSL*); /* cavium additions */ -CYASSL_API int CyaSSL_UseCavium(CYASSL*, int devId); -CYASSL_API int CyaSSL_CTX_UseCavium(CYASSL_CTX*, int devId); +WOLFSSL_API int wolfSSL_UseCavium(WOLFSSL*, int devId); +WOLFSSL_API int wolfSSL_CTX_UseCavium(WOLFSSL_CTX*, int devId); /* TLS Extensions */ @@ -1248,39 +1248,39 @@ CYASSL_API int CyaSSL_CTX_UseCavium(CYASSL_CTX*, int devId); /* SNI types */ enum { - CYASSL_SNI_HOST_NAME = 0 + WOLFSSL_SNI_HOST_NAME = 0 }; -CYASSL_API int CyaSSL_UseSNI(CYASSL* ssl, unsigned char type, const void* data, +WOLFSSL_API int wolfSSL_UseSNI(WOLFSSL* ssl, unsigned char type, const void* data, unsigned short size); -CYASSL_API int CyaSSL_CTX_UseSNI(CYASSL_CTX* ctx, unsigned char type, +WOLFSSL_API int wolfSSL_CTX_UseSNI(WOLFSSL_CTX* ctx, unsigned char type, const void* data, unsigned short size); -#ifndef NO_CYASSL_SERVER +#ifndef NO_WOLFSSL_SERVER /* SNI options */ enum { - CYASSL_SNI_CONTINUE_ON_MISMATCH = 0x01, /* do not abort on mismatch flag */ - CYASSL_SNI_ANSWER_ON_MISMATCH = 0x02 /* fake match on mismatch flag */ + WOLFSSL_SNI_CONTINUE_ON_MISMATCH = 0x01, /* do not abort on mismatch flag */ + WOLFSSL_SNI_ANSWER_ON_MISMATCH = 0x02 /* fake match on mismatch flag */ }; -CYASSL_API void CyaSSL_SNI_SetOptions(CYASSL* ssl, unsigned char type, +WOLFSSL_API void wolfSSL_SNI_SetOptions(WOLFSSL* ssl, unsigned char type, unsigned char options); -CYASSL_API void CyaSSL_CTX_SNI_SetOptions(CYASSL_CTX* ctx, unsigned char type, +WOLFSSL_API void wolfSSL_CTX_SNI_SetOptions(WOLFSSL_CTX* ctx, unsigned char type, unsigned char options); /* SNI status */ enum { - CYASSL_SNI_NO_MATCH = 0, - CYASSL_SNI_FAKE_MATCH = 1, /* if CYASSL_SNI_ANSWER_ON_MISMATCH is enabled */ - CYASSL_SNI_REAL_MATCH = 2 + WOLFSSL_SNI_NO_MATCH = 0, + WOLFSSL_SNI_FAKE_MATCH = 1, /* if WOLFSSL_SNI_ANSWER_ON_MISMATCH is enabled */ + WOLFSSL_SNI_REAL_MATCH = 2 }; -CYASSL_API unsigned char CyaSSL_SNI_Status(CYASSL* ssl, unsigned char type); +WOLFSSL_API unsigned char wolfSSL_SNI_Status(WOLFSSL* ssl, unsigned char type); -CYASSL_API unsigned short CyaSSL_SNI_GetRequest(CYASSL *ssl, unsigned char type, +WOLFSSL_API unsigned short wolfSSL_SNI_GetRequest(WOLFSSL *ssl, unsigned char type, void** data); -CYASSL_API int CyaSSL_SNI_GetFromBuffer( +WOLFSSL_API int wolfSSL_SNI_GetFromBuffer( const unsigned char* clientHello, unsigned int helloSz, unsigned char type, unsigned char* sni, unsigned int* inOutSz); @@ -1292,27 +1292,27 @@ CYASSL_API int CyaSSL_SNI_GetFromBuffer( /* Fragment lengths */ enum { - CYASSL_MFL_2_9 = 1, /* 512 bytes */ - CYASSL_MFL_2_10 = 2, /* 1024 bytes */ - CYASSL_MFL_2_11 = 3, /* 2048 bytes */ - CYASSL_MFL_2_12 = 4, /* 4096 bytes */ - CYASSL_MFL_2_13 = 5 /* 8192 bytes *//* CyaSSL ONLY!!! */ + WOLFSSL_MFL_2_9 = 1, /* 512 bytes */ + WOLFSSL_MFL_2_10 = 2, /* 1024 bytes */ + WOLFSSL_MFL_2_11 = 3, /* 2048 bytes */ + WOLFSSL_MFL_2_12 = 4, /* 4096 bytes */ + WOLFSSL_MFL_2_13 = 5 /* 8192 bytes *//* wolfSSL ONLY!!! */ }; -#ifndef NO_CYASSL_CLIENT +#ifndef NO_WOLFSSL_CLIENT -CYASSL_API int CyaSSL_UseMaxFragment(CYASSL* ssl, unsigned char mfl); -CYASSL_API int CyaSSL_CTX_UseMaxFragment(CYASSL_CTX* ctx, unsigned char mfl); +WOLFSSL_API int wolfSSL_UseMaxFragment(WOLFSSL* ssl, unsigned char mfl); +WOLFSSL_API int wolfSSL_CTX_UseMaxFragment(WOLFSSL_CTX* ctx, unsigned char mfl); #endif #endif /* Truncated HMAC */ #ifdef HAVE_TRUNCATED_HMAC -#ifndef NO_CYASSL_CLIENT +#ifndef NO_WOLFSSL_CLIENT -CYASSL_API int CyaSSL_UseTruncatedHMAC(CYASSL* ssl); -CYASSL_API int CyaSSL_CTX_UseTruncatedHMAC(CYASSL_CTX* ctx); +WOLFSSL_API int wolfSSL_UseTruncatedHMAC(WOLFSSL* ssl); +WOLFSSL_API int wolfSSL_CTX_UseTruncatedHMAC(WOLFSSL_CTX* ctx); #endif #endif @@ -1321,18 +1321,18 @@ CYASSL_API int CyaSSL_CTX_UseTruncatedHMAC(CYASSL_CTX* ctx); #ifdef HAVE_SUPPORTED_CURVES enum { - CYASSL_ECC_SECP160R1 = 0x10, - CYASSL_ECC_SECP192R1 = 0x13, - CYASSL_ECC_SECP224R1 = 0x15, - CYASSL_ECC_SECP256R1 = 0x17, - CYASSL_ECC_SECP384R1 = 0x18, - CYASSL_ECC_SECP521R1 = 0x19 + WOLFSSL_ECC_SECP160R1 = 0x10, + WOLFSSL_ECC_SECP192R1 = 0x13, + WOLFSSL_ECC_SECP224R1 = 0x15, + WOLFSSL_ECC_SECP256R1 = 0x17, + WOLFSSL_ECC_SECP384R1 = 0x18, + WOLFSSL_ECC_SECP521R1 = 0x19 }; -#ifndef NO_CYASSL_CLIENT +#ifndef NO_WOLFSSL_CLIENT -CYASSL_API int CyaSSL_UseSupportedCurve(CYASSL* ssl, unsigned short name); -CYASSL_API int CyaSSL_CTX_UseSupportedCurve(CYASSL_CTX* ctx, +WOLFSSL_API int wolfSSL_UseSupportedCurve(WOLFSSL* ssl, unsigned short name); +WOLFSSL_API int wolfSSL_CTX_UseSupportedCurve(WOLFSSL_CTX* ctx, unsigned short name); #endif @@ -1341,67 +1341,67 @@ CYASSL_API int CyaSSL_CTX_UseSupportedCurve(CYASSL_CTX* ctx, /* Secure Renegotiation */ #ifdef HAVE_SECURE_RENEGOTIATION -CYASSL_API int CyaSSL_UseSecureRenegotiation(CYASSL* ssl); -CYASSL_API int CyaSSL_Rehandshake(CYASSL* ssl); +WOLFSSL_API int wolfSSL_UseSecureRenegotiation(WOLFSSL* ssl); +WOLFSSL_API int wolfSSL_Rehandshake(WOLFSSL* ssl); #endif /* Session Ticket */ #ifdef HAVE_SESSION_TICKET -#ifndef NO_CYASSL_CLIENT +#ifndef NO_WOLFSSL_CLIENT -CYASSL_API int CyaSSL_UseSessionTicket(CYASSL* ssl); -CYASSL_API int CyaSSL_CTX_UseSessionTicket(CYASSL_CTX* ctx); -CYASSL_API int CyaSSL_get_SessionTicket(CYASSL*, unsigned char*, unsigned int*); -CYASSL_API int CyaSSL_set_SessionTicket(CYASSL*, unsigned char*, unsigned int); -typedef int (*CallbackSessionTicket)(CYASSL*, const unsigned char*, int, void*); -CYASSL_API int CyaSSL_set_SessionTicket_cb(CYASSL*, +WOLFSSL_API int wolfSSL_UseSessionTicket(WOLFSSL* ssl); +WOLFSSL_API int wolfSSL_CTX_UseSessionTicket(WOLFSSL_CTX* ctx); +WOLFSSL_API int wolfSSL_get_SessionTicket(WOLFSSL*, unsigned char*, unsigned int*); +WOLFSSL_API int wolfSSL_set_SessionTicket(WOLFSSL*, unsigned char*, unsigned int); +typedef int (*CallbackSessionTicket)(WOLFSSL*, const unsigned char*, int, void*); +WOLFSSL_API int wolfSSL_set_SessionTicket_cb(WOLFSSL*, CallbackSessionTicket, void*); #endif #endif -#define CYASSL_CRL_MONITOR 0x01 /* monitor this dir flag */ -#define CYASSL_CRL_START_MON 0x02 /* start monitoring flag */ +#define WOLFSSL_CRL_MONITOR 0x01 /* monitor this dir flag */ +#define WOLFSSL_CRL_START_MON 0x02 /* start monitoring flag */ /* External facing KDF */ -CYASSL_API -int CyaSSL_MakeTlsMasterSecret(unsigned char* ms, unsigned int msLen, +WOLFSSL_API +int wolfSSL_MakeTlsMasterSecret(unsigned char* ms, unsigned int msLen, const unsigned char* pms, unsigned int pmsLen, const unsigned char* cr, const unsigned char* sr, int tls1_2, int hash_type); -CYASSL_API -int CyaSSL_DeriveTlsKeys(unsigned char* key_data, unsigned int keyLen, +WOLFSSL_API +int wolfSSL_DeriveTlsKeys(unsigned char* key_data, unsigned int keyLen, const unsigned char* ms, unsigned int msLen, const unsigned char* sr, const unsigned char* cr, int tls1_2, int hash_type); -#ifdef CYASSL_CALLBACKS +#ifdef WOLFSSL_CALLBACKS -/* used internally by CyaSSL while OpenSSL types aren't */ +/* used internally by wolfSSL while OpenSSL types aren't */ #include typedef int (*HandShakeCallBack)(HandShakeInfo*); typedef int (*TimeoutCallBack)(TimeoutInfo*); -/* CyaSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack +/* wolfSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack for diagnostics */ -CYASSL_API int CyaSSL_connect_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack, +WOLFSSL_API int wolfSSL_connect_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, Timeval); -CYASSL_API int CyaSSL_accept_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack, +WOLFSSL_API int wolfSSL_accept_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, Timeval); -#endif /* CYASSL_CALLBACKS */ +#endif /* WOLFSSL_CALLBACKS */ -#ifdef CYASSL_HAVE_WOLFSCEP - CYASSL_API void CyaSSL_wolfSCEP(void); -#endif /* CYASSL_HAVE_WOLFSCEP */ +#ifdef WOLFSSL_HAVE_WOLFSCEP + WOLFSSL_API void wolfSSL_wolfSCEP(void); +#endif /* WOLFSSL_HAVE_WOLFSCEP */ -#ifdef CYASSL_HAVE_CERT_SERVICE - CYASSL_API void CyaSSL_cert_service(void); +#ifdef WOLFSSL_HAVE_CERT_SERVICE + WOLFSSL_API void wolfSSL_cert_service(void); #endif @@ -1410,5 +1410,5 @@ CYASSL_API int CyaSSL_accept_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack, #endif -#endif /* CYASSL_SSL_H */ +#endif /* WOLFSSL_SSL_H */ diff --git a/wolfssl/wolfcrypt/include.am b/wolfssl/wolfcrypt/include.am new file mode 100644 index 000000000..e688495f3 --- /dev/null +++ b/wolfssl/wolfcrypt/include.am @@ -0,0 +1,47 @@ +# vim:ft=automake +# All paths should be given relative to the root + +nobase_include_HEADERS+= \ + wolfssl/wolfcrypt/aes.h \ + wolfssl/wolfcrypt/arc4.h \ + #wolfssl/wolfcrypt/asn.h \ + #wolfssl/wolfcrypt/asn_public.h \ + #wolfssl/wolfcrypt/poly1305.h \ + wolfssl/wolfcrypt/camellia.h + #wolfssl/wolfcrypt/coding.h \ + #wolfssl/wolfcrypt/compress.h \ + #wolfssl/wolfcrypt/des3.h \ + #wolfssl/wolfcrypt/dh.h \ + #wolfssl/wolfcrypt/dsa.h \ + #wolfssl/wolfcrypt/ecc.h \ + #wolfssl/wolfcrypt/error-crypt.h \ + #wolfssl/wolfcrypt/fips_test.h \ + #wolfssl/wolfcrypt/hc128.h \ + #wolfssl/wolfcrypt/hmac.h \ + #wolfssl/wolfcrypt/integer.h \ + #wolfssl/wolfcrypt/md2.h \ + #wolfssl/wolfcrypt/md4.h \ + #wolfssl/wolfcrypt/md5.h \ + #wolfssl/wolfcrypt/misc.h \ + #wolfssl/wolfcrypt/pkcs7.h \ + #wolfssl/wolfcrypt/wc_port.h \ + #wolfssl/wolfcrypt/pwdbased.h \ + #wolfssl/wolfcrypt/rabbit.h \ + #wolfssl/wolfcrypt/chacha.h \ + #wolfssl/wolfcrypt/random.h \ + #wolfssl/wolfcrypt/ripemd.h \ + #wolfssl/wolfcrypt/rsa.h \ + #wolfssl/wolfcrypt/settings.h \ + #wolfssl/wolfcrypt/sha256.h \ + #wolfssl/wolfcrypt/sha512.h \ + #wolfssl/wolfcrypt/sha.h \ + #wolfssl/wolfcrypt/blake2.h \ + #wolfssl/wolfcrypt/blake2-int.h \ + #wolfssl/wolfcrypt/blake2-impl.h \ + #wolfssl/wolfcrypt/tfm.h \ + #wolfssl/wolfcrypt/types.h \ + #wolfssl/wolfcrypt/visibility.h \ + #wolfssl/wolfcrypt/logging.h \ + #wolfssl/wolfcrypt/memory.h \ + #wolfssl/wolfcrypt/mpi_class.h \ + #wolfssl/wolfcrypt/mpi_superclass.h diff --git a/wolfssl/wolfcrypt/visibility.h b/wolfssl/wolfcrypt/visibility.h index 4fd6fb82f..b51881dbc 100644 --- a/wolfssl/wolfcrypt/visibility.h +++ b/wolfssl/wolfcrypt/visibility.h @@ -21,9 +21,9 @@ /* Visibility control macros */ - -#ifndef CTAO_CRYPT_VISIBILITY_H -#define CTAO_CRYPT_VISIBILITY_H +#define CTAO_CRYPT_VISIBILITY_H WOLF_CRYPT_VISIBILITY_H +#ifndef WOLF_CRYPT_VISIBILITY_H +#define WOLF_CRYPT_VISIBILITY_H /* CYASSL_API is used for the public API symbols. @@ -31,41 +31,56 @@ CYASSL_LOCAL is used for non-API symbols (private). */ - -#if defined(BUILDING_CYASSL) +#define BUILDING_WOLFSSL BUILDING_CYASSL +#if defined(BUILDING_WOLFSSL) #if defined(HAVE_VISIBILITY) && HAVE_VISIBILITY - #define CYASSL_API __attribute__ ((visibility("default"))) - #define CYASSL_LOCAL __attribute__ ((visibility("hidden"))) + #define WOLFSSL_API __attribute__ ((visibility("default"))) + #define CYASSL_API WOLFSSL_API + #define WOLFSSL_LOCAL __attribute__ ((visibility("hidden"))) + #define CYASSL_LOCAL WOLFSSL_LOCAL #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) - #define CYASSL_API __global - #define CYASSL_LOCAL __hidden + #define WOLFSSL_API __global + #define CYASSL_API WOLFSSL_API + #define WOLFSSL_LOCAL __hidden + #define CYASSL_LOCAL WOLFSSL_LOCAL #elif defined(_MSC_VER) - #ifdef CYASSL_DLL - #define CYASSL_API extern __declspec(dllexport) + #define CYASSL_DLL WOLFSSL_DLL + #ifdef WOLFSSL_DLL + #define WOLFSSL_API extern __declspec(dllexport) + #define CYASSL_API WOLFSSL_API #else //#define CYASSL_API #define WOLFSSL_API #define CYASSL_API WOLFSSL_API #endif - #define CYASSL_LOCAL + #define WOLFSSL_LOCAL + #define CYASSL_LOCAL WOLFSSL_LOCAL #else - #define CYASSL_API - #define CYASSL_LOCAL + #define WOLFSSL_API + #define CYASSL_API WOLFSSL_API + #define WOLFSSL_LOCAL + #define CYASSL_LOCAL WOLFSSL_LOCAL #endif /* HAVE_VISIBILITY */ #else /* BUILDING_CYASSL */ #if defined(_MSC_VER) - #ifdef CYASSL_DLL - #define CYASSL_API extern __declspec(dllimport) + #define CYASSL_DLL WOLFSSL_DLL + #ifdef WOLFSSL_DLL + #define WOLFSSL_API extern __declspec(dllimport) + #define CYASSL_API WOLFSSL_API #else - #define CYASSL_API + #define WOLFSSL_API + #define CYASSL_API WOLFSSL_API #endif - #define CYASSL_LOCAL + #define WOLFSSL_LOCAL + #define CYASSL_LOCAL WOLFSSL_LOCAL #else - #define CYASSL_API - #define CYASSL_LOCAL + #define WOLFSSL_API + #define CYASSL_API WOLFSSL_API + #define WOLFSSL_LOCAL + #define CYASSL_LOCAL WOLFSSL_LOCAL #endif -#endif /* BUILDING_CYASSL */ +#endif /* BUILDING_WOLFSSL */ -#endif /* CTAO_CRYPT_VISIBILITY_H */ +#endif /* WOLF_CRYPT_VISIBILITY_H */