2016-03-10 15 views
0

我收到錯誤,當我運行在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)); 
} 

預先感謝您

+0

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

+0

*「我有一個完整的複製場景,我可以私下發送......」* - 如果您在適當的網站上提問,那麼您應該提供詳細信息,以便社區可以複製它。否則,它可能會被***關閉不能重複***或類似。如果您不想提供詳細信息,那麼您需要找到另一個論壇,因爲這不是* Stack Exchange網絡中的網站的工作原理。 – jww

+0

另請參閱[OpenSSL中的可能錯誤 - rfc 3161 - TSA服務](http://openssl.6102.n7.nabble.com/possible-Bug-in-OpenSSL-rfc-3161-TSA-service-td43128.html)在OpenSSL郵件列表上。 – jww

回答

0

你沒問任何問題,所以沒有什麼可回答在這裏但無論哪種方式,我會嘗試一些光棚到您的黑暗:)

你的供應商最有可能在TS響應中增加一些屬性證書 - 我想他正在使用DSE200並啓用TAC,但其他人可能會看到類似的問題 - 而OpenSSL目前不支持這種情況。您可以從openssl-users郵件列表中查看this older thread,詳細討論了此問題。

+0

問題在標題中,我該如何解決?我閱讀了所有這些舊線索,但我不太瞭解它,我不是那個專家,我不理會我是否有解決方案。您能否提一些建議?我該怎麼辦?使用其他技術來驗證我收到的TSA響應或什麼?我應該發佈證書,以便看看? – MSCA

+0

@MSCA最簡單的解決方案應該是使用別的默認OpenSSL應用程序進行驗證,或使用其他時間戳服務提供程序。 – jariq

+0

謝謝jariq,更改提供者更復雜,有關使用其他方法執行驗證的任何建議?你知道的任何標準? – MSCA