@@ -23,7 +23,6 @@ namespace Yubico.YubiKey.Piv
23
23
[ Trait ( TraitTypes . Category , TestCategories . Simple ) ]
24
24
public class PinNoCollectorTests : PivSessionIntegrationTestBase
25
25
{
26
-
27
26
[ Theory ]
28
27
[ InlineData ( StandardTestDevice . Fw5 ) ]
29
28
public void VerifyPin_Sign_Succeeds (
@@ -54,7 +53,7 @@ public void VerifyPin_WrongPin_ReturnsFalse(
54
53
55
54
// Act
56
55
var isValid = Session . TryVerifyPin ( pin , out var retriesRemaining ) ;
57
-
56
+
58
57
// Assert
59
58
Assert . False ( isValid ) ;
60
59
_ = Assert . NotNull ( retriesRemaining ) ;
@@ -94,24 +93,22 @@ public void ChangePuk_Succeeds(
94
93
{
95
94
// Arrange
96
95
TestDeviceType = testDeviceType ;
97
- var newPuk = "gjH@5K!8"u8 . ToArray ( ) ;
98
- var newPin = "1@$#5s!8"u8 . ToArray ( ) ;
99
96
100
97
using ( var pivSession = GetSession ( authenticate : false ) )
101
98
{
102
99
pivSession . ResetApplication ( ) ;
103
- var isValid = pivSession . TryChangePuk ( DefaultPuk , newPuk , out var retriesRemaining ) ;
100
+ var isValid = pivSession . TryChangePuk ( DefaultPuk , ComplexPuk , out var retriesRemaining ) ;
104
101
Assert . True ( isValid ) ;
105
102
Assert . Null ( retriesRemaining ) ;
106
103
}
107
104
108
105
using ( var pivSession = GetSession ( authenticate : false ) )
109
106
{
110
- var isValid = pivSession . TryResetPin ( newPuk , newPin , out var retriesRemaining ) ;
107
+ var isValid = pivSession . TryResetPin ( ComplexPuk , ComplexPin , out var retriesRemaining ) ;
111
108
Assert . True ( isValid ) ;
112
109
Assert . Null ( retriesRemaining ) ;
113
110
114
- isValid = pivSession . TryVerifyPin ( newPin , out retriesRemaining ) ;
111
+ isValid = pivSession . TryVerifyPin ( ComplexPin , out retriesRemaining ) ;
115
112
Assert . True ( isValid ) ;
116
113
Assert . Null ( retriesRemaining ) ;
117
114
@@ -135,27 +132,25 @@ public void ChangeRetryCounts_Succeeds(
135
132
0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 ,
136
133
0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08
137
134
} ;
138
- var newPuk = "gjH@5K!8"u8 . ToArray ( ) ;
139
- var newPin = "1@$#5s!8"u8 . ToArray ( ) ;
140
-
135
+
141
136
using ( var pivSession = GetSession ( authenticate : false ) )
142
137
{
143
- var isValid = pivSession . TryChangePin ( DefaultPin , newPin , out var retriesRemaining ) ;
138
+ var isValid = pivSession . TryChangePin ( DefaultPin , ComplexPin , out var retriesRemaining ) ;
144
139
Assert . True ( isValid ) ;
145
140
Assert . Null ( retriesRemaining ) ;
146
141
147
- isValid = pivSession . TryChangePuk ( DefaultPuk , newPuk , out retriesRemaining ) ;
142
+ isValid = pivSession . TryChangePuk ( DefaultPuk , ComplexPuk , out retriesRemaining ) ;
148
143
Assert . Null ( retriesRemaining ) ;
149
144
Assert . True ( isValid ) ;
150
145
}
151
146
152
147
using ( var pivSession = GetSession ( authenticate : false ) )
153
148
{
154
- var isValid = pivSession . TryVerifyPin ( newPin , out var retriesRemaining ) ;
149
+ var isValid = pivSession . TryVerifyPin ( ComplexPin , out var retriesRemaining ) ;
155
150
Assert . True ( isValid ) ;
156
151
Assert . Null ( retriesRemaining ) ;
157
152
158
- isValid = pivSession . TryResetPin ( newPuk , DefaultPin , out retriesRemaining ) ;
153
+ isValid = pivSession . TryResetPin ( ComplexPuk , DefaultPin , out retriesRemaining ) ;
159
154
Assert . True ( isValid ) ;
160
155
Assert . Null ( retriesRemaining ) ;
161
156
}
@@ -166,30 +161,31 @@ public void ChangeRetryCounts_Succeeds(
166
161
Assert . True ( isValid ) ;
167
162
Assert . Null ( retriesRemaining ) ;
168
163
169
- isValid = pivSession . TryChangePin ( DefaultPin , newPin , out retriesRemaining ) ;
164
+ isValid = pivSession . TryChangePin ( DefaultPin , ComplexPin , out retriesRemaining ) ;
170
165
Assert . True ( isValid ) ;
171
166
Assert . Null ( retriesRemaining ) ;
172
167
173
- isValid = pivSession . TryVerifyPin ( newPin , out retriesRemaining ) ;
168
+ isValid = pivSession . TryVerifyPin ( ComplexPin , out retriesRemaining ) ;
174
169
Assert . Null ( retriesRemaining ) ;
175
170
Assert . True ( isValid ) ;
176
171
}
177
172
178
173
using ( var pivSession = GetSession ( authenticate : false ) )
179
174
{
180
- var isValid = pivSession . TryChangePinAndPukRetryCounts ( mgmtKey , newPin , 7 , 8 , out var retriesRemaining ) ;
175
+ var isValid =
176
+ pivSession . TryChangePinAndPukRetryCounts ( mgmtKey , ComplexPin , 7 , 8 , out var retriesRemaining ) ;
181
177
Assert . True ( isValid ) ;
182
178
Assert . Null ( retriesRemaining ) ;
183
179
184
180
isValid = pivSession . TryVerifyPin ( DefaultPin , out retriesRemaining ) ;
185
181
Assert . True ( isValid ) ;
186
182
Assert . Null ( retriesRemaining ) ;
187
183
188
- isValid = pivSession . TryResetPin ( DefaultPuk , newPin , out retriesRemaining ) ;
184
+ isValid = pivSession . TryResetPin ( DefaultPuk , ComplexPin , out retriesRemaining ) ;
189
185
Assert . True ( isValid ) ;
190
186
Assert . Null ( retriesRemaining ) ;
191
187
192
- isValid = pivSession . TryChangePin ( newPin , DefaultPin , out retriesRemaining ) ;
188
+ isValid = pivSession . TryChangePin ( ComplexPin , DefaultPin , out retriesRemaining ) ;
193
189
Assert . True ( isValid ) ;
194
190
Assert . Null ( retriesRemaining ) ;
195
191
}
0 commit comments