Skip to content

Commit

Permalink
Merge pull request #589 from Nitrokey/fix-tdes-hazmat
Browse files Browse the repository at this point in the history
Fix deprecation warning with TripleDES
  • Loading branch information
sosthene-nitrokey authored Nov 28, 2024
2 parents d67ae66 + 63f7262 commit dbc6e7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pynitrokey/nk3/piv_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Any, Callable, Optional, Sequence, Union

import smartcard
from cryptography.hazmat.decrepit.ciphers.algorithms import TripleDES
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from smartcard.CardConnection import CardConnection
Expand Down Expand Up @@ -168,8 +169,8 @@ def authenticate_admin(self, admin_key: bytes) -> None:

if len(admin_key) == 24:
algorithm: Union[
algorithms.TripleDES, algorithms.AES128, algorithms.AES256
] = algorithms.TripleDES(admin_key)
TripleDES, algorithms.AES128, algorithms.AES256
] = TripleDES(admin_key)
# algo = "tdes"
algo_byte = 0x03
expected_len = 8
Expand Down

0 comments on commit dbc6e7d

Please sign in to comment.