CTaoCrypt test mods for MQX

This commit is contained in:
Chris Conlon
2013-09-16 15:48:36 -06:00
parent abff02532d
commit ee78b108cf
2 changed files with 41 additions and 32 deletions

View File

@@ -99,6 +99,7 @@
#ifdef FREESCALE_MQX
#include <mqx.h>
#include <fio.h>
#include <stdlib.h>
#else
#include <stdio.h>
#endif
@@ -2376,6 +2377,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out)
#ifndef NO_RSA
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
#ifdef FREESCALE_MQX
static const char* clientKey = "a:\\certs\\client-key.der";
static const char* clientCert = "a:\\certs\\client-cert.der";
@@ -2383,7 +2385,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out)
static const char* caKeyFile = "a:\\certs\\ca-key.der";
static const char* caCertFile = "a:\\certs\\ca-cert.pem";
#endif
#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && defined(CYASSL_MKD_SHELL)
#elif defined(CYASSL_MKD_SHELL)
static char* clientKey = "certs/client-key.der";
static char* clientCert = "certs/client-cert.der";
void set_clientKey(char *key) { clientKey = key ; } /* set by shell command */
@@ -2394,7 +2396,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out)
void set_caKeyFile (char * key) { caKeyFile = key ; } /* set by shell command */
void set_caCertFile(char * cert) { caCertFile = cert ; } /* set by shell command */
#endif
#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
#else
static const char* clientKey = "./certs/client-key.der";
static const char* clientCert = "./certs/client-cert.der";
#ifdef CYASSL_CERT_GEN
@@ -2402,6 +2404,7 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out)
static const char* caCertFile = "./certs/ca-cert.pem";
#endif
#endif
#endif
@@ -2848,11 +2851,13 @@ int rsa_test(void)
#ifndef NO_DH
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
#ifdef FREESCALE_MQX
static const char* dhKey = "a:\certs\\dh2048.der";
#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
#else
static const char* dhKey = "./certs/dh2048.der";
#endif
#endif
int dh_test(void)
{
@@ -2926,11 +2931,13 @@ int dh_test(void)
#ifndef NO_DSA
#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
#ifdef FREESCALE_MQX
static const char* dsaKey = "a:\\certs\\dsa2048.der";
#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048)
#else
static const char* dsaKey = "./certs/dsa2048.der";
#endif
#endif
int dsa_test(void)
{

View File

@@ -292,6 +292,8 @@
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#define FREESCALE_K70_RNGA
/* #define FREESCALE_K53_RNGB */
#include "mqx.h"
#ifndef NO_FILESYSTEM
#include "mfs.h"
#include "fio.h"