Hello Chris,
Thank you very much for your advice, since I am new on SSL I found them really helpfull!
I follow all the of your steps. So far my definitions are as follows
#ifdef ECONAIS
#include "libwismart.h"
#define WOLFSSL_LWIP
#define NO_FILESYSTEM
#define NO_WRITEV
// #define NO_DEV_RANDOM
#define XMALLOC(s, h, type) ((void *)chHeapAlloc(NULL,(s)))
#define XFREE(p, h, type) do{if(p){chHeapFree(p);}}while(0);
// #define XREALLOC(p, n, h, t) //Since ChiBios do not has realloc I create my own realloc "XREALLOC" and it is as post it here(if you can take a quick view to tell me if it seems right to you I would be pleased).
#endif
void *XREALLOC (void *ptr, size_t size) {
void *newptr;
// Allocate new block, returning NULL if not possible.
newptr = XMALLOC (size,0,DYNAMIC_TYPE_BIGINT);
if (newptr == NULL) return NULL;
// Don't copy/free original block if it was NULL.
if (ptr != NULL) {
// Copy the memory, free the old block and return the new block.
XMEMCPY (newptr, ptr, size);
XFREE (ptr,0,DYNAMIC_TYPE_BIGINT);
}
return newptr;
}
Moreover I added in internal.h our definition for mutexes
#ifdef SINGLE_THREADED
typedef int wolfSSL_Mutex;
#else /* MULTI_THREADED */
#ifdef ECONAIS
typedef Mutex wolfSSL_Mutex;
Finally I write my own GenerateSeed and is as shown below
int GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
int i;
for (i = 0; i < sz; i++ ) {
output[ i ] = chTimeNow() % 256;
}
return 0;
}
chTimeNow returns the msec since the program started.
I also used chTimeNow instead of gettimeofday(we do not support gettimeofday) and I do not know if I will have any problem with it!?
To your question my project as I said is to create SSL over our existing TCP/IP Stack and I am trying to do so by porting wolfSSL. The wireless embedded system that I am working on is EC32S13 ( http://www.econais.com/wp/?page_id=114 )!
On the website you can find a lot of information on who we are and what we do! If have any queries about us please feel free to ask and we will be glad to answer your question.
Yours sincerely,
Andreas