Merge branch 'master' of github.com:cyassl/cyassl

This commit is contained in:
toddouska
2014-03-25 16:02:12 -07:00
44 changed files with 109 additions and 70 deletions

View File

@@ -33,7 +33,7 @@
#endif
#include <cyassl/ctaocrypt/aes.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef NO_INLINE
#include <cyassl/ctaocrypt/misc.h>
@@ -3493,3 +3493,4 @@ static int AesCaviumCbcDecrypt(Aes* aes, byte* out, const byte* in,
#endif /* NO_AES */

View File

@@ -38,7 +38,7 @@
#include <cyassl/ctaocrypt/sha.h>
#include <cyassl/ctaocrypt/md5.h>
#include <cyassl/ctaocrypt/md2.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/pwdbased.h>
#include <cyassl/ctaocrypt/des3.h>
#include <cyassl/ctaocrypt/sha256.h>

View File

@@ -61,7 +61,7 @@
#ifdef HAVE_CAMELLIA
#include <cyassl/ctaocrypt/camellia.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef NO_INLINE
#include <cyassl/ctaocrypt/misc.h>

View File

@@ -28,7 +28,7 @@
#ifndef NO_CODING
#include <cyassl/ctaocrypt/coding.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>

View File

@@ -30,7 +30,7 @@
#include <cyassl/ctaocrypt/compress.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef NO_INLINE
#include <cyassl/ctaocrypt/misc.h>

View File

@@ -28,7 +28,7 @@
#ifndef NO_DH
#include <cyassl/ctaocrypt/dh.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifndef USER_MATH_LIB
#include <math.h>

View File

@@ -30,7 +30,7 @@
#include <cyassl/ctaocrypt/dsa.h>
#include <cyassl/ctaocrypt/sha.h>
#include <cyassl/ctaocrypt/random.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
enum {

View File

@@ -31,7 +31,7 @@
#include <cyassl/ctaocrypt/ecc.h>
#include <cyassl/ctaocrypt/asn.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef HAVE_ECC_ENCRYPT
#include <cyassl/ctaocrypt/hmac.h>
@@ -3658,17 +3658,27 @@ static void ecc_ctx_init(ecEncCtx* ctx, int flags)
}
/* allow ecc context reset so user doesn't have to init/free for resue */
int ecc_ctx_reset(ecEncCtx* ctx, RNG* rng)
{
if (ctx == NULL || rng == NULL)
return BAD_FUNC_ARG;
ecc_ctx_init(ctx, ctx->protocol);
return ecc_ctx_set_salt(ctx, ctx->protocol, rng);
}
/* alloc/init and set defaults, return new Context */
ecEncCtx* ecc_ctx_new(int flags, RNG* rng)
{
int ret = 0;
ecEncCtx* ctx = (ecEncCtx*)XMALLOC(sizeof(ecEncCtx), 0, DYNAMIC_TYPE_ECC);
ecc_ctx_init(ctx, flags);
if (ctx && flags)
ret = ecc_ctx_set_salt(ctx, flags, rng);
if (ctx)
ctx->protocol = (byte)flags;
ret = ecc_ctx_reset(ctx, rng);
if (ret != 0) {
ecc_ctx_free(ctx);
ctx = NULL;

View File

@@ -25,7 +25,7 @@
#include <cyassl/ctaocrypt/settings.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef _MSC_VER
/* 4996 warning to use MS extensions e.g., strcpy_s instead of XSTRNCPY */

View File

@@ -28,7 +28,7 @@
#ifdef HAVE_HC128
#include <cyassl/ctaocrypt/hc128.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef NO_INLINE
#include <cyassl/ctaocrypt/hc128.h>

View File

@@ -44,7 +44,7 @@
#endif
#include <cyassl/ctaocrypt/hmac.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef HAVE_CAVIUM

View File

@@ -28,7 +28,7 @@
/* submitted by eof */
#include <cyassl/ctaocrypt/logging.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef __cplusplus

View File

@@ -28,7 +28,7 @@
#ifdef USE_CYASSL_MEMORY
#include <cyassl/ctaocrypt/memory.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef CYASSL_MALLOC_CHECK
#include <stdio.h>

View File

@@ -28,7 +28,7 @@
#ifdef HAVE_PKCS7
#include <cyassl/ctaocrypt/pkcs7.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifndef min

View File

@@ -25,7 +25,7 @@
#include <cyassl/ctaocrypt/settings.h>
#include <cyassl/ctaocrypt/types.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef _MSC_VER
@@ -352,7 +352,7 @@ int UnLockMutex(CyaSSL_Mutex *m)
return BAD_MUTEX_E;
}
#elif defined(CYASSL_MDK_ARM)
#elif defined(CYASSL_MDK_ARM)|| defined(CYASSL_CMSIS_RTOS)
#if defined(CYASSL_CMSIS_RTOS)
#include "cmsis_os.h"

View File

@@ -46,7 +46,7 @@
#include <cyassl/ctaocrypt/pwdbased.h>
#include <cyassl/ctaocrypt/hmac.h>
#include <cyassl/ctaocrypt/integer.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#if defined(CYASSL_SHA512) || defined(CYASSL_SHA384)
#include <cyassl/ctaocrypt/sha512.h>
#endif

View File

@@ -28,7 +28,7 @@
#ifndef NO_RABBIT
#include <cyassl/ctaocrypt/rabbit.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef NO_INLINE
#include <cyassl/ctaocrypt/misc.h>

View File

@@ -31,7 +31,7 @@
*/
#include <cyassl/ctaocrypt/random.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#ifdef NO_RC4
#include <cyassl/ctaocrypt/sha256.h>

View File

@@ -30,7 +30,7 @@
#include <cyassl/ctaocrypt/rsa.h>
#include <cyassl/ctaocrypt/random.h>
#include <cyassl/ctaocrypt/error.h>
#include <cyassl/ctaocrypt/error-crypt.h>
#include <cyassl/ctaocrypt/logging.h>
#ifdef SHOW_GEN