project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.49k stars 2.01k forks source link

src/credentials/CHIPCertFromX509.cpp:442: Error 0x00000305 #34574

Open SmartHua opened 3 months ago

SmartHua commented 3 months ago

Reproduction steps

class MyKeypairDelegate : KeypairDelegate { override fun generatePrivateKey() {

}

override fun createCertificateSigningRequest(): ByteArray {
    return CHIPConstant.createCertificateSigningRequest
}

override fun getPublicKey(): ByteArray {
    return CHIPConstant.keyPairPublicKey
}

override fun ecdsaSignMessage(message: ByteArray): ByteArray {
    return CsrManager.signer(message)
}

}

val myKeypairDelegate = MyKeypairDelegate() val operationalKeyConfig = OperationalKeyConfig( myKeypairDelegate, CHIPConstant.rca, CHIPConstant.ica, CHIPConstant.noc, CHIPConstant.ipk ) chipDeviceController = ChipDeviceController(ControllerParams.newBuilder(operationalKeyConfig) .setControllerVendorId(VENDOR_ID).build())

How to implement KeypairGate?

Bug prevalence

/

GitHub hash of the SDK that was being used

1.2

Platform

android

Platform Version(s)

No response

Anything else?

No response

sdrsdr commented 3 months ago

same here with commit 5e3127f5ac61e13c572a968199280d90a9c19dce chip-cert works for paa but not for pai

sdrsdr commented 3 months ago

I'm having this on Linux (Ububtu 24.04) so it's not android specific

lmapii commented 1 week ago

I'm seeing the same when using chip-cert print-cert on a PAI:

chip-cert print-cert credentials/test/attestation/Chip-Test-PAI-FFF2-NoPID-Cert.der
ConvertX509CertToChipCert() failed
src/credentials/CHIPCert.cpp:929: Error 0x00000305