<!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/romankulikov">Roman Kulikov</a>
<a href="https://gitlab.com/gnutls/gnutls/-/issues/1255#note_669553228">commented</a>:
</p>
<div style="">
<p dir="auto">If I got it right this logic has been implemented from the very beginning. In commit <a href="https://gitlab.com/gnutls/gnutls/-/commit/d02e7a1d22f73ce589508394390d0d1493952820" data-original="d02e7a1d22f73" data-link="false" data-link-reference="false" data-project="179611" data-commit="d02e7a1d22f73ce589508394390d0d1493952820" data-reference-type="commit" data-container="body" data-placement="top" title="Added the function gnutls_x509_crt_list_import(). This is a convinience..." class="gfm gfm-commit has-tooltip">d02e7a1d</a> <code>gnutls_x509_crt_list_import</code> was added with such chunk of code:</p>
<pre class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+int gnutls_x509_crt_list_import(gnutls_x509_crt_t *certs, unsigned int cert_max,</span>
<span id="LC2" class="line" lang="plaintext">+    const gnutls_datum_t * data, gnutls_x509_crt_fmt_t format, unsigned int flags)</span>
<span id="LC3" class="line" lang="plaintext">+{</span>
<span id="LC4" class="line" lang="plaintext">...</span>
<span id="LC5" class="line" lang="plaintext">+    do {</span>
<span id="LC6" class="line" lang="plaintext">...</span>
<span id="LC7" class="line" lang="plaintext">+       ret = gnutls_x509_crt_import( certs[count], &tmp, GNUTLS_X509_FMT_PEM);</span>
<span id="LC8" class="line" lang="plaintext">+       if (ret < 0) {</span>
<span id="LC9" class="line" lang="plaintext">+            gnutls_assert();</span>
<span id="LC10" class="line" lang="plaintext">+            goto error;</span>
<span id="LC11" class="line" lang="plaintext">+        }</span>
<span id="LC12" class="line" lang="plaintext">...</span>
<span id="LC13" class="line" lang="plaintext">+    } while (cert_max > count && ptr != NULL);</span>
<span id="LC14" class="line" lang="plaintext">+</span>
<span id="LC15" class="line" lang="plaintext">+    return count;</span>
<span id="LC16" class="line" lang="plaintext">+</span>
<span id="LC17" class="line" lang="plaintext">+error:</span>
<span id="LC18" class="line" lang="plaintext">+    CLEAR_CERTS;</span>
<span id="LC19" class="line" lang="plaintext">+    return ret;</span>
<span id="LC20" class="line" lang="plaintext">+}</span></code></pre>
<p dir="auto">Sanity check of any certificate in list results in import abort of the whole list.</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/-/issues/1255#note_669553228">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/97986673d0eecf5b2e7ce32767bb7efd/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/1255#note_669553228"}}</script>


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