Skip to content

Commit 59f5ef0

Browse files
author
Flavio Oliveira
committed
bump version: 0.1.1
1 parent 2da55ab commit 59f5ef0

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "u2f"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["Flavio Oliveira <[email protected]>"]
55

66
description = "Rust FIDO U2F Library"

src/authorization.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ pub fn parse_sign_response(app_id: String, client_data: Vec<u8>, attestation_cer
2727
let user_presence_flag = mem.split_to(1);
2828
let counter = mem.split_to(4);
2929

30-
let raw_data = mem.clone();
31-
3230
let sig_len = asn_length(mem.clone()).unwrap();
3331
let signature = mem.split_to(sig_len);
3432

@@ -39,13 +37,11 @@ pub fn parse_sign_response(app_id: String, client_data: Vec<u8>, attestation_cer
3937
let mut msg = vec![];
4038
msg.put(app_id_hash.as_ref());
4139
msg.put(user_presence_flag.clone());
42-
msg.put(raw_data.clone());
40+
msg.put(counter.clone());
4341
msg.put(client_data_hash.as_ref());
4442

45-
let msg_hash = digest::digest(&digest::SHA256, &msg);
46-
4743
let input_sig = Input::from(&signature[..]);
48-
let input_msg = Input::from(msg_hash.as_ref());
44+
let input_msg = Input::from(msg.as_ref());
4945

5046
// The signature is to be verified by the relying party using the public key certified
5147
// in the attestation certificate.

src/util.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ pub fn asn_length(mem: Bytes) -> Result<usize> {
5252
}
5353

5454
length = length + (numbem_of_bytes as usize);
55-
56-
if length < 128 {
57-
return Err(U2fError::Asm1DecoderError);
58-
}
5955

6056
Ok(length + 2) // Add the 2 initial bytes: type and length.
6157
}

0 commit comments

Comments
 (0)