-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
verifyKey is not taken into consideration #149
Comments
@jakobsa Hi! The core point now is that holders MUST have secretData as a core point of signature purposes. (not good point :/) If you would like, we could make a list of appropriate considerations and desires to further API 3.0. One of the points: maybe algorithms should hold secret data with which they should work? |
For me only token verification was relevant, so I didn't consider the implications of signing much. My suggestions are only valid if the following assumptions are true:
Suggestion:
|
@jakobsa Hi, could you check latest master? It has been fixed, I guess |
Issue Description and Steps
I have to verify a JWT token using RS256. The public key material is received from an endpoint as modulus and exponent. I could not use any of the provided key extractors for key material in that format. I had to create the JWTCryptoKeyPublic instance myself and found the verifyKey block useful as it should allow for directly setting the public key the verifier should use.
I was surprised to see that it would not work, and after digging into the sources I found that secretData needed to be set (here is why: JWTCoding+VersionThree:560).
SecretData referred to as key will not be used by RSBaseAlgorithms down the callstack as self.verifyKey is preferred then. (JWTAlgorithmRSBase:127-129).
To summarize.
Holders configured like that do not work:
JWTAlgorithmRSFamilyDataHolder* verifyDataHolder = [JWTAlgorithmRSFamilyDataHolder new]; verifyDataHolder.algorithmName(JWTAlgorithmNameRS256).verifyKey(publicKey);
Holders configured like that will work:
The text was updated successfully, but these errors were encountered: