Skip to content

Commit

Permalink
bump version: 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio Oliveira committed Sep 13, 2017
1 parent 2da55ab commit 59f5ef0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "u2f"
version = "0.1.0"
version = "0.1.1"
authors = ["Flavio Oliveira <[email protected]>"]

description = "Rust FIDO U2F Library"
Expand Down
8 changes: 2 additions & 6 deletions src/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ pub fn parse_sign_response(app_id: String, client_data: Vec<u8>, 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);

Expand All @@ -39,13 +37,11 @@ pub fn parse_sign_response(app_id: String, client_data: Vec<u8>, 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.
Expand Down
4 changes: 0 additions & 4 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ pub fn asn_length(mem: Bytes) -> Result<usize> {
}

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.
}
Expand Down

0 comments on commit 59f5ef0

Please sign in to comment.