<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p class="details" style="font-style: italic; color: #666;">
<a href="https://gitlab.com/airtower-luna">Airtower</a> created an issue: <a href="https://gitlab.com/gnutls/gnutls/-/issues/1254">#1254</a>
</p>
<div></div>
<h2 dir="auto">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true"></a>Description of problem:</h2>
<p dir="auto">While <a href="https://github.com/airtower-luna/mod_gnutls/pull/4" rel="nofollow noreferrer noopener" target="_blank">debugging issues when using mod_gnutls with Let's Encrypt certificates</a> I noticed that <code>gnutls_ocsp_resp_verify()</code> considers OCSP responses invalid if they're signed directly by a CA on the trust list (as Let's Encrypt does) instead of using a delegated signer. This is because <code>gnutls_ocsp_resp_verify()</code> requires the id-kp-OCSPSigning key purpose unconditionally. According to <a href="https://datatracker.ietf.org/doc/html/rfc6960#section-4.2.2.2" rel="nofollow noreferrer noopener" target="_blank">RFC 6960, Section 4.2.2.2</a> the id-kp-OCSPSigning key purpose is only needed for a delegated signer, not the CA certificate that issued the certificate being checked, or a signer explicitly declared as trusted.</p>
<h2 dir="auto">
<a id="user-content-version-of-gnutls-used" class="anchor" href="#version-of-gnutls-used" aria-hidden="true"></a>Version of gnutls used:</h2>
<ul dir="auto">
<li>3.7.1 (from Ubuntu)</li>
<li>GnuTLS <code>master</code> as of <a href="https://gitlab.com/gnutls/gnutls/-/commit/c70941cea73cb38e0d27395e63aafca12dac9a72" data-original="c70941cea73cb38e0d27395e63aafca12dac9a72" data-link="false" data-link-reference="false" data-project="179611" data-commit="c70941cea73cb38e0d27395e63aafca12dac9a72" data-reference-type="commit" data-container="body" data-placement="top" title="Merge branch 'wip/dueno/sh-tests' into 'master'" class="gfm gfm-commit has-tooltip">c70941ce</a>
</li>
</ul>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<p dir="auto">The attached files contain a trust list (root and intermediate CA, <a href="https://gitlab.com/gnutls/gnutls/uploads/d544e60c477309f3fe3e6647ede1476e/trust.pem" data-canonical-src="/uploads/d544e60c477309f3fe3e6647ede1476e/trust.pem" data-link="true" class="gfm">trust.pem</a>), an OCSP response signed directly by the intermediate CA (<a href="https://gitlab.com/gnutls/gnutls/uploads/f6d145b7380a647689fda4e42e964f45/response-ca.der" data-canonical-src="/uploads/f6d145b7380a647689fda4e42e964f45/response-ca.der" data-link="true" class="gfm">response-ca.der</a>), and an OCSP response signed by a delegated signer signed by the intermediate CA (<a href="https://gitlab.com/gnutls/gnutls/uploads/31b7ef44312c611a6a77d97947735f11/response-delegated.der" data-canonical-src="/uploads/31b7ef44312c611a6a77d97947735f11/response-delegated.der" data-link="true" class="gfm">response-delegated.der</a>). Both responses are for a certificate issued by the intermediate CA.</p>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li>datefudge --static "2021-07-14 00:00" ocsptool --infile=response-ca.der --verify-response --load-trust=trust.pem</li>
<li>datefudge --static "2021-07-14 00:00" ocsptool --infile=response-delegated.der --verify-response --load-trust=trust.pem</li>
</ul>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<p dir="auto">The first verification fails with "Signer cert keyusage error", the second succeeds.</p>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">Both responses should be considered valid.</p>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1254">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/b62c5ddb5b308d1b4e1ec2ae62aea384/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1254"}}</script>


</p>
</div>
</body>
</html>