Skip to content

Commit 92da903

Browse files
committed
misc: pr feedback
remove comments, revert test change, simpler complexpin and complexpuk
1 parent dbb6718 commit 92da903

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

Yubico.YubiKey/src/Yubico/YubiKey/Piv/PivSession.Attestation.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,6 @@ private static bool IsSupportedCert(X509Certificate2 certificate, KeyType keyTyp
431431
_ => throw new ArgumentException($"Unsupported key type: {keyType}")
432432
};
433433

434-
// var certKeyType = isRsa
435-
// ? KeyDefinitions.GetByRSALength(certificate.PublicKey.Key.KeySize).KeyType
436-
// : GetKeyTypeForECDsa(certificate);
437434
bool isSameAlgorithm = certKeyType == keyType;
438435
byte[] certDer = certificate.GetRawCertData();
439436
return certificate.Handle != IntPtr.Zero &&

Yubico.YubiKey/tests/integration/Yubico/YubiKey/Fido2/LargeBlobTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ public LargeBlobTests()
4545
[SkippableFact(typeof(DeviceNotFoundException))]
4646
public void SetLargeBlob_Succeeds()
4747
{
48-
// bool isValid = Fido2ResetForTest.DoReset(_testDevice.SerialNumber);
49-
// Assert.True(isValid);
48+
bool isValid = Fido2ResetForTest.DoReset(_testDevice.SerialNumber);
49+
Assert.True(isValid);
5050

5151
using (var fido2Session = new Fido2Session(_testDevice))
5252
{
5353
fido2Session.KeyCollector = Fido2ResetForTest.ResetForTestKeyCollectorDelegate;
54-
var isValid = fido2Session.TrySetPin(new ReadOnlyMemory<byte>(_pin));
54+
isValid = fido2Session.TrySetPin(new ReadOnlyMemory<byte>(_pin));
5555
Assert.True(isValid);
5656

5757
var user1 = new UserEntity(new byte[] { 1, 2, 3, 4 })

Yubico.YubiKey/tests/integration/Yubico/YubiKey/Piv/PivSessionIntegrationTestBase.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ public class PivSessionIntegrationTestBase : IDisposable
2525
{
2626
public static Memory<byte> DefaultPin => "123456"u8.ToArray();
2727
public static Memory<byte> DefaultPuk => "12345678"u8.ToArray();
28-
public static Memory<byte> ComplexPuk => "gjH@5K!8"u8.ToArray();
29-
public static Memory<byte> ComplexPin => "1@$#5s!8"u8.ToArray();
28+
public static Memory<byte> ComplexPuk => "11234567"u8.ToArray();
29+
public static Memory<byte> ComplexPin => "12234567"u8.ToArray();
3030

3131
public static Memory<byte> DefaultManagementKey => new byte[] // Both Aes and TDes
3232
{
@@ -42,24 +42,6 @@ public class PivSessionIntegrationTestBase : IDisposable
4242
0x23, 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9A
4343
};
4444

45-
// public void SetFipsApprovedCredentials(PivSession? session)
46-
// {
47-
// session ??= Session;
48-
// session.TryChangePin(DefaultPin, ComplexPin, out _);
49-
// session.TryChangePuk(DefaultPuk, ComplexPuk, out _);
50-
// session.TryChangeManagementKey(DefaultManagementKey, ComplexManagementKey, PivTouchPolicy.Always);
51-
// Assert.True(session.TryVerifyPin(ComplexPin, out _));
52-
// }
53-
54-
// public void SetFipsApprovedCredentials(
55-
// IYubiKeyDevice? device,
56-
// ScpKeyParameters parameters)
57-
// {
58-
// device ??= Device;
59-
// using var session = new PivSession(device, parameters);
60-
// SetFipsApprovedCredentials(session);
61-
// }
62-
6345
protected KeyType DefaultManagementKeyType =>
6446
Device.FirmwareVersion > FirmwareVersion.V5_7_0 ? KeyType.AES192 : KeyType.TripleDES;
6547

0 commit comments

Comments
 (0)