2016-03-10 65 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