<!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/dueno">Daiki Ueno</a>
commented:
</p>
<div style="">
<p dir="auto">Since the salt size is always controlled through spki, why not just set it manually, before calling <code>gnutls_pubkey_verify_data2</code>:</p>
<pre class="code highlight js-syntax-highlight c" lang="c" v-pre="true"><code><span id="LC1" class="line" lang="c">               <span class="k">if</span> <span class="p">(</span><span class="n">tests</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">pk</span> <span class="o">==</span> <span class="n">GNUTLS_PK_RSA_PSS</span><span class="p">)</span> <span class="p">{</span></span>
<span id="LC2" class="line" lang="c">                       <span class="n">gnutls_x509_spki_t</span> <span class="n">spki</span><span class="p">;</span></span>
<span id="LC3" class="line" lang="c">                       <span class="n">gnutls_x509_spki_init</span><span class="p">(</span><span class="o">&</span><span class="n">spki</span><span class="p">);</span></span>
<span id="LC4" class="line" lang="c">                       <span class="n">gnutls_x509_spki_set_rsa_pss_params</span><span class="p">(</span><span class="n">spki</span><span class="p">,</span> <span class="n">tests</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">digest</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span></span>
<span id="LC5" class="line" lang="c">                       <span class="n">gnutls_pubkey_set_spki</span><span class="p">(</span><span class="n">pubkey</span><span class="p">,</span> <span class="n">spki</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span></span>
<span id="LC6" class="line" lang="c">                       <span class="n">gnutls_x509_spki_deinit</span><span class="p">(</span><span class="n">spki</span><span class="p">);</span></span>
<span id="LC7" class="line" lang="c">               <span class="p">}</span></span></code></pre>
<p dir="auto">A fun fact is that, even if we use the reproducible construction, <code>getrandom</code> is always called for RSA blinding; so if the purpose of doing this is to avoid access to the random source, it wouldn't work out I'm afraid.</p>
</div>


</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/953#note_304965161">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/7f7a0bd6368204456dd32d2b998d7109/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/953#note_304965161"}}</script>


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