Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/protocols/secure_channel/tests/FuzzPASE_PW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,10 @@ void TestPASESession::FuzzHandlePake1(const uint32_t fuzzedSetupPasscode, const

// Compute mPASEVerifier (in order for mSpake2p.BeginVerifier() to use it, once it is called by the pairingAccessory through
// HandleMsg1_and_SendMsg2)
RETURN_SAFELY_IGNORED pairingAccessory.mPASEVerifier.Generate(fuzzedPBKDF2Iter, fuzzedSaltSpan, fuzzedSetupPasscode);
// If Generate() fails (the fuzz domains intentionally include out-of-range iter/salt),
// mPASEVerifier stays uninitialized; reading it below (BeginVerifier / HandleMsg*) would be an
// MSan false positive that cannot occur in production, which checks Generate(). Bail instead.
VerifyOrReturn(pairingAccessory.mPASEVerifier.Generate(fuzzedPBKDF2Iter, fuzzedSaltSpan, fuzzedSetupPasscode) == CHIP_NO_ERROR);

/************************Injecting Fuzzed Pake1 Message into PaseSession::OnMessageReceived*************************/

Expand Down Expand Up @@ -750,7 +753,10 @@ void TestPASESession::FuzzHandlePake2(const uint32_t fuzzedSetupPasscode, const

// Below Steps take place in HandleMsg1
// Compute mPASEVerifier to be able to pass it to BeginVerifier()
RETURN_SAFELY_IGNORED pairingAccessory.mPASEVerifier.Generate(fuzzedPBKDF2Iter, fuzzedSaltSpan, fuzzedSetupPasscode);
// If Generate() fails (the fuzz domains intentionally include out-of-range iter/salt),
// mPASEVerifier stays uninitialized; reading it below (BeginVerifier / HandleMsg*) would be an
// MSan false positive that cannot occur in production, which checks Generate(). Bail instead.
VerifyOrReturn(pairingAccessory.mPASEVerifier.Generate(fuzzedPBKDF2Iter, fuzzedSaltSpan, fuzzedSetupPasscode) == CHIP_NO_ERROR);
Comment thread
Alami-Amine marked this conversation as resolved.
Outdated

RETURN_SAFELY_IGNORED pairingAccessory.mSpake2p.BeginVerifier(nullptr, 0, nullptr, 0, pairingAccessory.mPASEVerifier.mW0,
kP256_FE_Length, pairingAccessory.mPASEVerifier.mL,
Expand Down Expand Up @@ -880,7 +886,10 @@ void TestPASESession::FuzzHandlePake3(const uint32_t fuzzedSetupPasscode, const

// Below Steps take place in HandleMsg1
// compute mPASEVerifier to be able to pass it to BeginVerifier()
RETURN_SAFELY_IGNORED pairingAccessory.mPASEVerifier.Generate(fuzzedPBKDF2Iter, fuzzedSaltSpan, fuzzedSetupPasscode);
// If Generate() fails (the fuzz domains intentionally include out-of-range iter/salt),
// mPASEVerifier stays uninitialized; reading it below (BeginVerifier / HandleMsg*) would be an
// MSan false positive that cannot occur in production, which checks Generate(). Bail instead.
VerifyOrReturn(pairingAccessory.mPASEVerifier.Generate(fuzzedPBKDF2Iter, fuzzedSaltSpan, fuzzedSetupPasscode) == CHIP_NO_ERROR);

RETURN_SAFELY_IGNORED pairingAccessory.mSpake2p.BeginVerifier(nullptr, 0, nullptr, 0, pairingAccessory.mPASEVerifier.mW0,
kP256_FE_Length, pairingAccessory.mPASEVerifier.mL,
Expand Down
Loading