<!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;
}
body {
font-size: 0.875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";'>
<div class="content">

<p class="details" style="font-style: italic; color: #666;">
<a href="https://gitlab.com/wardev1" style="color: #1068bf; text-decoration: none;">Evan Ward</a> created an issue: <a href="https://gitlab.com/gnutls/gnutls/-/issues/1372" style="color: #1068bf; text-decoration: none;">#1372</a>
</p>
<div class="md" style="color: #303030; word-wrap: break-word;">
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-color: #eaeaea; border-bottom-style: solid; color: #303030; margin: 0 0 16px;" align="initial">
<a id="user-content-description-of-problem" class="anchor" href="#description-of-problem" aria-hidden="true" style="color: #1068bf; margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Description of problem:</h2>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">Currently gnutls-cli fails to verify the server certificate that openssl s_client does verify. Based on the openssl output the relevant OCSP response is the 19th out of 20 responses. In <a href="https://gitlab.com/gnutls/gnutls/-/blob/master/lib/cert-session.c#L284" style="color: #1068bf; margin-top: 0; text-decoration: none;">https://gitlab.com/gnutls/gnutls/-/blob/master/lib/cert-session.c#L284</a> it seems that gnutls only checks the first OCSP response. Gnutls output:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true" style='display: block; font-size: 13px; color: #303030; line-height: 1.6em; overflow-x: auto; border-radius: 2px; position: relative; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; word-break: break-all; word-wrap: break-word; background-color: #fafafa; margin: 0 0 16px; padding: 12px; border: 1px solid #dbdbdb;'><code style='font-size: inherit; color: inherit; word-wrap: normal; word-break: keep-all; background-color: inherit; border-radius: 4px; white-space: pre; margin-top: 0; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; overflow-wrap: normal; padding: unset;'><span id="LC1" class="line" lang="plaintext" style="margin-top: 0;">|<3>| ASSERT: ../../../lib/x509/ocsp.c[gnutls_ocsp_resp_check_crt]:1414</span>
<span id="LC2" class="line" lang="plaintext">|<3>| ASSERT: ../../lib/cert-session.c[check_ocsp_response]:286</span>
<span id="LC3" class="line" lang="plaintext">|<1>| Got OCSP response with an unrelated certificate.</span>
<span id="LC4" class="line" lang="plaintext">|<3>| ASSERT: ../../lib/ocsp-api.c[gnutls_ocsp_status_request_get2]:98</span>
<span id="LC5" class="line" lang="plaintext">|<3>| ASSERT: ../../../lib/x509/name_constraints.c[gnutls_x509_crt_get_name_constraints]:470</span>
<span id="LC6" class="line" lang="plaintext">|<3>| ASSERT: ../../../lib/x509/name_constraints.c[gnutls_x509_crt_get_name_constraints]:470</span>
<span id="LC7" class="line" lang="plaintext">- Status: The certificate is NOT trusted. The received OCSP status response is invalid. </span>
<span id="LC8" class="line" lang="plaintext">*** PKI verification of server certificate failed...</span>
<span id="LC9" class="line" lang="plaintext">|<3>| ASSERT: ../../lib/handshake.c[_gnutls_run_verify_callback]:3000</span>
<span id="LC10" class="line" lang="plaintext">|<3>| ASSERT: ../../lib/handshake.c[handshake_client]:3119</span>
<span id="LC11" class="line" lang="plaintext">*** Fatal error: Error in the certificate.</span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">The message "Got OCSP response with an unrelated certificate." is correct as 19 unrelated responses were received. That should not preclude verifying the one valid response.</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-color: #eaeaea; border-bottom-style: solid; color: #303030; margin: 24px 0 16px;" align="initial">
<a id="user-content-version-of-gnutls-used" class="anchor" href="#version-of-gnutls-used" aria-hidden="true" style="color: #1068bf; margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Version of gnutls used:</h2>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">3.7.3</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-color: #eaeaea; border-bottom-style: solid; color: #303030; margin: 24px 0 16px;" align="initial">
<a id="user-content-distributor-of-gnutls-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-gnutls-eg-ubuntu-fedora-rhel" aria-hidden="true" style="color: #1068bf; margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">Ubuntu</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-color: #eaeaea; border-bottom-style: solid; color: #303030; margin: 24px 0 16px;" align="initial">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true" style="color: #1068bf; margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>How reproducible:</h2>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">100% reproducible for the particular site.</p>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">Steps to Reproduce:</p>
<ul dir="auto" style="text-align: initial; list-style-type: disc; margin: 0 0 16px; padding: 0;">
<li style="margin-top: 0; line-height: 1.6em; margin-left: 25px; padding-left: 3px;">Find a server that includes OCSP responses for many unrelated certificates along with the correct response. Make sure the correct response is not first in the list. Say example.com</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">gnutls-cli example.com</li>
<li style="line-height: 1.6em; margin-left: 25px; padding-left: 3px;">observe failure to verify certs</li>
</ul>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-color: #eaeaea; border-bottom-style: solid; color: #303030; margin: 24px 0 16px;" align="initial">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true" style="color: #1068bf; margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Actual results:</h2>
<p dir="auto" style="color: #303030; margin: 0 0 16px;" align="initial">see description</p>
<h2 dir="auto" style="font-size: 1.5em; font-weight: 600; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-color: #eaeaea; border-bottom-style: solid; color: #303030; margin: 24px 0 16px;" align="initial">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true" style="color: #1068bf; margin-top: 0; float: left; margin-left: -20px; text-decoration: none; outline: none;"></a>Expected results:</h2>
<p dir="auto" style="color: #303030; margin: 0;" align="initial">gnutls checks all OCSP responses before deciding the OCSP is invalid.</p>
</div>

</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/1372" style="color: #1068bf; text-decoration: none;">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/1c9fd961ace55f53803fb0b0e5e8c1d7/unsubscribe" style="color: #1068bf; text-decoration: none;">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/1372"}}</script>


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