-
Notifications
You must be signed in to change notification settings - Fork 447
Use cryptography.x509 for certificate loading #660
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
Conversation
- Uses x509.load_pem_x509_certificate to read a certificate file. This ensures 1) the certificate is a valid certificate 2) trailing newlines and whitespaces will be ignored - Adds tests for the above scenarios Fixes IdentityPython#659
- Uses cryptography.x509 load_pem_x509_certificate or load_der_x509_certificate depending on the cert type. This ensures 1) the certificate is a valid certificate 2) trailing newlines and whitespaces will be ignored - Ignores cer/crt as certificate type since these are file extensions and do not guarrantee the certificate encoding. Uses "pem" as default type (mostly for backward compatibility). Only other valid option is "der" (everything else falls back to "pem") - Uses sigver cert loading function for the metadata cert loading (removes read_cert function)
Codecov Report
@@ Coverage Diff @@
## master #660 +/- ##
==========================================
+ Coverage 65.06% 65.06% +<.01%
==========================================
Files 102 102
Lines 25667 25659 -8
==========================================
- Hits 16700 16696 -4
+ Misses 8967 8963 -4
Continue to review full report at Codecov.
|
Is there any possibility to handle also #278 in this PR? |
I don't think we should handle #278 here. I also don't certificate-passwords are widely used. Let's keep this issue about loading certificates only and we can revisit certificate-passwords again in the future in a different issue/PR. |
I marked that as closing and then closed It, now I've reopened it again. I have a presentiment that It would be a "won't fix" but my excuse in Advance, I didn't mean to be cynical |
I pushed this feature here Probably it would belong to this PR. |
closed by a924435 |
load_der_x509_certificate depending on the cert type. This ensures 1)
the certificate is a valid certificate 2) trailing newlines and
whitespaces will be ignored
and do not guarrantee the certificate encoding. Uses "pem" as default
type (mostly for backward compatibility). Only other valid option is
"der" (everything else falls back to "pem")
(removes read_cert function)
All Submissions: