Skip to content
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

Add helper for making RSA key from exponent and modulus #307

Merged
merged 78 commits into from
Dec 26, 2023
Merged

Conversation

prince-chrismc
Copy link
Collaborator

@prince-chrismc prince-chrismc commented Aug 21, 2023

Follow up of #298 since GitHub closed the PR when I pushed and will not let me re-open 😞

I fixed the wolfSSL test not passing, I put together some code for the openssl 3.0 support

//cc @zofer1 who originally submitted this


While evaluating JWT-CPP I have found a case where we have the public key defined as modulus and exponent. I have added a wrapper function to allow this functionality and hide the openssl details for this.

I have also added adding a set of claims defined as json to a verifier to allow static configuration files in the application level.

For the case where we may apply external claims verification we only want to verify the signature only and skip the claims verification. For this I have split the verify functions accordingly while maintaining a BWC.

closes #271

@zofer1
Copy link
Contributor

zofer1 commented Aug 21, 2023

I see you made a lot of changes. OpenSSL did deprecate the functions in v3 but it is still usable. I will test the openssl 3 changes although I wanted to do this at a later stage after the original PR is approved and with the additions for elliptic curve.
Please advise if further tasks are pending so we make it this time before the PR is closed

@prince-chrismc
Copy link
Collaborator Author

We made a decent effort to remove all the deprecated function usage with OpenSSL 3.0 and it would be ideal to keep it that way. The test code you submitted passes but I do agree it needs to be tested more.

I would love to fixup some of the memory management, there's a current a leak when it makes the key. it would be easier to merge this before trying to add more.

I think it's getting a little bit complicated and the EC curve will need just a much fiddling to maintain support for the 5 (or 6) combination of SSL libraries we support

include/jwt-cpp/jwt.h Outdated Show resolved Hide resolved
@prince-chrismc
Copy link
Collaborator Author

I am pretty happy with this there's some missing negative case tests https://coveralls.io/builds/62156107/source?filename=include%2Fjwt-cpp%2Fjwt.h#L953 especially for the openssl error and I try to find sometime this week to work on those

Copy link
Owner

@Thalhammer Thalhammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for the tiny nitpick it looks fine.

include/jwt-cpp/jwt.h Show resolved Hide resolved
@prince-chrismc prince-chrismc added this to the 0.8.0 milestone Dec 9, 2023
@prince-chrismc
Copy link
Collaborator Author

Finally found the memory leak 🚀

More improvements to actions + fixed an example 😫 worth it

@prince-chrismc
Copy link
Collaborator Author

Finally green ✅

@prince-chrismc prince-chrismc merged commit 953aab6 into master Dec 26, 2023
57 checks passed
@prince-chrismc prince-chrismc deleted the pr-298 branch December 26, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for JWT verification without x5c.
4 participants