header updates

This commit is contained in:
Kaleb Himes 2014-12-18 11:40:51 -07:00
parent d7a3585a96
commit fc1ddf117f
14 changed files with 177 additions and 178 deletions

View File

@ -21,9 +21,8 @@
/* Visibility control macros */
#include <wolfssl/wolfcrypt/visibility.h>
// #ifndef CTAO_CRYPT_VISIBILITY_H
// #define CTAO_CRYPT_VISIBILITY_H
#ifndef CTAO_CRYPT_VISIBILITY_H
#define CTAO_CRYPT_VISIBILITY_H
/* CYASSL_API is used for the public API symbols.
@ -32,39 +31,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 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 */
#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 */

View File

@ -89,6 +89,7 @@
#define CYASSL_TLSV1_1 WOLFSSL_TLSV1_1
#define CYASSL_TLSV1_2 WOLFSSL_TLSV1_2
#define CYASSL_SSLV3 WOLFSSL_SSLV3
#define MAX_CYASSL_FILE_SIZE MAX_WOLFSSL_FILE_SIZE
#define CyaSSL_session_reused wolfSSL_session_reused
#define CyaSSL_get_version wolfSSL_get_version
#define CyaSSL_get_shutdown wolfSSL_get_shutdown

View File

@ -1,7 +1,7 @@
/* certs_test.h */
#ifndef CYASSL_CERTS_TEST_H
#define CYASSL_CERTS_TEST_H
#ifndef WOLFSSL_CERTS_TEST_H
#define WOLFSSL_CERTS_TEST_H
#ifdef USE_CERT_BUFFERS_1024
@ -1174,5 +1174,5 @@ const int sizeof_server_cert_der_2048 = sizeof(server_cert_der_2048);
#endif /* USE_CERT_BUFFERS_1024 */
#endif /* CYASSL_CERTS_TEST_H */
#endif /* WOLFSSL_CERTS_TEST_H */

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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,27 +20,27 @@
*/
#ifndef CYASSL_CRL_H
#define CYASSL_CRL_H
#ifndef WOLFSSL_CRL_H
#define WOLFSSL_CRL_H
#ifdef HAVE_CRL
#include <cyassl/ssl.h>
#include <cyassl/ctaocrypt/asn.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/asn.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CYASSL_CRL CYASSL_CRL;
typedef struct WOLFSSL_CRL WOLFSSL_CRL;
CYASSL_LOCAL int InitCRL(CYASSL_CRL*, CYASSL_CERT_MANAGER*);
CYASSL_LOCAL void FreeCRL(CYASSL_CRL*, int dynamic);
WOLFSSL_LOCAL int InitCRL(WOLFSSL_CRL*, WOLFSSL_CERT_MANAGER*);
WOLFSSL_LOCAL void FreeCRL(WOLFSSL_CRL*, int dynamic);
CYASSL_LOCAL int LoadCRL(CYASSL_CRL* crl, const char* path, int type, int mon);
CYASSL_LOCAL int BufferLoadCRL(CYASSL_CRL*, const byte*, long, int);
CYASSL_LOCAL int CheckCertCRL(CYASSL_CRL*, DecodedCert*);
WOLFSSL_LOCAL int LoadCRL(WOLFSSL_CRL* crl, const char* path, int type, int mon);
WOLFSSL_LOCAL int BufferLoadCRL(WOLFSSL_CRL*, const byte*, long, int);
WOLFSSL_LOCAL int CheckCertCRL(WOLFSSL_CRL*, DecodedCert*);
#ifdef __cplusplus
@ -48,4 +48,4 @@ CYASSL_LOCAL int CheckCertCRL(CYASSL_CRL*, DecodedCert*);
#endif
#endif /* HAVE_CRL */
#endif /* CYASSL_CRL_H */
#endif /* WOLFSSL_CRL_H */

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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,16 +20,16 @@
*/
#ifndef CYASSL_ERROR_H
#define CYASSL_ERROR_H
#ifndef WOLFSSL_ERROR_H
#define WOLFSSL_ERROR_H
#include <cyassl/ctaocrypt/error-crypt.h> /* pull in CTaoCrypt errors */
#include <wolfssl/wolfcrypt/error-crypt.h> /* pull in CTaoCrypt errors */
#ifdef __cplusplus
extern "C" {
#endif
enum CyaSSL_ErrorCodes {
enum wolfSSL_ErrorCodes {
INPUT_CASE_ERROR = -301, /* process input state error */
PREFIX_ERROR = -302, /* bad index to key rounds */
MEMORY_ERROR = -303, /* out of memory */
@ -140,7 +140,7 @@ enum CyaSSL_ErrorCodes {
};
#ifdef CYASSL_CALLBACKS
#ifdef WOLFSSL_CALLBACKS
enum {
MIN_PARAM_ERR = UNSUPPORTED_SUITE,
MAX_PARAM_ERR = MIN_PARAM_ERR - 10
@ -148,7 +148,7 @@ enum CyaSSL_ErrorCodes {
#endif
CYASSL_LOCAL
WOLFSSL_LOCAL
void SetErrorString(int err, char* buff);
@ -157,6 +157,6 @@ void SetErrorString(int err, char* buff);
#endif
#endif /* CyaSSL_ERROR_H */
#endif /* wolfSSL_ERROR_H */

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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,26 +20,26 @@
*/
/* CyaSSL OCSP API */
/* wolfSSL OCSP API */
#ifndef CYASSL_OCSP_H
#define CYASSL_OCSP_H
#ifndef WOLFSSL_OCSP_H
#define WOLFSSL_OCSP_H
#ifdef HAVE_OCSP
#include <cyassl/ssl.h>
#include <cyassl/ctaocrypt/asn.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/asn.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CYASSL_OCSP CYASSL_OCSP;
typedef struct WOLFSSL_OCSP WOLFSSL_OCSP;
CYASSL_LOCAL int InitOCSP(CYASSL_OCSP*, CYASSL_CERT_MANAGER*);
CYASSL_LOCAL void FreeOCSP(CYASSL_OCSP*, int dynamic);
WOLFSSL_LOCAL int InitOCSP(WOLFSSL_OCSP*, WOLFSSL_CERT_MANAGER*);
WOLFSSL_LOCAL void FreeOCSP(WOLFSSL_OCSP*, int dynamic);
CYASSL_LOCAL int CheckCertOCSP(CYASSL_OCSP*, DecodedCert*);
WOLFSSL_LOCAL int CheckCertOCSP(WOLFSSL_OCSP*, DecodedCert*);
#ifdef __cplusplus
} /* extern "C" */
@ -47,6 +47,6 @@ CYASSL_LOCAL int CheckCertOCSP(CYASSL_OCSP*, DecodedCert*);
#endif /* HAVE_OCSP */
#endif /* CYASSL_OCSP_H */
#endif /* WOLFSSL_OCSP_H */

View File

@ -1,9 +1,9 @@
/* cyassl options.h
/* wolfssl options.h
* generated from configure options
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
*/

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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 @@
*/
#ifndef CYASSL_SNIFFER_H
#define CYASSL_SNIFFER_H
#ifndef WOLFSSL_SNIFFER_H
#define WOLFSSL_SNIFFER_H
#include <cyassl/ctaocrypt/settings.h>
#include <wolfssl/wolfcrypt/settings.h>
#ifdef _WIN32
#ifdef SSL_SNIFFER_EXPORTS
@ -41,28 +41,28 @@
#endif
CYASSL_API
WOLFSSL_API
SSL_SNIFFER_API int ssl_SetPrivateKey(const char* address, int port,
const char* keyFile, int keyType,
const char* password, char* error);
CYASSL_API
WOLFSSL_API
SSL_SNIFFER_API int ssl_SetNamedPrivateKey(const char* name,
const char* address, int port,
const char* keyFile, int keyType,
const char* password, char* error);
CYASSL_API
WOLFSSL_API
SSL_SNIFFER_API int ssl_DecodePacket(const unsigned char* packet, int length,
unsigned char* data, char* error);
CYASSL_API
WOLFSSL_API
SSL_SNIFFER_API int ssl_Trace(const char* traceFile, char* error);
CYASSL_API void ssl_InitSniffer(void);
WOLFSSL_API void ssl_InitSniffer(void);
CYASSL_API void ssl_FreeSniffer(void);
WOLFSSL_API void ssl_FreeSniffer(void);
/* ssl_SetPrivateKey keyTypes */
@ -76,5 +76,5 @@ enum {
} /* extern "C" */
#endif
#endif /* CyaSSL_SNIFFER_H */
#endif /* wolfSSL_SNIFFER_H */

View File

@ -2,14 +2,14 @@
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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,8 +20,8 @@
*/
#ifndef CYASSL_SNIFFER_ERROR_H
#define CYASSL_SNIFFER_ERROR_H
#ifndef WOLFSSL_SNIFFER_ERROR_H
#define WOLFSSL_SNIFFER_ERROR_H
/* need to have errors as #defines since .rc files can't handle enums */
/* need to start at 1 and go in order for same reason */
@ -108,5 +108,5 @@
/* !!!! also add to msgTable in sniffer.c and .rc file !!!! */
#endif /* CyaSSL_SNIFFER_ERROR_H */
#endif /* wolfSSL_SNIFFER_ERROR_H */

View File

@ -27,14 +27,14 @@
/* for users not using preprocessor flags*/
#include <cyassl/ctaocrypt/settings.h>
#include <cyassl/version.h>
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/version.h>
/*
* Name Change Include
* wolfssl -> cyassl compatability layer
* wolfssl -> wolfssl compatability layer
*/
#include <cyassl/ssl.h>
#include <wolfssl/ssl.h>
#ifndef NO_FILESYSTEM
#ifdef FREESCALE_MQX
@ -1095,28 +1095,28 @@ enum {
/* for GetBulkCipher and internal use */
enum BulkCipherAlgorithm {
cyassl_cipher_null,
cyassl_rc4,
cyassl_rc2,
cyassl_des,
cyassl_triple_des, /* leading 3 (3des) not valid identifier */
cyassl_des40,
cyassl_idea,
cyassl_aes,
cyassl_aes_gcm,
cyassl_aes_ccm,
cyassl_chacha,
cyassl_camellia,
cyassl_hc128, /* wolfSSL extensions */
cyassl_rabbit
wolfssl_cipher_null,
wolfssl_rc4,
wolfssl_rc2,
wolfssl_des,
wolfssl_triple_des, /* leading 3 (3des) not valid identifier */
wolfssl_des40,
wolfssl_idea,
wolfssl_aes,
wolfssl_aes_gcm,
wolfssl_aes_ccm,
wolfssl_chacha,
wolfssl_camellia,
wolfssl_hc128, /* wolfSSL extensions */
wolfssl_rabbit
};
/* for KDF TLS 1.2 mac types */
enum KDF_MacAlgorithm {
cyassl_sha256 = 4, /* needs to match internal MACAlgorithm */
cyassl_sha384,
cyassl_sha512
wolfssl_sha256 = 4, /* needs to match internal MACAlgorithm */
wolfssl_sha384,
wolfssl_sha512
};
@ -1381,7 +1381,7 @@ int wolfSSL_DeriveTlsKeys(unsigned char* key_data, unsigned int keyLen,
#ifdef WOLFSSL_CALLBACKS
/* used internally by wolfSSL while OpenSSL types aren't */
#include <cyassl/callbacks.h>
#include <wolfssl/callbacks.h>
typedef int (*HandShakeCallBack)(HandShakeInfo*);
typedef int (*TimeoutCallBack)(TimeoutInfo*);

View File

@ -7,20 +7,20 @@
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <cyassl/ssl.h>
#include <cyassl/ctaocrypt/types.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <wolfssl/ssl.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/error-crypt.h>
#ifdef ATOMIC_USER
#include <cyassl/ctaocrypt/aes.h>
#include <cyassl/ctaocrypt/arc4.h>
#include <cyassl/ctaocrypt/hmac.h>
#include <wolfssl/wolfcrypt/aes.h>
#include <wolfssl/wolfcrypt/arc4.h>
#include <wolfssl/wolfcrypt/hmac.h>
#endif
#ifdef HAVE_PK_CALLBACKS
#include <cyassl/ctaocrypt/random.h>
#include <cyassl/ctaocrypt/asn.h>
#include <wolfssl/wolfcrypt/random.h>
#include <wolfssl/wolfcrypt/asn.h>
#ifdef HAVE_ECC
#include <cyassl/ctaocrypt/ecc.h>
#include <wolfssl/wolfcrypt/ecc.h>
#endif /* HAVE_ECC */
#endif /*HAVE_PK_CALLBACKS */
@ -1393,7 +1393,7 @@ static INLINE int myMacEncryptCb(WOLFSSL* ssl, unsigned char* macOut,
const char* tlsStr = "TLS";
/* example supports (d)tls aes */
if (wolfSSL_GetBulkCipher(ssl) != cyassl_aes) {
if (wolfSSL_GetBulkCipher(ssl) != wolfssl_aes) {
printf("myMacEncryptCb not using AES\n");
return -1;
}
@ -1467,7 +1467,7 @@ static INLINE int myDecryptVerifyCb(WOLFSSL* ssl,
const char* tlsStr = "TLS";
/* example supports (d)tls aes */
if (wolfSSL_GetBulkCipher(ssl) != cyassl_aes) {
if (wolfSSL_GetBulkCipher(ssl) != wolfssl_aes) {
printf("myMacEncryptCb not using AES\n");
return -1;
}

View File

@ -1,15 +1,15 @@
/* cyassl_version.h.in
/* wolfssl_version.h.in
*
* Copyright (C) 2006-2014 wolfSSL Inc.
*
* This file is part of CyaSSL.
* This file is part of wolfSSL. (formerly known as CyaSSL)
*
* 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.
@ -26,8 +26,8 @@
extern "C" {
#endif
#define LIBCYASSL_VERSION_STRING "3.3.0"
#define LIBCYASSL_VERSION_HEX 0x03003000
#define LIBWOLFSSL_VERSION_STRING "3.3.0"
#define LIBWOLFSSL_VERSION_HEX 0x03003000
#ifdef __cplusplus
}

View File

@ -21,8 +21,7 @@
/* Visibility control macros */
#define CTAO_CRYPT_VISIBILITY_H WOLF_CRYPT_VISIBILITY_H
#ifndef WOLF_CRYPT_VISIBILITY_H
#if !defined(WOLF_CRYPT_VISIBILITY_H && CTAO_CRYPT_VISIBILITY_H)
#define WOLF_CRYPT_VISIBILITY_H

View File

@ -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,8 +20,8 @@
*/
#ifndef CTAO_CRYPT_PORT_H
#define CTAO_CRYPT_PORT_H
#if !defined(WOLF_CRYPT_PORT_H && CTAO_CRYPT_PORT_H)
#define WOLF_CRYPT_PORT_H
#ifdef __cplusplus
@ -30,7 +30,7 @@
#ifdef USE_WINDOWS_API
#ifdef CYASSL_GAME_BUILD
#ifdef WOLFSSL_GAME_BUILD
#include "system/xtl.h"
#else
#ifndef WIN32_LEAN_AND_MEAN
@ -48,26 +48,26 @@
#endif
#elif defined(MICRIUM)
/* do nothing, just don't pick Unix */
#elif defined(FREERTOS) || defined(CYASSL_SAFERTOS)
#elif defined(FREERTOS) || defined(WOLFSSL_SAFERTOS)
/* do nothing */
#elif defined(EBSNET)
/* do nothing */
#elif defined(FREESCALE_MQX)
/* do nothing */
#elif defined(CYASSL_MDK_ARM)
#if defined(CYASSL_MDK5)
#elif defined(WOLFSSL_MDK_ARM)
#if defined(WOLFSSL_MDK5)
#include "cmsis_os.h"
#else
#include <rtl.h>
#endif
#elif defined(CYASSL_CMSIS_RTOS)
#elif defined(WOLFSSL_CMSIS_RTOS)
#include "cmsis_os.h"
#elif defined(CYASSL_TIRTOS)
#elif defined(WOLFSSL_TIRTOS)
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Semaphore.h>
#else
#ifndef SINGLE_THREADED
#define CYASSL_PTHREADS
#define WOLFSSL_PTHREADS
#include <pthread.h>
#endif
#if defined(OPENSSL_EXTRA) || defined(GOAHEAD_WS)
@ -77,47 +77,47 @@
#ifdef SINGLE_THREADED
typedef int CyaSSL_Mutex;
typedef int wolfSSL_Mutex;
#else /* MULTI_THREADED */
/* FREERTOS comes first to enable use of FreeRTOS Windows simulator only */
#ifdef FREERTOS
typedef xSemaphoreHandle CyaSSL_Mutex;
#elif defined(CYASSL_SAFERTOS)
typedef struct CyaSSL_Mutex {
typedef xSemaphoreHandle wolfSSL_Mutex;
#elif defined(WOLFSSL_SAFERTOS)
typedef struct wolfSSL_Mutex {
signed char mutexBuffer[portQUEUE_OVERHEAD_BYTES];
xSemaphoreHandle mutex;
} CyaSSL_Mutex;
} wolfSSL_Mutex;
#elif defined(USE_WINDOWS_API)
typedef CRITICAL_SECTION CyaSSL_Mutex;
#elif defined(CYASSL_PTHREADS)
typedef pthread_mutex_t CyaSSL_Mutex;
typedef CRITICAL_SECTION wolfSSL_Mutex;
#elif defined(WOLFSSL_PTHREADS)
typedef pthread_mutex_t wolfSSL_Mutex;
#elif defined(THREADX)
typedef TX_MUTEX CyaSSL_Mutex;
typedef TX_MUTEX wolfSSL_Mutex;
#elif defined(MICRIUM)
typedef OS_MUTEX CyaSSL_Mutex;
typedef OS_MUTEX wolfSSL_Mutex;
#elif defined(EBSNET)
typedef RTP_MUTEX CyaSSL_Mutex;
typedef RTP_MUTEX wolfSSL_Mutex;
#elif defined(FREESCALE_MQX)
typedef MUTEX_STRUCT CyaSSL_Mutex;
#elif defined(CYASSL_MDK_ARM)
#if defined(CYASSL_CMSIS_RTOS)
typedef osMutexId CyaSSL_Mutex;
typedef MUTEX_STRUCT wolfSSL_Mutex;
#elif defined(WOLFSSL_MDK_ARM)
#if defined(WOLFSSL_CMSIS_RTOS)
typedef osMutexId wolfSSL_Mutex;
#else
typedef OS_MUT CyaSSL_Mutex;
typedef OS_MUT wolfSSL_Mutex;
#endif
#elif defined(CYASSL_CMSIS_RTOS)
typedef osMutexId CyaSSL_Mutex;
#elif defined(CYASSL_TIRTOS)
typedef ti_sysbios_knl_Semaphore_Handle CyaSSL_Mutex;
#elif defined(WOLFSSL_CMSIS_RTOS)
typedef osMutexId wolfSSL_Mutex;
#elif defined(WOLFSSL_TIRTOS)
typedef ti_sysbios_knl_Semaphore_Handle wolfSSL_Mutex;
#else
#error Need a mutex type in multithreaded mode
#endif /* USE_WINDOWS_API */
#endif /* SINGLE_THREADED */
CYASSL_LOCAL int InitMutex(CyaSSL_Mutex*);
CYASSL_LOCAL int FreeMutex(CyaSSL_Mutex*);
CYASSL_LOCAL int LockMutex(CyaSSL_Mutex*);
CYASSL_LOCAL int UnLockMutex(CyaSSL_Mutex*);
WOLFSSL_LOCAL int InitMutex(wolfSSL_Mutex*);
WOLFSSL_LOCAL int FreeMutex(wolfSSL_Mutex*);
WOLFSSL_LOCAL int LockMutex(wolfSSL_Mutex*);
WOLFSSL_LOCAL int UnLockMutex(wolfSSL_Mutex*);
/* filesystem abstraction layer, used by ssl.c */
@ -172,10 +172,10 @@ CYASSL_LOCAL int UnLockMutex(CyaSSL_Mutex*);
#else
/* stdio, default case */
#define XFILE FILE*
#if defined(CYASSL_MDK_ARM)
#if defined(WOLFSSL_MDK_ARM)
#include <stdio.h>
extern FILE * CyaSSL_fopen(const char *name, const char *mode) ;
#define XFOPEN CyaSSL_fopen
extern FILE * wolfSSL_fopen(const char *name, const char *mode) ;
#define XFOPEN wolfSSL_fopen
#else
#define XFOPEN fopen
#endif
@ -196,5 +196,5 @@ CYASSL_LOCAL int UnLockMutex(CyaSSL_Mutex*);
} /* extern "C" */
#endif
#endif /* CTAO_CRYPT_PORT_H */
#endif /* WOLF_CRYPT_PORT_H */