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

cryptenroll: Use CTAP2.1 credProtect extension #32295

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

BryanJacobs
Copy link
Contributor

When enrolling a new FIDO2 token with a client PIN, this tells the authenticator to require the PIN on all uses.

Works around #31443 in most (not all) scenarios.

A full fix would require checking the uv flag of the result from the getAssertion call and comparing with the JSON token info for whether a PIN or UV was requested.

Nonetheless, this should be an improvement.

@github-actions github-actions bot added util-lib please-review PR is ready for (re-)review by a maintainer labels Apr 16, 2024
@poettering poettering added cryptsetup fido2 good-to-merge/with-minor-suggestions and removed please-review PR is ready for (re-)review by a maintainer labels Apr 16, 2024
@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed good-to-merge/with-minor-suggestions labels Apr 16, 2024
@github-actions github-actions bot added please-review PR is ready for (re-)review by a maintainer and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Apr 16, 2024
@poettering
Copy link
Member

looks good, just one minor nitpick, see above.

@poettering poettering added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels Apr 16, 2024
@github-actions github-actions bot added please-review PR is ready for (re-)review by a maintainer and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels Apr 16, 2024
@BryanJacobs
Copy link
Contributor Author

looks good, just one minor nitpick, see above.

Addressed, thank you.

@poettering
Copy link
Member

please squash.

ant log_warning, not log_notice, please

@BryanJacobs
Copy link
Contributor Author

please squash.

ant log_warning, not log_notice, please

Done. Apologies for wasting your time.

@poettering
Copy link
Member

Done. Apologies for wasting your time.

np. but one mor fix please

When enrolling a new FIDO2 token with a client PIN, this tells the authenticator to require the PIN on all uses.

It also collects a PIN before attempting to create a credential.

Works around #31443 in most (not all) scenarios.
@poettering poettering added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed and removed please-review PR is ready for (re-)review by a maintainer labels Apr 16, 2024
@poettering
Copy link
Member

thanks! lgtm!

@yuwata yuwata merged commit 12cf745 into systemd:main Apr 17, 2024
44 of 49 checks passed
@github-actions github-actions bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Apr 17, 2024
kszczek added a commit to kszczek/systemd that referenced this pull request Apr 27, 2024
The recently merged PR systemd#32295 introduced support for the credProtect
extension, but in doing so, it broke the discoverability of credentials
by setting the policy to "userVerificationRequired". This policy would
require us to pass the PIN to the token in the pre-flight request to
be able to discover it, which defeats the purpose of the pre-flight
request as it's supposed to be non-interactive.

This commit relaxes the protection policy, so that the credential can
be discovered if we provide it's ID, which we do.
kszczek added a commit to kszczek/systemd that referenced this pull request Apr 27, 2024
The recently merged PR systemd#32295 introduced support for the credProtect
extension, but in doing so, it broke the discoverability of credentials
by setting the policy to FIDO_CRED_PROT_UV_REQUIRED. This policy would
require us to pass the PIN to the token in the pre-flight request to
be able to discover it, which defeats the purpose of pre-flight
requests as they're supposed to be non-interactive.

While relaxing the policy to FIDO_CRED_PROT_UV_OPTIONAL_WITH_ID would
solve this problem in most cases, some edge cases would remain broken.
One of those edge cases is outlined in the CTAP 2.1 specification,
which states:

Note: Some authenticators for high-security environments may be
configured to always set credProtect 3 for all created credentials
regardless of what the platform requests.

This commit removes the support for the credProtect extension.
kszczek added a commit to kszczek/systemd that referenced this pull request Apr 27, 2024
The recently merged PR systemd#32295 introduced support for the credProtect
extension, but in doing so, it broke the discoverability of credentials
by setting the policy to FIDO_CRED_PROT_UV_REQUIRED for UV-less,
PIN-protected credentials. This policy would require us to pass the PIN
to the token in the pre-flight request to be able to discover it,
which defeats the purpose of pre-flight requests as they're supposed
to be non-interactive.

This commit restricts the usage of credProtect to UV credentials only.
poettering pushed a commit that referenced this pull request May 2, 2024
The recently merged PR #32295 introduced support for the credProtect
extension, but in doing so, it broke the discoverability of credentials
by setting the policy to FIDO_CRED_PROT_UV_REQUIRED for UV-less,
PIN-protected credentials. This policy would require us to pass the PIN
to the token in the pre-flight request to be able to discover it,
which defeats the purpose of pre-flight requests as they're supposed
to be non-interactive.

This commit restricts the usage of credProtect to UV credentials only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants