Skip to content

Commit

Permalink
Update ctap-types
Browse files Browse the repository at this point in the history
This patch updates the ctap-types dependency.  PinAuth (a type alias for
Bytes<16>) is now replaced by a reference to a byte slice.
  • Loading branch information
robin-nitrokey committed Oct 29, 2023
1 parent d1b9fbb commit dd85858
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch", tag =

# forked
admin-app = { git = "https://github.com/Nitrokey/admin-app", tag = "v0.1.0-nitrokey.3" }
ctap-types = { git = "https://github.com/nitrokey/ctap-types.git", rev = "de8aa1f3dc4f773160f427680e854759bed869d7" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", rev = "82a85dc5fd88d32259b9e3f4f5542bc28b8c4f55" }
ctap-types = { git = "https://github.com/nitrokey/ctap-types.git", tag = "v0.1.2-nitrokey.4" }
fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.7" }
trussed = { git = "https://github.com/Nitrokey/trussed", tag = "v0.1.0-nitrokey.12" }
serde-indexed = { git = "https://github.com/sosthene-nitrokey/serde-indexed.git", rev = "5005d23cb4ee8622e62188ea0f9466146f851f0d" }

Expand Down
7 changes: 6 additions & 1 deletion src/lib/ctap_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,18 @@ where
let data = &data[0].id;
let rpid_hash = hash(&mut w.wc.trussed, request.rp_id.as_bytes())
.map_err(|_| ctap2::Error::InvalidParameter as u8)?;
let pin_auth = request
.pin_auth
.map(|s| Bytes::from_slice(s))
.transpose()
.map_err(|_| ctap2::Error::InvalidParameter as u8)?;
let maybe_output = w.bridge_u2f_to_webcrypt_raw(
output,
data,
RequestDetails {
rpid: rpid_hash.clone(),
source: RS_FIDO2,
pin_auth: request.pin_auth.copied(),
pin_auth,
},
);

Expand Down
3 changes: 1 addition & 2 deletions src/lib/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::commands_types::WebcryptMessage;
use crate::types::Error::BadFormat;
use crate::types::TRANSPORT_CMD_ID::COMM_CMD_WRITE;
use crate::{Bytes, Message};
use ctap_types::ctap2::PinAuth;
use delog::log;
use heapless_bytes::Bytes32;

Expand Down Expand Up @@ -206,7 +205,7 @@ pub enum RequestSource {
pub struct RequestDetails {
pub source: RequestSource,
pub rpid: Bytes32,
pub pin_auth: Option<PinAuth>,
pub pin_auth: Option<Bytes<16>>,
}

impl From<Message> for WebcryptRequest {
Expand Down

0 comments on commit dd85858

Please sign in to comment.