-
I'm using the OpenSSH ssh-keygen write-attestation option while generating a
The key is created successfully on my YubiKey as I would expect. I am now attempting to write some code to process the ssh-sk-attest-v01 format attestation file. All of the fields are reasonably easy to parse with the exception of
Looking at the implementation I see that the OpenSSH codebase is just copying (1, 2) the signature return value from
Therefore, I feel that this is a better question for |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
The attestation signature is created using the key of the attesting authority (except for the case of self attestation, when it is created using the credential private key). For YubiKeys, the algorithm is ES256 and the signature is encoded as an ASN.1 DER Ecdsa-Sig-Value object. You can find the attestation public key in the attestation certificate. |
Beta Was this translation helpful? Give feedback.
-
@LDVG Thanks for your help on correctly parsing the ASN.1 DER Ecdsa-Sig-Value object. Unfortunately, I still am running into issues getting the signature to verify. Can you offer any additional pointers here? The spec says:
However, I'm uncertain of what should be included in the verified message (and the format it should be in). Should I include the ATTESTED CRED DATA as a byte slice? If so, where does the challenge fit in? Instead, should I formatting the message as JSON using the serialization algorithm. If so, in the context of SSH, how do I know the correct values for |
Beta Was this translation helpful? Give feedback.
-
Thanks for your help @LDVG. Unfortunately, I'm still have issues verifying the signature. I generated a specific example using a local testing only YubiKey which has never and will never be used outside the testing environment:
After parsing I end up with the following:
Do any of these values pop out as obviously incorrect to you? When using these the signature fails to verify. Can you see what I'm doing wrong? |
Beta Was this translation helpful? Give feedback.
-
Huge thanks @LDVG! That resolved my issue. |
Beta Was this translation helpful? Give feedback.
The attestation signature is created using the key of the attesting authority (except for the case of self attestation, when it is created using the credential private key). For YubiKeys, the algorithm is ES256 and the signature is encoded as an ASN.1 DER Ecdsa-Sig-Value object. You can find the attestation public key in the attestation certificate.