From d86bc6958bde93cafbf11975fa727a1a077976e9 Mon Sep 17 00:00:00 2001 From: Kai Jan Kriegel Date: Fri, 23 Sep 2022 20:30:12 +0200 Subject: [PATCH] return correct length from step --- bffhd/authentication/fabfire_bin/server.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bffhd/authentication/fabfire_bin/server.rs b/bffhd/authentication/fabfire_bin/server.rs index e4695d6..6ebeb15 100644 --- a/bffhd/authentication/fabfire_bin/server.rs +++ b/bffhd/authentication/fabfire_bin/server.rs @@ -161,7 +161,7 @@ impl Authentication for FabFire { writer .write_all(&data) .map_err(|e| SessionError::Io { source: e })?; - Ok(rsasl::session::Step::NeedsMore(Some(send_buf.len()))) + Ok(rsasl::session::Step::NeedsMore(Some(data.len()))) }, Err(e) => { tracing::error!( @@ -205,7 +205,7 @@ impl Authentication for FabFire { writer .write_all(&data) .map_err(|e| SessionError::Io { source: e })?; - Ok(rsasl::session::Step::NeedsMore(Some(send_buf.len()))) + Ok(rsasl::session::Step::NeedsMore(Some(data.len()))) }, Err(e) => { tracing::error!("Failed to convert APDUCommand to Vec: {:?}", e); @@ -262,7 +262,7 @@ impl Authentication for FabFire { writer .write_all(&data) .map_err(|e| SessionError::Io { source: e })?; - Ok(rsasl::session::Step::NeedsMore(Some(send_buf.len()))) + Ok(rsasl::session::Step::NeedsMore(Some(data.len()))) }, Err(e) => { tracing::error!("Failed to convert APDUCommand to Vec: {:?}", e); @@ -323,7 +323,7 @@ impl Authentication for FabFire { writer .write_all(&data) .map_err(|e| SessionError::Io { source: e })?; - Ok(rsasl::session::Step::NeedsMore(Some(send_buf.len()))) + Ok(rsasl::session::Step::NeedsMore(Some(data.len()))) }, Err(e) => { tracing::error!("Failed to convert APDUCommand to Vec: {:?}", e); @@ -391,7 +391,7 @@ impl Authentication for FabFire { writer .write_all(&data) .map_err(|e| SessionError::Io { source: e })?; - Ok(rsasl::session::Step::NeedsMore(Some(send_buf.len()))) + Ok(rsasl::session::Step::NeedsMore(Some(data.len()))) }, Err(e) => { tracing::error!("Failed to convert to Vec: {:?}", e); @@ -440,7 +440,7 @@ impl Authentication for FabFire { writer .write_all(&data) .map_err(|e| SessionError::Io { source: e })?; - Ok(rsasl::session::Step::NeedsMore(Some(send_buf.len()))) + Ok(rsasl::session::Step::NeedsMore(Some(data.len()))) }, Err(e) => { tracing::error!("Failed to convert to Vec: {:?}", e); @@ -486,9 +486,7 @@ impl Authentication for FabFire { ) .is_ok() { - return Ok(rsasl::session::Step::Done(Some( - send_buf.len(), - ))); + return Ok(rsasl::session::Step::Done(None)); } }, },