Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change List<byte[]> storedDevicePublicKeys to IReadOnlyList<byte[]> #477

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Src/Fido2/AuthenticatorAssertionResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
AssertionOptions options,
Fido2Configuration config,
byte[] storedPublicKey,
List<byte[]> storedDevicePublicKeys,
IReadOnlyList<byte[]> storedDevicePublicKeys,
uint storedSignatureCounter,
IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredId,
IMetadataService? metadataService,
Expand Down Expand Up @@ -235,7 +235,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
/// <param name="hash"></param>
/// </summary>
private static async ValueTask<byte[]?> DevicePublicKeyAuthenticationAsync(
List<byte[]> storedDevicePublicKeys,
IReadOnlyList<byte[]> storedDevicePublicKeys,
AuthenticationExtensionsClientOutputs clientExtensionResults,
AuthenticatorData authData,
byte[] hash)
Expand Down Expand Up @@ -320,7 +320,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
List<DevicePublicKeyAuthenticatorOutput> matchedDpkKeys = new();

// For each dpkRecord in credentialRecord.devicePubKeys
storedDevicePublicKeys.ForEach(storedDevicePublicKey =>
foreach (var storedDevicePublicKey in storedDevicePublicKeys)
{
var dpkRecord = DevicePublicKeyAuthenticatorOutput.Parse(storedDevicePublicKey);

Expand All @@ -330,7 +330,7 @@ public async Task<VerifyAssertionResult> VerifyAsync(
// Append dpkRecord to matchedDpkKeys.
matchedDpkKeys.Add(dpkRecord);
}
});
}

// If matchedDpkKeys is empty
if (matchedDpkKeys.Count == 0)
Expand Down
2 changes: 1 addition & 1 deletion Src/Fido2/Fido2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task<VerifyAssertionResult> MakeAssertionAsync(
AuthenticatorAssertionRawResponse assertionResponse,
AssertionOptions originalOptions,
byte[] storedPublicKey,
List<byte[]> storedDevicePublicKeys,
IReadOnlyList<byte[]> storedDevicePublicKeys,
uint storedSignatureCounter,
IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredentialIdCallback,
CancellationToken cancellationToken = default)
Expand Down
2 changes: 1 addition & 1 deletion Src/Fido2/IFido2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Task<VerifyAssertionResult> MakeAssertionAsync(
AuthenticatorAssertionRawResponse assertionResponse,
AssertionOptions originalOptions,
byte[] storedPublicKey,
List<byte[]> storedDevicePublicKeys,
IReadOnlyList<byte[]> storedDevicePublicKeys,
uint storedSignatureCounter,
IsUserHandleOwnerOfCredentialIdAsync isUserHandleOwnerOfCredentialIdCallback,
CancellationToken cancellationToken = default);
Expand Down