我收到錯誤,當我運行在Ubuntu 14.04的Openssl的驗證指令使用OpenSSL 1.0.1f 1月6日2014年的錯誤是0x2F067065
與錯誤字符串time stamp routines:TS_CHECK_SIGNING_CERTS:ess signing certificate error
。錯誤0x2F067065在ts_rsp_verify.c:291
時間戳服務提供者懷疑這是Openssl錯誤。 Openssl忙於新版本,並且對這個低優先級的問題沒有反應。
什麼是這個錯誤,我該如何解決它?有人可以幫忙嗎?
這是當發生錯誤:
openssl ts -verify -digest e16db7d30581e44a5540f19553852b5a4e4e26f9adc365cc846f94038ee33025 \
-in /tmp/namirial.tsr -CAfile /tmp/NamirialCATSA.pem
Verification: FAILED
140236013643424:error:2F067065:time stamp routines:TS_CHECK_SIGNING_CERTS:ess signing
certificate error:ts_rsp_verify.c:291:
如果有必要,我有一個完整的再現場景,我可以私下發送。錯誤是系統和穩定的。
這是我調用openssl庫進行驗證的PHP代碼,有關如何找到類似庫的任何幫助(因爲它似乎是Openssl中的一個錯誤,因此我需要使用另一個庫)以及如何在Ubuntu中調用它的形式PHP?
public static function validate ($hash, $base64_response_string, $response_time, $tsa_cert_file)
{
//if (strlen($hash) !== 40)
//if (strlen($hash) !== 64) // sha256
//throw new Exception("Invalid Hash");
$binary_response_string = base64_decode($base64_response_string);
if (!strlen($binary_response_string))
throw new Exception("There was no response-string");
if (!intval($response_time))
throw new Exception("There is no valid response-time given");
if (!file_exists($tsa_cert_file))
throw new Exception("The TSA-Certificate could not be found");
$responsefile = self::createTempFile($binary_response_string);
$cmd = "openssl ts -verify -digest ".escapeshellarg($hash)." -in ".escapeshellarg($responsefile)." -CAfile ".escapeshellarg($tsa_cert_file);
$retarray = array();
exec($cmd." 2>&1", $retarray, $retcode);
if(unlink($responsefile)) {
If ($debugMN) {echo " File Deleted Tempfile in validate"; }
}
/*
* just 2 "normal" cases:
* 1) Everything okay -> retcode 0 + retarray[0] == "Verification: OK"
* 2) Hash is wrong -> retcode 1 + strpos(retarray[somewhere], "message imprint mismatch") !== false
*
* every other case (Certificate not found/invalid/openssl is not installed/ts command not known)
* are being handled the same way -> retcode 1 + any retarray NOT containing "message imprint mismatch"
*/
if ($retcode === 0 && strtolower(trim($retarray[0])) == "verification: ok")
{
if (self::getTimestampFromAnswer ($binary_response_string) != $response_time)
throw new Exception("The responsetime of the request was changed");
return true;
}
foreach ($retarray as $retline)
{
if (stripos($retline, "message imprint mismatch") !== false)
return false;
}
throw new Exception("Systemcommand failed: ".implode(", ", $retarray));
}
預先感謝您
Stack Overflow是編程和開發問題的網站。這個問題似乎與題目無關,因爲它不涉及編程或開發。請參閱幫助中心的[我可以詢問哪些主題](http://stackoverflow.com/help/on-topic)。也許[超級用戶](http://superuser.com/)或[Apple Stack Exchange](http://apple.stackexchange.com/)會是一個更好的地方。另請參閱[我在哪裏發佈有關Dev Ops的問題?](http://meta.stackexchange.com/q/134306)。 – jww
*「我有一個完整的複製場景,我可以私下發送......」* - 如果您在適當的網站上提問,那麼您應該提供詳細信息,以便社區可以複製它。否則,它可能會被***關閉不能重複***或類似。如果您不想提供詳細信息,那麼您需要找到另一個論壇,因爲這不是* Stack Exchange網絡中的網站的工作原理。 – jww
另請參閱[OpenSSL中的可能錯誤 - rfc 3161 - TSA服務](http://openssl.6102.n7.nabble.com/possible-Bug-in-OpenSSL-rfc-3161-TSA-service-td43128.html)在OpenSSL郵件列表上。 – jww