Skip to content

Commit

Permalink
Validation step optimization
Browse files Browse the repository at this point in the history
allows for exiting the loop early on match

Co-authored-by: Emil Lundberg <emil@yubico.com>
  • Loading branch information
timcappalli and emlun committed Apr 29, 2024
1 parent b3bf34c commit bdba742
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4121,8 +4121,10 @@ To validate the calling origin is an authorized related origin for a given cerem
1. Let |domain| be the [=effective domain=] of |url|. If that is null, [=continue=].
1. Remove any [=public suffix=] from the end of |domain|, including private registries and unknown registries. If |domain| is now empty, [=continue=].
1. Split |domain| into [=origin labels|labels=] and let |label| be the right-most one.
1. If |label| is not in |labelsSeen| and the number of elements in |labelsSeen| is less than |maxLabels|, then insert |label| into |labelsSeen|. Otherwise, [=continue=].
1. If |labelsSeen| [=set/contains=] |label|, [=continue=].
1. If |rpIdRequested| and |url| are [=same origin=], return `true`.
1. [=set/Append=] |label| to |labelsSeen|.
1. If the [=set/size=] of |labelsSeen| is greater than or equal to |maxLabels|, [=break=].
1. Return `false`.

# WebAuthn <dfn>Authenticator Model</dfn> # {#sctn-authenticator-model}
Expand Down

0 comments on commit bdba742

Please sign in to comment.