#9143 Fixed empty license encryption key
This commit is contained in:
parent
197fa4c69a
commit
c650e7df6c
|
@ -78,25 +78,25 @@ if ($update_settings) {
|
||||||
|
|
||||||
$customer_key = $_POST['keys']['customer_key'];
|
$customer_key = $_POST['keys']['customer_key'];
|
||||||
|
|
||||||
$license_encryption_key = get_parameter('license_encryption_key', false);
|
$license_encryption_key = get_parameter('license_encryption_key', '');
|
||||||
if ($license_encryption_key !== false) {
|
$check = db_get_value_sql('SELECT `key` FROM tupdate_settings WHERE `key` LIKE "license_encryption_key"');
|
||||||
$check = db_get_value_sql('SELECT `key` FROM tupdate_settings WHERE `key` LIKE "license_encryption_key"');
|
if ($check === false) {
|
||||||
if ($check === false) {
|
db_process_sql_insert(
|
||||||
db_process_sql_insert(
|
'tupdate_settings',
|
||||||
'tupdate_settings',
|
[
|
||||||
[
|
db_escape_key_identifier('value') => $license_encryption_key,
|
||||||
db_escape_key_identifier('value') => $license_encryption_key,
|
db_escape_key_identifier('key') => 'license_encryption_key',
|
||||||
db_escape_key_identifier('key') => 'license_encryption_key',
|
]
|
||||||
]
|
);
|
||||||
);
|
} else {
|
||||||
} else {
|
db_process_sql_update(
|
||||||
db_process_sql_update(
|
'tupdate_settings',
|
||||||
'tupdate_settings',
|
[db_escape_key_identifier('value') => $license_encryption_key],
|
||||||
[db_escape_key_identifier('value') => $license_encryption_key],
|
[db_escape_key_identifier('key') => 'license_encryption_key']
|
||||||
[db_escape_key_identifier('key') => 'license_encryption_key']
|
);
|
||||||
);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (empty($license_encryption_key) === false) {
|
||||||
$customer_key = openssl_blowfish_encrypt_hex($customer_key, io_safe_output($license_encryption_key));
|
$customer_key = openssl_blowfish_encrypt_hex($customer_key, io_safe_output($license_encryption_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14752,7 +14752,7 @@ function api_set_metaconsole_license_file($key)
|
||||||
}
|
}
|
||||||
|
|
||||||
$license_encryption_key = db_get_value('value', 'tupdate_settings', '`key`', 'license_encryption_key');
|
$license_encryption_key = db_get_value('value', 'tupdate_settings', '`key`', 'license_encryption_key');
|
||||||
if ($license_encryption_key !== false) {
|
if (empty($license_encryption_key) === false) {
|
||||||
$key = openssl_blowfish_encrypt_hex($key, io_safe_output($license_encryption_key));
|
$key = openssl_blowfish_encrypt_hex($key, io_safe_output($license_encryption_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue