From 9019224ccde87bafc61c1fe0683f7161c24db1bc Mon Sep 17 00:00:00 2001 From: l30054665 Date: Sun, 6 Jul 2025 18:31:58 +0800 Subject: [PATCH 1/5] fuzz Signed-off-by: l30054665 --- test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp | 1 + test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp b/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp index 0b1103234..ade8df988 100644 --- a/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp +++ b/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp @@ -45,6 +45,7 @@ void AuthAclFuzzTest(const uint8_t* data, size_t size) context->accesser.isCommonFlag = false; authSink->VerifyCertificate(context); authSink->VerifyCertificate(nullptr); + } } } diff --git a/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp b/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp index a60faf0ed..544025b0b 100644 --- a/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp +++ b/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp @@ -215,6 +215,7 @@ void AuthConfirmFuzzTestThird(FuzzedDataProvider &fdp) authSinkForwardUltrasonicDoneState_->GetStateType(); authSrcPinNegotiateStartState_->ProcessCredAuth(context_); int32_t credType = fdp.ConsumeIntegral(); + authSrcPinNegotiateStartState_->GetCredIdByCredType(context_, credType); } -- Gitee From 7112a525d0d3f360e7b54e47267c949f77711ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Sun, 6 Jul 2025 10:34:24 +0000 Subject: [PATCH 2/5] update test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp b/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp index ade8df988..52dab3e6c 100644 --- a/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp +++ b/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp @@ -32,6 +32,7 @@ void AuthAclFuzzTest(const uint8_t* data, size_t size) FuzzedDataProvider fdp(data, size); int32_t sessionId = fdp.ConsumeIntegral(); std::string result = fdp.ConsumeRandomLengthString(); + std::string peerDeviceId = fdp.ConsumeRandomLengthString(); std::shared_ptr authSink = std::make_shared(); std::shared_ptr authSrc = std::make_shared(); @@ -45,7 +46,8 @@ void AuthAclFuzzTest(const uint8_t* data, size_t size) context->accesser.isCommonFlag = false; authSink->VerifyCertificate(context); authSink->VerifyCertificate(nullptr); - + authSink->DerivativeSessionKey(context); + authSrc->GetPeerDeviceId(context, peerDeviceId); } } } -- Gitee From 9685fe40225f290b8170f85996a5e17ceb4c6e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Sun, 6 Jul 2025 10:35:08 +0000 Subject: [PATCH 3/5] update test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- .../authconfirm_fuzzer/auth_confirm_fuzzer.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp b/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp index 544025b0b..0418c112a 100644 --- a/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp +++ b/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp @@ -165,6 +165,7 @@ void AuthConfirmFuzzTestNext(JsonObject &jsonObject, FuzzedDataProvider &fdp) authSrcConfirmState_->GetIdenticalCredentialInfo(context_, jsonObject); authSrcConfirmState_->GetShareCredentialInfo(context_, jsonObject); authSrcConfirmState_->GetP2PCredentialInfo(context_, jsonObject); + authSinkConfirmState_->CreateProxyData(context_, jsonObject); authSinkConfirmState_->NegotiateCredential(context_, jsonObject); authSinkConfirmState_->NegotiateAcl(context_, jsonObject); authSinkNegotiateStateMachine_->GetIdenticalCredentialInfo(context_, jsonObject); @@ -200,6 +201,9 @@ void AuthConfirmFuzzTestThird(FuzzedDataProvider &fdp) { std::string businessId = fdp.ConsumeRandomLengthString(); std::string businessValue = fdp.ConsumeRandomLengthString(); + std::string authorizeInfo = fdp.ConsumeRandomLengthString(); + std::vector deleteCredInfo; + DistributedDeviceProfile::AccessControlProfile acl; authSinkNegotiateStateMachine_->IsAntiDisturbanceMode(businessId); authSinkNegotiateStateMachine_->IsAntiDisturbanceMode(""); authSinkNegotiateStateMachine_->ParseAndCheckAntiDisturbanceMode(businessId, businessValue); @@ -215,8 +219,18 @@ void AuthConfirmFuzzTestThird(FuzzedDataProvider &fdp) authSinkForwardUltrasonicDoneState_->GetStateType(); authSrcPinNegotiateStartState_->ProcessCredAuth(context_); int32_t credType = fdp.ConsumeIntegral(); - authSrcPinNegotiateStartState_->GetCredIdByCredType(context_, credType); + authSrcConfirmState_->NegotiateProxyCredential(context_); + authSrcConfirmState_->NegotiateProxyAcl(context_); + authSrcConfirmState_->ResetBindLevel(context_); + authSinkConfirmState_->GetBundleLabel(context_); + authSinkConfirmState_->NegotiateProxyAcl(context_); + authSinkConfirmState_->ProcessUserAuthorize(context_); + authSinkConfirmState_->ProcessServerAuthorize(context_); + authSinkConfirmState_->NegotiateProxyCredential(context_); + authSrcConfirmState_->GetSrcProxyCredTypeForP2P(context_, deleteCredInfo); + authSinkConfirmState_->ProcessUserOption(context_, authorizeInfo); + authSrcConfirmState_->GetSrcProxyAclInfoForP2P(context_, acl); } void AuthConfirmFuzzTest(const uint8_t* data, size_t size) -- Gitee From 2ed14f3586d91a66fb6e05c3c1410da625af98eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Mon, 7 Jul 2025 02:58:36 +0000 Subject: [PATCH 4/5] update test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp b/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp index 52dab3e6c..f04209748 100644 --- a/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp +++ b/test/commonfuzztest/authacl_fuzzer/auth_acl_fuzzer.cpp @@ -46,6 +46,7 @@ void AuthAclFuzzTest(const uint8_t* data, size_t size) context->accesser.isCommonFlag = false; authSink->VerifyCertificate(context); authSink->VerifyCertificate(nullptr); + context->IsProxyBind = true; authSink->DerivativeSessionKey(context); authSrc->GetPeerDeviceId(context, peerDeviceId); } -- Gitee From a60efa86533529dfa98e9baef36f8d60c61882ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B0=9A?= Date: Mon, 7 Jul 2025 02:59:10 +0000 Subject: [PATCH 5/5] update test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李尚 --- test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp b/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp index 0418c112a..0571eab22 100644 --- a/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp +++ b/test/servicesfuzztest/authconfirm_fuzzer/auth_confirm_fuzzer.cpp @@ -220,6 +220,7 @@ void AuthConfirmFuzzTestThird(FuzzedDataProvider &fdp) authSrcPinNegotiateStartState_->ProcessCredAuth(context_); int32_t credType = fdp.ConsumeIntegral(); authSrcPinNegotiateStartState_->GetCredIdByCredType(context_, credType); + context_->IsProxyBind = true; authSrcConfirmState_->NegotiateProxyCredential(context_); authSrcConfirmState_->NegotiateProxyAcl(context_); authSrcConfirmState_->ResetBindLevel(context_); -- Gitee