diff --git a/src/darwin/Framework/CHIP/MTRCertificates.mm b/src/darwin/Framework/CHIP/MTRCertificates.mm index 5837a50a3fe21a..b153cf4442b373 100644 --- a/src/darwin/Framework/CHIP/MTRCertificates.mm +++ b/src/darwin/Framework/CHIP/MTRCertificates.mm @@ -186,7 +186,7 @@ + (BOOL)isCertificate:(MTRCertificateDERBytes)certificate1 equalTo:(MTRCertifica MTR_LOG_ERROR("Can't extract public key from second certificate: %s", ErrorStr(err)); return NO; } - P256PublicKeySpan keySpan2(pubKey1.ConstBytes()); + P256PublicKeySpan keySpan2(pubKey2.ConstBytes()); if (!keySpan1.data_equal(keySpan2)) { return NO;