diff --git a/src/controller/python/OpCredsBinding.cpp b/src/controller/python/OpCredsBinding.cpp index 6f9fc42b5825c1..337f409f65ebbf 100644 --- a/src/controller/python/OpCredsBinding.cpp +++ b/src/controller/python/OpCredsBinding.cpp @@ -157,13 +157,11 @@ class TestCommissioner : public chip::Controller::AutoCommissioner { auto nocChain = report.Get().rcac; - MutableByteSpan rcacSpan(const_cast(nocChain.data()), nocChain.size()); - chip::ByteSpan rcacByteSpan(rcacSpan.data(), rcacSpan.size()); // Convert RCAC to CHIP cert format to be deciphered by TLV later in python3 std::vector chipRcac(Credentials::kMaxCHIPCertLength); MutableByteSpan chipRcacSpan(chipRcac.data(), chipRcac.size()); - chip::Credentials::ConvertX509CertToChipCert(rcacByteSpan, chipRcacSpan); + chip::Credentials::ConvertX509CertToChipCert(nocChain, chipRcacSpan); mCHIPRCACData.assign(chipRcacSpan.data(), chipRcacSpan.data() + chipRcacSpan.size());