diff --git a/config.php.in b/config.php.in index e9a12fa1..07857d0d 100644 --- a/config.php.in +++ b/config.php.in @@ -229,6 +229,7 @@ $config['TSA_PUBLIC_KEY_FILE'] = ''; $config['TSA_START_ID'] = 1; $config['TSA_STAMP_REQUEST_UNIT_SIZE'] = 10000; $config['TSA_VERIFY_CERTIFICATE'] = true; +$config['TSA_RELAXED_CHECK'] = false; $config['DB_DRIVER'] = 'mysql'; $config['DB_PREFIX'] = ''; diff --git a/webui/system/helper/TrustedTimestamps.php b/webui/system/helper/TrustedTimestamps.php index 182c7a42..c8e2ec64 100644 --- a/webui/system/helper/TrustedTimestamps.php +++ b/webui/system/helper/TrustedTimestamps.php @@ -181,7 +181,13 @@ class TrustedTimestamps $cmd = OPENSSL_BINARY . " ts -reply -in ".escapeshellarg($responsefile)." -token_out | " . OPENSSL_BINARY . " pkcs7 -inform DER -print_certs -out ".escapeshellarg($untrustedfile); shell_exec($cmd); - $cmd = OPENSSL_BINARY . " ts -verify -digest ".escapeshellarg($hash)." -in ".escapeshellarg($responsefile)." -CAfile ".escapeshellarg($tsa_cert_file)." -untrusted ".escapeshellarg($untrustedfile); + if(TSA_RELAXED_CHECK) { + $relaxed_check = " -no_check_time "; + } else { + $relaxed_check = ""; + } + + $cmd = OPENSSL_BINARY . " ts -verify -digest " . escapeshellarg($hash) . $relaxed_check . " -in ".escapeshellarg($responsefile)." -CAfile ".escapeshellarg($tsa_cert_file)." -untrusted ".escapeshellarg($untrustedfile); $retarray = array(); exec($cmd." 2>&1", $retarray, $retcode);