mirror of
https://gitlab.com/fabinfra/fabaccess/bffh.git
synced 2024-11-23 15:17:57 +01:00
trim trailing \0 at the correct point
This commit is contained in:
parent
964293f653
commit
dca231f32e
@ -495,9 +495,9 @@ impl Authentication for FabFire {
|
|||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
match apdu_response.body {
|
match apdu_response.body {
|
||||||
Some(data) => {
|
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::<AuthId>::with(
|
let prov = ThisProvider::<AuthId>::with(
|
||||||
authid.trim_matches(char::from(0)),
|
&authid,
|
||||||
);
|
);
|
||||||
let key = session
|
let key = session
|
||||||
.need_with::<FabFireCardKey, _, _>(&prov, |key| {
|
.need_with::<FabFireCardKey, _, _>(&prov, |key| {
|
||||||
|
@ -353,9 +353,9 @@ impl Authentication for FabFire {
|
|||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
match apdu_response.body {
|
match apdu_response.body {
|
||||||
Some(data) => {
|
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::<AuthId>::with(
|
let prov = ThisProvider::<AuthId>::with(
|
||||||
authid.trim_matches(char::from(0)),
|
&authid,
|
||||||
);
|
);
|
||||||
let key = session
|
let key = session
|
||||||
.need_with::<FabFireCardKey, _, _>(&prov, |key| {
|
.need_with::<FabFireCardKey, _, _>(&prov, |key| {
|
||||||
|
Loading…
Reference in New Issue
Block a user