Skip to content

Commit be65793

Browse files
Clean up warnings
1 parent 7371f1e commit be65793

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

libwebauthn/examples/webauthn_json_hid.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@ use std::error::Error;
33
use std::io::{self, Write};
44
use std::time::Duration;
55

6-
use ctap_types::ctap2::make_credential;
76
use libwebauthn::UvUpdate;
87
use rand::{thread_rng, Rng};
98
use text_io::read;
109
use tokio::sync::broadcast::Receiver;
1110
use tracing_subscriber::{self, EnvFilter};
1211

1312
use libwebauthn::ops::webauthn::{
14-
GetAssertionRequest, MakeCredentialRequest, RelyingPartyId, ResidentKeyRequirement,
15-
UserVerificationRequirement, WebAuthnIDL as _,
13+
GetAssertionRequest, MakeCredentialRequest, RelyingPartyId, UserVerificationRequirement,
14+
WebAuthnIDL as _,
1615
};
1716
use libwebauthn::pin::PinRequestReason;
18-
use libwebauthn::proto::ctap2::{
19-
Ctap2CredentialType, Ctap2PublicKeyCredentialDescriptor, Ctap2PublicKeyCredentialRpEntity,
20-
Ctap2PublicKeyCredentialUserEntity,
21-
};
17+
use libwebauthn::proto::ctap2::Ctap2PublicKeyCredentialDescriptor;
2218
use libwebauthn::transport::hid::list_devices;
2319
use libwebauthn::transport::{Channel as _, Device};
2420
use libwebauthn::webauthn::{Error as WebAuthnError, WebAuthn};
@@ -79,9 +75,6 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
7975
let devices = list_devices().await.unwrap();
8076
println!("Devices found: {:?}", devices);
8177

82-
let user_id: [u8; 32] = thread_rng().gen();
83-
let challenge: [u8; 32] = thread_rng().gen();
84-
8578
for mut device in devices {
8679
println!("Selected HID authenticator: {}", &device);
8780
let mut channel = device.channel().await?;
@@ -143,6 +136,7 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
143136
.unwrap();
144137
println!("WebAuthn MakeCredential response: {:?}", response);
145138

139+
let challenge: [u8; 32] = thread_rng().gen();
146140
let credential: Ctap2PublicKeyCredentialDescriptor =
147141
(&response.authenticator_data).try_into().unwrap();
148142
let get_assertion = GetAssertionRequest {

libwebauthn/src/ops/webauthn/create.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::{
1010
};
1111

1212
use serde::Deserialize;
13-
use serde_json::{Map as JsonMap, Value as JsonValue};
1413

1514
/**
1615
* https://www.w3.org/TR/webauthn-3/#sctn-parseCreationOptionsFromJSON
@@ -34,8 +33,6 @@ fn default_user_verification() -> UserVerificationRequirement {
3433
UserVerificationRequirement::Preferred
3534
}
3635

37-
type JsonObject = JsonMap<String, JsonValue>;
38-
3936
#[derive(Debug, Clone, Deserialize)]
4037
pub struct PublicKeyCredentialCreationOptionsJSON {
4138
pub rp: Ctap2PublicKeyCredentialRpEntity,

libwebauthn/src/ops/webauthn/make_credential.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ impl MakeCredentialsResponseUnsignedExtensions {
6969
let mut prf = None;
7070
if let Some(signed_extensions) = signed_extensions {
7171
(hmac_create_secret, prf) = if let Some(incoming_ext) = &request.extensions {
72-
if let Some(hmac_create_secret) = incoming_ext.hmac_create_secret {
72+
if let Some(_hmac_create_secret) = incoming_ext.hmac_create_secret {
7373
(signed_extensions.hmac_secret, None)
74-
} else if let Some(prf) = &incoming_ext.prf {
74+
} else if let Some(_prf) = &incoming_ext.prf {
7575
(
7676
None,
7777
Some(MakeCredentialPrfOutput {

0 commit comments

Comments
 (0)