Commit 848f10e
authored
[fuzz] Initialize PASE fuzz harness state before the code under test reads it (project-chip#73094)
Two harnesses in FuzzPASE_PW.cpp left an object partially uninitialized before
the code they exercise read it, which the OSS-Fuzz memory (MSan) build flagged as
use-of-uninitialized-value:
- FuzzHandlePBKDFParamResponse prepares the commissioner PASESession by hand and
skips Init()/Pair(), which normally set mSetupPINCode. The exercised path
HandlePBKDFParamResponse() -> SetupSpake2p() -> Spake2pVerifier::ComputeWS()
reads mSetupPINCode, so set a fixed valid passcode in the harness.
- FuzzSpake2pVerifier copies fuzzed vectors that may be shorter than
mW0[kP256_FE_Length] / mL[kP256_Point_Length] into an uninitialized
Spake2pVerifier, leaving the tail bytes unset; BeginVerifier() -> FELoad()
later reads them. Zero-initialize the verifier, which keeps the short-input
coverage the domains intend.
Both are test-harness gaps, not product bugs: production always initializes
mSetupPINCode via Init()/Pair(), and production verifiers come from
Generate()/Deserialize(), which populate the whole struct.1 parent fdd6856 commit 848f10e
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
| |||
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
498 | 504 | | |
499 | 505 | | |
500 | 506 | | |
| |||
0 commit comments