This repository was archived by the owner on Dec 15, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,9 @@ let KnownFacets: [Data: String] = [
1515 SHA256 . digest ( " https://vault.bitwarden.com/app-id.json " ) : " https://vault.bitwarden.com " ,
1616 SHA256 . digest ( " https://keepersecurity.com " ) : " https://keepersecurity.com " ,
1717 SHA256 . digest ( " https://api-9dcf9b83.duosecurity.com " ) : " https://api-9dcf9b83.duosecurity.com " ,
18- SHA256 . digest ( " https://dashboard.stripe.com " ) : " https://dashboard.stripe.com "
18+ SHA256 . digest ( " https://dashboard.stripe.com " ) : " https://dashboard.stripe.com " ,
19+
20+ // When we return an error during authentication, Chrome will send a registration request with
21+ // a bogus AppID.
22+ " AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA " . data ( using: . ascii) !: " bogus "
1923]
Original file line number Diff line number Diff line change @@ -98,6 +98,14 @@ class U2FAuthenticator {
9898 let req = try APDU . RegisterRequest ( raw: raw)
9999
100100 let facet = KnownFacets [ req. applicationParameter]
101+
102+ // When we return an error during authentication, Chrome will send a registration request with
103+ // a bogus AppID.
104+ if facet == " bogus " {
105+ self . sendError ( status: . OtherError, cid: cid)
106+ return
107+ }
108+
101109 let notification = UserPresence . Notification. Register ( facet: facet)
102110
103111 UserPresence . test ( notification) { tupSuccess in
@@ -155,7 +163,7 @@ class U2FAuthenticator {
155163
156164 if reg. inSEP && !laptopIsOpen {
157165 // Can't use SEP/TouchID if laptop is closed.
158- sendError ( status: . OtherError , cid: cid)
166+ sendError ( status: . ConditionsNotSatisfied , cid: cid)
159167 return
160168 }
161169
You can’t perform that action at this time.
0 commit comments