Skip to content

Commit

Permalink
Fix deprecation warning (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Oct 1, 2024
1 parent b6d1bfd commit 8164824
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yubikit/piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ def challenge_len(self) -> int:

def _parse_management_key(key_type, management_key):
if key_type == MANAGEMENT_KEY_TYPE.TDES:
return algorithms.TripleDES(management_key)
# TripleDES moved to decrepit in cryptography 43
try:
from cryptography.hazmat.decrepit.ciphers.algorithms import TripleDES
except ImportError:
TripleDES = algorithms.TripleDES
return TripleDES(management_key)
else:
return algorithms.AES(management_key)

Expand Down

0 comments on commit 8164824

Please sign in to comment.