working on commit tests

This commit is contained in:
Jacob Barthelmeh
2014-12-30 11:00:18 -07:00
parent 9f3de72055
commit 8594ccf2df
8 changed files with 47 additions and 47 deletions

View File

@@ -187,7 +187,7 @@ AC_ARG_ENABLE([fortress],
if test "$ENABLED_FORTRESS" = "yes" if test "$ENABLED_FORTRESS" = "yes"
then then
AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DCYASSL_ALWAYS_VERIFY_CB -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DCYASSL_KEY_GEN" AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DCYASSL_ALWAYS_VERIFY_CB -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DWOLFSSL_KEY_GEN"
fi fi
@@ -200,7 +200,7 @@ AC_ARG_ENABLE([bump],
if test "$ENABLED_BUMP" = "yes" if test "$ENABLED_BUMP" = "yes"
then then
AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DCYASSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT" AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DWOLFSSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT"
fi fi
ENABLED_SLOWMATH="yes" ENABLED_SLOWMATH="yes"
@@ -536,7 +536,7 @@ AC_ARG_ENABLE([keygen],
if test "$ENABLED_KEYGEN" = "yes" if test "$ENABLED_KEYGEN" = "yes"
then then
AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN" AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
fi fi
@@ -1441,7 +1441,7 @@ then
if test "x$ENABLED_KEYGEN" = "xno" if test "x$ENABLED_KEYGEN" = "xno"
then then
ENABLED_KEYGEN="yes" ENABLED_KEYGEN="yes"
AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN" AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
fi fi
if test "x$ENABLED_CERTGEN" = "xno" if test "x$ENABLED_CERTGEN" = "xno"
then then

View File

@@ -26,11 +26,11 @@
#ifndef HAVE_FIPS #ifndef HAVE_FIPS
#include <wolfssl/wolfcrypt/types.h> #include <wolfssl/wolfcrypt/types.h>
/* compatibility macros */ /* compatibility macros */
#define CYASSL_WORD_SIZE WOLFSSL_WORD_SIZE #define CYASSL_WORD_SIZE WOLFSSL_WORD_SIZE
#define CYASSL_BIT_SIZE WOLFSSL_BIT_SIZE #define CYASSL_BIT_SIZE WOLFSSL_BIT_SIZE
#define CYASSL_MAX_16BIT WOLFSSL_MAX_16BIT #define CYASSL_MAX_16BIT WOLFSSL_MAX_16BIT
#define CYASSL_MAX_ERROR_SZ WOLFSSL_MAX_ERROR_SZ
#define cyassl_word wolfssl_word #define cyassl_word wolfssl_word
#else #else
#include <cyassl/ctaocrypt/settings.h> #include <cyassl/ctaocrypt/settings.h>

View File

@@ -5758,18 +5758,18 @@ static INLINE int Encrypt(WOLFSSL* ssl, byte* out, const byte* input, word16 sz)
#ifdef HAVE_CAMELLIA #ifdef HAVE_CAMELLIA
case wolfssl_camellia: case wolfssl_camellia:
CamelliaCbcEncrypt(ssl->encrypt.cam, out, input, sz); wc_CamelliaCbcEncrypt(ssl->encrypt.cam, out, input, sz);
break; break;
#endif #endif
#ifdef HAVE_HC128 #ifdef HAVE_HC128
case wolfssl_hc128: case wolfssl_hc128:
return Hc128_Process(ssl->encrypt.hc128, out, input, sz); return wc_Hc128_Process(ssl->encrypt.hc128, out, input, sz);
#endif #endif
#ifdef BUILD_RABBIT #ifdef BUILD_RABBIT
case wolfssl_rabbit: case wolfssl_rabbit:
return RabbitProcess(ssl->encrypt.rabbit, out, input, sz); return wc_RabbitProcess(ssl->encrypt.rabbit, out, input, sz);
#endif #endif
#ifdef HAVE_CHACHA #ifdef HAVE_CHACHA

View File

@@ -911,10 +911,10 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt,
#endif #endif
if (version == PKCS5v2) if (version == PKCS5v2)
ret = PBKDF2(key, (byte*)password, passwordSz, salt, saltSz, iterations, ret = wc_PBKDF2(key, (byte*)password, passwordSz, salt, saltSz, iterations,
derivedLen, typeH); derivedLen, typeH);
else if (version == PKCS5) else if (version == PKCS5)
ret = PBKDF1(key, (byte*)password, passwordSz, salt, saltSz, iterations, ret = wc_PBKDF1(key, (byte*)password, passwordSz, salt, saltSz, iterations,
derivedLen, typeH); derivedLen, typeH);
else if (version == PKCS12) { else if (version == PKCS12) {
int i, idx = 0; int i, idx = 0;
@@ -935,10 +935,10 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt,
unicodePasswd[idx++] = 0x00; unicodePasswd[idx++] = 0x00;
unicodePasswd[idx++] = 0x00; unicodePasswd[idx++] = 0x00;
ret = PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz, ret = wc_PKCS12_PBKDF(key, unicodePasswd, idx, salt, saltSz,
iterations, derivedLen, typeH, 1); iterations, derivedLen, typeH, 1);
if (decryptionType != RC4_TYPE) if (decryptionType != RC4_TYPE)
ret += PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt, saltSz, ret += wc_PKCS12_PBKDF(cbcIv, unicodePasswd, idx, salt, saltSz,
iterations, 8, typeH, 2); iterations, 8, typeH, 2);
} }
else { else {
@@ -965,7 +965,7 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt,
if (version == PKCS5v2 || version == PKCS12) if (version == PKCS5v2 || version == PKCS12)
desIv = cbcIv; desIv = cbcIv;
ret = Des_SetKey(&dec, key, desIv, DES_DECRYPTION); ret = wc_Des_SetKey(&dec, key, desIv, DES_DECRYPTION);
if (ret != 0) { if (ret != 0) {
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER);
@@ -973,7 +973,7 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt,
return ret; return ret;
} }
Des_CbcDecrypt(&dec, input, input, length); wc_Des_CbcDecrypt(&dec, input, input, length);
break; break;
} }
@@ -984,14 +984,14 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt,
if (version == PKCS5v2 || version == PKCS12) if (version == PKCS5v2 || version == PKCS12)
desIv = cbcIv; desIv = cbcIv;
ret = Des3_SetKey(&dec, key, desIv, DES_DECRYPTION); ret = wc_Des3_SetKey(&dec, key, desIv, DES_DECRYPTION);
if (ret != 0) { if (ret != 0) {
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER);
#endif #endif
return ret; return ret;
} }
ret = Des3_CbcDecrypt(&dec, input, input, length); ret = wc_Des3_CbcDecrypt(&dec, input, input, length);
if (ret != 0) { if (ret != 0) {
#ifdef WOLFSSL_SMALL_STACK #ifdef WOLFSSL_SMALL_STACK
XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER); XFREE(key, NULL, DYNAMIC_TYPE_TMP_BUFFER);
@@ -1006,8 +1006,8 @@ static int DecryptKey(const char* password, int passwordSz, byte* salt,
{ {
Arc4 dec; Arc4 dec;
Arc4SetKey(&dec, key, derivedLen); wc_Arc4SetKey(&dec, key, derivedLen);
Arc4Process(&dec, input, input, length); wc_Arc4Process(&dec, input, input, length);
break; break;
} }
#endif #endif
@@ -1276,7 +1276,7 @@ int RsaPublicKeyDecodeRaw(const byte* n, word32 nSz, const byte* e, word32 eSz,
#ifndef NO_DH #ifndef NO_DH
int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz) int wc_DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz)
{ {
int length; int length;
@@ -1289,7 +1289,7 @@ int DhKeyDecode(const byte* input, word32* inOutIdx, DhKey* key, word32 inSz)
return 0; return 0;
} }
int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz) int wc_DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz)
{ {
if (key == NULL || p == NULL || g == NULL || pSz == 0 || gSz == 0) if (key == NULL || p == NULL || g == NULL || pSz == 0 || gSz == 0)
return BAD_FUNC_ARG; return BAD_FUNC_ARG;
@@ -1324,7 +1324,7 @@ int DhSetKey(DhKey* key, const byte* p, word32 pSz, const byte* g, word32 gSz)
} }
int DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz, int wc_DhParamsLoad(const byte* input, word32 inSz, byte* p, word32* pInOutSz,
byte* g, word32* gInOutSz) byte* g, word32* gInOutSz)
{ {
word32 i = 0; word32 i = 0;
@@ -4629,7 +4629,7 @@ static INLINE void FreeTmpRsas(byte** tmps, void* heap)
/* Convert RsaKey key to DER format, write to output (inLen), return bytes /* Convert RsaKey key to DER format, write to output (inLen), return bytes
written */ written */
int RsaKeyToDer(RsaKey* key, byte* output, word32 inLen) int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen)
{ {
word32 seqSz, verSz, rawLen, intTotalLen = 0; word32 seqSz, verSz, rawLen, intTotalLen = 0;
word32 sizes[RSA_INTS]; word32 sizes[RSA_INTS];

View File

@@ -23,18 +23,18 @@
#include <config.h> #include <config.h>
#endif #endif
#include <cyassl/ctaocrypt/settings.h> #include <wolfssl/wolfcrypt/settings.h>
#ifdef HAVE_HC128 #ifdef HAVE_HC128
#include <cyassl/ctaocrypt/hc128.h> #include <wolfssl/wolfcrypt/hc128.h>
#include <cyassl/ctaocrypt/error-crypt.h> #include <wolfssl/wolfcrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h> #include <wolfssl/wolfcrypt/logging.h>
#ifdef NO_INLINE #ifdef NO_INLINE
#include <cyassl/ctaocrypt/hc128.h> #include <wolfssl/wolfcrypt/hc128.h>
#include <cyassl/ctaocrypt/misc.h> #include <wolfssl/wolfcrypt/misc.h>
#else #else
#include <ctaocrypt/src/misc.c> #include <wolfcrypt/src/misc.c>
#endif #endif

View File

@@ -2,14 +2,14 @@
* *
* Copyright (C) 2006-2014 wolfSSL Inc. * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (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 * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
@@ -22,10 +22,10 @@
#ifndef NO_HC128 #ifndef NO_HC128
#ifndef CTAO_CRYPT_HC128_H #ifndef WOLF_CRYPT_HC128_H
#define CTAO_CRYPT_HC128_H #define WOLF_CRYPT_HC128_H
#include <cyassl/ctaocrypt/types.h> #include <wolfssl/wolfcrypt/types.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -47,14 +47,14 @@ typedef struct HC128 {
} HC128; } HC128;
CYASSL_API int Hc128_Process(HC128*, byte*, const byte*, word32); WOLFSSL_API int wc_Hc128_Process(HC128*, byte*, const byte*, word32);
CYASSL_API int Hc128_SetKey(HC128*, const byte* key, const byte* iv); WOLFSSL_API int wc_Hc128_SetKey(HC128*, const byte* key, const byte* iv);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */
#endif #endif
#endif /* CTAO_CRYPT_HC128_H */ #endif /* WOLF_CRYPT_HC128_H */
#endif /* HAVE_HC128 */ #endif /* HAVE_HC128 */

View File

@@ -301,14 +301,14 @@ int mp_sub_d (mp_int * a, mp_digit b, mp_int * c);
int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e, int mp_init_multi(mp_int* a, mp_int* b, mp_int* c, mp_int* d, mp_int* e,
mp_int* f); mp_int* f);
#if defined(HAVE_ECC) || defined(CYASSL_KEY_GEN) #if defined(HAVE_ECC) || defined(WOLFSSL_KEY_GEN)
int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c); int mp_sqrmod(mp_int* a, mp_int* b, mp_int* c);
#endif #endif
#ifdef HAVE_ECC #ifdef HAVE_ECC
int mp_read_radix(mp_int* a, const char* str, int radix); int mp_read_radix(mp_int* a, const char* str, int radix);
#endif #endif
#ifdef CYASSL_KEY_GEN #ifdef WOLFSSL_KEY_GEN
int mp_prime_is_prime (mp_int * a, int t, int *result); int mp_prime_is_prime (mp_int * a, int t, int *result);
int mp_gcd (mp_int * a, mp_int * b, mp_int * c); int mp_gcd (mp_int * a, mp_int * b, mp_int * c);
int mp_lcm (mp_int * a, mp_int * b, mp_int * c); int mp_lcm (mp_int * a, mp_int * b, mp_int * c);

View File

@@ -64,13 +64,13 @@ WOLFSSL_API int wc_RsaFlattenPublicKey(RsaKey*, byte*, word32*, byte*,
word32*); word32*);
#ifdef WOLFSSL_KEY_GEN #ifdef WOLFSSL_KEY_GEN
WOLFSSL_API int MakeRsaKey(RsaKey* key, int size, long e, RNG* rng); WOLFSSL_API int wc_MakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
WOLFSSL_API int RsaKeyToDer(RsaKey*, byte* output, word32 inLen); WOLFSSL_API int wc_RsaKeyToDer(RsaKey*, byte* output, word32 inLen);
#endif #endif
#ifdef HAVE_CAVIUM #ifdef HAVE_CAVIUM
WOLFSSL_API int RsaInitCavium(RsaKey*, int); WOLFSSL_API int wc_RsaInitCavium(RsaKey*, int);
WOLFSSL_API void RsaFreeCavium(RsaKey*); WOLFSSL_API void wc_RsaFreeCavium(RsaKey*);
#endif #endif