Skip to content

fixup getAssertion, polish algorithms#371

Merged
vijaybh merged 17 commits into
masterfrom
jeffh-fixup-getA-polish-algs
Mar 14, 2017
Merged

fixup getAssertion, polish algorithms#371
vijaybh merged 17 commits into
masterfrom
jeffh-fixup-getA-polish-algs

Conversation

@equalsJeffH

Copy link
Copy Markdown
Contributor

This initial set of commits applies @jyasskin's techniques from makeCredential() to getAssertion().

More commits to follow (to fix various [subtype:algorithms] issues I've signed up for), tho review of these initial commits is most welcome in the meantime.

Comment thread index.bs Outdated
- Asynchronously invoke the [=authenticatorGetAssertion=] operation on this authenticator with |rpId|,
|clientDataHash|, |credentialList|, and |clientExtensions| as parameters.
- Add an entry to |issuedRequests|, corresponding to this request.
1. [=list/For each=] credential |C| in <code>{{options}}.{{AssertionOptions/allowList}}</code> that is present on this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How can the client tell if a credential is on a particular authenticator? This is only possible in certain circumstances. Maybe we should flip this. Something like "For each credential in allowList, append to credentialList. Some clients may be able to determine, by client-specific methods, the presence or absence of credentials on certain authenticators. In this case, the client MAY skip appending those credentials which it knows to not be on the authenticator."

Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

thx, yeah, i trimmed too much out of the prior step 8, have attempted to backfit things, pls review new commit(s).

Comment thread index.bs Outdated
1. If |credentialList| [=list/is empty=] then [=continue=].

1. [=In parallel=], [=list/for each=] credential |C| in |credentialList|:
1. If |C| has a non-empty {{transports}} list, the client MAY, [=list/for each=] |transport| in {{transports}},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This means that if a credential has say "USB, BTLE, NFC", then it will get invoked three times, once on each transport? This seems like overkill. We could instead say the client SHOULD select a transport from that list, and otherwise it can pick any one transport to contact the authenticator over.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have attempted to state this, assuming I understood what you meant by the "otherwise" clause. pls review new commit(s).

Comment thread index.bs Outdated
1. {{ScopedCredential/type}} whose value is the {{ScopedCredentialType}} representing this [=scoped
credential=]'s type.
1. {{ScopedCredential/id}} whose value is a new {{ArrayBuffer}} containing the bytes of the crendential ID
returned from the successful [=authenticatorMakeCredential=] operation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You mean authenticatorGetAssertion? This also returns a credential ID.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

argh, yes.

Comment thread index.bs Outdated
:: A new {{ScopedCredential}} object whose fields are:
1. {{ScopedCredential/type}} whose value is the {{ScopedCredentialType}} representing this [=scoped
credential=]'s type.
1. {{ScopedCredential/id}} whose value is a new {{ArrayBuffer}} containing the bytes of the crendential ID

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo - "crendential".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, thx.

@vijaybh

vijaybh commented Mar 6, 2017

Copy link
Copy Markdown
Contributor

We should also check back to see if the following are addressed by this PR and the previous revisions to makeCredential: #251, #253, #254, #255, #258, #276, #279, #280, #281 and #282.

@vijaybh

vijaybh commented Mar 7, 2017

Copy link
Copy Markdown
Contributor

Noticed that you converted a few authenticator functions to <a></a> markup from [= =]. Not sure if this is intentional. Other than that. LGTM.

@equalsJeffH

Copy link
Copy Markdown
Contributor Author

Noticed that you converted a few authenticator functions to <a></a> markup from [= =]. Not sure if this is intentional.

accident-when-resolving-conflicts :-/ thx.

Other than that. LGTM.

k, thx.

we should also check back to see if the following are addressed by this PR and the previous revisions to makeCredential: #251, #253, #254, #255, #258, #276, #279, #280, #281 and #282.

Yeah, what I meant by..

More commits to follow (to fix various [subtype:algorithms] issues I've signed up for)

..is the former, including fixing them in this branch and PR if they are not already fixed -- that ok ?

@vijaybh

vijaybh commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

Works for me. LMK when you think we should merge this branch (for the current changes it would be nice to get Jeffrey or JC to review as well).

@equalsJeffH

Copy link
Copy Markdown
Contributor Author

for the current changes it would be nice to get Jeffrey or JC to review as well

Agreed -- @jcjones is already in the reviewers list -- I tried to add @jyasskin but he does not appear in the drop-down menu, tho he is now listed as a wg member -- perhaps he lacks "write perms" to the repo and that is why?

Comment thread index.bs Outdated
challenge value (e.g., by using
<a href="https://developer.android.com/reference/android/security/keystore/KeyGenParameterSpec.Builder.html#setAttestationChallenge(byte%5B%5D)">
setAttestationChallenge</a>),
setAttestationChallenge=]),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems bad

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah -- bikeshed barfed on me, i will fix..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should be fixed as of commit eee29f9

@jcjones

jcjones commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

I'll finish my review of this this afternoon.

@equalsJeffH

Copy link
Copy Markdown
Contributor Author

note that I'm still pushing commits to this branch -- will signal when I'm done doing so (in the next day or two)

@jcjones

jcjones commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

I've gone in detail through the algorithm updates, comparing with my current implementation even - it looks really good, it's a lot clearer with the switch notation since all of that is operating in parallel. I don't see anything in this rev that cries out for changing.

Comment thread index.bs Outdated
them. By default, the RP ID for a WebAuthn operation is set to the [=current settings object=]'s
[=origin=]. This default can be overridden by the caller subject to certain restrictions, as specified in
them. By default, the RP ID for a WebAuthn operation is set to the [=relevant settings object=] of the {{WebAuthentication}}
object's [=origin=]. This default can be overridden by the caller subject to certain restrictions, as specified in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The RP ID is set to the relevant settings object? Or did you mean the RP ID is set to the origin specified by the WebAuthentication object's relevant settings object?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect you mean (relevant settings object of the Webauthentication object)'s origin, but I don't think most readers would put the parentheses there :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, the latter.

Comment thread index.bs Outdated
return [=a promise rejected with=] a {{DOMException}} whose name is "{{NotAllowedError}}", and terminate this algorithm.
1. Set |global| to this {{WebAuthentication}} object's [=global object|environment settings object's global object=].

1. Set |callerOrigin| to the [=relevant settings object=] of this {{WebAuthentication}} object's [=origin=]. If |callerOrigin|

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See above. I think this should be "origin specified by the WebAuthentication object's relevant settings object".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

doh. thanks, done.

Comment thread index.bs Outdated

- The <dfn>rpId</dfn> parameter explicitly specifies the RP ID that the credential should be associated with. If it is
omitted, the RP ID will be set to the [=current settings object=]'s [=origin=].
omitted, the RP ID will be set to the [=relevant settings object=] of the {{WebAuthentication}} object's [=origin=].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See previous comment on this construct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Comment thread index.bs Outdated

- The optional <dfn>rpId</dfn> parameter specifies the rpId claimed by the caller. If it is omitted, it will be assumed to
be equal to the [=current settings object=]'s [=origin=].
be equal to the [=relevant settings object=] of the {{WebAuthentication}} object's [=origin=].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

@vijaybh

vijaybh commented Mar 11, 2017

Copy link
Copy Markdown
Contributor

LGTM. @jcjones, would you also take a look and we can merge if you're happy with the changes?

@AngeloKai AngeloKai closed this Mar 13, 2017
@AngeloKai AngeloKai deleted the jeffh-fixup-getA-polish-algs branch March 13, 2017 13:53
@equalsJeffH equalsJeffH restored the jeffh-fixup-getA-polish-algs branch March 13, 2017 15:15
@equalsJeffH

Copy link
Copy Markdown
Contributor Author

this PR was accidentally closed, reopening...

@equalsJeffH equalsJeffH reopened this Mar 13, 2017
@equalsJeffH

equalsJeffH commented Mar 13, 2017

Copy link
Copy Markdown
Contributor Author

@jcjones @vijaybh - pls note that commit c49cb0f attempts resolution of #277 and is presently only applied to makeCredential(). can apply to getAssertion() as well if it looks reasonable. I poked through JC's firefox code to try to assess but am unable to so assess as yet due to unfamiliarity with FF guts. ultimately, @jyasskin @bzbarsky should probably also review.

@jcjones jcjones left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see any blocking issues here, and it's a great cleanup. My comments are all style nits, feel free to address them or not as you see fit!

r=me

Comment thread index.bs

1. Let |promise| be [=a new promise=]. Return |promise| and start a timer for |adjustedTimeout| milliseconds. Then execute the
following steps [=in parallel=].
following steps [=in parallel=]. The [=task source=] for these [=tasks=] is the [=dom manipulation task source=].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems to mean to me that if the user has many types of authenticators available, this could starve the dom manipulation task thread pool. Probably not a big deal, but may be an implementation quirk to handle.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok. let's leave it as =dom manipulation task source=] for now -- most all users will likely have only one or maybe two authenticators (we are surmizing) -- and we can use a different task source or invent a new task source if needed as @bzbarsky noted in #277 (comment)

Comment thread index.bs Outdated
:: The [=recognized algorithm name=] of the hash algorithm selected by the client for generating the
[=hash of the serialized client data=]
: {{tokenBinding}}
:: The [=Token Binding ID=] associated with |callerOrigin| (if any)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it clear what encoding should be done here if there's no token binding ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

tokenBinding is an optional member of the ClientData dictionary, so the implication here is it would not appear in the dictionary if a Token Binding ID is unanavailable, thus the (if any) qualification. Perhaps we can make that more clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, I attempted modest clarification in 1c84e8b

Comment thread index.bs Outdated
1. [=set/Append=] |authenticator| to |issuedRequests|.

1. Let |promise| be [=a new Promise=]. Return |promise| and start a timer for |adjustedTimeout| milliseconds. Then execute the
following steps [=in parallel=].

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this line end in a colon, then, since it's sort-of starting another block?

By that logic, maybe we should up the indentation level, too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm. I am sympathetic, tho @jyasskin did not do such in makeCredential(), so I'm inclined to leave it as-is for now.

@jcjones

jcjones commented Mar 14, 2017

Copy link
Copy Markdown
Contributor

Oh, and since I just hit "submit" too early - the explicit global you've added in c49cb0f for ScopedCredentialInfo looks correct to me, in that we don't need to worry then about ScopedCredentialInfo outliving the WebAuthn call. I'm pretty sure it's right, based on my previous conversations about what to do there.

@equalsJeffH

Copy link
Copy Markdown
Contributor Author

@jcjones said:

the explicit global you've added in c49cb0f for ScopedCredentialInfo looks correct to me, in that we don't need to worry then about ScopedCredentialInfo outliving the WebAuthn call. I'm pretty sure it's right, based on my previous conversations about what to do there.

Ok, if it's the correct global, then I wonder about the prose used to state its use, hence asking for @jyasskin & @bzbarsky input... :)

@jcjones

jcjones commented Mar 14, 2017

Copy link
Copy Markdown
Contributor

LGTM. If we're wrong about the source of the global object, I figure that's a minor change on top of this much more substantive one.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants