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

[FIDO] Support extensions #161

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open

[FIDO] Support extensions #161

wants to merge 44 commits into from

Conversation

AdamVe
Copy link
Member

@AdamVe AdamVe commented Nov 20, 2024

Adds support for defined FIDO extensions (see CTAP2.1 and Webauthn specifications). This PR also adds simple framework for adding new extensions, by extending the Extension class and implementing relevant methods.

Extension processing happens during BasicWebauthnClient.makeCredential and BasicWebauthnClient.getAssertion calls, based on the creation and request options.

Results are exposed through PublicKeyCredential.getClientExtensionResults().

The following extensions are implemented:

  • hmac-secret
  • prf
  • credProps
  • credProtect
  • credBlob
  • largeBlob
  • minPinLength

A new BasicWebauthnClient constructor takes a list of Extension objects which it will process, by default the list contains defined extensions.

There are instrumented tests for each of the extensions (note that a supporting HW is needed for running the tests).

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpotBugs found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@@ -364,6 +418,24 @@ public CredentialManager getCredentialManager(char[] pin)
}
}

protected static class WithExtensionResults<T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just re-use Pair for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will update 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants