Skip to content

Commit

Permalink
Remove temp log statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mlepage-google committed Mar 15, 2023
1 parent 8127f00 commit 52f4a6f
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/protocols/secure_channel/CASESession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,8 +1141,6 @@ CHIP_ERROR CASESession::SendSigma3a()

ChipLogDetail(SecureChannel, "Sending Sigma3");

ChipLogError(DeviceLayer, "@@@@@@@@@@ SendSigma3a");

auto * workPtr = Platform::New<SendSigma3Work>();
VerifyOrExit(workPtr != nullptr, err = CHIP_ERROR_NO_MEMORY);
{
Expand Down Expand Up @@ -1202,10 +1200,6 @@ void CASESession::SendSigma3b(SendSigma3Work & work)
{
CHIP_ERROR err = CHIP_NO_ERROR;

ChipLogError(DeviceLayer, "@@@@@@@@@@ SendSigma3b");

// TODO SignWithOpKeypair has moved here but check for race condition etc.

// Generate a signature
err = work.fabricTable->SignWithOpKeypair(work.fabricIndex, ByteSpan{ work.msg_R3_Signed.Get(), work.msg_r3_signed_len }, work.tbsData3Signature);
SuccessOrExit(err);
Expand Down Expand Up @@ -1261,7 +1255,8 @@ void CASESession::SendSigma3b(SendSigma3Work & work)

CHIP_ERROR CASESession::SendSigma3c(SendSigma3Work & work)
{
CHIP_ERROR err = CHIP_NO_ERROR;
CHIP_ERROR err = CHIP_NO_ERROR;
bool ignoreFailure = true;

System::PacketBufferHandle msg_R3;
size_t data_len;
Expand All @@ -1270,16 +1265,14 @@ CHIP_ERROR CASESession::SendSigma3c(SendSigma3Work & work)

AutoReleaseSessionKey sr3k(*mSessionManager->GetSessionKeystore());

ChipLogError(DeviceLayer, "@@@@@@@@@@ SendSigma3c %d", (int)work.status.AsInteger());

// TODO add checks here (ignoreFailure?)

// Special case: if for whatever reason not in expected state or sequence,
// don't do anything, including sending a status report or aborting the
// pending establish.
VerifyOrExit(mState == State::kSendSigma3BackgroundPending, err = CHIP_ERROR_INCORRECT_STATE);
VerifyOrExit(mSequence == work.sequence, err = CHIP_ERROR_INCORRECT_STATE);

ignoreFailure = false;

SuccessOrExit(err = work.status);

// Generate S3K key
Expand Down Expand Up @@ -1336,11 +1329,7 @@ CHIP_ERROR CASESession::SendSigma3c(SendSigma3Work & work)
exit:
Platform::Delete(&work);

// TODO might need ignoreFailure to handle some paths

ChipLogError(DeviceLayer, "@@@@@@@@@@ SendSigma3c DONE %d", (int)err.AsInteger());

if (err != CHIP_NO_ERROR)
if (err != CHIP_NO_ERROR && !ignoreFailure)
{
SendStatusReport(mExchangeCtxt, kProtocolCodeInvalidParam);
mState = State::kInitialized;
Expand Down

0 comments on commit 52f4a6f

Please sign in to comment.