You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wolfSSL-FIPS-FAQ/src/section01.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
This page lists some of the most common issues and questions that are recieved by our wolfSSL security experts, along with their responses. This FAQ is useful for solving general questions that pertain to building/implementing wolfSSL FIPS. If this page does not provide an answer to your question, please feel free to check the wolfSSL Manual, or contact us at [email protected].
4
4
5
+
Last Updated: 8 Dec 2025
6
+
5
7
## Questions
6
8
7
9
1.[Why did I receive wolfSSL_X.X.X_commercial-fips-OE-v2.7z when we validated with Y.Y.Y?](./section02.md#why-did-i-receive-wolfssl-xxx-xommercial-fips-oe-v27z-when-we=validated-with-yyy)
@@ -12,3 +14,14 @@ This page lists some of the most common issues and questions that are recieved b
12
14
3. [Followup Post Q: Who can determine when NO_ATTRIBUTE_CONSTRUCTOR is allowed?](./section02.md#does-the-power-on-self-test-post-really-have-to-run-every-time)
13
15
4. [Followup Post Q: What about with fips-ready, can I use NO_ATTRIBUTE_CONSTRUCTOR with fips-ready?](./section02.md#does-the-power-on-self-test-post-really-have-to-run-every-time)
14
16
4.[What can go wrong for the end user after basic testing?](./section02.md#what-can-go-wrong-for-the-end-user-after-basic-testing)
17
+
5.[Moving from 140-2 to 140-3, what's new?](./section02.md#moving-from-140-2-to-140-3-whats-new)
18
+
1. [Will my applications that are linked agaist the 140-2 module still work with the 140-3 module?](./section02.md#will-my-app-for-1402-still-work-with-1403)
19
+
2. [The wc_SetSeed_Cb() callback and the TLS Layer:](./section02.md#wc-setseed-and-tls)
20
+
3. [The wc_SetSeed_Cb() callback and a custom seed generation function:](./section02.md#wc-setseed-and-custom-genseed)
21
+
4. [Threading consideration for all CASTs():](./section02.md#threading-and-casts)
22
+
5. [wc_SetSeedCb() a bit unique with relation to CAST's:](./section02.md#setseedcb-and-casts)
Copy file name to clipboardExpand all lines: wolfSSL-FIPS-FAQ/src/section02.md
+58-5Lines changed: 58 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -149,17 +149,64 @@ extern unsigned int my_rng_seed_gen(void);
149
149
level */
150
150
```
151
151
152
+
## The wc_SetSeed_Cb() callback and a custom seed generation function:
153
+
154
+
To avoid potential implementation bugs users should follow the known good procedure for adding a custom seed function.
155
+
Step 1) In either user_settings.h or settings.h header add the following:
156
+
157
+
```
158
+
/* Seed Source */
159
+
extern unsigned int my_rng_seed_gen(byte* output, word32 sz);
160
+
#undef CUSTOM_RAND_GENERATE_SEED
161
+
#define CUSTOM_RAND_GENERATE_SEED my_rng_seed_gen
162
+
```
163
+
164
+
Definition: A ***Consuming Application*** is anything outside the module boundary
165
+
that consumes the FIPS 140-3 crypto but is not subject to the
166
+
FIPS 140-3 validation (may be subject to ESV but that is
167
+
separate from 140-3)
168
+
169
+
Step 2) At the ***Consuming Application*** level implement the callback function:
170
+
171
+
```
172
+
/* @param output The buffer to fill with entropy bits one byte at a time,
173
+
* if the solution returns bits instead of bytes be sure
174
+
* to gather 8 times 'sz' instead of just 'sz'
175
+
* @param sz The number of bytes the output buffer can hold based on
176
+
* declared size in the Consuming Application
177
+
*/
178
+
unsigned int my_rng_seed_gen(byte* output, word32 sz)
179
+
{
180
+
/* Pseudo code */
181
+
fill buffer 'output' with 'sz' bytes of entropy
182
+
if filling fails return the appropriate error code for this system
183
+
otherwise return 0 to indicate success
184
+
}
185
+
```
186
+
187
+
Step 3) Finally ***ONLY*** use the wolfSSL supplied callback wc_GenerateSeed()
188
+
as your seeding mechanism. Register it in the ***Consuming Application***
189
+
with:
190
+
191
+
```
192
+
#ifdef WC_RNG_SEED_CB
193
+
wc_SetSeed_Cb(wc_GenerateSeed);
194
+
#else
195
+
#error "Module was not compiled with required setting WC_RNG_SEED_CB"
196
+
#endif
197
+
```
198
+
152
199
## The POST
153
200
Under 140-2 POST stood for "Power On Self Test" and ran EVERY algorithm self-test leading to slow power-on / boot times.
154
201
Under 140-3 POST stands for "Pre-Operational Self Test" and only runs the integrity check of the module (and any dependency self-test to support the integrity check). Since HMAC-SHA2-256 self-test must first run and then the integrity check is performed. No other self-tests run at this stage in the 140-3.
155
202
156
-
## Threading considertation for all CASTs():
203
+
## Threading consideration for all CASTs():
157
204
158
205
Calling a CAST in a thread for the first time or allowing a CAST to run automatically by using a service for the first time in a thread may result in another thread getting a "FIPS_CAST_STATE_PROCESSING" error (meaning that another thread is actively running the CAST) if it attempts to exercise the same CAST in parallel. This will result in the module dropping into the degraded mode of operation.
159
206
160
207
Once degraded mode is active the only recovery from degraded mode is a power cycle of the module or by re-running the integrity test to simulate a reload/power cycle of the module. To simulate reload or power cycle of the module, shut down all threads then call wolfCrypt_IntegrityTest_fips(); before starting threads up again.
161
208
162
-
To avoid this problem one can simply call wc_RunAllCast_fips()^1 on startup along with the other FIPS specific initializers.
209
+
To avoid this problem one can simply call wc_RunAllCast_fips() on startup along with the other FIPS specific initializers.
163
210
164
211
Example:
165
212
@@ -212,7 +259,7 @@ if (wc_RunCast_fips(FIPS_CAST_RSA_SIGN_PKCS1v15) != 0){
212
259
}
213
260
```
214
261
215
-
## wc_SetSeedCb() a bit unique:
262
+
## wc_SetSeedCb() a bit unique with relation to CAST's:
216
263
217
264
wc_SetSeed_Cb(); is the first operational use of the DRBG and as such the CAST will run when the callback is set for the first time. To avoid a race condition on the CAST users should set the seed callback one time on startup and not on a per-thread basis or one time globally and then once per thread is also acceptable if the CAST has passed by the time threads are launched. This would be for a scenario where thread-A needs entropy-source-A and thread-B uses a different entropy source. Please remember that calling wolfSSL_Init() will set the seed callback and therefore should not be called on a per-thread basis unless called at least once globally first. A good practice if setting per thread might be:
218
265
@@ -239,7 +286,7 @@ int main(void) {
239
286
240
287
By checking the return value of the call the function should block prior to threads starting up avoiding any race conditions on the CAST completing prior to threads consuming the DRBG.
241
288
242
-
##Key Access Management
289
+
##Key Access Management
243
290
244
291
1. Users calling wolfSSL (SSL/TLS) APIs’ do not need to worry about this item
245
292
2. Users invoking wolfcrypt (wc_XXX) APIs’ directly that involve loading or using a private key must manage the key access at the application level. To be able to read in or use a private key the application must allow this by calling
@@ -304,9 +351,10 @@ static inline int true_lock(void)
304
351
#endif
305
352
```
306
353
307
-
API's that require UNLOCK before first use (should also be re-LOCKED after use):
354
+
## API's that require UNLOCK before first use (should also be re-LOCKED after use):
308
355
309
356
```
357
+
v5.2.1 (and all other v5.X.X modules)
310
358
* wc_PRF
311
359
* wc_PRF_TLSv12
312
360
* wc_HKDF_Extract
@@ -329,6 +377,8 @@ API's that require UNLOCK before first use (should also be re-LOCKED after use):
329
377
* wc_ecc_shared_secret_ex
330
378
* wc_DhGenerateKeyPair
331
379
* wc_DhAgree
380
+
381
+
v6.0.0 and newer module add some new ones in addition to the above list:
332
382
* wc_SRTP_KDF
333
383
* wc_SRTCP_KDF
334
384
* wc_SRTCP_KDF_ex
@@ -342,5 +392,8 @@ API's that require UNLOCK before first use (should also be re-LOCKED after use):
342
392
* wc_ed448_export_key
343
393
* wc_PBKDF2_ex
344
394
* wc_PBKDF2
395
+
396
+
v7.0.0 (upcoming)
397
+
* Will have some additional services listed here for Post Quantum key material
0 commit comments