#263 New auth menus. Allow saving keys without setting password

This commit is contained in:
RonaldReagan
2021-05-21 12:18:29 -06:00
parent 4fe207e721
commit 3e950bba2c
6 changed files with 106 additions and 89 deletions
+11 -4
View File
@@ -922,8 +922,6 @@ void authsetup(char **args, int numargs) // set up private and public keys
preprivpwdcfg = (iterations << 10) | authmemusage;
xor_block(prepriv, keyhash, preprivlen);
}
savepreprivkey(numargs > 2 && args[2][0] ? path(args[2]) : AUTHPREPRIVATECFGFILE
, prepriv, preprivlen, psalt, preprivpwdcfg);
}
}
else if(!strcasecmp(args[0], "NEWPASS"))
@@ -940,10 +938,19 @@ void authsetup(char **args, int numargs) // set up private and public keys
privpwdcfg = (iterations << 10) | authmemusage;
xor_block(priv, keyhash, 32);
}
saveprivkey(numargs > 2 && args[2][0] ? path(args[2]) : AUTHPRIVATECFGFILE,
priv, keyhash + 32, salt, privpwdcfg);
}
}
else if(!strcasecmp(args[0], "SAVEPRIV"))
{
ed25519_pubkey_from_private(keyhash + 32, priv);
saveprivkey(numargs > 2 && args[2][0] ? path(args[2]) : AUTHPRIVATECFGFILE,
priv, keyhash + 32, salt, privpwdcfg);
}
else if(!strcasecmp(args[0], "SAVEPRE"))
{
savepreprivkey(numargs > 2 && args[2][0] ? path(args[2]) : AUTHPREPRIVATECFGFILE,
prepriv, preprivlen, psalt, preprivpwdcfg);
}
#ifndef PRODUCTION
else if(!strcasecmp(args[0], "UNARMED")) // FIXME: this is for testing purposes only - to test simultaneous logins from the same account - delete before release!
{