<!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/tomato42">Hubert Kario (@mention me if you need reply)</a> created an issue <a href="https://gitlab.com/gnutls/gnutls/-/issues/1082">#1082</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 gnutls receives an encrypted TLS 1.3 record with content_type of zero (the AEAD plaintext is all zero), gnutls responds with incorrect alert message: bad_record_mac instead of the unexpected_message alert</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">current master, <a href="https://gitlab.com/gnutls/gnutls/-/commit/423a1565d280107edd92684714ee22356200b038" data-original="423a1565d280107edd92684714ee22356200b038" data-link="false" data-link-reference="false" data-project="179611" data-commit="423a1565d280107edd92684714ee22356200b038" data-reference-type="commit" data-container="body" data-placement="top" title="Merge branch 'master' into 'master'" class="gfm gfm-commit has-tooltip">423a1565</a></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 on Fedora 31</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>compile, <code>cd doc/credentials</code>
</li>
<li><code>./gnutls-http-serv --priority NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:+DHE-PSK:+PSK -p 4433 -a -d 6</code></li>
<li><code>PYTHONPATH=~/tlsfuzzer python3 ~/tlsfuzzer/scripts/test-tls13-zero-content-type.py</code></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">all non sanity tests fail:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">sanity ...</span>
<span id="LC2" class="line" lang="plaintext">OK</span>
<span id="LC3" class="line" lang="plaintext"></span>
<span id="LC4" class="line" lang="plaintext">zero content type and padding during application data ...</span>
<span id="LC5" class="line" lang="plaintext">Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x7f01502c4fd0> (child: <tlsfuzzer.expect.ExpectClose object at 0x7f01502c6050>) with last message being: <tlslite.messages.Message object at 0x7f01502c6e10></span>
<span id="LC6" class="line" lang="plaintext">Error while processing</span>
<span id="LC7" class="line" lang="plaintext">Traceback (most recent call last):</span>
<span id="LC8" class="line" lang="plaintext"> File "scripts/test-tls13-zero-content-type.py", line 427, in main</span>
<span id="LC9" class="line" lang="plaintext"> runner.run()</span>
<span id="LC10" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/runner.py", line 239, in run</span>
<span id="LC11" class="line" lang="plaintext"> node.process(self.state, msg)</span>
<span id="LC12" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/expect.py", line 1759, in process</span>
<span id="LC13" class="line" lang="plaintext"> raise AssertionError(problem_desc)</span>
<span id="LC14" class="line" lang="plaintext">AssertionError: Expected alert description "unexpected_message" does not match received "bad_record_mac"</span>
<span id="LC15" class="line" lang="plaintext"></span>
<span id="LC16" class="line" lang="plaintext">zero content type during application data ...</span>
<span id="LC17" class="line" lang="plaintext">Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x7f01502c4890> (child: <tlsfuzzer.expect.ExpectClose object at 0x7f01502c48d0>) with last message being: <tlslite.messages.Message object at 0x7f01502ddb90></span>
<span id="LC18" class="line" lang="plaintext">Error while processing</span>
<span id="LC19" class="line" lang="plaintext">Traceback (most recent call last):</span>
<span id="LC20" class="line" lang="plaintext"> File "scripts/test-tls13-zero-content-type.py", line 427, in main</span>
<span id="LC21" class="line" lang="plaintext"> runner.run()</span>
<span id="LC22" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/runner.py", line 239, in run</span>
<span id="LC23" class="line" lang="plaintext"> node.process(self.state, msg)</span>
<span id="LC24" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/expect.py", line 1759, in process</span>
<span id="LC25" class="line" lang="plaintext"> raise AssertionError(problem_desc)</span>
<span id="LC26" class="line" lang="plaintext">AssertionError: Expected alert description "unexpected_message" does not match received "bad_record_mac"</span>
<span id="LC27" class="line" lang="plaintext"></span>
<span id="LC28" class="line" lang="plaintext">zero content type with padding after handshake ...</span>
<span id="LC29" class="line" lang="plaintext">Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x7f01502c0410> (child: <tlsfuzzer.expect.ExpectClose object at 0x7f01502c0450>) with last message being: <tlslite.messages.Message object at 0x7f01502c6d50></span>
<span id="LC30" class="line" lang="plaintext">Error while processing</span>
<span id="LC31" class="line" lang="plaintext">Traceback (most recent call last):</span>
<span id="LC32" class="line" lang="plaintext"> File "scripts/test-tls13-zero-content-type.py", line 427, in main</span>
<span id="LC33" class="line" lang="plaintext"> runner.run()</span>
<span id="LC34" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/runner.py", line 239, in run</span>
<span id="LC35" class="line" lang="plaintext"> node.process(self.state, msg)</span>
<span id="LC36" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/expect.py", line 1759, in process</span>
<span id="LC37" class="line" lang="plaintext"> raise AssertionError(problem_desc)</span>
<span id="LC38" class="line" lang="plaintext">AssertionError: Expected alert description "unexpected_message" does not match received "bad_record_mac"</span>
<span id="LC39" class="line" lang="plaintext"></span>
<span id="LC40" class="line" lang="plaintext">zero content type during handshake ...</span>
<span id="LC41" class="line" lang="plaintext">Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x7f01502c0a90> (child: <tlsfuzzer.expect.ExpectClose object at 0x7f01502c0ad0>) with last message being: <tlslite.messages.Message object at 0x7f01502dd750></span>
<span id="LC42" class="line" lang="plaintext">Error while processing</span>
<span id="LC43" class="line" lang="plaintext">Traceback (most recent call last):</span>
<span id="LC44" class="line" lang="plaintext"> File "scripts/test-tls13-zero-content-type.py", line 427, in main</span>
<span id="LC45" class="line" lang="plaintext"> runner.run()</span>
<span id="LC46" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/runner.py", line 239, in run</span>
<span id="LC47" class="line" lang="plaintext"> node.process(self.state, msg)</span>
<span id="LC48" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/expect.py", line 1759, in process</span>
<span id="LC49" class="line" lang="plaintext"> raise AssertionError(problem_desc)</span>
<span id="LC50" class="line" lang="plaintext">AssertionError: Expected alert description "unexpected_message" does not match received "bad_record_mac"</span>
<span id="LC51" class="line" lang="plaintext"></span>
<span id="LC52" class="line" lang="plaintext">zero content type after handshake ...</span>
<span id="LC53" class="line" lang="plaintext">Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x7f01502b3d10> (child: <tlsfuzzer.expect.ExpectClose object at 0x7f01502b3d50>) with last message being: <tlslite.messages.Message object at 0x7f01502c6e10></span>
<span id="LC54" class="line" lang="plaintext">Error while processing</span>
<span id="LC55" class="line" lang="plaintext">Traceback (most recent call last):</span>
<span id="LC56" class="line" lang="plaintext"> File "scripts/test-tls13-zero-content-type.py", line 427, in main</span>
<span id="LC57" class="line" lang="plaintext"> runner.run()</span>
<span id="LC58" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/runner.py", line 239, in run</span>
<span id="LC59" class="line" lang="plaintext"> node.process(self.state, msg)</span>
<span id="LC60" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/expect.py", line 1759, in process</span>
<span id="LC61" class="line" lang="plaintext"> raise AssertionError(problem_desc)</span>
<span id="LC62" class="line" lang="plaintext">AssertionError: Expected alert description "unexpected_message" does not match received "bad_record_mac"</span>
<span id="LC63" class="line" lang="plaintext"></span>
<span id="LC64" class="line" lang="plaintext">zero content type with padding during handshake ...</span>
<span id="LC65" class="line" lang="plaintext">Error encountered while processing node <tlsfuzzer.expect.ExpectAlert object at 0x7f01502c4150> (child: <tlsfuzzer.expect.ExpectClose object at 0x7f01502c4190>) with last message being: <tlslite.messages.Message object at 0x7f01502c6a90></span>
<span id="LC66" class="line" lang="plaintext">Error while processing</span>
<span id="LC67" class="line" lang="plaintext">Traceback (most recent call last):</span>
<span id="LC68" class="line" lang="plaintext"> File "scripts/test-tls13-zero-content-type.py", line 427, in main</span>
<span id="LC69" class="line" lang="plaintext"> runner.run()</span>
<span id="LC70" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/runner.py", line 239, in run</span>
<span id="LC71" class="line" lang="plaintext"> node.process(self.state, msg)</span>
<span id="LC72" class="line" lang="plaintext"> File "/home/hkario/dev/tlsfuzzer/tlsfuzzer/expect.py", line 1759, in process</span>
<span id="LC73" class="line" lang="plaintext"> raise AssertionError(problem_desc)</span>
<span id="LC74" class="line" lang="plaintext">AssertionError: Expected alert description "unexpected_message" does not match received "bad_record_mac"</span>
<span id="LC75" class="line" lang="plaintext"></span>
<span id="LC76" class="line" lang="plaintext">sanity ...</span>
<span id="LC77" class="line" lang="plaintext">OK</span>
<span id="LC78" class="line" lang="plaintext"></span>
<span id="LC79" class="line" lang="plaintext">TLS 1.3 zero-value content type</span>
<span id="LC80" class="line" lang="plaintext">Check if handling of records with an internal content type of zero is </span>
<span id="LC81" class="line" lang="plaintext">correct.</span>
<span id="LC82" class="line" lang="plaintext"></span>
<span id="LC83" class="line" lang="plaintext">Test end</span>
<span id="LC84" class="line" lang="plaintext">====================</span>
<span id="LC85" class="line" lang="plaintext">version: 1</span>
<span id="LC86" class="line" lang="plaintext">====================</span>
<span id="LC87" class="line" lang="plaintext">TOTAL: 8</span>
<span id="LC88" class="line" lang="plaintext">SKIP: 0</span>
<span id="LC89" class="line" lang="plaintext">PASS: 2</span>
<span id="LC90" class="line" lang="plaintext">XFAIL: 0</span>
<span id="LC91" class="line" lang="plaintext">FAIL: 6</span>
<span id="LC92" class="line" lang="plaintext">XPASS: 0</span>
<span id="LC93" class="line" lang="plaintext">====================</span>
<span id="LC94" class="line" lang="plaintext">FAILED:</span>
<span id="LC95" class="line" lang="plaintext"> 'zero content type after handshake'</span>
<span id="LC96" class="line" lang="plaintext"> 'zero content type and padding during application data'</span>
<span id="LC97" class="line" lang="plaintext"> 'zero content type during application data'</span>
<span id="LC98" class="line" lang="plaintext"> 'zero content type during handshake'</span>
<span id="LC99" class="line" lang="plaintext"> 'zero content type with padding after handshake'</span>
<span id="LC100" class="line" lang="plaintext"> 'zero content type with padding during handshake'</span></code></pre>
<h2 dir="auto">
<a id="user-content-expected-results" class="anchor" href="#expected-results" aria-hidden="true"></a>Expected results:</h2>
<p dir="auto">all tests pass</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/1082">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/6ed9ebff104316bc347eb166e6bd68dd/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/1082"}}</script>
</p>
</div>
</body>
</html>