diff --git a/configure.ac b/configure.ac index 3819a95e5..4a1d6f442 100644 --- a/configure.ac +++ b/configure.ac @@ -1472,7 +1472,7 @@ AC_ARG_ENABLE([smallstack], if test "x$ENABLED_SMALL_STACK" = "xyes" then - AM_CFLAGS="$AM_CFLAGS -DCYASSL_SMALL_STACK" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SMALL_STACK" fi diff --git a/cyassl/ssl.h b/cyassl/ssl.h index 46ef3e82f..399f9e227 100644 --- a/cyassl/ssl.h +++ b/cyassl/ssl.h @@ -283,6 +283,27 @@ /* End wolfssl -> cyassl -> openssl compatibility */ + +/* JRB macro redefinitions and api calls for cryptography for reverse compat. */ +#ifdef WOLFSSL_SMALL_STACK + #define CYASSL_SMALL_STACK +#endif + + +/* wrapper around macros until they are changed in cyassl code + * needs investigation in regards to macros in fips */ +#define WOLFSSL_MAX_16BIT CYASSL_MAX_16BIT +#define WOLFSSL_MSG(x) CYASSL_MSG(x) + +/* for arc4 reverse compatibility */ +#ifndef NO_RC4 + #define CYASSL_ARC4_CAVIUM_MAGIC WOLFSSL_ARC4_CAVIUM_MAGIC + #define Arc4Process wc_Arc4Process + #define Arc4SetKey wc_Arc4SetKey + #define Arc4InitCavium wc_Arc4InitCavium + #define Arc4FreeCavium wc_Arc4FreeCavium +#endif + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/wolfcrypt/src/arc4.c b/wolfcrypt/src/arc4.c index 6b52da849..410ad34f2 100644 --- a/wolfcrypt/src/arc4.c +++ b/wolfcrypt/src/arc4.c @@ -29,10 +29,6 @@ #include -/* wrapper around macros until they are changed in cyassl code */ -#define WOLFSSL_MAX_16BIT CYASSL_MAX_16BIT -#define WOLFSSL_MSG(x) CYASSL_MSG(x) - #ifdef HAVE_CAVIUM static void wc_Arc4CaviumSetKey(Arc4* arc4, const byte* key, word32 length); diff --git a/ctaocrypt/src/camellia.c b/wolfcrypt/src/camellia.c similarity index 99% rename from ctaocrypt/src/camellia.c rename to wolfcrypt/src/camellia.c index eaed4c90b..f0dfd76f6 100644 --- a/ctaocrypt/src/camellia.c +++ b/wolfcrypt/src/camellia.c @@ -29,14 +29,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. @@ -70,6 +70,8 @@ #endif + + /* u32 must be 32bit word */ typedef unsigned int u32; typedef unsigned char u8; @@ -492,7 +494,7 @@ static int camellia_setup128(const unsigned char *key, u32 *subkey) u32 il, ir, t0, t1, w0, w1; u32 kw4l, kw4r, dw, tl, tr; -#ifdef CYASSL_SMALL_STACK +#ifdef WOLFSSL_SMALL_STACK u32* subL; u32* subR; @@ -710,7 +712,7 @@ static int camellia_setup128(const unsigned char *key, u32 *subkey) dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw); CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw; -#ifdef CYASSL_SMALL_STACK +#ifdef WOLFSSL_SMALL_STACK XFREE(subL, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(subR, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif @@ -725,7 +727,7 @@ static int camellia_setup256(const unsigned char *key, u32 *subkey) u32 il, ir, t0, t1, w0, w1; /* temporary variables */ u32 kw4l, kw4r, dw, tl, tr; -#ifdef CYASSL_SMALL_STACK +#ifdef WOLFSSL_SMALL_STACK u32* subL; u32* subR; @@ -1017,7 +1019,7 @@ static int camellia_setup256(const unsigned char *key, u32 *subkey) dw = CamelliaSubkeyL(31) ^ CamelliaSubkeyR(31), dw = CAMELLIA_RL8(dw); CamelliaSubkeyR(31) = CamelliaSubkeyL(31) ^ dw,CamelliaSubkeyL(31) = dw; -#ifdef CYASSL_SMALL_STACK +#ifdef WOLFSSL_SMALL_STACK XFREE(subL, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(subR, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif diff --git a/wolfssl/wolfcrypt/arc4.h b/wolfssl/wolfcrypt/arc4.h index 778f06da7..67335747f 100644 --- a/wolfssl/wolfcrypt/arc4.h +++ b/wolfssl/wolfcrypt/arc4.h @@ -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. @@ -31,12 +31,6 @@ extern "C" { #endif -/* for reverse compatibility */ -#define CYASSL_ARC4_CAVIUM_MAGIC WOLFSSL_ARC4_CAVIUM_MAGIC -#define Arc4Process wc_Arc4Process -#define Arc4SetKey wc_Arc4SetKey -#define Arc4InitCavium wc_Arc4InitCavium -#define Arc4FreeCavium wc_Arc4FreeCavium #define WOLFSSL_ARC4_CAVIUM_MAGIC 0xBEEF0001 diff --git a/cyassl/ctaocrypt/camellia.h b/wolfssl/wolfcrypt/camellia.h similarity index 97% rename from cyassl/ctaocrypt/camellia.h rename to wolfssl/wolfcrypt/camellia.h index aec9ecf69..43ef20f0c 100644 --- a/cyassl/ctaocrypt/camellia.h +++ b/wolfssl/wolfcrypt/camellia.h @@ -48,8 +48,8 @@ #ifdef HAVE_CAMELLIA -#ifndef CTAO_CRYPT_CAMELLIA_H -#define CTAO_CRYPT_CAMELLIA_H +#ifndef WOLF_CRYPT_CAMELLIA_H +#define WOLF_CRYPT_CAMELLIA_H #include @@ -91,6 +91,6 @@ CYASSL_API void CamelliaCbcDecrypt(Camellia* cam, } /* extern "C" */ #endif -#endif /* CTAO_CRYPT_AES_H */ +#endif /* WOLF_CRYPT_AES_H */ #endif /* HAVE_CAMELLIA */