Skip to content

Commit 78214b6

Browse files
chore(cable): drop dead unsafe Send/Sync, fix top-of-README table
CableQrCodeDevice's fields (NonZeroScalar, ByteArray, Option<Arc<dyn CableKnownDeviceInfoStore>>) all auto-derive Send + Sync, so the hand-rolled unsafe impls are dead. Verified compile-time via a T: Send + Sync assertion in the test module; downstream consumers (credentialsd spawns CableQrCodeDevice across tokio::spawn) keep working. Also brings the top-of-README transport-support table in line with the example table further down — caBLE v2 plus CTAP 2.3 hybrid.
1 parent 0c42f4e commit 78214b6

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Validating the relying party ID against the calling origin requires the [Public
5151
| **Bluetooth Low Energy** | 🟢 Supported (bluez) | 🟢 Supported (bluez) |
5252
| **NFC** | 🟢 Supported (pcsc or libnfc) | 🟢 Supported (pcsc or libnfc) |
5353
| **TPM 2.0 (Platform)** | 🟠 Planned ([#4][#4]) | 🟠 Planned ([#4][#4]) |
54-
| **Hybrid (QR code scan, aka caBLE v2)** | N/A | 🟢 Supported |
54+
| **Hybrid (QR code scan, caBLE v2 + CTAP 2.3)** | N/A | 🟢 Supported |
5555

5656
## Example programs
5757

libwebauthn/src/transport/cable/qr_code_device.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ impl CableQrCodeDevice {
231231
}
232232
}
233233

234-
unsafe impl Send for CableQrCodeDevice {}
235-
236-
unsafe impl Sync for CableQrCodeDevice {}
237-
238234
impl Display for CableQrCodeDevice {
239235
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
240236
write!(f, "CableQrCodeDevice")
@@ -302,6 +298,13 @@ mod tests {
302298
use super::*;
303299
use std::collections::BTreeMap;
304300

301+
// Downstream callers (e.g. credentialsd) move a CableQrCodeDevice across
302+
// tokio::spawn boundaries, so both Send and Sync need to auto-derive.
303+
const _: fn() = || {
304+
fn assert_send_sync<T: Send + Sync>() {}
305+
assert_send_sync::<CableQrCodeDevice>();
306+
};
307+
305308
#[test]
306309
fn qr_code_omits_key_6_for_cloud_assisted_only() {
307310
let device = CableQrCodeDevice::new_transient(

0 commit comments

Comments
 (0)