diff --git a/Src/Fido2.AspNet/DateTimeUtilities.cs b/Src/Fido2.AspNet/DateTimeUtilities.cs index e393808b..bdedf3b1 100644 --- a/Src/Fido2.AspNet/DateTimeUtilities.cs +++ b/Src/Fido2.AspNet/DateTimeUtilities.cs @@ -13,18 +13,17 @@ internal static class DateTimeUtilities /// public static DateTimeOffset GetNextIncrement(this DateTimeOffset startTime, TimeSpan increment) { - //Find next increment + // Find next increment var nextIncrementTicks = (long)(Math.Ceiling((decimal)startTime.Ticks / (decimal)increment.Ticks) * (decimal)increment.Ticks); - //Find the difference between the start time and the target time + // Find the difference between the start time and the target time var timeSpanDiff = TimeSpan.FromTicks(nextIncrementTicks).Subtract(TimeSpan.FromTicks(startTime.Ticks)); - //If the calculated difference is 0 then make it the increment value + // If the calculated difference is 0 then make it the increment value if (timeSpanDiff.Ticks == 0) timeSpanDiff = TimeSpan.FromTicks(increment.Ticks); - //Add the difference to the normalised time + // Add the difference to the normalized time return startTime.Add(timeSpanDiff); } - } diff --git a/Src/Fido2.AspNet/DistributedCacheMetadataService.cs b/Src/Fido2.AspNet/DistributedCacheMetadataService.cs index f380e79f..fb4ca2ba 100644 --- a/Src/Fido2.AspNet/DistributedCacheMetadataService.cs +++ b/Src/Fido2.AspNet/DistributedCacheMetadataService.cs @@ -60,7 +60,7 @@ protected virtual string GetBlobCacheKey(IMetadataRepository repository) if (!string.IsNullOrWhiteSpace(blob?.NextUpdate) && DateTimeOffset.TryParseExact( blob.NextUpdate, - new[] { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "o" }, //Sould be ISO8601 date but allow for other ISO-like formats too + new[] { "yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "o" }, // Should be ISO8601 date but allow for other ISO-like formats too System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AssumeUniversal | System.Globalization.DateTimeStyles.AdjustToUniversal, out var parsedDate)) diff --git a/Src/Fido2.Ctap2/Commands/AuthenticatorClientPinCommand.cs b/Src/Fido2.Ctap2/Commands/AuthenticatorClientPinCommand.cs index 87f92ff0..ea1d2e60 100644 --- a/Src/Fido2.Ctap2/Commands/AuthenticatorClientPinCommand.cs +++ b/Src/Fido2.Ctap2/Commands/AuthenticatorClientPinCommand.cs @@ -23,7 +23,7 @@ public sealed class AuthenticatorClientPinCommand : CtapCommand } /// - /// Required PIN protocol version chosen by the client + /// Required PIN protocol version chosen by the client. /// [CborMember(0x01)] public uint PinProtocol { get; } diff --git a/Src/Fido2.Ctap2/Commands/AuthenticatorGetAssertionCommand.cs b/Src/Fido2.Ctap2/Commands/AuthenticatorGetAssertionCommand.cs index 027f98b4..080a14eb 100644 --- a/Src/Fido2.Ctap2/Commands/AuthenticatorGetAssertionCommand.cs +++ b/Src/Fido2.Ctap2/Commands/AuthenticatorGetAssertionCommand.cs @@ -27,13 +27,13 @@ public sealed class AuthenticatorGetAssertionCommand : CtapCommand } /// - /// Relying party identifier + /// Relying party identifier. /// [CborMember(0x01)] public string RpId { get; } /// - /// Hash of the serialized client data collected by the host + /// Hash of the serialized client data collected by the host. /// [CborMember(0x02)] public byte[] ClientDataHash { get; } @@ -46,13 +46,13 @@ public sealed class AuthenticatorGetAssertionCommand : CtapCommand public PublicKeyCredentialDescriptor[] AllowList { get; } /// - /// CBOR map of extension identifier → authenticator extension input values + /// CBOR map of extension identifier → authenticator extension input values. /// [CborMember(0x04)] public CborMap? Extensions { get; } /// - /// Map of authenticator options + /// Map of authenticator options. /// [CborMember(0x05)] public AuthenticatorGetAssertionOptions? Options { get; } diff --git a/Src/Fido2/AuthenticatorAssertionResponse.cs b/Src/Fido2/AuthenticatorAssertionResponse.cs index 79b90147..4a44a7a2 100644 --- a/Src/Fido2/AuthenticatorAssertionResponse.cs +++ b/Src/Fido2/AuthenticatorAssertionResponse.cs @@ -46,16 +46,13 @@ public static AuthenticatorAssertionResponse Parse(AuthenticatorAssertionRawResp } /// - /// Implements algorithm from https://www.w3.org/TR/webauthn/#verifying-assertion + /// Implements algorithm from https://www.w3.org/TR/webauthn/#verifying-assertion. /// - /// The assertionoptions that was sent to the client - /// - /// The expected fully qualified server origins, used to verify that the signature is sent to the expected server - /// - /// The stored public key for this CredentialId + /// The original assertion options that was sent to the client. + /// The stored public key for this CredentialId. /// The stored counter value for this CredentialId - /// A function that returns if user handle is owned by the credential ID - /// + /// A function that returns if user handle is owned by the credential ID. + /// The used to propagate notifications that the operation should be canceled. public async Task VerifyAsync( AssertionOptions options, Fido2Configuration config, diff --git a/Src/Fido2/Fido2.cs b/Src/Fido2/Fido2.cs index c8e1585b..656448a4 100644 --- a/Src/Fido2/Fido2.cs +++ b/Src/Fido2/Fido2.cs @@ -24,10 +24,10 @@ public class Fido2 : IFido2 } /// - /// Returns CredentialCreateOptions including a challenge to be sent to the browser/authr to create new credentials + /// Returns CredentialCreateOptions including a challenge to be sent to the browser/authenticator to create new credentials. /// /// - /// Recommended. This member is intended for use by Relying Parties that wish to limit the creation of multiple credentials for the same account on a single authenticator.The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter. + /// Recommended. This member is intended for use by Relying Parties that wish to limit the creation of multiple credentials for the same account on a single authenticator. The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter. public CredentialCreateOptions RequestNewCredential( Fido2User user, List excludeCredentials, @@ -37,11 +37,11 @@ public class Fido2 : IFido2 } /// - /// Returns CredentialCreateOptions including a challenge to be sent to the browser/authr to create new credentials + /// Returns CredentialCreateOptions including a challenge to be sent to the browser/authenticator to create new credentials. /// /// /// This member is intended for use by Relying Parties that wish to express their preference for attestation conveyance. The default is none. - /// Recommended. This member is intended for use by Relying Parties that wish to limit the creation of multiple credentials for the same account on a single authenticator.The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter. + /// Recommended. This member is intended for use by Relying Parties that wish to limit the creation of multiple credentials for the same account on a single authenticator. The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter. public CredentialCreateOptions RequestNewCredential( Fido2User user, List excludeCredentials, @@ -55,12 +55,12 @@ public class Fido2 : IFido2 } /// - /// Verifies the response from the browser/authr after creating new credentials + /// Verifies the response from the browser/authenticator after creating new credentials. /// - /// - /// - /// - /// + /// The attestation response from the authenticator. + /// The original options that was sent to the client. + /// The delegate used to validate that the CredentialID is unique to this user. + /// The used to propagate notifications that the operation should be canceled. /// public async Task MakeNewCredentialAsync( AuthenticatorAttestationRawResponse attestationResponse, @@ -80,7 +80,7 @@ public class Fido2 : IFido2 } /// - /// Returns AssertionOptions including a challenge to the browser/authr to assert existing credentials and authenticate a user. + /// Returns AssertionOptions including a challenge to the browser/authenticator to assert existing credentials and authenticate a user. /// /// public AssertionOptions GetAssertionOptions( @@ -94,8 +94,15 @@ public class Fido2 : IFido2 } /// - /// Verifies the assertion response from the browser/authr to assert existing credentials and authenticate a user. + /// Verifies the assertion response from the browser/authenticator to assert existing credentials and authenticate a user. /// + /// The assertion response from the authenticator. + /// The original options that was sent to the client. + /// The stored credential public key. + /// The stored device public keys. + /// The stored value of the signature counter. + /// The delegate used to validate that the user handle is indeed owned of the CredentialId. + /// The used to propagate notifications that the operation should be canceled. /// public async Task MakeAssertionAsync( AuthenticatorAssertionRawResponse assertionResponse, @@ -121,7 +128,7 @@ public class Fido2 : IFido2 } /// - /// Result of parsing and verifying attestation. Used to transport Public Key back to RP + /// Result of parsing and verifying attestation. Used to transport Public Key back to RP. /// public sealed class CredentialMakeResult : Fido2ResponseBase { @@ -139,15 +146,17 @@ public CredentialMakeResult(string status, string errorMessage, RegisteredPublic } /// -/// Callback function used to validate that the CredentialID is unique to this User +/// Callback function used to validate that the CredentialID is unique to this user. /// /// +/// The used to propagate notifications that the operation should be canceled. /// public delegate Task IsCredentialIdUniqueToUserAsyncDelegate(IsCredentialIdUniqueToUserParams credentialIdUserParams, CancellationToken cancellationToken); /// -/// Callback function used to validate that the user handle is indeed owned of the CredentialId +/// Callback function used to validate that the user handle is indeed owned of the CredentialId. /// /// +/// The used to propagate notifications that the operation should be canceled. /// public delegate Task IsUserHandleOwnerOfCredentialIdAsync(IsUserHandleOwnerOfCredentialIdParams credentialIdUserHandleParams, CancellationToken cancellationToken); diff --git a/Src/Fido2/IMetadataService.cs b/Src/Fido2/IMetadataService.cs index 322c2edd..b720e0c5 100644 --- a/Src/Fido2/IMetadataService.cs +++ b/Src/Fido2/IMetadataService.cs @@ -7,7 +7,7 @@ namespace Fido2NetLib; public interface IMetadataService { /// - /// Gets the metadata payload entry by a guid asynchronously + /// Gets the metadata payload entry by a guid asynchronously. /// /// The Authenticator Attestation GUID. /// Returns the entry; Otherwise null. diff --git a/Src/Fido2/Objects/AttestedCredentialData.cs b/Src/Fido2/Objects/AttestedCredentialData.cs index 650f1d81..74dc8941 100644 --- a/Src/Fido2/Objects/AttestedCredentialData.cs +++ b/Src/Fido2/Objects/AttestedCredentialData.cs @@ -9,7 +9,7 @@ namespace Fido2NetLib.Objects; public sealed class AttestedCredentialData { /// - /// Minimum length of the attested credential data structure. AAGUID + credentialID length + credential ID + credential public key. + /// Minimum length of the attested credential data structure. AAGUID + credentialID length + credential ID + credential public key. /// /// private const int _minLength = 20; // Marshal.SizeOf(typeof(Guid)) + sizeof(ushort) + sizeof(byte) + sizeof(byte)