mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
Add test on data decryption
This commit is contained in:
@@ -219,6 +219,11 @@ function dolDecrypt($chain, $key = '')
|
||||
} else {
|
||||
$newchain = openssl_decrypt((string) $tmpexplode[0], $ciphering, $key, 0, '');
|
||||
}
|
||||
// Test validity of decryption
|
||||
if (!ascii_check($newchain)) {
|
||||
dol_syslog("Error dolDecrypt failed: The key dolibarr_main_dolcrypt or dolibarr_main_instance_unique_id, found in conf.php file, is the the one used to encrypt this encrypted string", LOG_ERR);
|
||||
return $chain;
|
||||
}
|
||||
} else {
|
||||
dol_syslog("Error dolDecrypt openssl_decrypt is not available", LOG_ERR);
|
||||
return $chain;
|
||||
|
||||
Reference in New Issue
Block a user