diff --git a/bffhd/authentication/fabfire/server.rs b/bffhd/authentication/fabfire/server.rs index 3108dd8..7a71d7d 100644 --- a/bffhd/authentication/fabfire/server.rs +++ b/bffhd/authentication/fabfire/server.rs @@ -495,9 +495,9 @@ impl Authentication for FabFire { Ok(_) => { match apdu_response.body { Some(data) => { - let authid = String::from_utf8(data).unwrap(); + let authid = String::from_utf8(data).unwrap().trim_matches(char::from(0)).to_string(); let prov = ThisProvider::::with( - authid.trim_matches(char::from(0)), + &authid, ); let key = session .need_with::(&prov, |key| { diff --git a/bffhd/authentication/fabfire_bin/server.rs b/bffhd/authentication/fabfire_bin/server.rs index 5e8cbb1..e9367ab 100644 --- a/bffhd/authentication/fabfire_bin/server.rs +++ b/bffhd/authentication/fabfire_bin/server.rs @@ -353,9 +353,9 @@ impl Authentication for FabFire { Ok(_) => { match apdu_response.body { Some(data) => { - let authid = String::from_utf8(data).unwrap(); + let authid = String::from_utf8(data).unwrap().trim_matches(char::from(0)).to_string(); let prov = ThisProvider::::with( - authid.trim_matches(char::from(0)), + &authid, ); let key = session .need_with::(&prov, |key| {