From 441ad34bac91c12bfa38cb3c2f9bc4829df7b2cc Mon Sep 17 00:00:00 2001 From: Dennis Dyall Date: Tue, 17 Dec 2024 16:28:27 +0100 Subject: [PATCH] tests: fixed more pivsession tests --- .../Yubico/YubiKey/Piv/Commands/AuthMgmtKeyCmdTests.cs | 4 ++-- .../Yubico/YubiKey/Piv/Commands/SetMgmtKeyCmdTests.cs | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/AuthMgmtKeyCmdTests.cs b/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/AuthMgmtKeyCmdTests.cs index 7fca166e2..da901cbb0 100644 --- a/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/AuthMgmtKeyCmdTests.cs +++ b/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/AuthMgmtKeyCmdTests.cs @@ -56,7 +56,7 @@ public void AuthKey_Default_Succeeds() 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; - var initCmd = new InitializeAuthenticateManagementKeyCommand(false); + var initCmd = new InitializeAuthenticateManagementKeyCommand(false, PivAlgorithm.TripleDes); InitializeAuthenticateManagementKeyResponse initRsp = pivSession.Connection.SendCommand(initCmd); Assert.Equal(ResponseStatus.Success, initRsp.Status); @@ -88,7 +88,7 @@ public void AuthKey_Aes_Succeeds() 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58 }; - var initCmd = new InitializeAuthenticateManagementKeyCommand(true); + var initCmd = new InitializeAuthenticateManagementKeyCommand(true, PivAlgorithm.TripleDes); InitializeAuthenticateManagementKeyResponse initRsp = pivSession.Connection.SendCommand(initCmd); Assert.Equal(ResponseStatus.Success, initRsp.Status); diff --git a/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/SetMgmtKeyCmdTests.cs b/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/SetMgmtKeyCmdTests.cs index a030e3b64..d219c5f74 100644 --- a/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/SetMgmtKeyCmdTests.cs +++ b/Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/Commands/SetMgmtKeyCmdTests.cs @@ -52,10 +52,7 @@ public void SetKey_ValidAes_Succeeds() 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38 }; - var setCmd = new SetManagementKeyCommand(keyData) - { - Algorithm = PivAlgorithm.Aes128, - }; + var setCmd = new SetManagementKeyCommand(keyData, PivAlgorithm.Aes128); SetManagementKeyResponse setRsp = pivSession.Connection.SendCommand(setCmd); Assert.Equal(ResponseStatus.AuthenticationRequired, setRsp.Status);