Skip to content

Commit

Permalink
Add ability to identify ed25519 complete chains.
Browse files Browse the repository at this point in the history
  • Loading branch information
gderber committed Jul 8, 2024
1 parent 518847a commit c03fff0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/modules/certificate_complete_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
import cryptography.hazmat.primitives.serialization
import cryptography.hazmat.primitives.asymmetric.rsa
import cryptography.hazmat.primitives.asymmetric.ec
import cryptography.hazmat.primitives.asymmetric.ed25519
import cryptography.hazmat.primitives.asymmetric.padding
import cryptography.hazmat.primitives.hashes
import cryptography.hazmat.primitives.asymmetric.utils
Expand Down Expand Up @@ -196,6 +197,11 @@ def is_parent(module, cert, potential_parent):
cert.cert.tbs_certificate_bytes,
cryptography.hazmat.primitives.asymmetric.ec.ECDSA(cert.cert.signature_hash_algorithm),
)
elif isinstance(public_key, cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey):
public_key.verify(
cert.cert.signature,
cert.cert.tbs_certificate_bytes
)
else:
# Unknown public key type
module.warn('Unknown public key type "{0}"'.format(public_key))
Expand Down

0 comments on commit c03fff0

Please sign in to comment.