feat(common): Add Apple to known FIDO services.

pull/2853/head
Andrew Kozlik 1 year ago committed by matejcik
parent be920d7cec
commit 9528e2f9eb

@ -0,0 +1,5 @@
{
"name": "Apple",
"webauthn": ["apple.com"],
"use_self_attestation": false
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -3,6 +3,7 @@
//! do not edit manually!
const ICON_APPLE: &[u8] = include_res!("model_tt/res/fido/icon_apple.toif");
const ICON_AWS: &[u8] = include_res!("model_tt/res/fido/icon_aws.toif");
const ICON_BINANCE: &[u8] = include_res!("model_tt/res/fido/icon_binance.toif");
const ICON_BITBUCKET: &[u8] = include_res!("model_tt/res/fido/icon_bitbucket.toif");
@ -41,6 +42,7 @@ const ICON_WEBAUTHN: &[u8] = include_res!("model_tt/res/fido/icon_webauthn.toif"
pub fn get_fido_icon_data<T: AsRef<str>>(icon_name: Option<T>) -> &'static [u8] {
if let Some(icon_name) = icon_name {
match icon_name.as_ref() {
"apple" => ICON_APPLE,
"aws" => ICON_AWS,
"binance" => ICON_BINANCE,
"bitbucket" => ICON_BITBUCKET,

@ -21,6 +21,14 @@ class FIDOApp:
# fmt: off
def by_rp_id_hash(rp_id_hash: bytes) -> FIDOApp | None:
if rp_id_hash == b"\x22\x65\xcb\xcc\x3e\xf2\x41\x06\xc9\xe0\xed\xdb\xd0\x4f\x3c\xca\x0d\x03\x22\x5d\xa3\xfc\xca\x8e\x2d\x86\xf7\xa3\x94\xaf\x92\x83":
# WebAuthn key for Apple
return FIDOApp(
"apple.com", # label
"apple", # icon_name
None, # use_sign_count
False, # use_self_attestation
)
if rp_id_hash == b"\x96\x89\x78\xa2\x99\x53\xde\x52\xd3\xef\x0f\x0c\x71\xb7\xb7\xb6\xb1\xaf\x9f\x08\xe2\x57\x89\x6a\x8d\x81\x26\x91\x85\x30\x29\x3b":
# U2F key for Amazon Web Services
return FIDOApp(

Loading…
Cancel
Save