cotp 1.9.9

Trustworthy, encrypted, command-line TOTP/HOTP authenticator app with import functionality.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use clap::Args;
use zeroize::Zeroize;

use crate::{otp::otp_element::OTPDatabase, utils};

use super::SubcommandExecutor;

#[derive(Args)]
pub struct PasswdArgs;

impl SubcommandExecutor for PasswdArgs {
    fn run_command(self, mut database: OTPDatabase) -> color_eyre::Result<OTPDatabase> {
        let mut new_password = utils::verified_password("New password: ", 8);
        database.save_with_pw(&new_password)?;
        new_password.zeroize();
        Ok(database)
    }
}