diff --git a/Cargo.lock b/Cargo.lock index 7dc0f1c..5fe4874 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3861,6 +3861,7 @@ name = "verifier" version = "0.1.0" dependencies = [ "coset", + "log", "p256", "passkey-authenticator", "rand", diff --git a/verifier/Cargo.toml b/verifier/Cargo.toml index 4840685..dd2a4ca 100644 --- a/verifier/Cargo.toml +++ b/verifier/Cargo.toml @@ -7,6 +7,7 @@ repository.workspace = true version = "0.1.0" [dependencies] +log.workspace = true p256 = { workspace = true, features = ["ecdsa", "pkcs8"] } sha2.workspace = true @@ -17,4 +18,4 @@ rand.workspace = true [features] default = ["std"] -std = ["coset/std", "p256/std", "rand/std", "sha2/std"] +std = ["coset/std", "log/std", "p256/std", "rand/std", "sha2/std"] diff --git a/verifier/src/lib.rs b/verifier/src/lib.rs index 4c486c5..b623778 100644 --- a/verifier/src/lib.rs +++ b/verifier/src/lib.rs @@ -66,6 +66,8 @@ pub enum VerifyError { VerifySignature, } +const LOG_TARGET: &str = "verifier::verify_signature"; + pub fn webauthn_verify( authenticator_data: &[u8], client_data_json: &[u8], @@ -89,6 +91,12 @@ pub fn webauthn_verify( let signature = DerSignature::try_from(signature_der).map_err(|_| VerifyError::ParseSignature)?; + log::trace!( + "Run WebAuthn verify_signature: message={:?}, public_key={:?}, signature={:?}", + &message, + &public_key, + &signature + ); // Step 5: Verify the signature verifying_key .verify(&message, &signature)