-
Notifications
You must be signed in to change notification settings - Fork 4
definition of a webauthn varsig type #11
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
Draft
chunningham
wants to merge
2
commits into
ChainAgnostic:main
Choose a base branch
from
chunningham:feat/webauthn-sig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -390,6 +390,28 @@ sig-bytes = 128(OCTET) | |
| | `es512-varsig-header` | `%x1202` | `%x8224` | P-521 [multicodec] prefix | | ||
| | `es512-hash-algorithm` | `%x13` | `%x13` | SHA2-512 [multicodec] prefix | | ||
|
|
||
| ### 5.3.4 Example: Webauthn | ||
|
|
||
| ``` abnf | ||
| webauthn-varsig = webauthn-varsig-header client-data-json authenticator-data-json sig-bytes | ||
|
|
||
| webauthn-varsig-header = TODO | ||
| client-data-json = JSON | ||
| authenticator-data-length = 1*unsigned-varint | ||
| authenticator-data = OCTET | ||
| sig-bytes = OCTET | ||
| ``` | ||
|
|
||
| The Webauthn varsig header notifies the consumer that the signature is generated via webauthn. Verification must therefor rely on the [`client-data-json`][Webauthn Client Data JSON] JSON object and the [`authenticator-data`][Webauthn Authenticator Data] bytestring. The `client-data-json` object is self-describing and thus does not need to have a length prefix, however it must include the required fields as specified by the Webauthn spec. The `authenticator-data` can vary in length but must have at least 37 bytes, and so requires the `authenticator-data-length` varint to specify it's length. The length of `sig-bytes` can be known via the [`attestedCredentialData`][Webauthn Attested Credential Data] portian of the [`authenticator-data`][Webauthn Authenticator Data] byte string. In order to keep the varsig verifiable and concise, the signed payload MUST be included via CID as the `challenge` field of the [`client-data-json`][Webauthn Client Data JSON]. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reminder: say this isn't the PRF thing that's currently an extension but will be core webauthn some day (as per brook's comment in today's meeting) |
||
|
|
||
| Verification of this varsig follows these steps: | ||
| 1. extraction of the `client-data-json` and `authenticator-data` from the varsig. | ||
| 2. extraction of a CID from `client-data-json` | ||
| 3. matching of the extracted CID with the signed-over payload | ||
| 4. extraction of the credential public key from the [`attestedCredentialData`][Webauthn Attested Credential Data] in `authenticator-data`. | ||
| 5. `sha256` hashing of `client-data-json` and concatenation with the [`authenticator-data`][Webauthn Authenticator Data] (i.e. `concat(authenticator-data, sha256(client-data-json))`), according to the process defined as [Webauthn Signature Creation][Webauthn Signature Creation] | ||
| 6. verification of the `sig-bytes` with the credential public key and the byte string resulting from step 5, according to the public key type specified by the credential public key object. | ||
|
|
||
| # 6 Further Reading | ||
|
|
||
| * [Canonicalization Attacks Against MACs and Signatures][canonicalization attacks] | ||
|
|
@@ -416,3 +438,7 @@ sig-bytes = 128(OCTET) | |
| [multicodec]: https://github.com/multiformats/multicodec | ||
| [raw binary multicodec]: https://github.com/multiformats/multicodec/blob/master/table.csv#L40 | ||
| [unsigned varint]: https://github.com/multiformats/unsigned-varint | ||
| [Webauthn Client Data JSON]: https://w3c.github.io/webauthn/#dictionary-client-data | ||
| [Webauthn Authenticator Data]: https://w3c.github.io/webauthn/#sctn-authenticator-data | ||
| [Webauthn Signature Creation]: https://w3c.github.io/webauthn/#fig-signature | ||
| [Webauthn Attested Credential Data]: https://w3c.github.io/webauthn/#sctn-attested-credential-data | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put some placeholder code here ?