Skip to content

Commit a6c6fbc

Browse files
authored
Merge pull request #236 from kaleb-himes/Q42025-FIPS-FAQ-UPDT
FIPS FAQ UPDT Q4 2025
2 parents f8866d6 + e1561a3 commit a6c6fbc

File tree

2 files changed

+71
-5
lines changed

2 files changed

+71
-5
lines changed

wolfSSL-FIPS-FAQ/src/section01.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
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].
44

5+
Last Updated: 8 Dec 2025
6+
57
## Questions
68

79
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
1214
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)
1315
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)
1416
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)
23+
6. [Key Access Management](./section02.md#key-access-management)
24+
7. [wc_SetSeedCb() a bit unique with relation to CAST's:](./section02.md#setseedcb-and-casts)
25+
1. [API's that require UNLOCK before first use (should also be re-LOCKED after use):](./section02.md#apis-to-unlock)
26+
27+

wolfSSL-FIPS-FAQ/src/section02.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,64 @@ extern unsigned int my_rng_seed_gen(void);
149149
level */
150150
```
151151

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+
152199
## The POST
153200
Under 140-2 POST stood for "Power On Self Test" and ran EVERY algorithm self-test leading to slow power-on / boot times.
154201
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.
155202

156-
## Threading considertation for all CASTs():
203+
## Threading consideration for all CASTs():
157204

158205
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.
159206

160207
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.
161208

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.
163210

164211
Example:
165212

@@ -212,7 +259,7 @@ if (wc_RunCast_fips(FIPS_CAST_RSA_SIGN_PKCS1v15) != 0){
212259
}
213260
```
214261

215-
## wc_SetSeedCb() a bit unique:
262+
## wc_SetSeedCb() a bit unique with relation to CAST's:
216263

217264
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:
218265

@@ -239,7 +286,7 @@ int main(void) {
239286

240287
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.
241288

242-
##Key Access Management
289+
## Key Access Management
243290

244291
1. Users calling wolfSSL (SSL/TLS) APIs’ do not need to worry about this item
245292
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)
304351
#endif
305352
```
306353

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):
308355

309356
```
357+
v5.2.1 (and all other v5.X.X modules)
310358
* wc_PRF
311359
* wc_PRF_TLSv12
312360
* wc_HKDF_Extract
@@ -329,6 +377,8 @@ API's that require UNLOCK before first use (should also be re-LOCKED after use):
329377
* wc_ecc_shared_secret_ex
330378
* wc_DhGenerateKeyPair
331379
* wc_DhAgree
380+
381+
v6.0.0 and newer module add some new ones in addition to the above list:
332382
* wc_SRTP_KDF
333383
* wc_SRTCP_KDF
334384
* wc_SRTCP_KDF_ex
@@ -342,5 +392,8 @@ API's that require UNLOCK before first use (should also be re-LOCKED after use):
342392
* wc_ed448_export_key
343393
* wc_PBKDF2_ex
344394
* wc_PBKDF2
395+
396+
v7.0.0 (upcoming)
397+
* Will have some additional services listed here for Post Quantum key material
345398
```
346399

0 commit comments

Comments
 (0)