add entropy steps for VxWorks

This commit is contained in:
lchristina26
2016-01-08 11:43:05 -07:00
parent 0718f4b9a3
commit efae688120
2 changed files with 21 additions and 13 deletions

View File

@ -38,6 +38,18 @@ click "Edit". Enter the above define to the end of the line.
6. Copy the certs folder in ```<path_to_wolfssl>/``` 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

View File

@ -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 <randomNumGen.h>
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) {