<!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">On 32bit gnutls-cli --benchmark-ciphers produces wrong results. Same machine
64bit installation:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Checking ciphers, payload size: 16384</span>
<span id="LC2" class="line" lang="plaintext">                3DES-CBC 27.91 MB/sec</span>
<span id="LC3" class="line" lang="plaintext">             AES-128-CBC 1.34 GB/sec</span>
<span id="LC4" class="line" lang="plaintext">             SALSA20-256 0.62 GB/sec</span>
<span id="LC5" class="line" lang="plaintext">                    NULL 35.20 GB/sec</span></code></pre>
<p dir="auto">and 32bit chroot:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Checking ciphers, payload size: 16384</span>
<span id="LC2" class="line" lang="plaintext">                3DES-CBC 27.19 MB/sec</span>
<span id="LC3" class="line" lang="plaintext">             AES-128-CBC 0.47 GB/sec</span>
<span id="LC4" class="line" lang="plaintext">             SALSA20-256 0.39 GB/sec</span>
<span id="LC5" class="line" lang="plaintext">                    NULL 0.40 GB/sec</span></code></pre>
<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.5, but it should be present in 3.6.6 also.</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">Debian</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">Always.</p>
<p dir="auto">Steps to Reproduce:</p>
<ul dir="auto">
<li>one Run gnutls-cli --benchmark-ciphers</li>
</ul>
<p dir="auto">This was found and diagnosed by Hiroyuki YAMAMORI as <a href="https://bugs.debian.org/920477" rel="nofollow noreferrer noopener" target="_blank">https://bugs.debian.org/920477</a>:</p>
<blockquote dir="auto">
<p>The following code is the cause.</p>
<p>"gnutls-3.6.5/src/benchmark.h" line 45</p>
</blockquote>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">struct benchmark_st {</span>
<span id="LC2" class="line" lang="plaintext">        struct timespec start;</span>
<span id="LC3" class="line" lang="plaintext">        unsigned long size;      <== 32bit in i386 arch.</span>
<span id="LC4" class="line" lang="plaintext">        sighandler_t old_handler;</span>
<span id="LC5" class="line" lang="plaintext">#if defined(_WIN32)</span>
<span id="LC6" class="line" lang="plaintext">        HANDLE wtimer;</span>
<span id="LC7" class="line" lang="plaintext">        HANDLE wthread;</span>
<span id="LC8" class="line" lang="plaintext">        LARGE_INTEGER alarm_timeout;</span>
<span id="LC9" class="line" lang="plaintext">#endif</span></code></pre>
<blockquote dir="auto">
<p>This size variable will overflow.</p>
</blockquote>

</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/685">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/ea4d1dec52415aef0fb4b91ef61b0e68/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/685"}}</script>
</p>
</div>
</body>
</html>