diff --git a/ctaocrypt/src/random.c b/ctaocrypt/src/random.c index 33a282b02..aabc19926 100644 --- a/ctaocrypt/src/random.c +++ b/ctaocrypt/src/random.c @@ -146,6 +146,19 @@ int GenerateSeed(OS_Seed* os, byte* output, word32 sz) return 0; } +#elif defined(CYASSL_SAFERTOS) + +#warning "write a real random seed!!!!, just for testing now" + +int GenerateSeed(OS_Seed* os, byte* output, word32 sz) +{ + int i; + for (i = 0; i < sz; i++ ) + output[i] = i; + + return 0; +} + #elif defined(NO_DEV_RANDOM) #error "you need to write an os specific GenerateSeed() here" diff --git a/cyassl/ctaocrypt/settings.h b/cyassl/ctaocrypt/settings.h index 8fcb58b67..ad93345a8 100644 --- a/cyassl/ctaocrypt/settings.h +++ b/cyassl/ctaocrypt/settings.h @@ -150,6 +150,8 @@ #endif #ifdef CYASSL_LSR + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY #define NO_WRITEV #define NO_SHA512 #define NO_DH @@ -160,6 +162,7 @@ #define NO_RABBIT #ifndef NO_FILESYSTEM #define LSR_FS + #include "inc/hw_types.h" #include "fs.h" #endif #define CYASSL_LWIP @@ -181,6 +184,12 @@ #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) #endif +#ifdef CYASSL_LOW_MEMORY + #define RSA_LOW_MEM + #define CYASSL_SMALL_STACK + #define TFM_TIMING_RESISTANT +#endif + #ifdef MICRIUM #include "stdlib.h" diff --git a/src/ssl.c b/src/ssl.c index f4c40ec06..d25ebc377 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -1217,11 +1217,11 @@ static int ProcessChainBuffer(CYASSL_CTX* ctx, const unsigned char* buff, #elif defined(LSR_FS) #include #define XFILE struct fs_file* - #define XFOPEN(NAME, MODE) fs_open(NAME); - #define XFSEEK + #define XFOPEN(NAME, MODE) fs_open((char*)NAME); + #define XFSEEK(F, O, W) (void)F #define XFTELL(F) (F)->len - #define XREWIND - #define XFREAD(BUF, SZ, AMT, F) fs_read(F, BUF, SZ*AMT) + #define XREWIND(F) (void)F + #define XFREAD(BUF, SZ, AMT, F) fs_read(F, (char*)BUF, SZ*AMT) #define XFCLOSE fs_close #define XSEEK_END 0 #define XBADFILE NULL