-
Notifications
You must be signed in to change notification settings - Fork 276
Invalid JWK exponent encoding for RSA ? #40
Comments
It's big-endian, so it decodes to the same number: |
yes you are right, I got the endianess wrong when printing. The issue is not trimming the extra 0.
and I'm getting
and AAAAAw reprents 00 00 00 03, again it should only be 03 Right now it's invalid according to the spec:
I assume it should be easy to fix but I'm not fluent in Go, and it would probably be better to add tests to. |
Opened #41 with a fix. Thanks for catching this and reporting it to us! |
Thanks for this quick fix. I haven't checked but there may be other values that suffer from the same encoding issue.
|
Fixes issue #40: extraneous zero padding on serialized exponent
Merged fix now. Thanks again! |
I believe there is an issue regarding exponent ("e") encoding in JWK.
In jwk_test.go the TestMarshalNonPointer JWK encoding test looks strange to me :
Why isn't "e" encoded as "AQAB" as in input ?
as per JWA RFC7518 e should be encoded in Base64urlUInt
AQAB represent 0x010001 => 65537
AAEAAQ represent 0x01000100 => 16777472
The text was updated successfully, but these errors were encountered: