Bug 1649227 - Upgrade authenticator-rs to v0.2.13 r=kjacobs

https://crates.io/crates/authenticator/0.2.13
- Support for Linux on MIPS
- Fix a race condition in the main state machine causing repeated signature requests

Differential Revision: https://phabricator.services.mozilla.com/D81604
This commit is contained in:
J.C. Jones 2020-06-29 21:26:19 +00:00
Родитель 5269943007
Коммит b3dd4acf6b
13 изменённых файлов: 28 добавлений и 20 удалений

4
Cargo.lock сгенерированный
Просмотреть файл

@ -180,9 +180,9 @@ dependencies = [
[[package]]
name = "authenticator"
version = "0.2.12"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff593fb4dd388fe452c5e63d4d668699466bd46b571c4b852dfbca4bac8f0706"
checksum = "6cc4e983ae4499095b965b8c0c57596ae718fe551d2b04aa2c19c777a02e05a4"
dependencies = [
"bitflags",
"boxfnonce",

Просмотреть файл

@ -38,7 +38,6 @@ exclude = [
# Excluded because they are used only as dependencies, not top-level targets,
# so we don't need to vendor their dev-dependencies.
"dom/webauthn/u2f-hid-rs",
"gfx/webrender_bindings",
"media/mp4parse-rust/mp4parse",
"media/mp4parse-rust/mp4parse_capi",

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

2
third_party/rust/authenticator/Cargo.lock сгенерированный поставляемый
Просмотреть файл

@ -28,7 +28,7 @@ dependencies = [
[[package]]
name = "authenticator"
version = "0.2.12"
version = "0.2.13"
dependencies = [
"base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"bindgen 0.51.1 (registry+https://github.com/rust-lang/crates.io-index)",

2
third_party/rust/authenticator/Cargo.toml поставляемый
Просмотреть файл

@ -12,7 +12,7 @@
[package]
name = "authenticator"
version = "0.2.12"
version = "0.2.13"
authors = ["J.C. Jones <jc@mozilla.com>", "Tim Taubert <ttaubert@mozilla.com>", "Kyle Machulis <kyle@nonpolynomial.com>"]
description = "Library for interacting with CTAP1/2 security keys for Web Authentication. Used by Firefox."
license = "MPL-2.0"

16
third_party/rust/authenticator/src/consts.rs поставляемый
Просмотреть файл

@ -31,16 +31,16 @@ pub const U2FHID_FRAME_TIMEOUT: u32 = 500; // Default frame timeout in ms
pub const U2FHID_TRANS_TIMEOUT: u32 = 3000; // Default message timeout in ms
// U2FHID native commands
pub const U2FHID_PING: u8 = (TYPE_INIT | 0x01); // Echo data through local processor only
pub const U2FHID_MSG: u8 = (TYPE_INIT | 0x03); // Send U2F message frame
pub const U2FHID_LOCK: u8 = (TYPE_INIT | 0x04); // Send lock channel command
pub const U2FHID_INIT: u8 = (TYPE_INIT | 0x06); // Channel initialization
pub const U2FHID_WINK: u8 = (TYPE_INIT | 0x08); // Send device identification wink
pub const U2FHID_ERROR: u8 = (TYPE_INIT | 0x3f); // Error response
pub const U2FHID_PING: u8 = TYPE_INIT | 0x01; // Echo data through local processor only
pub const U2FHID_MSG: u8 = TYPE_INIT | 0x03; // Send U2F message frame
pub const U2FHID_LOCK: u8 = TYPE_INIT | 0x04; // Send lock channel command
pub const U2FHID_INIT: u8 = TYPE_INIT | 0x06; // Channel initialization
pub const U2FHID_WINK: u8 = TYPE_INIT | 0x08; // Send device identification wink
pub const U2FHID_ERROR: u8 = TYPE_INIT | 0x3f; // Error response
// U2FHID_MSG commands
pub const U2F_VENDOR_FIRST: u8 = (TYPE_INIT | 0x40); // First vendor defined command
pub const U2F_VENDOR_LAST: u8 = (TYPE_INIT | 0x7f); // Last vendor defined command
pub const U2F_VENDOR_FIRST: u8 = TYPE_INIT | 0x40; // First vendor defined command
pub const U2F_VENDOR_LAST: u8 = TYPE_INIT | 0x7f; // Last vendor defined command
pub const U2F_REGISTER: u8 = 0x01; // Registration command
pub const U2F_AUTHENTICATE: u8 = 0x02; // Authenticate/sign command
pub const U2F_VERSION: u8 = 0x03; // Read version string command

Просмотреть файл

@ -4,7 +4,10 @@
// Shared code for platforms that use raw HID access (Linux, FreeBSD, etc.)
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless, needless_lifetimes))]
#![cfg_attr(
feature = "cargo-clippy",
allow(clippy::cast_lossless, clippy::needless_lifetimes)
)]
use std::mem;

Просмотреть файл

@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::cast_lossless))]
extern crate libc;

3
third_party/rust/authenticator/src/linux/ioctl_mipsbe.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
/* automatically generated by rust-bindgen */
pub type __u32 = :: std :: os :: raw :: c_uint ; pub const _HIDIOCGRDESCSIZE : __u32 = 1074022401 ; pub const _HIDIOCGRDESC : __u32 = 1342457858 ;

3
third_party/rust/authenticator/src/linux/ioctl_mipsle.rs поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
/* automatically generated by rust-bindgen */
pub type __u32 = :: std :: os :: raw :: c_uint ; pub const _HIDIOCGRDESCSIZE : __u32 = 1074022401 ; pub const _HIDIOCGRDESC : __u32 = 1342457858 ;

Просмотреть файл

@ -171,7 +171,7 @@ impl StateMachine {
return;
}
while alive() {
'outer: while alive() {
// If the device matches none of the given key handles
// then just make it blink with bogus data.
if valid_handles.is_empty() {
@ -190,7 +190,7 @@ impl StateMachine {
key_handle.credential.clone(),
bytes,
)));
break;
break 'outer;
}
}
}

Просмотреть файл

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![cfg_attr(feature = "cargo-clippy", allow(needless_lifetimes))]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::needless_lifetimes))]
extern crate std;

Просмотреть файл

@ -25,7 +25,7 @@ cubeb-sys = { version = "0.7", optional = true, features=["gecko-in-tree"] }
encoding_glue = { path = "../../../../intl/encoding_glue" }
audioipc-client = { path = "../../../../media/audioipc/client", optional = true }
audioipc-server = { path = "../../../../media/audioipc/server", optional = true }
authenticator = "0.2.10"
authenticator = "0.2.13"
gkrust_utils = { path = "../../../../xpcom/rust/gkrust_utils" }
gecko_logger = { path = "../../../../xpcom/rust/gecko_logger" }
rsdparsa_capi = { path = "../../../../media/webrtc/signaling/src/sdp/rsdparsa_capi" }