Skip to content

Commit ad4c843

Browse files
Hybrid transport runtime errors fixes (#127)
## 1. Tungstenite now requiring selecting a crypto provider A panic at runtime when attempting to establish a secure WebSocket connection: ``` DEBUG tokio_tungstenite::tls::encryption::rustls: Added 148/148 native root certificates (ignored 0) thread 'main' panicked at /home/afresta/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rustls-0.23.27/src/crypto/mod.rs:249:14: no process-level CryptoProvider available -- call CryptoProvider::install_default() before this point note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` For more details, see: * snapview/tokio-tungstenite#336 * snapview/tokio-tungstenite#353 This is now fixed by explicitly selecting `rustls` as the `tungstenite` TLS backend, as recommended in `tokio-tungstenite`. ## 2. Hybrid initial GetInfo deserialization fails An error deserializing the caBLE initial message containing the GetInfo response: ``` DEBUG libwebauthn::transport::cable::tunnel: Responding to GetInfo request with cached response ERROR webauthn_make_credential{dev=CableChannel}:ctap2_get_info: libwebauthn::proto::ctap2::protocol: Failed to parse Ctap2GetInfoResponse from CBOR-data provided by the device. Parsing error: SerdeCbor(ErrorImpl { code: Message("invalid type: byte array, expected Ctap2GetInfoResponse"), offset: 0 }) thread 'main' panicked at libwebauthn/examples/webauthn_cable.rs:139:10: called `Result::unwrap()` on an `Err` value: Platform(InvalidDeviceResponse) note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` This was accidentally introduced in #110: https://github.com/linux-credentials/libwebauthn/pull/110/files#diff-d061af4011a3c577c5c2dbef3b1933b0e8c8a9ebc0bf70a0ebc3358e890ed725R587 Fixed by using the appropriate serialization method.
1 parent e73c76b commit ad4c843

File tree

3 files changed

+214
-2
lines changed

3 files changed

+214
-2
lines changed

Cargo.lock

Lines changed: 202 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libwebauthn/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ tungstenite = { version = "0.26.2" }
6060
tokio-tungstenite = { version = "0.26", features = [
6161
"rustls-tls-native-roots",
6262
] }
63+
rustls = { version = "0.23.27", features = ["ring"] }
6364
tokio-stream = "0.1"
6465
snow = { version = "0.10.0-beta.1", features = ["use-p256"] }
6566
ctap-types = { version = "0.4.0" }

0 commit comments

Comments
 (0)