@@ -853,7 +853,7 @@ CHIP_ERROR CASESession::SendSigma1()
853
853
ReturnErrorOnFailure (GenerateSigmaResumeMIC (encodeSigma1Inputs.initiatorRandom , encodeSigma1Inputs.resumptionId ,
854
854
ByteSpan (kKDFS1RKeyInfo ), ByteSpan (kResume1MIC_Nonce ), resumeMICSpan));
855
855
856
- encodeSigma1Inputs.initiatorResumeMICSpan = resumeMICSpan;
856
+ encodeSigma1Inputs.initiatorResumeMIC = resumeMICSpan;
857
857
encodeSigma1Inputs.sessionResumptionRequested = true ;
858
858
}
859
859
}
@@ -897,8 +897,6 @@ CHIP_ERROR CASESession::EncodeSigma1(System::PacketBufferHandle & msg, EncodeSig
897
897
{
898
898
MATTER_TRACE_SCOPE (" EncodeSigma1" , " CASESession" );
899
899
900
- // The API Contract requires the passed PacketBufferHandle to be empty
901
- VerifyOrReturnError (msg.IsNull (), CHIP_ERROR_INCORRECT_STATE);
902
900
VerifyOrReturnError (input.initiatorEphPubKey != nullptr , CHIP_ERROR_INVALID_ARGUMENT);
903
901
904
902
size_t dataLen = EstimateStructOverhead (kSigmaParamRandomNumberSize , // initiatorRandom
@@ -932,7 +930,7 @@ CHIP_ERROR CASESession::EncodeSigma1(System::PacketBufferHandle & msg, EncodeSig
932
930
if (input.sessionResumptionRequested )
933
931
{
934
932
ReturnErrorOnFailure (tlvWriter.Put (AsTlvContextTag (Sigma1Tags::kResumptionID ), input.resumptionId ));
935
- ReturnErrorOnFailure (tlvWriter.Put (AsTlvContextTag (Sigma1Tags::kResume1MIC ), input.initiatorResumeMICSpan ));
933
+ ReturnErrorOnFailure (tlvWriter.Put (AsTlvContextTag (Sigma1Tags::kResume1MIC ), input.initiatorResumeMIC ));
936
934
}
937
935
938
936
ReturnErrorOnFailure (tlvWriter.EndContainer (outerContainerType));
@@ -1110,7 +1108,7 @@ CASESession::NextStep CASESession::HandleSigma1(System::PacketBufferHandle && ms
1110
1108
parsedSigma1.resumptionId .size () == SessionResumptionStorage::kResumptionIdSize &&
1111
1109
CHIP_NO_ERROR ==
1112
1110
TryResumeSession (SessionResumptionStorage::ConstResumptionIdView (parsedSigma1.resumptionId .data ()),
1113
- parsedSigma1.initiatorResumeMICSpan , parsedSigma1.initiatorRandom ))
1111
+ parsedSigma1.initiatorResumeMIC , parsedSigma1.initiatorRandom ))
1114
1112
{
1115
1113
std::copy (parsedSigma1.initiatorRandom .begin (), parsedSigma1.initiatorRandom .end (), mInitiatorRandom );
1116
1114
std::copy (parsedSigma1.resumptionId .begin (), parsedSigma1.resumptionId .end (), mResumeResumptionId .begin ());
@@ -1175,8 +1173,6 @@ CHIP_ERROR CASESession::EncodeSigma2Resume(System::PacketBufferHandle & msgR2Res
1175
1173
{
1176
1174
MATTER_TRACE_SCOPE (" EncodeSigma2Resume" , " CASESession" );
1177
1175
1178
- // The API Contract requires the passed PacketBufferHandle to be empty
1179
- VerifyOrReturnError (msgR2Resume.IsNull (), CHIP_ERROR_INCORRECT_STATE);
1180
1176
VerifyOrReturnError (input.responderMrpConfig != nullptr , CHIP_ERROR_INVALID_ARGUMENT);
1181
1177
1182
1178
size_t maxDatalLen = EstimateStructOverhead (SessionResumptionStorage::kResumptionIdSize , // resumptionID
@@ -1338,8 +1334,6 @@ CHIP_ERROR CASESession::PrepareSigma2(EncodeSigma2Inputs & outSigma2Data)
1338
1334
1339
1335
CHIP_ERROR CASESession::EncodeSigma2 (System::PacketBufferHandle & msgR2, EncodeSigma2Inputs & input)
1340
1336
{
1341
- // The API Contract requires the passed PacketBufferHandle to be empty
1342
- VerifyOrReturnError (msgR2.IsNull (), CHIP_ERROR_INCORRECT_STATE);
1343
1337
VerifyOrReturnError (input.responderEphPubKey != nullptr , CHIP_ERROR_INVALID_ARGUMENT);
1344
1338
VerifyOrReturnError (input.msgR2Encrypted , CHIP_ERROR_INCORRECT_STATE);
1345
1339
// Check if length of msgR2Encrypted is set and is at least larger than the MIC length
@@ -2351,8 +2345,8 @@ CHIP_ERROR CASESession::ParseSigma1(TLV::ContiguousBufferTLVReader & tlvReader,
2351
2345
if (err == CHIP_NO_ERROR && tlvReader.GetTag () == AsTlvContextTag (Sigma1Tags::kResume1MIC ))
2352
2346
{
2353
2347
resume1MICTagFound = true ;
2354
- ReturnErrorOnFailure (tlvReader.GetByteView (outParsedSigma1.initiatorResumeMICSpan ));
2355
- VerifyOrReturnError (outParsedSigma1.initiatorResumeMICSpan .size () == CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES,
2348
+ ReturnErrorOnFailure (tlvReader.GetByteView (outParsedSigma1.initiatorResumeMIC ));
2349
+ VerifyOrReturnError (outParsedSigma1.initiatorResumeMIC .size () == CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES,
2356
2350
CHIP_ERROR_INVALID_CASE_PARAMETER);
2357
2351
err = tlvReader.Next ();
2358
2352
}
0 commit comments