I’m developing a new acme client, and so far I’m struggling with new account registration. My generated payload passes JWS validation, so I think it might be something to do with the nonce, but can’t figure out what’s wrong exactly. Here is the request I’m sending:
POST request to the "https://acme-staging-v02.api.letsencrypt.org/acme/new-acct",
with the following headers set:
"user-agent": "certifika 0.1/reqwest 0.10"
"content-type": "application/jose+json"
{"payload":"eyJjb250YWN0IjpbIm1haWx0bzp2enIwMDZAZ21haWwuY29tIl0sInRlcm1zT2ZTZXJ2aWNlQWdyZWVkIjp0cnVlfQ","signature":"MEUCIQDfp0j2tooqXmhQCj9gO1meJ1gM8qBtS9Zof9x_kvsMVwIgbn8YWQMOPMVvwzLEI8y4MIFgGkb2EYJvsTD1gmiGrNI","protected":"eyJqd2siOnsiY3J2IjoiUC0yNTYiLCJrdHkiOiJFQyIsIngiOiJ0WUpWZlpVdDZiMTVUVGd1VjRzeGdwYm5mMnZ2OWFyR1VLcXE3bUZ5WHY0IiwieSI6IlFHZUMwdWpGX2I3MVlURmg3dzdzcGp0QkpQLXpyTWg0aWtBZUlsMTRhNjgifSwibm9uY2UiOiIwMDAxenlWcWlGMVVBdWlrbjA5eGpYb0xjcUJNdGNoaDU5SmdTS1UwLW9MQ2dzNCIsImFsZyI6IkVTMjU2IiwidXJsIjoiaHR0cDovLzEyNy4wLjAuMTo4OCJ9"}
Any advice on what’s wrong with my JWS/nonce is highly appreciated.
For JWS ES256, a fixed 64-byte signature is expected. So you would take the two integer values (R, S) from inside the ASN.1 encoding, pad them to 32 bytes each as necessary, and mash them together into a 64 byte array.
Are you generating the signature with OpenSSL or something?
(I think you have other problems in your JWS as well, but this is the first problem to overcome).
Wow, thanks, I did not know about that…That’s must be it…I’m not using openssl, I’m writing the client in rust, and using this crate to sign the message: https://briansmith.org/rustdoc/ring/signature
Will have to dig a lil bit deeper into it. Thanks for the hint!