Skip to content

Commit b8b36a0

Browse files
authored
Change List<byte[]> storedDevicePublicKeys to IReadOnlyList<byte[]> (#477)
1 parent 5284757 commit b8b36a0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Src/Fido2/AuthenticatorAssertionResponse.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
5757
AssertionOptions options,
5858
Fido2Configuration config,
5959
byte[] storedPublicKey,
60-
List<byte[]> storedDevicePublicKeys,
60+
IReadOnlyList<byte[]> storedDevicePublicKeys,
6161
uint storedSignatureCounter,
6262
IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredId,
6363
IMetadataService? metadataService,
@@ -235,7 +235,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
235235
/// <param name="hash"></param>
236236
/// </summary>
237237
private static async ValueTask<byte[]?> DevicePublicKeyAuthenticationAsync(
238-
List<byte[]> storedDevicePublicKeys,
238+
IReadOnlyList<byte[]> storedDevicePublicKeys,
239239
AuthenticationExtensionsClientOutputs clientExtensionResults,
240240
AuthenticatorData authData,
241241
byte[] hash)
@@ -320,7 +320,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
320320
List<DevicePublicKeyAuthenticatorOutput> matchedDpkKeys = new();
321321

322322
// For each dpkRecord in credentialRecord.devicePubKeys
323-
storedDevicePublicKeys.ForEach(storedDevicePublicKey =>
323+
foreach (var storedDevicePublicKey in storedDevicePublicKeys)
324324
{
325325
var dpkRecord = DevicePublicKeyAuthenticatorOutput.Parse(storedDevicePublicKey);
326326

@@ -330,7 +330,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
330330
// Append dpkRecord to matchedDpkKeys.
331331
matchedDpkKeys.Add(dpkRecord);
332332
}
333-
});
333+
}
334334

335335
// If matchedDpkKeys is empty
336336
if (matchedDpkKeys.Count == 0)

Src/Fido2/Fido2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public async Task<VerifyAssertionResult> MakeAssertionAsync(
108108
AuthenticatorAssertionRawResponse assertionResponse,
109109
AssertionOptions originalOptions,
110110
byte[] storedPublicKey,
111-
List<byte[]> storedDevicePublicKeys,
111+
IReadOnlyList<byte[]> storedDevicePublicKeys,
112112
uint storedSignatureCounter,
113113
IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredentialIdCallback,
114114
CancellationToken cancellationToken = default)

Src/Fido2/IFido2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Task<VerifyAssertionResult> MakeAssertionAsync(
1717
AuthenticatorAssertionRawResponse assertionResponse,
1818
AssertionOptions originalOptions,
1919
byte[] storedPublicKey,
20-
List<byte[]> storedDevicePublicKeys,
20+
IReadOnlyList<byte[]> storedDevicePublicKeys,
2121
uint storedSignatureCounter,
2222
IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredentialIdCallback,
2323
CancellationToken cancellationToken = default);

0 commit comments

Comments
 (0)