Skip to content

Commit

Permalink
[TraceDecoder] Add decrypted payload field (project-chip#23243)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and adbridge committed Nov 18, 2022
1 parent 3d8e64b commit 33916fc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions examples/common/tracing/TraceDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ CHIP_ERROR TraceDecoder::MaybeLogAndConsumeEncryptedPayload(Json::Value & json)
size_t size = static_cast<uint16_t>(json[kPayloadEncryptedSizeKey].asLargestUInt());
if (size)
{
auto payload = json[kPayloadEncryptedDataKey].asString();
auto bufferPtr = json[kPayloadEncryptedBufferPtrKey].asString();
auto scoppedIndent = ScopedLogIndentWithSize("Encrypted Payload", size);
auto payload = json[kPayloadEncryptedDataKey].asString();
auto bufferPtr = json[kPayloadEncryptedBufferPtrKey].asString();
auto scopedIndent = ScopedLogIndentWithSize("Encrypted Payload", size);
Log("data", payload.c_str());
Log("buffer_ptr", bufferPtr.c_str());
}
Expand Down Expand Up @@ -272,6 +272,12 @@ CHIP_ERROR TraceDecoder::MaybeLogAndConsumePayload(Json::Value & json, bool isRe
auto size = static_cast<uint16_t>(json[kPayloadSizeKey].asLargestUInt());
if (size)
{
{
auto payload = json[kPayloadDataKey].asString();
auto scopedIndent = ScopedLogIndentWithSize("Decrypted Payload", size);
Log("data", payload.c_str());
}

bool shouldDecode = !isResponse || mOptions.mEnableProtocolInteractionModelResponse;
auto payload = json[kPayloadDataKey].asString();
auto protocolId = json[kProtocolIdKey].asLargestUInt();
Expand Down

0 comments on commit 33916fc

Please sign in to comment.