Closed mkauf closed 3 years ago
Hello @mkauf ,
Thanks for the report. Indeed there are bugs in the jwk validation functions. Fixing the kty
bug made me realize other parts had some bugs too (I'm talking to you both x5c
and x5u
!).
Also, some tests were simply wrong, like this one: https://github.com/babelouest/rhonabwy/blob/master/test/jwk_import.c#L685
I'll soon push a fix about that, shouldn't take long.
The bug has been fixed in the master branch, including some refactoring of the functions r_jwk_is_valid
and r_jwk_key_type
.
Thank you very much for the bugfix!
JWKs must have a "kty" member. From RFC 7517:
In the function
r_jwk_is_valid()
in jwk.c, there are some checks:I don't understand the reasoning behind this. "kty" should always be present, and this should be checked.
Current code: