-
Notifications
You must be signed in to change notification settings - Fork 89
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
acme_certificate: fix crash when using fullchain_dest #324
acme_certificate: fix crash when using fullchain_dest #324
Conversation
I'm currently wondering why CI didn't fail before, The crash happened here for me:
|
Indeed, in cryptography 35.0.0 the code is different: https://github.com/pyca/cryptography/blob/35.0.0/src/rust/src/x509.rs#L393 It's actually due to a change in the |
I think we should still change this, since it's better to just pass one certificate on to This will probably also be a problem with other modules which read PEM files, like x509_certificate_info. While cryptography's new behavior is definitely better for modules such as x509_certificate, some users might depend on the old behavior with x509_certificate_info. |
(The Zuul error is unrelated.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the case where concatenated certs should be processed would it make sense to decouple from cryptography
's behavior by splitting and iterating that list ourselves and just call load_pem_x509_certificate
uniformly (i.e. only use it with the assumption that the target is not a chain)?
Yes, but we already do that (in the cases where we actually want all the certs). The problem are the places where we are only interested in the first cert, but didn't make that explicit. |
Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
(plugins/module_utils/crypto/pem.py's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
recheck |
@Ajpantuso thanks for reviewing this! |
Backport to stable-1: 💚 backport PR created✅ Backport PR branch: Backported as #325 🤖 @patchback |
* Fix crash when using fullchain_dest. * Adjust changelog. * Update plugins/module_utils/acme/backend_cryptography.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Ajpantuso <ajpantuso@gmail.com> (cherry picked from commit 51b6bb2)
* Fix crash when using fullchain_dest. * Adjust changelog. * Update plugins/module_utils/acme/backend_cryptography.py Co-authored-by: Ajpantuso <ajpantuso@gmail.com> Co-authored-by: Ajpantuso <ajpantuso@gmail.com> (cherry picked from commit 51b6bb2) Co-authored-by: Felix Fontein <felix@fontein.de>
SUMMARY
I noticed that acme_certificate crashes when using the cryptography backend when renewing certificates if the
fullchain_dest
option is used, since it passes the content of the fullchain file to cryptography'sload_pem_x509_certificate
function. Since that one no longer calls libssl but uses its own parser (since cryptography 35.0.0), this leads to an error raised.ISSUE TYPE
COMPONENT NAME
acme_certificate