From a073730c3891de0706b2a61592c9aae168e79dfe Mon Sep 17 00:00:00 2001 From: Kaleb Himes Date: Thu, 18 Dec 2014 14:06:27 -0700 Subject: [PATCH] compatibility layer includes --- cyassl/ssl.h | 5 +++++ src/crl.c | 3 +++ src/internal.c | 3 +++ src/io.c | 4 ++++ src/keys.c | 2 ++ src/ocsp.c | 3 +++ src/sniffer.c | 3 ++- src/ssl.c | 3 +++ src/tls.c | 5 ++++- wolfssl/wolfcrypt/types.h | 25 +++++++++++++------------ 10 files changed, 42 insertions(+), 14 deletions(-) diff --git a/cyassl/ssl.h b/cyassl/ssl.h index e5742fcf1..d53c83ef8 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -123,6 +123,7 @@ #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 +#define CYASSL_CBIO_ERR_CONN_RST WOLFSSL_CBIO_ERR_CONN_RST /* src/tls.c */ #define CYASSL_SERVER_END WOLFSSL_SERVER_END @@ -136,6 +137,10 @@ #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 +#define cyassl_chacha wolfssl_chacha + +/* keys.c */ +#define cyassl_triple_des wolfssl_triple_des diff --git a/src/crl.c b/src/crl.c index 5ffe8c637..f0b7c157c 100644 --- a/src/crl.c +++ b/src/crl.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + /* Name change compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/internal.c b/src/internal.c index 07c14c03e..1c78d15a1 100644 --- a/src/internal.c +++ b/src/internal.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + /* Name change compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include diff --git a/src/io.c b/src/io.c index 5536367ae..905101abf 100644 --- a/src/io.c +++ b/src/io.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/* Name change compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include #endif @@ -33,6 +36,7 @@ #include #include + /* if user writes own I/O callbacks they can define CYASSL_USER_IO to remove automatic setting of default I/O functions EmbedSend() and EmbedReceive() but they'll still need SetCallback xxx() at end of file diff --git a/src/keys.c b/src/keys.c index 5bd6ac958..f2e13925d 100644 --- a/src/keys.c +++ b/src/keys.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +/* Name change compatibility layer */ +#include #ifdef HAVE_CONFIG_H #include diff --git a/src/ocsp.c b/src/ocsp.c index a0150e87a..95696b25a 100644 --- a/src/ocsp.c +++ b/src/ocsp.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + /* Name change compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/sniffer.c b/src/sniffer.c index 2462aaac2..41dff99fb 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -19,7 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ - + /* Name change compatibility layer */ +#include #ifdef HAVE_CONFIG_H #include diff --git a/src/ssl.c b/src/ssl.c index 5f70e0e34..3d8cb18dc 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + /* Name change compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include #endif diff --git a/src/tls.c b/src/tls.c index e40398f58..dd8a0b119 100644 --- a/src/tls.c +++ b/src/tls.c @@ -19,13 +19,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + /* Name change compatibility layer */ +#include + #ifdef HAVE_CONFIG_H #include #endif #include -#include +#include #include #include #include diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index c61028b11..b7d4d8617 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -2,7 +2,7 @@ * * Copyright (C) 2006-2014 wolfSSL Inc. * - * This file is part of wolfSSL. + * This file is part of wolfSSL. (formerly known as CyaSSL) * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,14 +19,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#if !defined(WOLF_CRYPT_TYPES_H && CTAO_CRYPT_TYPES_H) + +#if !defined(WOLF_CRYPT_TYPES_H) && !defined(CTAO_CRYPT_TYPES_H) +#elif defined(CTAO_CRYPT_TYPES_H) + /* do nothing */ +#else #define WOLF_CRYPT_TYPES_H #include #include - -/* wolfssl_wolfssl compatibility layer */ -#include #ifdef __cplusplus extern "C" { @@ -129,15 +130,15 @@ enum { /* set up rotate style */ #if defined(_MSC_VER) || defined(__BCPLUSPLUS__) - #define INTEL_INTRINSICS - #define FAST_ROTATE + #define INTEL_INTRINSICS + #define FAST_ROTATE #elif defined(__MWERKS__) && TARGET_CPU_PPC - #define PPC_INTRINSICS - #define FAST_ROTATE + #define PPC_INTRINSICS + #define FAST_ROTATE #elif defined(__GNUC__) && defined(__i386__) /* GCC does peephole optimizations which should result in using rotate instructions */ - #define FAST_ROTATE + #define FAST_ROTATE #endif @@ -229,7 +230,6 @@ enum { /* memory allocation types for user hints */ - enum { DYNAMIC_TYPE_CA = 1, DYNAMIC_TYPE_CERT = 2, @@ -326,4 +326,5 @@ WOLFSSL_API word32 CheckRunTimeSettings(void); } /* extern "C" */ #endif -#endif /* WOLF_CRYPT_TYPES_H */ + +#endif /* WOLF_CRYPT_TYPES_H */ \ No newline at end of file