mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 21:33:00 +00:00
openssl_pkcs12: fix crash when trying to get non-existing other certificates (#487)
* Fix crash when trying to get non-existing other certificates. * Add test.
This commit is contained in:
@@ -559,6 +559,8 @@ class PkcsPyOpenSSL(Pkcs):
|
||||
return crypto.dump_certificate(crypto.FILETYPE_PEM, cert) if cert else None
|
||||
|
||||
def _dump_other_certificates(self, pkcs12):
|
||||
if pkcs12.get_ca_certificates() is None:
|
||||
return []
|
||||
return [
|
||||
crypto.dump_certificate(crypto.FILETYPE_PEM, other_cert)
|
||||
for other_cert in pkcs12.get_ca_certificates()
|
||||
|
||||
Reference in New Issue
Block a user