Hey folks,
I'm currently updating openidconnect-rs to the newest base64 version. However I'm having difficulties as the tests for rp-id_token-bad-sig-rs256 and rp-id_token-bad-sig-hs256 fail on decoding base64.
After a bit of digging I found that the new base64 parser contains better error checking thus failing as the returned base64 for the signature is invalid. The description of the test, however, says that the test should fail on token validation failure and not on base64 decoding error.
Therefore I propose changing that response to contain valid base64 using canoncial encoding containing an invalid signature as described in [1]
Further Info
The base64 that is returned from the endpoint is:
1234ABCDDDILNNRRRUWZ__aaaccdefghijkklosvwxx
If we base64 decode that we get this (bytes in hex representation):
d7 6d f8 00 10 83 0c 32 0b 34 d4 51 45 45 99 ff f6 9a 69 c7 1d 79 f8 21 8a 39 24 96 8b 2f c3 1c
Returning that back to base64 we get the following:
1234ABCDDDILNNRRRUWZ__aaaccdefghijkklosvwxw
Now lets have a look at the last character of both base64 text (x and w) in binary:
x: 01111000
w: 01110111
With the w all padding bits are 1 to match Canonical Encoding from [1]
References
Hey folks,
I'm currently updating openidconnect-rs to the newest base64 version. However I'm having difficulties as the tests for
rp-id_token-bad-sig-rs256andrp-id_token-bad-sig-hs256fail on decoding base64.After a bit of digging I found that the new base64 parser contains better error checking thus failing as the returned base64 for the signature is invalid. The description of the test, however, says that the test should fail on token validation failure and not on base64 decoding error.
Therefore I propose changing that response to contain valid base64 using canoncial encoding containing an invalid signature as described in [1]
Further Info
The base64 that is returned from the endpoint is:
If we base64 decode that we get this (bytes in hex representation):
Returning that back to base64 we get the following:
Now lets have a look at the last character of both base64 text (
xandw) in binary:x:01111000w:01110111With the
wall padding bits are1to match Canonical Encoding from [1]References