aboutsummaryrefslogtreecommitdiff
path: root/src/auth.rs
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-03 00:23:13 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-03 01:24:00 +0100
commit248f8b209b0150e70e82ab15b73bf32b0f47341d (patch)
tree2c18d6e200bd258883cb5bf08962db8690bac66c /src/auth.rs
parent52afed9c6a17ec9c120a5a91b445afa74be87f0e (diff)
downloadnitrokey-rs-248f8b209b0150e70e82ab15b73bf32b0f47341d.tar.gz
nitrokey-rs-248f8b209b0150e70e82ab15b73bf32b0f47341d.tar.bz2
Remove CommandError::RngError
We switched to rand::thread_rng() which cannot fail. Therefore the CommandError::RngError is no longer needed and removed in this patch.
Diffstat (limited to 'src/auth.rs')
-rw-r--r--src/auth.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/auth.rs b/src/auth.rs
index 017cdbb..a129bd8 100644
--- a/src/auth.rs
+++ b/src/auth.rs
@@ -149,10 +149,7 @@ where
A: AuthenticatedDevice<D>,
T: Fn(*const i8, *const i8) -> c_int,
{
- let temp_password = match generate_password(TEMPORARY_PASSWORD_LENGTH) {
- Ok(pw) => pw,
- Err(_) => return Err((device, CommandError::RngError)),
- };
+ let temp_password = generate_password(TEMPORARY_PASSWORD_LENGTH);
let password = match get_cstring(password) {
Ok(password) => password,
Err(err) => return Err((device, err)),