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

Consider cryptography 42.x.x new validation #948

Open
amolinaalvarez opened this issue Mar 5, 2024 · 2 comments
Open

Consider cryptography 42.x.x new validation #948

amolinaalvarez opened this issue Mar 5, 2024 · 2 comments

Comments

@amolinaalvarez
Copy link

In cryptography 42.x.x, this library introduces a new parsing validation that raises a ValueError when load_pem_public_key is called with an invalid PEM. This affects the JWS decode function, as PyJWT does not currently handle this exception. Does it make sense to address this scenario?

PyJWT unmanaged exception point:

return cast(RSAPublicKey, load_pem_public_key(key_bytes))

cryptography new validation: https://github.com/pyca/cryptography/blob/b507701ab4c14c345fd036c20ec7b95dae78c1a4/src/rust/src/error.rs#L12

Thank you.

@codespearhead
Copy link

Of course! Can you make a PR?

@CollinEMac
Copy link

Hi 👋

I opened a PR that I think would handle this case.

#952

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

No branches or pull requests

3 participants