WolfSSL Warning

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

WolfSSL Warning

Post by SeeCwriter »

One of the many warnings in the Wolf source code, is in NbWoldSsl.cpp, line 991:

Code: Select all

C:/nburn/libraries/crypto/NetBurner/NbWolfSsl.cpp:991:44: warning: unsigned conversion from 'int' to 'uint8_t' {aka 'unsigned char'} changes value from '1000' to '232' [-Woverflow]
     gSslQueue.Init(&(gSslQueueStorage[0]), SSL_QUEUE_SIZE);
                                            ^~~~~~~~~~~~~~
The Init function is defined as:

Code: Select all

uint8_t Init(void **pQueueStorage, uint8_t size);
At the top of file NbWolfSsl.cpp, line 78, SSL_QUEUE_SIZE is defined as 1000. Wouldn't that set 'size' to zero?
User avatar
Jon
Posts: 79
Joined: Mon Feb 05, 2018 10:54 am

Re: WolfSSL Warning

Post by Jon »

Hi SeeCWriter,

That will actually truncate the size to 232. This should be fine for the queue, as the posts are handled quickly and we take care not to post duplicates when we it's avoidable (during a close, for example). Additionally, the array actually used for the queue storage, gSslQueueStorage can handle 1000 items and isn't being truncated (it's not a uint_8). Still, the define value should probably be changed to match the truncated value. I'll look into that and make sure that gets addressed. Thank you for pointing it out.

The other warnings you are seeing are some unused variables that we use for debugging purposes, some conversions from int to uint32_t in a iprintf() statement which is okay in that particular instance, and a warning about hardening for side channel attacks. This last warning can be addressed by making a modification in the user_settings.h file for the specified platform. We currently have this off by default because it impacts the performance of the modules.

There's also a warning about converting a string constant to a "char *". This can be fixed by making ClientCertList const. I'll add that in for the release after 3.3.4.

Please feel free to let us know if you have any other questions.

Kind Regards,
Jon
Post Reply