From 59f5ef022bcb577041f3c0632395d558178936af Mon Sep 17 00:00:00 2001 From: Flavio Oliveira Date: Wed, 13 Sep 2017 07:23:36 +0200 Subject: [PATCH] bump version: 0.1.1 --- Cargo.toml | 2 +- src/authorization.rs | 8 ++------ src/util.rs | 4 ---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5ec93c5..816b1ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "u2f" -version = "0.1.0" +version = "0.1.1" authors = ["Flavio Oliveira "] description = "Rust FIDO U2F Library" diff --git a/src/authorization.rs b/src/authorization.rs index 74f7792..6527257 100644 --- a/src/authorization.rs +++ b/src/authorization.rs @@ -27,8 +27,6 @@ pub fn parse_sign_response(app_id: String, client_data: Vec, attestation_cer let user_presence_flag = mem.split_to(1); let counter = mem.split_to(4); - let raw_data = mem.clone(); - let sig_len = asn_length(mem.clone()).unwrap(); let signature = mem.split_to(sig_len); @@ -39,13 +37,11 @@ pub fn parse_sign_response(app_id: String, client_data: Vec, attestation_cer let mut msg = vec![]; msg.put(app_id_hash.as_ref()); msg.put(user_presence_flag.clone()); - msg.put(raw_data.clone()); + msg.put(counter.clone()); msg.put(client_data_hash.as_ref()); - let msg_hash = digest::digest(&digest::SHA256, &msg); - let input_sig = Input::from(&signature[..]); - let input_msg = Input::from(msg_hash.as_ref()); + let input_msg = Input::from(msg.as_ref()); // The signature is to be verified by the relying party using the public key certified // in the attestation certificate. diff --git a/src/util.rs b/src/util.rs index 76ee689..fc5ddcb 100644 --- a/src/util.rs +++ b/src/util.rs @@ -52,10 +52,6 @@ pub fn asn_length(mem: Bytes) -> Result { } length = length + (numbem_of_bytes as usize); - - if length < 128 { - return Err(U2fError::Asm1DecoderError); - } Ok(length + 2) // Add the 2 initial bytes: type and length. }