mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-09 18:51:29 -07:00
openssl_* module_utils/crypto.py: add full list of OIDs known to current OpenSSL (#54943)
* Add full list of OIDs known to current OpenSSL. * Remove hardcoded OIDs. * UID -> x500UniqueIdentifier * Reference actual version used. * Don't normalize to lower-case. * Change test back. * Fix typo. * Apply changes suggested by RedHat legal.
This commit is contained in:
parent
0303ea2bfa
commit
c411883618
5 changed files with 1148 additions and 200 deletions
|
@ -294,7 +294,7 @@ class CertificateSigningRequestInfoCryptography(CertificateSigningRequestInfo):
|
|||
def _get_subject(self):
|
||||
result = dict()
|
||||
for attribute in self.csr.subject:
|
||||
result[crypto_utils.crpytography_oid_to_name(attribute.oid)] = attribute.value
|
||||
result[crypto_utils.cryptography_oid_to_name(attribute.oid)] = attribute.value
|
||||
return result
|
||||
|
||||
def _get_key_usage(self):
|
||||
|
@ -339,7 +339,7 @@ class CertificateSigningRequestInfoCryptography(CertificateSigningRequestInfo):
|
|||
try:
|
||||
ext_keyusage_ext = self.csr.extensions.get_extension_for_class(x509.ExtendedKeyUsage)
|
||||
return sorted([
|
||||
crypto_utils.crpytography_oid_to_name(eku) for eku in ext_keyusage_ext.value
|
||||
crypto_utils.cryptography_oid_to_name(eku) for eku in ext_keyusage_ext.value
|
||||
]), ext_keyusage_ext.critical
|
||||
except cryptography.x509.ExtensionNotFound:
|
||||
return None, False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue