<!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=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<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">GnuTLS sends the downgrade sentinel at TLS 1.3. Per RFC 8446, it should only be sent at TLS 1.2 or earlier.
<a href="https://tools.ietf.org/html/rfc8446#section-4.1.3" rel="nofollow noreferrer noopener" target="_blank">https://tools.ietf.org/html/rfc8446#section-4.1.3</a></p>
<p dir="auto">Skimming <code>handshake.c</code>, the issue appears to be that <code>_gnutls_gen_server_random</code> is called very early, before the <code>supported_versions</code> extension is parsed.</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>
<p dir="auto">master branch. Also reproduced in 3.6.5.</p>
<h2 dir="auto">
<a id="user-content-distributor-of-gnutls-eg-ubuntu-fedora-rhel" class="anchor" href="#distributor-of-gnutls-eg-ubuntu-fedora-rhel" aria-hidden="true"></a>Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)</h2>
<p dir="auto">compiled from source</p>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li><code>gnutls-serv -p 4433 -a --x509certfile ./doc/credentials/x509/cert-rsa.pem --x509keyfile ./doc/credentials/x509/key-rsa.pem</code></li>
<li>
<code>openssl s_client -connect localhost:4433 -debug</code> with OpenSSL 1.1.1 or later</li>
<li>Look for the first block of "read from " lines, to find the ServerHello</li>
<li>Check the rest of the output to confirm TLS 1.3 was negotiated</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 ServerHello contains the string "DOWNGRD" in the printable hex dump (it's split over two rows), which is (most of) the TLS 1.3 downgrade sentinel.</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">The TLS 1.3 downgrade sentinel is not present.</p>

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

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/689">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/6b26fd586306b8ec4eee1ec3a497e5ca/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/689"}}</script>
</p>
</div>
</body>
</html>