Ubuntu ts_rsp_verify中出现错误0x2F067065。c:291

Ubuntu ts_rsp_verify中出现错误0x2F067065。c:291,ubuntu,openssl,certificate,sha256,timestamping,Ubuntu,Openssl,Certificate,Sha256,Timestamping,我在2014年1月6日使用Openssl 1.0.1f在Ubuntu 14.04上运行Openssl验证命令时收到一个错误。错误为0x2F067065,错误字符串为时间戳例程:TS\U检查\U签名\U证书:ess签名证书错误 时间戳提供程序怀疑这是一个Openssl错误。Openssl正忙于新版本的发布,在这个低优先级的问题上没有响应 这是什么错误,我如何修复它?有人能帮忙吗 此时会发生错误: openssl ts -verify -digest e16db7d30581e44a5540f19

我在2014年1月6日使用Openssl 1.0.1f在Ubuntu 14.04上运行Openssl验证命令时收到一个错误。错误为0x2F067065,错误字符串为时间戳例程:TS\U检查\U签名\U证书:ess签名证书错误

时间戳提供程序怀疑这是一个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中的一个bug,因此我需要使用另一个库)以及如何在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));
}

提前谢谢你

你没有问任何问题,所以这里没有什么可以回答的,但不管怎样,我都会努力为你的黑暗照亮:)


您的提供商很可能在TS响应中添加了一些属性证书-我猜他使用的是启用TAC的DSE200,很可能其他人都看到了类似的问题-而OpenSSL目前不支持此类场景。您可以查看openssl用户邮件列表,其中详细讨论了此问题。

问题在标题中,我如何解决它?我读了所有那些旧的帖子,但我不太懂,我不是专家,我忽略了是否有解决方案。你能给我个建议吗?我该怎么办?使用另一种技术来验证我收到的TSA响应还是什么?我应该发布证书以便您可以查看吗?@MSCA最简单的解决方案应该是使用默认OpenSSL应用程序以外的其他程序进行验证,或者使用其他时间戳提供程序。感谢jariq,更改提供程序更复杂,有没有关于使用其他程序执行验证的建议?您知道有什么可用的标准吗?@MSCA我不知道,但用JAVA或.NET编写一个标准应该相当容易(取决于您的编码技能)。此时,我想知道是否有人开发了可信时间戳验证,我可以从服务器端的PHP代码调用它。它应该取代我对Openssl的调用来完成这项工作。这个问题似乎离题了,因为它与编程或开发无关。请参见帮助中心中的。也许或者会是一个更好的提问的地方。另请参见“我有一个完整的复制场景,我可以私下发送…”-如果你在适当的网站上提问,那么你应该提供详细信息,以便社区可以复制它。否则,它可能会以“无法复制”或类似方式关闭。如果您不想提供详细信息,那么您需要找到另一个论坛,因为Stack Exchange网络中的站点不是这样工作的。另请参见OpenSSL邮件列表。谢谢jww,我将按照您的指示在此处提问。此时,我想知道是否有人开发了可信时间戳验证,我可以从服务器端的PHP代码调用它。它应该取代我对Openssl的调用来完成这项工作。我如何在本文中上传我提到的证书,以便社区重现错误(NamirialCATSA.pem)?