Skip to content

Commit

Permalink
Merge pull request #625 from Nitrokey/fix-admin-auth
Browse files Browse the repository at this point in the history
Fix admin auth
  • Loading branch information
sosthene-nitrokey authored Feb 25, 2025
2 parents 65a0cee + 0fcdfdd commit 2828c1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pynitrokey/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.3
0.7.4
4 changes: 2 additions & 2 deletions pynitrokey/nk3/piv_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ def authenticate_admin(self, admin_key: bytes) -> None:

our_challenge = os.urandom(expected_len)
cipher = Cipher(algorithm, mode=modes.ECB())
encryptor = cipher.encryptor()
decryptor = cipher.decryptor()
response = encryptor.update(challenge) + encryptor.finalize()
response = decryptor.update(challenge) + decryptor.finalize()
decryptor = cipher.decryptor()
our_challenge_encrypted = decryptor.update(our_challenge) + decryptor.finalize()
response_body = Tlv.build(
[(0x7C, Tlv.build([(0x80, response), (0x81, our_challenge_encrypted)]))]
Expand Down

0 comments on commit 2828c1d

Please sign in to comment.