mirror of
https://github.com/itflow-org/itflow
synced 2026-11-27 22:59:00 +00:00
Credential vault: each agent's and API key's copy of the master key is sealed with AES-256-GCM under a 600,000 round PBKDF2-SHA256 key with its full 256 bits instead of a 64 bit key, old copies still read and moved to the new format at the next sign-in or API call, Admin > Backup lists the copies still in the old format with a button to retire them; sign-in no longer keeps the plain master key in the session between the password and two-step steps, which also fixes the vault being closed after a mistyped two-step code; 26.12.2 changelog entries
This commit is contained in:
@@ -221,7 +221,9 @@ function userPasswordProblem($password) {
|
||||
function userSetPassword($user_id, $password) {
|
||||
global $mysqli;
|
||||
$hash = password_hash((string) $password, PASSWORD_DEFAULT);
|
||||
$ciphertext = escapeSql(encryptUserSpecificKey((string) $password));
|
||||
// No copy when this session's vault doesn't open (a reset from the sign-in page) - an admin resetting it later gives them one
|
||||
$ciphertext = encryptUserSpecificKey((string) $password);
|
||||
$ciphertext = escapeSql($ciphertext === false ? '' : $ciphertext);
|
||||
mysqli_query($mysqli, "UPDATE users SET user_password = '" . escapeSql($hash) . "', user_specific_encryption_ciphertext = '$ciphertext' WHERE user_id = " . intval($user_id));
|
||||
userSessionRestamp($user_id, $hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user