<!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 style="">
<blockquote dir="auto">
<p>So we can easily do the REMOVE_TLS13_IN_LOOP outside the main loop.</p>
</blockquote>
<p dir="auto">That would require 2-path iterations over the array, no? The current logic is something like:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">for i in 0...n {</span>
<span id="LC2" class="line" lang="plaintext"> if entries[i] is NULL, SRP, or PSK {</span>
<span id="LC3" class="line" lang="plaintext"> // REMOVE_TLS13_IN_LOOP</span>
<span id="LC4" class="line" lang="plaintext"> if entries[i] is TLS 1.3 {</span>
<span id="LC5" class="line" lang="plaintext"> entries[i...n] <- entries[i+1...n] // (*)</span>
<span id="LC6" class="line" lang="plaintext"> retry the loop from i</span>
<span id="LC7" class="line" lang="plaintext"> }</span>
<span id="LC8" class="line" lang="plaintext"> }</span>
<span id="LC9" class="line" lang="plaintext"> ...</span>
<span id="LC10" class="line" lang="plaintext">}</span></code></pre>
<p dir="auto">I don't see anything wrong here, though it might be a little cleaner if (*) is rewritten using memmove, and <code>REMOVE_TLS13_IN_LOOP</code> doesn't take <code>i</code> as the argument.</p>
</div>
</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/679#note_134149897">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/5cd190594f3aae84582acefbbd0b0e45/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/679#note_134149897"}}</script>
</p>
</div>
</body>
</html>