fetch salt only once
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-09-17 21:44:51 +02:00
parent 1a262c17cb
commit c9d8d24eec
2 changed files with 14 additions and 10 deletions

View File

@@ -94,8 +94,6 @@ fn main() -> Fido2LuksResult<()> {
))
};
if args.is_empty() {
let salt = conf.input_salt.obtain(&conf.password_helper)?;
dbg!(hex::encode(&salt));
if env.contains_key("CRYPTTAB_NAME") {
//Indicates that this script is being run as keyscript
let mut out = stdout();
@@ -109,7 +107,13 @@ fn main() -> Fido2LuksResult<()> {
match args.first().map(|s| s.as_ref()).unwrap() {
"addkey" => add_key_to_luks(&Config::load_default_location()?).map(|_| ()),
"setup" => setup(),
"open" if args.get(1).map(|a| &*a == "-e").unwrap_or(false) => open(&envy::prefixed("FIDO2LUKS_").from_env::<EnvConfig>().expect("Missing env config values").into(), &secret()?),
"open" if args.get(1).map(|a| &*a == "-e").unwrap_or(false) => open(
&envy::prefixed("FIDO2LUKS_")
.from_env::<EnvConfig>()
.expect("Missing env config values")
.into(),
&secret()?,
),
"open" => open(&conf, &secret()?),
"connected" => match authenticator_connected()? {
false => {