1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

common/webauthn: Allow multiple URLs per app.

This commit is contained in:
Andrew Kozlik 2019-09-26 16:18:47 +02:00
parent 528ee9ccf1
commit 839c6cdac5
25 changed files with 35 additions and 39 deletions

View File

@ -1,5 +1,5 @@
{
"label": "Binance",
"webauthn": "www.binance.com",
"webauthn": ["www.binance.com"],
"use_sign_count": false
}

View File

@ -1,4 +1,4 @@
{
"label": "Bitbucket",
"u2f": "https://bitbucket.org"
"u2f": ["https://bitbucket.org"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Bitfinex",
"u2f": "https://www.bitfinex.com"
"u2f": ["https://www.bitfinex.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Bitwarden",
"u2f": "https://vault.bitwarden.com/app-id.json"
"u2f": ["https://vault.bitwarden.com/app-id.json"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Dashlane",
"u2f": "https://www.dashlane.com"
"u2f": ["https://www.dashlane.com"]
}

View File

@ -1,5 +1,5 @@
{
"label": "Dropbox",
"u2f": "https://www.dropbox.com/u2f-app-id.json",
"webauthn": "www.dropbox.com"
"u2f": ["https://www.dropbox.com/u2f-app-id.json"],
"webauthn": ["www.dropbox.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Duo",
"u2f": "https://api-9dcf9b83.duosecurity.com"
"u2f": ["https://api-9dcf9b83.duosecurity.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "FastMail",
"u2f": "https://www.fastmail.com"
"u2f": ["https://www.fastmail.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Fedora",
"u2f": "https://id.fedoraproject.org/u2f-origins.json"
"u2f": ["https://id.fedoraproject.org/u2f-origins.json"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Gandi",
"u2f": "https://account.gandi.net/api/u2f/trusted_facets.json"
"u2f": ["https://account.gandi.net/api/u2f/trusted_facets.json"]
}

View File

@ -1,6 +1,6 @@
{
"label": "GitHub",
"u2f": "https://github.com/u2f/trusted_facets",
"webauthn": "github.com",
"u2f": ["https://github.com/u2f/trusted_facets"],
"webauthn": ["github.com"],
"use_sign_count": true
}

View File

@ -1,4 +1,4 @@
{
"label": "GitLab",
"u2f": "https://gitlab.com"
"u2f": ["https://gitlab.com"]
}

View File

@ -1,5 +1,5 @@
{
"label": "Google",
"u2f": "https://www.gstatic.com/securitykey/origins.json",
"webauthn": "google.com"
"u2f": ["https://www.gstatic.com/securitykey/origins.json"],
"webauthn": ["google.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Keeper",
"u2f": "https://keepersecurity.com"
"u2f": ["https://keepersecurity.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "LastPass",
"u2f": "https://lastpass.com"
"u2f": ["https://lastpass.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "login.gov",
"webauthn": "secure.login.gov"
"webauthn": ["secure.login.gov"]
}

View File

@ -1,5 +1,5 @@
{
"label": "Microsoft",
"webauthn": "login.microsoft.com",
"webauthn": ["login.microsoft.com"],
"use_sign_count": false
}

View File

@ -1,4 +1,4 @@
{
"label": "Slush Pool",
"u2f": "https://slushpool.com/static/security/u2f.json"
"u2f": ["https://slushpool.com/static/security/u2f.json"]
}

View File

@ -1,4 +1,4 @@
{
"label": "Stripe",
"u2f": "https://dashboard.stripe.com"
"u2f": ["https://dashboard.stripe.com"]
}

View File

@ -1,4 +1,4 @@
{
"label": "u2f.bin.coffee",
"u2f": "https://u2f.bin.coffee"
"u2f": ["https://u2f.bin.coffee"]
}

View File

@ -1,4 +1,4 @@
{
"label": "webauthn.bin.coffee",
"webauthn": "webauthn.bin.coffee"
"webauthn": ["webauthn.bin.coffee"]
}

View File

@ -1,4 +1,4 @@
{
"label": "WebAuthn.io",
"webauthn": "webauthn.io"
"webauthn": ["webauthn.io"]
}

View File

@ -1,4 +1,4 @@
{
"label": "WebAuthn.me",
"webauthn": "webauthn.me"
"webauthn": ["webauthn.me"]
}

View File

@ -1,4 +1,4 @@
{
"label": "demo.yubico.com",
"webauthn": "demo.yubico.com"
"webauthn": ["demo.yubico.com"]
}

View File

@ -19,17 +19,13 @@ def gen_core(data):
print("_knownapps = {")
print(" # U2F")
for d in data:
if "u2f" in d:
url, label = d["u2f"], d["label"]
for url in d.get("u2f", []):
label = d["label"]
print(' "%s": {"label": "%s", "use_sign_count": True},' % (url, label))
print(" # WebAuthn")
for d in data:
if "webauthn" in d:
origin, label, use_sign_count = (
d["webauthn"],
d["label"],
d.get("use_sign_count", None),
)
for origin in d.get("webauthn", []):
label, use_sign_count = (d["label"], d.get("use_sign_count", None))
if use_sign_count is None:
print(' "%s": {"label": "%s"},' % (origin, label))
else:
@ -42,15 +38,15 @@ def gen_core(data):
def gen_mcu(data):
for d in data:
if "u2f" in d:
url, label = d["u2f"], d["label"]
for url in d.get("u2f", []):
label = d["label"]
h = sha256(url.encode()).digest()
print(
'\t{\n\t\t// U2F: %s\n\t\t%s,\n\t\t"%s"\n\t},'
% (url, c_bytes(h), label)
)
if "webauthn" in d:
origin, label = d["webauthn"], d["label"]
for origin in d.get("webauthn", []):
label = d["label"]
h = sha256(origin.encode()).digest()
print(
'\t{\n\t\t// WebAuthn: %s\n\t\t%s,\n\t\t"%s"\n\t},'