mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-03-26 21:33:25 +00:00
CSR: avoid access of private attributes (#910)
* Avoid access of private attributes. * Add changelog.
This commit is contained in:
2
changelogs/fragments/910-csr.yml
Normal file
2
changelogs/fragments/910-csr.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "openssl_csr, openssl_csr_pipe - avoid accessing internal members of cryptography's ``KeyUsage`` extension object (https://github.com/ansible-collections/community.crypto/pull/910)."
|
||||
@@ -600,8 +600,7 @@ class CertificateSigningRequestCryptographyBackend(CertificateSigningRequestBack
|
||||
return False
|
||||
params = cryptography_parse_key_usage_params(self.keyUsage)
|
||||
for param, value in params.items():
|
||||
# TODO: check whether getattr() with '_' prepended is really needed
|
||||
if getattr(current_keyusage_ext.value, "_" + param) != value:
|
||||
if getattr(current_keyusage_ext.value, param) != value:
|
||||
return False
|
||||
return current_keyusage_ext.critical == self.keyUsage_critical
|
||||
|
||||
|
||||
Reference in New Issue
Block a user