<!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: #777;">
<a href="https://gitlab.com/rufferson">Ruslan Marchenko</a> created an issue <a href="https://gitlab.com/gnutls/gnutls/-/issues/1041">#1041</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">When using TLS1.3 connection and attempting to retrieve tls-unique binding data the
gnutls_session_channel_binding() call succeeds however returns empty data (zero size buffer).
Looking at the code - the call intercepts finished message only on lib/handshake.c but not in lib/tls13/finished.c
Technically you don't need to store finished in tls13 as it could always be computed, which is not done in this call.</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">3.6.14-1</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">ArchLinux</p>
<h2 dir="auto">
<a id="user-content-how-reproducible" class="anchor" href="#how-reproducible" aria-hidden="true"></a>How reproducible:</h2>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">  gnutls_datum_t cb;</span>
<span id="LC2" class="line" lang="plaintext">  int ret = gnutls_session_channel_binding (priv->session, GNUTLS_CB_TLS_UNIQUE, &cb);</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">  if (ret == GNUTLS_E_SUCCESS)</span>
<span id="LC5" class="line" lang="plaintext">    {</span>
<span id="LC6" class="line" lang="plaintext">      if (data != NULL)</span>
<span id="LC7" class="line" lang="plaintext">        {</span>
<span id="LC8" class="line" lang="plaintext">          g_tls_log_debug (gnutls, "tls-unique binding size %d", cb.size);</span>
<span id="LC9" class="line" lang="plaintext">          g_free (g_byte_array_steal (data, NULL));</span>
<span id="LC10" class="line" lang="plaintext">          g_byte_array_append (data, cb.data, cb.size);</span>
<span id="LC11" class="line" lang="plaintext">        }</span>
<span id="LC12" class="line" lang="plaintext">      g_free (cb.data);</span>
<span id="LC13" class="line" lang="plaintext">      return TRUE;</span>
<span id="LC14" class="line" lang="plaintext">    }</span></code></pre>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li>run with G_TLS_GNUTLS_PRIORITY='NORMAL:%COMPAT:!VERS-TLS1.3' - result is</li>
</ul>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">(/home/ruff/co/glib-networking/_build/tls/tests/connection-gnutls:430951): GLib-Net-DEBUG: 11:27:43.445: CLIENT[0x55b24b896440]: tls-unique binding size 12</span>
<span id="LC2" class="line" lang="plaintext">(/home/ruff/co/glib-networking/_build/tls/tests/connection-gnutls:430951): GLib-Net-DEBUG: 11:27:43.445: SERVER[0x55b24b8a29d0]: tls-unique binding size 12</span></code></pre>
<ul dir="auto">
<li>run with defaults (which prefers TLS1.3)</li>
</ul>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">(/home/ruff/co/glib-networking/_build/tls/tests/connection-gnutls:430949): GLib-Net-DEBUG: 11:27:43.398: CLIENT[0x564054f58440]: tls-unique binding size 0</span>
<span id="LC2" class="line" lang="plaintext">(/home/ruff/co/glib-networking/_build/tls/tests/connection-gnutls:430949): GLib-Net-DEBUG: 11:27:43.398: SERVER[0x564054f649d0]: tls-unique binding size 0</span></code></pre>
<h2 dir="auto">
<a id="user-content-actual-results" class="anchor" href="#actual-results" aria-hidden="true"></a>Actual results:</h2>
<p dir="auto">see above</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">tls-unique binding size 48 (at least that's what I get with OpenSSL)</p>

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

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1041">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/dc1ff6606e2d3202c66ea2a1c611dff9/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/1041"}}</script>


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