Open doitian opened 8 months ago
The message length is a part of the ckb-auth interface. The simplest workaround I can think of is to allow users to skip the SHA256 hash in libecc and pass the SHA256 hash directly.
We can add a new ID: AuthAlgorithmIdSecp256R1Raw, it skips hashing internally.
Thank you for your hard work. I have successfully tested the secp256r1 in the
auth_libecc
library. However, there is a major issue with this library as it only allows messages of 32 bytes.As per the Webauthn specification, specifically section 6.3.3, the data to be signed must have a minimum length of 69 bytes. Although the ECC signature (DSS) requires the data to be hashed with SHA256,
libecc
automatically handles this hashing process. If I pass an SHA256 hash toauth_libecc
, it will perform two passes of SHA256 hashing, resulting in a verification failure.The message length is a part of the ckb-auth interface. The simplest workaround I can think of is to allow users to skip the SHA256 hash in
libecc
and pass the SHA256 hash directly.Test Vector
The
message
is a 69-byte binary that needs to be signed. It consists of 37 bytes of authenticator data and a 32-byte client data hash.Context
I'm trying to make ckb-auth work with the signature created by JoyID, more background can be found in my post: How to Verify JoyID WebAuthn Signature