WIP: Allow decrypting logins/credentials via the API

This commit is contained in:
wrongecho
2024-08-22 17:46:58 +01:00
parent 63feff03d2
commit 0c60ecc329
6 changed files with 43 additions and 11 deletions

View File

@@ -20,7 +20,7 @@ if (isset($_POST['add_api_key'])) {
$password = password_hash(trim($_POST['password']), PASSWORD_DEFAULT);
$apikey_specific_encryption_ciphertext = encryptUserSpecificKey(trim($_POST['password']));
mysqli_query($mysqli,"INSERT INTO api_keys SET api_key_name = '$name', api_key_secret = '$secret', api_key_expire = '$expire', api_key_client_id = $client");
mysqli_query($mysqli,"INSERT INTO api_keys SET api_key_name = '$name', api_key_secret = '$secret', api_key_decrypt_hash = '$apikey_specific_encryption_ciphertext', api_key_expire = '$expire', api_key_client_id = $client");
$api_key_id = mysqli_insert_id($mysqli);