1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-31 16:53:27 +00:00

Split win_webauthn into separate lib

This commit is contained in:
Isaiah Inuwa
2025-11-21 17:24:12 -06:00
parent 0a040b1edc
commit 89a0f0fd4d
14 changed files with 117 additions and 711 deletions

View File

@@ -496,12 +496,6 @@ dependencies = [
"cipher",
]
[[package]]
name = "bumpalo"
version = "3.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
[[package]]
name = "byteorder"
version = "1.5.0"
@@ -617,7 +611,7 @@ dependencies = [
"pbkdf2",
"rand 0.9.1",
"rusqlite",
"security-framework 3.5.0",
"security-framework",
"serde",
"serde_json",
"sha1",
@@ -756,16 +750,6 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "core-foundation"
version = "0.10.1"
@@ -988,7 +972,7 @@ dependencies = [
"bytes",
"cbc",
"chacha20poly1305",
"core-foundation 0.10.1",
"core-foundation",
"desktop_objc",
"dirs",
"ed25519",
@@ -1007,7 +991,7 @@ dependencies = [
"russh-cryptovec",
"scopeguard",
"secmem-proc",
"security-framework 3.5.0",
"security-framework",
"security-framework-sys",
"serde",
"serde_json",
@@ -1050,7 +1034,7 @@ dependencies = [
"tokio-util",
"tracing",
"tracing-subscriber",
"windows-registry 0.6.1",
"windows-registry",
"windows_plugin_authenticator",
]
@@ -1060,7 +1044,7 @@ version = "0.0.0"
dependencies = [
"anyhow",
"cc",
"core-foundation 0.10.1",
"core-foundation",
"glob",
"thiserror 2.0.12",
"tokio",
@@ -1248,15 +1232,6 @@ version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
[[package]]
name = "encoding_rs"
version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
dependencies = [
"cfg-if",
]
[[package]]
name = "endi"
version = "1.1.0"
@@ -1367,12 +1342,6 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foldhash"
version = "0.1.5"
@@ -1385,21 +1354,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
]
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "form_urlencoded"
version = "1.2.2"
@@ -1614,25 +1568,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "h2"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386"
dependencies = [
"atomic-waker",
"bytes",
"fnv",
"futures-core",
"futures-sink",
"http",
"indexmap",
"slab",
"tokio",
"tokio-util",
"tracing",
]
[[package]]
name = "half"
version = "2.7.1"
@@ -1722,126 +1657,6 @@ dependencies = [
"windows 0.57.0",
]
[[package]]
name = "http"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "http-body"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
dependencies = [
"bytes",
"http",
]
[[package]]
name = "http-body-util"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
dependencies = [
"bytes",
"futures-core",
"http",
"http-body",
"pin-project-lite",
]
[[package]]
name = "httparse"
version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "hyper"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb3aa54a13a0dfe7fbe3a59e0c76093041720fdc77b110cc0fc260fafb4dc51e"
dependencies = [
"atomic-waker",
"bytes",
"futures-channel",
"futures-core",
"h2",
"http",
"http-body",
"httparse",
"itoa",
"pin-project-lite",
"pin-utils",
"smallvec",
"tokio",
"want",
]
[[package]]
name = "hyper-rustls"
version = "0.27.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
dependencies = [
"http",
"hyper",
"hyper-util",
"rustls",
"rustls-pki-types",
"tokio",
"tokio-rustls",
"tower-service",
]
[[package]]
name = "hyper-tls"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
dependencies = [
"bytes",
"http-body-util",
"hyper",
"hyper-util",
"native-tls",
"tokio",
"tokio-native-tls",
"tower-service",
]
[[package]]
name = "hyper-util"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c6995591a8f1380fcb4ba966a252a4b29188d51d2b89e3a252f5305be65aea8"
dependencies = [
"base64",
"bytes",
"futures-channel",
"futures-core",
"futures-util",
"http",
"http-body",
"hyper",
"ipnet",
"libc",
"percent-encoding",
"pin-project-lite",
"socket2 0.6.1",
"system-configuration",
"tokio",
"tower-service",
"tracing",
"windows-registry 0.5.3",
]
[[package]]
name = "icu_collections"
version = "2.1.1"
@@ -1979,22 +1794,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "ipnet"
version = "2.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
[[package]]
name = "iri-string"
version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
dependencies = [
"memchr",
"serde",
]
[[package]]
name = "is_terminal_polyfill"
version = "1.70.2"
@@ -2007,16 +1806,6 @@ version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]]
name = "js-sys"
version = "0.3.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65"
dependencies = [
"once_cell",
"wasm-bindgen",
]
[[package]]
name = "keytar"
version = "0.1.6"
@@ -2330,23 +2119,6 @@ dependencies = [
"libloading",
]
[[package]]
name = "native-tls"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
dependencies = [
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework 2.11.1",
"security-framework-sys",
"tempfile",
]
[[package]]
name = "nix"
version = "0.29.0"
@@ -2633,50 +2405,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
[[package]]
name = "openssl"
version = "0.10.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654"
dependencies = [
"bitflags",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
"openssl-macros",
"openssl-sys",
]
[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "openssl-probe"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
[[package]]
name = "openssl-sys"
version = "0.9.110"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "option-ext"
version = "0.2.0"
@@ -3171,48 +2899,6 @@ version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
[[package]]
name = "reqwest"
version = "0.12.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d0946410b9f7b082a427e4ef5c8ff541a88b357bc6c637c40db3a68ac70a36f"
dependencies = [
"base64",
"bytes",
"encoding_rs",
"futures-channel",
"futures-core",
"futures-util",
"h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-rustls",
"hyper-tls",
"hyper-util",
"js-sys",
"log",
"mime",
"native-tls",
"percent-encoding",
"pin-project-lite",
"rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
"tokio",
"tokio-native-tls",
"tower",
"tower-http",
"tower-service",
"url",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "rfc6979"
version = "0.4.0"
@@ -3223,20 +2909,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "ring"
version = "0.17.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24"
dependencies = [
"cc",
"cfg-if",
"getrandom 0.2.16",
"libc",
"untrusted",
"windows-sys 0.52.0",
]
[[package]]
name = "rsa"
version = "0.9.6"
@@ -3333,45 +3005,6 @@ dependencies = [
"rustix 1.1.2",
]
[[package]]
name = "rustls"
version = "0.23.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7"
dependencies = [
"once_cell",
"rustls-pki-types",
"rustls-webpki",
"subtle",
"zeroize",
]
[[package]]
name = "rustls-pki-types"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a"
dependencies = [
"zeroize",
]
[[package]]
name = "rustls-webpki"
version = "0.103.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52"
dependencies = [
"ring",
"rustls-pki-types",
"untrusted",
]
[[package]]
name = "rustversion"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "ryu"
version = "1.0.20"
@@ -3396,15 +3029,6 @@ dependencies = [
"sdd",
]
[[package]]
name = "schannel"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "scopeguard"
version = "1.2.0"
@@ -3483,19 +3107,6 @@ dependencies = [
"windows 0.61.3",
]
[[package]]
name = "security-framework"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
"bitflags",
"core-foundation 0.9.4",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework"
version = "3.5.0"
@@ -3503,7 +3114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc198e42d9b7510827939c9a15f5062a0c913f3371d765977e586d2fe6c16f4a"
dependencies = [
"bitflags",
"core-foundation 0.10.1",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
@@ -3580,18 +3191,6 @@ dependencies = [
"serde",
]
[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa",
"ryu",
"serde",
]
[[package]]
name = "serial_test"
version = "3.2.0"
@@ -3707,16 +3306,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "socket2"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
dependencies = [
"libc",
"windows-sys 0.60.2",
]
[[package]]
name = "spin"
version = "0.9.8"
@@ -3816,15 +3405,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "sync_wrapper"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
dependencies = [
"futures-core",
]
[[package]]
name = "synstructure"
version = "0.13.2"
@@ -3850,27 +3430,6 @@ dependencies = [
"windows 0.61.3",
]
[[package]]
name = "system-configuration"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
dependencies = [
"bitflags",
"core-foundation 0.9.4",
"system-configuration-sys",
]
[[package]]
name = "system-configuration-sys"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "tempfile"
version = "3.23.0"
@@ -3980,7 +3539,7 @@ dependencies = [
"parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.5.10",
"socket2",
"tokio-macros",
"tracing",
"windows-sys 0.52.0",
@@ -3997,26 +3556,6 @@ dependencies = [
"syn",
]
[[package]]
name = "tokio-native-tls"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
"native-tls",
"tokio",
]
[[package]]
name = "tokio-rustls"
version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
dependencies = [
"rustls",
"tokio",
]
[[package]]
name = "tokio-stream"
version = "0.1.15"
@@ -4101,51 +3640,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2"
[[package]]
name = "tower"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
dependencies = [
"futures-core",
"futures-util",
"pin-project-lite",
"sync_wrapper",
"tokio",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-http"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
dependencies = [
"bitflags",
"bytes",
"futures-util",
"http",
"http-body",
"iri-string",
"pin-project-lite",
"tower",
"tower-layer",
"tower-service",
]
[[package]]
name = "tower-layer"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
[[package]]
name = "tower-service"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
version = "0.1.41"
@@ -4231,12 +3725,6 @@ dependencies = [
"petgraph",
]
[[package]]
name = "try-lock"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "typenum"
version = "1.18.0"
@@ -4418,12 +3906,6 @@ dependencies = [
"subtle",
]
[[package]]
name = "untrusted"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
[[package]]
name = "url"
version = "2.5.7"
@@ -4466,7 +3948,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ebfe12e38930c3b851aea35e93fab1a6c29279cad7e8e273f29a21678fee8c0"
dependencies = [
"core-foundation 0.10.1",
"core-foundation",
"sha1",
"sha2",
"windows-sys 0.61.2",
@@ -4498,15 +3980,6 @@ dependencies = [
"libc",
]
[[package]]
name = "want"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
dependencies = [
"try-lock",
]
[[package]]
name = "wasi"
version = "0.11.1+wasi-snapshot-preview1"
@@ -4522,64 +3995,6 @@ dependencies = [
"wit-bindgen",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60"
dependencies = [
"cfg-if",
"once_cell",
"rustversion",
"wasm-bindgen-macro",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0"
dependencies = [
"cfg-if",
"js-sys",
"once_cell",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76"
dependencies = [
"unicode-ident",
]
[[package]]
name = "wayland-backend"
version = "0.3.11"
@@ -4650,16 +4065,6 @@ dependencies = [
"pkg-config",
]
[[package]]
name = "web-sys"
version = "0.3.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "weedle2"
version = "5.0.0"
@@ -4675,6 +4080,18 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d"
[[package]]
name = "win_webauthn"
version = "0.0.0"
dependencies = [
"base64",
"ciborium",
"hex",
"tracing",
"windows 0.61.3",
"windows-core 0.61.2",
]
[[package]]
name = "winapi"
version = "0.3.9"
@@ -4840,17 +4257,6 @@ dependencies = [
"windows-link 0.1.3",
]
[[package]]
name = "windows-registry"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
dependencies = [
"windows-link 0.1.3",
"windows-result 0.3.4",
"windows-strings 0.4.2",
]
[[package]]
name = "windows-registry"
version = "0.6.1"
@@ -5101,14 +4507,11 @@ dependencies = [
"ciborium",
"desktop_core",
"futures",
"hex",
"reqwest",
"serde",
"serde_json",
"sha2",
"tokio",
"tracing",
"tracing-subscriber",
"win_webauthn",
"windows 0.61.3",
"windows-core 0.61.2",
]

View File

@@ -8,7 +8,7 @@ members = [
"macos_provider",
"napi",
"process_isolation",
"proxy",
"proxy", "win_webauthn",
"windows_plugin_authenticator"
]

View File

@@ -0,0 +1,26 @@
[package]
name = "win_webauthn"
version.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[dependencies]
base64 = { workspace = true }
ciborium = "0.2"
tracing = { workspace = true }
[dev-dependencies]
hex = { workspace = true }
[lints]
workspace = true
[target.'cfg(windows)'.dependencies]
windows = { workspace = true, features = [
"Win32_Foundation",
"Win32_Security",
"Win32_System_Com",
"Win32_System_LibraryLoader",
] }
windows-core = { workspace = true }

View File

@@ -6,9 +6,6 @@ use std::{error::Error, fmt::Display};
pub use types::{AuthenticatorInfo, CtapTransport, CtapVersion, PublicKeyCredentialParameters};
use plugin::PluginAuthenticator;
pub use util::HwndExt;
#[derive(Debug)]
pub struct WinWebAuthnError {
kind: ErrorKind,
@@ -40,7 +37,7 @@ impl WinWebAuthnError {
}
#[derive(Debug)]
pub enum ErrorKind {
enum ErrorKind {
DllLoad,
Serialization,
WindowsInternal,

View File

@@ -1,8 +1,7 @@
//! Functions for interacting with Windows COM.
#[allow(non_snake_case)]
use std::{
alloc,
error::Error,
mem::MaybeUninit,
ptr::{self, NonNull},
sync::{Arc, OnceLock},
@@ -18,13 +17,12 @@ use windows::{
use windows_core::{IInspectable, Interface};
use super::types::{
PluginCancelOperationRequest, PluginGetAssertionRequest, PluginLockStatus,
PluginMakeCredentialRequest, WEBAUTHN_PLUGIN_CANCEL_OPERATION_REQUEST,
WEBAUTHN_PLUGIN_OPERATION_REQUEST, WEBAUTHN_PLUGIN_OPERATION_RESPONSE,
PluginLockStatus, WEBAUTHN_PLUGIN_CANCEL_OPERATION_REQUEST, WEBAUTHN_PLUGIN_OPERATION_REQUEST,
WEBAUTHN_PLUGIN_OPERATION_RESPONSE,
};
use super::PluginAuthenticator;
use crate::win_webauthn::{ErrorKind, WinWebAuthnError};
use crate::{ErrorKind, WinWebAuthnError};
static HANDLER: OnceLock<Arc<dyn PluginAuthenticator + Send + Sync>> = OnceLock::new();

View File

@@ -12,7 +12,7 @@ pub use types::{
};
use super::{ErrorKind, WinWebAuthnError};
use crate::win_webauthn::util::WindowsString;
use crate::util::WindowsString;
#[derive(Clone, Copy)]
pub struct Clsid(GUID);

View File

@@ -1,25 +1,23 @@
//! Types pertaining to registering a plugin implementation and handling plugin
//! authenticator requests.
use std::{collections::HashSet, fmt::Display, mem::MaybeUninit, ptr::NonNull};
#![allow(non_snake_case)]
use std::{mem::MaybeUninit, ptr::NonNull};
use base64::{engine::general_purpose::STANDARD, Engine as _};
use ciborium::Value;
use windows::{
core::{GUID, HRESULT},
Win32::{
Foundation::HWND, System::LibraryLoader::GetProcAddress,
UI::WindowsAndMessaging::WindowFromPoint,
},
Win32::{Foundation::HWND, System::LibraryLoader::GetProcAddress},
};
use windows_core::{s, PCWSTR};
use windows_core::s;
use crate::win_webauthn::{
util::{webauthn_call, ArrayPointerIterator, WindowsString},
use crate::{
util::{webauthn_call, WindowsString},
ErrorKind, WinWebAuthnError,
};
use crate::win_webauthn::types::{
use crate::types::{
AuthenticatorInfo, CredentialList, CtapTransport, HmacSecretSalt,
WebAuthnExtensionMakeCredentialOutput, WEBAUTHN_COSE_CREDENTIAL_PARAMETERS,
WEBAUTHN_CREDENTIAL_ATTESTATION, WEBAUTHN_CREDENTIAL_LIST, WEBAUTHN_EXTENSIONS,

View File

@@ -12,7 +12,7 @@ use windows::{
};
use windows_core::{s, PCWSTR};
use crate::win_webauthn::{
use crate::{
// com::ComBuffer,
util::{ArrayPointerIterator, WindowsString},
ErrorKind,

View File

@@ -1,13 +1,12 @@
use windows::{
core::s,
Win32::{
Foundation::{FreeLibrary, HMODULE, HWND, RECT},
Foundation::{FreeLibrary, HMODULE},
System::LibraryLoader::{LoadLibraryExA, LOAD_LIBRARY_SEARCH_SYSTEM32},
UI::WindowsAndMessaging::GetWindowRect,
},
};
use crate::win_webauthn::{
use crate::{
// com::ComBuffer,
ErrorKind,
WinWebAuthnError,
@@ -16,7 +15,7 @@ use crate::win_webauthn::{
macro_rules! webauthn_call {
($symbol:literal as fn $fn_name:ident($($arg:ident: $arg_type:ty),+) -> $result_type:ty) => (
pub(super) fn $fn_name($($arg: $arg_type),*) -> Result<$result_type, WinWebAuthnError> {
let library = crate::win_webauthn::util::load_webauthn_lib()?;
let library = crate::util::load_webauthn_lib()?;
let response = unsafe {
let address = GetProcAddress(library, s!($symbol)).ok_or(
WinWebAuthnError::new(
@@ -33,7 +32,7 @@ macro_rules! webauthn_call {
) -> $result_type = std::mem::transmute_copy(&address);
function($($arg),*)
};
crate::win_webauthn::util::free_webauthn_lib(library)?;
crate::util::free_webauthn_lib(library)?;
Ok(response)
}
)
@@ -60,23 +59,6 @@ pub(super) fn free_webauthn_lib(library: HMODULE) -> Result<(), WinWebAuthnError
})
}
}
pub trait HwndExt {
fn center_position(&self) -> windows::core::Result<(i32, i32)>;
}
impl HwndExt for HWND {
fn center_position(&self) -> windows::core::Result<(i32, i32)> {
let mut window: RECT = RECT::default();
unsafe {
GetWindowRect(*self, &mut window)?;
}
// TODO: We may need to adjust for scaling.
let center_x = (window.right + window.left) / 2;
let center_y = (window.bottom + window.top) / 2;
Ok((center_x, center_y))
}
}
pub(super) trait WindowsString {
fn to_utf16(&self) -> Vec<u16>;

View File

@@ -15,16 +15,13 @@ windows = { workspace = true, features = [
"Win32_System_LibraryLoader",
] }
windows-core = { workspace = true }
hex = { workspace = true }
reqwest = { version = "0.12", features = ["json", "blocking"] }
serde_json = { workspace = true }
serde = { workspace = true, features = ["derive"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
ciborium = "0.2"
sha2 = "0.10"
tokio = { workspace = true }
base64 = { workspace = true }
win_webauthn = { path = "../win_webauthn" }
[lints]
workspace = true

View File

@@ -1,13 +1,15 @@
use serde_json;
use std::{sync::Arc, time::Duration};
use crate::ipc2::PasskeyAssertionWithoutUserInterfaceRequest;
use win_webauthn::plugin::PluginGetAssertionRequest;
use crate::{
ipc2::{
PasskeyAssertionRequest, PasskeyAssertionResponse, Position, TimedCallback,
UserVerification, WindowsProviderClient,
PasskeyAssertionRequest, PasskeyAssertionResponse,
PasskeyAssertionWithoutUserInterfaceRequest, Position, TimedCallback, UserVerification,
WindowsProviderClient,
},
win_webauthn::{plugin::PluginGetAssertionRequest, ErrorKind, HwndExt, WinWebAuthnError},
util::HwndExt,
};
pub fn get_assertion(
@@ -123,7 +125,7 @@ fn create_get_assertion_response(
authenticator_data: Vec<u8>,
signature: Vec<u8>,
user_handle: Vec<u8>,
) -> std::result::Result<Vec<u8>, WinWebAuthnError> {
) -> std::result::Result<Vec<u8>, Box<dyn std::error::Error>> {
// Construct a CTAP2 response with the proper structure
// Create CTAP2 GetAssertion response map according to CTAP2 specification
@@ -180,11 +182,7 @@ fn create_get_assertion_response(
// Encode to CBOR with error handling
let mut cbor_data = Vec::new();
if let Err(e) = ciborium::ser::into_writer(&cbor_value, &mut cbor_data) {
return Err(WinWebAuthnError::with_cause(
ErrorKind::Serialization,
"Failed to encode CBOR assertion response",
e,
));
return Err(format!("Failed to encode CBOR assertion response: {e}"))?;
}
tracing::debug!("Formatted CBOR assertion response: {:?}", cbor_data);

View File

@@ -11,25 +11,23 @@ mod make_credential;
mod types;
mod util;
mod webauthn;
mod win_webauthn;
use std::{collections::HashSet, sync::Arc, time::Duration};
// Re-export main functionality
pub use types::UserVerificationRequirement;
use win_webauthn::plugin::{PluginAddAuthenticatorOptions, WebAuthnPlugin};
use win_webauthn::{
plugin::{
PluginAddAuthenticatorOptions, PluginAuthenticator, PluginCancelOperationRequest,
PluginGetAssertionRequest, PluginLockStatus, PluginMakeCredentialRequest, WebAuthnPlugin,
},
AuthenticatorInfo, CtapVersion, PublicKeyCredentialParameters,
};
use crate::{
ipc2::{ConnectionStatus, TimedCallback, WindowsProviderClient},
make_credential::make_credential,
win_webauthn::{
plugin::{
PluginAuthenticator, PluginCancelOperationRequest, PluginGetAssertionRequest,
PluginLockStatus, PluginMakeCredentialRequest,
},
AuthenticatorInfo, CtapVersion, PublicKeyCredentialParameters,
},
};
const AUTHENTICATOR_NAME: &str = "Bitwarden Desktop";

View File

@@ -3,13 +3,17 @@ use std::collections::HashMap;
use std::sync::Arc;
use std::time::Duration;
use crate::ipc2::{
PasskeyRegistrationRequest, PasskeyRegistrationResponse, Position, TimedCallback,
UserVerification, WindowsProviderClient,
};
use crate::win_webauthn::{
use win_webauthn::{
plugin::{PluginMakeCredentialRequest, PluginMakeCredentialResponse},
CtapTransport, ErrorKind, HwndExt, WinWebAuthnError,
CtapTransport,
};
use crate::{
ipc2::{
PasskeyRegistrationRequest, PasskeyRegistrationResponse, Position, TimedCallback,
UserVerification, WindowsProviderClient,
},
util::HwndExt,
};
pub fn make_credential(
@@ -149,19 +153,13 @@ fn send_registration_request(
/// Creates a CTAP make credential response from Bitwarden's WebAuthn registration response
fn create_make_credential_response(
attestation_object: Vec<u8>,
) -> std::result::Result<Vec<u8>, WinWebAuthnError> {
) -> std::result::Result<Vec<u8>, Box<dyn std::error::Error>> {
use ciborium::Value;
// Use the attestation object directly as the encoded response
let att_obj_items = ciborium::from_reader::<Value, _>(&attestation_object[..])
.map_err(|err| {
WinWebAuthnError::with_cause(
ErrorKind::Serialization,
"Failed to deserialize WebAuthn attestation object",
err,
)
})?
.map_err(|err| format!("Failed to deserialize WebAuthn attestation object: {err}"))?
.into_map()
.map_err(|_| WinWebAuthnError::new(ErrorKind::Serialization, "object is not a CBOR map"))?;
.map_err(|_| "object is not a CBOR map".to_string())?;
let webauthn_att_obj: HashMap<&str, &Value> = att_obj_items
.iter()
@@ -171,18 +169,12 @@ fn create_make_credential_response(
let att_fmt = webauthn_att_obj
.get("fmt")
.and_then(|s| s.as_text())
.ok_or(WinWebAuthnError::new(
ErrorKind::Serialization,
"could not read `fmt` key as a string",
))?
.ok_or("could not read `fmt` key as a string".to_string())?
.to_string();
let authenticator_data = webauthn_att_obj
.get("authData")
.and_then(|d| d.as_bytes())
.ok_or(WinWebAuthnError::new(
ErrorKind::Serialization,
"could not read `authData` key as bytes",
))?
.ok_or("could not read `authData` key as bytes".to_string())?
.clone();
let attestation = PluginMakeCredentialResponse {
format_type: att_fmt,
@@ -203,7 +195,7 @@ fn create_make_credential_response(
client_data_json: None,
registration_response_json: None,
};
attestation.to_ctap_response()
Ok(attestation.to_ctap_response()?)
}
#[cfg(test)]

View File

@@ -5,11 +5,28 @@ use std::time::{SystemTime, UNIX_EPOCH};
use windows::{
core::PCSTR,
Win32::{Foundation::*, System::LibraryLoader::*},
Win32::{Foundation::*, System::LibraryLoader::*, UI::WindowsAndMessaging::GetWindowRect},
};
use crate::com_buffer::ComBuffer;
pub trait HwndExt {
fn center_position(&self) -> windows::core::Result<(i32, i32)>;
}
impl HwndExt for HWND {
fn center_position(&self) -> windows::core::Result<(i32, i32)> {
let mut window: RECT = RECT::default();
unsafe {
GetWindowRect(*self, &mut window)?;
}
// TODO: We may need to adjust for scaling.
let center_x = (window.right + window.left) / 2;
let center_y = (window.bottom + window.top) / 2;
Ok((center_x, center_y))
}
}
pub unsafe fn delay_load<T>(library: PCSTR, function: PCSTR) -> Option<T> {
let library = LoadLibraryExA(library, None, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);