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

Client pin features #127

Merged
merged 22 commits into from
Aug 20, 2020
Merged

Conversation

kaczmarczyck
Copy link
Collaborator

This PR adds new subcommands from CTAP 2.1 in clientPin.

CTAP 2.1 introduces an interface for PIN protocol versions, since a v2 is currently being drafted. I decided to move all clientPin code for the existing PIN protocol v1 to a separate module. For better code sharing with a potential v2, we might introduce the common interface later when needed. I decided to not proactively refactor v1 into that interface, and wait until it is stable.

This has the added benefit of moving some complexity out of ctap/mod.rs which will have to accommodate more commands as they are introduced.

We will need to do more testing of changes for 2.1 in the wild when platforms and relying parties support it.

This PR contains some unused functions, this is intentional. They will later be used by the "Minimum PIN Length Extension" to allow some relying parties to see the minimum PIN length required by this authenticator, and include it in its attestation during MakeCredential. This feature establishes trust with relying parties with strict PIN policies.

Other open TODOs are (1) enforcing PIN length in code points and (2) places where the specification is ambiguous and discussed in the FIDO Alliance (you might lack permissions).

  • Tests pass
  • Appropriate changes to README are included in PR

@kaczmarczyck kaczmarczyck requested review from ia0 and gendx July 2, 2020 18:13
src/ctap/command.rs Show resolved Hide resolved
src/ctap/command.rs Outdated Show resolved Hide resolved
src/ctap/command.rs Show resolved Hide resolved
src/ctap/data_formats.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/storage.rs Show resolved Hide resolved
src/ctap/storage.rs Show resolved Hide resolved
src/ctap/storage.rs Outdated Show resolved Hide resolved
src/ctap/storage.rs Show resolved Hide resolved
src/ctap/storage.rs Show resolved Hide resolved
src/ctap/data_formats.rs Outdated Show resolved Hide resolved
src/ctap/data_formats.rs Outdated Show resolved Hide resolved
src/ctap/data_formats.rs Outdated Show resolved Hide resolved
src/ctap/storage.rs Outdated Show resolved Hide resolved
src/ctap/storage.rs Show resolved Hide resolved
src/ctap/response.rs Outdated Show resolved Hide resolved
src/ctap/storage.rs Show resolved Hide resolved
src/ctap/storage.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
@kaczmarczyck kaczmarczyck mentioned this pull request Jul 8, 2020
@kaczmarczyck
Copy link
Collaborator Author

This is a CTAP2.1 feature, tracked in #106 .

Copy link
Member

@ia0 ia0 left a comment

Choose a reason for hiding this comment

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

LGTM, letting others approve.

src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
@kaczmarczyck kaczmarczyck requested a review from gendx July 9, 2020 07:09
ia0
ia0 previously approved these changes Jul 9, 2020
Cargo.toml Outdated Show resolved Hide resolved
ia0
ia0 previously approved these changes Jul 9, 2020
@kaczmarczyck kaczmarczyck requested a review from gendx July 10, 2020 08:08
README.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@gendx gendx left a comment

Choose a reason for hiding this comment

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

I took a closer look to the pin_protocol_v1. I didn't look into all the details of the protocol, but I have a few nits regarding Rust code. Other than that looks good!

src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
@kaczmarczyck
Copy link
Collaborator Author

Thanks @gendx for the review and the Rust comments.

Concerning reviewing for details of the protocol, the old comments are thoroughly tested and mostly taken from mod.rs, so those should be good. The new commands, on the other hand, or not even in the publicly visible specification, so we don't really have any real life applications for testing. They are hidden behind the ctap2_1 feature flag for now for that reason.

@kaczmarczyck kaczmarczyck requested a review from gendx July 27, 2020 20:19
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
@kaczmarczyck kaczmarczyck requested a review from gendx August 6, 2020 06:46
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
@kaczmarczyck kaczmarczyck requested a review from gendx August 13, 2020 03:40
Copy link
Collaborator

@gendx gendx left a comment

Choose a reason for hiding this comment

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

Just a few remaining nits, but otherwise it looks good :)

src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/data_formats.rs Outdated Show resolved Hide resolved
@kaczmarczyck kaczmarczyck requested a review from gendx August 17, 2020 15:38
Copy link
Collaborator

@gendx gendx left a comment

Choose a reason for hiding this comment

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

Apart from a few nits that had unfortunately slipped through, and rebasing/merging with master, this looks good to me.

src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
src/ctap/pin_protocol_v1.rs Outdated Show resolved Hide resolved
gendx
gendx previously approved these changes Aug 20, 2020
@kaczmarczyck kaczmarczyck merged commit 74c773d into google:master Aug 20, 2020
@kaczmarczyck kaczmarczyck deleted the client-pin-features branch August 20, 2020 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants