From b4c9e5ab26b99fa75dfd11f45364b0a78139cff2 Mon Sep 17 00:00:00 2001 From: joegoldman674 <147369450+joegoldman2@users.noreply.github.com> Date: Sat, 23 Dec 2023 11:43:21 +0200 Subject: [PATCH] Change List storedDevicePublicKeys to IReadOnlyList --- Src/Fido2/AuthenticatorAssertionResponse.cs | 8 ++++---- Src/Fido2/Fido2.cs | 2 +- Src/Fido2/IFido2.cs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Src/Fido2/AuthenticatorAssertionResponse.cs b/Src/Fido2/AuthenticatorAssertionResponse.cs index fe94e536..953328f9 100644 --- a/Src/Fido2/AuthenticatorAssertionResponse.cs +++ b/Src/Fido2/AuthenticatorAssertionResponse.cs @@ -57,7 +57,7 @@ public async Task VerifyAsync( AssertionOptions options, Fido2Configuration config, byte[] storedPublicKey, - List storedDevicePublicKeys, + IReadOnlyList storedDevicePublicKeys, uint storedSignatureCounter, IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredId, IMetadataService? metadataService, @@ -235,7 +235,7 @@ public async Task VerifyAsync( /// /// private static async ValueTask DevicePublicKeyAuthenticationAsync( - List storedDevicePublicKeys, + IReadOnlyList storedDevicePublicKeys, AuthenticationExtensionsClientOutputs clientExtensionResults, AuthenticatorData authData, byte[] hash) @@ -320,7 +320,7 @@ public async Task VerifyAsync( List matchedDpkKeys = new(); // For each dpkRecord in credentialRecord.devicePubKeys - storedDevicePublicKeys.ForEach(storedDevicePublicKey => + foreach (var storedDevicePublicKey in storedDevicePublicKeys) { var dpkRecord = DevicePublicKeyAuthenticatorOutput.Parse(storedDevicePublicKey); @@ -330,7 +330,7 @@ public async Task VerifyAsync( // Append dpkRecord to matchedDpkKeys. matchedDpkKeys.Add(dpkRecord); } - }); + } // If matchedDpkKeys is empty if (matchedDpkKeys.Count == 0) diff --git a/Src/Fido2/Fido2.cs b/Src/Fido2/Fido2.cs index 98349375..f04ccd46 100644 --- a/Src/Fido2/Fido2.cs +++ b/Src/Fido2/Fido2.cs @@ -108,7 +108,7 @@ public async Task MakeAssertionAsync( AuthenticatorAssertionRawResponse assertionResponse, AssertionOptions originalOptions, byte[] storedPublicKey, - List storedDevicePublicKeys, + IReadOnlyList storedDevicePublicKeys, uint storedSignatureCounter, IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredentialIdCallback, CancellationToken cancellationToken = default) diff --git a/Src/Fido2/IFido2.cs b/Src/Fido2/IFido2.cs index e8a127e9..a0738db6 100644 --- a/Src/Fido2/IFido2.cs +++ b/Src/Fido2/IFido2.cs @@ -17,7 +17,7 @@ Task MakeAssertionAsync( AuthenticatorAssertionRawResponse assertionResponse, AssertionOptions originalOptions, byte[] storedPublicKey, - List storedDevicePublicKeys, + IReadOnlyList storedDevicePublicKeys, uint storedSignatureCounter, IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredentialIdCallback, CancellationToken cancellationToken = default);