<!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">

<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 auto;">
<tbody>
<tr>
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; overflow: hidden;" align="left" bgcolor="#ffffff">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; border-collapse: separate; border-spacing: 0;">
<tbody>
<tr>
<td style="color: #333333; border-bottom-width: 1px; border-bottom-color: #ededed; border-bottom-style: solid; font-size: 15px; font-weight: bold; line-height: 1.4; padding: 20px 0;">
Merge request <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1541">!1541</a> was reviewed by <a href="https://gitlab.com/dueno">Daiki Ueno</a>
</td>
</tr>
<tr>
<td style="overflow: hidden; font-size: 14px; line-height: 1.4; display: grid;">
<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
started a new
discussion on <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1541#note_852052219">lib/system/certs.c</a>:
</p>
<table>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="105" 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="110" 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">
110
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC110" class="line" lang="c"></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="105" 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="111" 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">
111
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC111" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;"># if defined(ANDROID) || defined(__ANDROID__)</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="105" 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="112" 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">
112
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0"><pre style="margin: 0;">+<span id="LC112" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;">#  define DEFAULT_TRUST_STORE_DIR "/system/etc/security/cacerts/"</span></span>
</pre></td>
</tr>

</table>
<div style="border-bottom-width: 1px; border-bottom-color: #ededed; border-bottom-style: solid;">
<p dir="auto">What about moving this out of the outer <code>#if</code> block:</p>
<div class="gl-relative markdown-code-block js-markdown-code">
<pre class="code highlight js-syntax-highlight language-c" lang="c" v-pre="true" style="border-radius: 2px; background-color: #fff; font-family: monospace; font-size: 90%; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; margin: 0 0 8px; padding: 8px 12px; border: 1px solid #dbdbdb;"><code><span id="LC1" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;">#if defined(ANDROID) || defined(__ANDROID__)</span></span>
<span id="LC2" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;"># define DEFAULT_TRUST_STORE_DIR "/system/etc/security/cacerts/"</span></span>
<span id="LC3" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;">#endif</span></span>
<span id="LC4" class="line" lang="c"></span>
<span id="LC5" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;">#if defined(DEFAULT_TRUST_STORE_DIR) || defined(DEFAULT_TRUST_STORE_FILE) || \</span></span>
<span id="LC6" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;">  (defined(DEFAULT_TRUST_STORE_PKCS11) && defined(ENABLE_PKCS11))</span></span>
<span id="LC7" class="line" lang="c"><span class="p">...</span></span>
<span id="LC8" class="line" lang="c"><span class="cp" style="color: #999; font-weight: 600;">#endif</span></span></code></pre>
<copy-code></copy-code>
</div>
<p dir="auto">That way <code>defined(ANDROID) || defined(__ANDROID__)</code> is checked at the single place, though <code>load_revoked_certs</code> below might need to be conditionalized as well.</p>
</div>

<p style="color: #777777;">
<a href="https://gitlab.com/dueno">Daiki Ueno</a>
started a new
discussion on <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1541#note_852052246">lib/system/certs.c</a>:
</p>
<table>
<tr class="line_holder old">
<td class="old_line diff-line-num old" data-linenumber="125" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
125
</td>
<td class="new_line diff-line-num old" data-linenumber="160" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb"><pre style="margin: 0;">-<span id="LC125" class="line" lang="c">      <span class="k" style="font-weight: 600;">if</span> <span class="p">(</span><span class="n" style="color: #333;">ret</span> <span class="o" style="font-weight: 600;">></span> <span class="mi" style="color: #099;">0</span><span class="p">)</span></span>
</pre></td>
</tr>
<tr class="line_holder old">
<td class="old_line diff-line-num old" data-linenumber="126" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
126
</td>
<td class="new_line diff-line-num old" data-linenumber="160" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb"><pre style="margin: 0;">-<span id="LC126" class="line" lang="c">              <span class="n" style="color: #333;">r</span> <span class="o" style="font-weight: 600;">+=</span> <span class="n" style="color: #333;">ret</span><span class="p">;</span></span>
</pre></td>
</tr>
<tr class="line_holder new">
<td class="old_line diff-line-num new" data-linenumber="127" 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 class="k" style="font-weight: 600;">if</span> <span class="p">(</span><span class="n" style="color: #333;">r</span> <span class="o" style="font-weight: 600;">==</span> <span class="mi" style="color: #099;">0</span><span class="p">)</span> <span class="p">{</span></span>
</pre></td>
</tr>

</table>
<div style="border-bottom-width: 1px; border-bottom-color: #ededed; border-bottom-style: solid;">
<p dir="auto">What is the intention behind this check? Besides the fact that <code>r</code> is always 0 here, the following code also has this check, so I wonder if it was to make the trust store implementations (PKCS#11, SSL_CERT_DIR, SSL_CERT_FILE, default trust dir) mutually exclusive. In that case do we need to calculate the sum?</p>
</div>

</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>

</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/1541">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/21e2f7aa5fd1f90f319f48996d2869e7/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/1541"}}</script>


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