diff --git a/IDE/WORKBENCH/README.md b/IDE/WORKBENCH/README.md index e5fb38711..333d54d39 100644 --- a/IDE/WORKBENCH/README.md +++ b/IDE/WORKBENCH/README.md @@ -38,6 +38,18 @@ click "Edit". Enter the above define to the end of the line. 6. Copy the certs folder in ```/``` to the Wind River Workbench workspace folder. This is where the simulator looks for the filesystem. +7. Include Entropy: + + - Create a new project, similar to step 1 but choose VxWorks Source Build + Project as the type of project instead of VxWorks Image Project. + - In the project directory, double click "Source Build Configuration" and + under os > core > CORE\_KERNEL Menu > VxWorks Kernel Component + Configuration find "Inject entropy in interrupts". Double click this. + - Go back to your VIP project. Right click the project and select "Properties". + - In "Properties", select "Project References". Check the box next to the + new project you created. Click "Ok". + - Rebuild the project. + ####2 Testing wolfSSL with VxWorks: #####2.1 wolfCrypt Test and Benchmark Applications The wolfCrypt test application will test each of the cryptographic algorithms diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index 5c9f3579f..4e194fef8 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -1265,26 +1265,22 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) return 0; } -#elif defined(WOLFSSL_VXWORKS) && defined(VXWORKS_SIM) +#elif defined(WOLFSSL_VXWORKS) #include int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz) { STATUS status; - unsigned char seed[1024]; - int i = 0; - /* cannot generate true entropy with VxWorks simulator */ - #warning "VxWorks simulator for testing purposes only!" + #ifdef VXWORKS_SIM + /* cannot generate true entropy with VxWorks simulator */ + #warning "not enough entropy, simulator for testing only" + int i = 0; - for (i = 0; i < sizeof(seed); i++) { - seed[i] = i * 3 % 256; - } - /* build entropy */ - (void) randAdd(seed, 0, 0); - for (i = 4; i <= sizeof(seed); i*=2) { - (void) randAdd (seed, i - 1, i); - } + for (i = 0; i < 1000; i++) { + randomAddTimeStamp(); + } + #endif status = randBytes (output, sz); if (status == ERROR) {