<!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 style="color: #777777;">
<a href="https://gitlab.com/ZoltanFridrich">Zoltán Fridrich</a>
commented on a
discussion on <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1512#note_849578988">lib/ext/compress_certificate.c</a>:
</p>
<table>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="160" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
160
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC160" class="line" lang="c"></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="161" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
161
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC161" class="line" lang="c">    <span class="n" style="color: #333;">DECR_LEN</span><span class="p">(</span><span class="n" style="color: #333;">data_size</span><span class="p">,</span> <span class="n" style="color: #333;">algs_size</span><span class="p">);</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="162" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
162
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC162" class="line" lang="c">    <span class="n" style="color: #333;">memcpy</span><span class="p">(</span><span class="n" style="color: #333;">algs</span><span class="p">,</span> <span class="n" style="color: #333;">data</span> <span class="o" style="font-weight: 600;">+</span> <span class="mi" style="color: #099;">1</span><span class="p">,</span> <span class="n" style="color: #333;">algs_size</span><span class="p">);</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="163" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
163
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC163" class="line" lang="c">    <span class="n" style="color: #333;">algs_size</span> <span class="o" style="font-weight: 600;">/=</span> <span class="k" style="font-weight: 600;">sizeof</span><span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">uint16_t</span><span class="p">);</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="164" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
164
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC164" class="line" lang="c"></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="165" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
165
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC165" class="line" lang="c">    <span class="k" style="font-weight: 600;">for</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">unsigned</span> <span class="n" style="color: #333;">i</span> <span class="o" style="font-weight: 600;">=</span> <span class="mi" style="color: #099;">0</span><span class="p">;</span> <span class="n" style="color: #333;">i</span> <span class="o" style="font-weight: 600;"><</span> <span class="n" style="color: #333;">algs_size</span><span class="p">;</span> <span class="o" style="font-weight: 600;">++</span><span class="n" style="color: #333;">i</span><span class="p">)</span> <span class="p">{</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="166" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
166
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC166" class="line" lang="c">        <span class="n" style="color: #333;">tmp</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">_gnutls_read_uint16</span><span class="p">((</span><span class="kt" style="color: #458; font-weight: 600;">uint8_t</span> <span class="o" style="font-weight: 600;">*</span><span class="p">)(</span><span class="n" style="color: #333;">algs</span> <span class="o" style="font-weight: 600;">+</span> <span class="n" style="color: #333;">i</span><span class="p">));</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="167" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
167
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC167" class="line" lang="c">        <span class="k" style="font-weight: 600;">if</span> <span class="p">(</span><span class="n" style="color: #333;">_gnutls_compress_certificate_num2method</span><span class="p">(</span><span class="n" style="color: #333;">tmp</span><span class="p">)</span> <span class="o" style="font-weight: 600;">==</span> <span class="n" style="color: #333;">GNUTLS_COMP_UNKNOWN</span><span class="p">)</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="168" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
168
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC168" class="line" lang="c">            <span class="k" style="font-weight: 600;">return</span> <span class="n" style="color: #333;">gnutls_assert_val</span><span class="p">(</span><span class="n" style="color: #333;">GNUTLS_E_RECEIVED_ILLEGAL_PARAMETER</span><span class="p">);</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="169" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
169
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC169" class="line" lang="c">    <span class="p">}</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="170" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
170
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC170" class="line" lang="c"></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="171" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
171
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC171" class="line" lang="c">    <span class="n" style="color: #333;">memcpy</span><span class="p">(</span><span class="n" style="color: #333;">priv_algs</span><span class="p">,</span> <span class="n" style="color: #333;">priv</span><span class="p">.</span><span class="n" style="color: #333;">data</span><span class="p">,</span> <span class="n" style="color: #333;">priv</span><span class="p">.</span><span class="n" style="color: #333;">size</span><span class="p">);</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="172" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
172
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC172" class="line" lang="c">    <span class="n" style="color: #333;">priv_algs_size</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">priv</span><span class="p">.</span><span class="n" style="color: #333;">size</span> <span class="o" style="font-weight: 600;">/</span> <span class="k" style="font-weight: 600;">sizeof</span><span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">uint16_t</span><span class="p">);</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="173" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
173
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC173" class="line" lang="c"></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="174" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
174
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC174" class="line" lang="c">    <span class="k" style="font-weight: 600;">for</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">unsigned</span> <span class="n" style="color: #333;">i</span> <span class="o" style="font-weight: 600;">=</span> <span class="mi" style="color: #099;">0</span><span class="p">;</span> <span class="n" style="color: #333;">i</span> <span class="o" style="font-weight: 600;"><</span> <span class="n" style="color: #333;">algs_size</span> <span class="o" style="font-weight: 600;">&&</span> <span class="n" style="color: #333;">method</span> <span class="o" style="font-weight: 600;">==</span> <span class="n" style="color: #333;">GNUTLS_COMP_UNKNOWN</span><span class="p">;</span> <span class="o" style="font-weight: 600;">++</span><span class="n" style="color: #333;">i</span><span class="p">)</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="1" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="new_line diff-line-num new" data-linenumber="175" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
175
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC175" class="line" lang="c">        <span class="k" style="font-weight: 600;">for</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">unsigned</span> <span class="n" style="color: #333;">j</span> <span class="o" style="font-weight: 600;">=</span> <span class="mi" style="color: #099;">0</span><span class="p">;</span> <span class="n" style="color: #333;">j</span> <span class="o" style="font-weight: 600;"><</span> <span class="n" style="color: #333;">priv_algs_size</span> <span class="o" style="font-weight: 600;">&&</span> <span class="n" style="color: #333;">method</span> <span class="o" style="font-weight: 600;">==</span> <span class="n" style="color: #333;">GNUTLS_COMP_UNKNOWN</span><span class="p">;</span> <span class="o" style="font-weight: 600;">++</span><span class="n" style="color: #333;">j</span><span class="p">)</span></span>
</pre></td>
</tr>

</table>
<div style="">
<p dir="auto">Does this makes sense here?
Currently the peers request has precedence before the local supported compression list. That means, if server requests client to compress his cert, the servers requested methods will always have precedence. Analogously it holds for client. Would it make sense to prefer servers compression list before the clients request?</p>
</div>


</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/-/merge_requests/1512#note_849578988">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/7f8efb10810cc040142db6992db85059/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 Merge request","url":"https://gitlab.com/gnutls/gnutls/-/merge_requests/1512#note_849578988"}}</script>


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