Skip to content

Commit

Permalink
Veridise Audit improvements (#31)
Browse files Browse the repository at this point in the history
* note webauth spec version 2

* check authenticatorData includes unused counter
  • Loading branch information
nalinbhardwaj authored Nov 7, 2023
1 parent f13149e commit f0a9e32
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/WebAuthn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ library WebAuthn {

/// Verifies the authFlags in authenticatorData. Numbers in inline comment
/// correspond to the same numbered bullets in
/// https://w3c.github.io/webauthn/#sctn-verifying-assertion.
/// https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion.
function checkAuthFlags(
bytes1 flags,
bool requireUserVerification
Expand Down Expand Up @@ -73,7 +73,7 @@ library WebAuthn {

/**
* Verifies a Webauthn P256 signature (Authentication Assertion) as described
* in https://w3c.github.io/webauthn/#sctn-verifying-assertion. We do not
* in https://www.w3.org/TR/webauthn-2/#sctn-verifying-assertion. We do not
* verify all the steps as described in the specification, only ones relevant
* to our context. Please carefully read through this list before usage.
* Specifically, we do verify the following:
Expand Down Expand Up @@ -135,7 +135,7 @@ library WebAuthn {
) internal view returns (bool) {
// Check that authenticatorData has good flags
if (
authenticatorData.length < 32 ||
authenticatorData.length < 37 ||
!checkAuthFlags(authenticatorData[32], requireUserVerification)
) {
return false;
Expand Down

0 comments on commit f0a9e32

Please sign in to comment.