Skip to content

Commit

Permalink
Fix deprecation warning with TripleDES
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Nov 28, 2024
1 parent d67ae66 commit 63f7262
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 63f7262

Please sign in to comment.