<!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 class="details" style="font-style: italic; color: #777;">
<a href="https://gitlab.com/ansasaki">Anderson Sasaki</a> created a merge request:
</p>
<p>
</p>
<div class="branch">
Project:Branches: ansasaki/gnutls:improve_fips_selftests to gnutls/gnutls:master
</div>
<div class="author">
Author: Anderson Sasaki
</div>
<div class="assignee">
Assignees: 
</div>
<div class="approvers">

</div>

<div>
<p dir="auto">This supersedes <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1073" data-original="!1073" data-link="false" data-link-reference="false" data-project="179611" data-merge-request="38239405" data-project-path="gnutls/gnutls" data-iid="1073" data-mr-title="WIP: fips: Improve signatures self-tests" data-reference-type="merge_request" data-container="body" data-placement="top" data-html="true" title="" class="gfm gfm-merge_request">!1073</a></p>
<p dir="auto">The goal of this patch set is to fix some bugs and clarify what are the tests actually executed for signing algorithms during the FIPS power-on self-tests. It addresses few bugs which could misguide the reader:</p>
<ul dir="auto">
<li>The <code>PK_KNOWN_TEST</code> and <code>PK_TEST</code> macros included the check for <code>GNUTLS_SELF_TEST_FLAG_ALL</code>. If more than one test was declared in a sequence, only the first one would be executed when the flag was not set. The macros were changed to not check the  <code>GNUTLS_SELF_TEST_FLAG_ALL</code>, allowing more than one test to be executed in sequence.</li>
<li>The <code>test_sig()</code> function always uses the same key regardless the value provided in the <code>bits</code> parameter. The value given in the <code>bits</code> parameter only changes the output message. Thus, calling <code>test_sig()</code> multiple times for a single key type passing different values in <code>bits</code> would always use the same key, but print messages as if different keys were tested. The code was changed to not call <code>test_sig()</code> for algorithms tested with <code>test_known_sig()</code> and to call <code>test_sig()</code> only once per key type.</li>
<li>Previously, the <code>test_known_sig()</code> would generate signatures only for deterministic algorithms. For non-deterministic algorithms only the verification operation was exercised. The code was changed to call <code>test_known_sig()</code> only for deterministic algorithms, which can have known answer tests.</li>
</ul>
<p dir="auto">Other than the bugs addressed, the following improvements were made:</p>
<ul dir="auto">
<li>Use deterministic signatures generation for ECDSA and DSA tests. This allows known answer tests to be executed for these algorithms</li>
<li>Use 2048 bits long key for DSA tests instead of 512 bits key</li>
</ul>
<p dir="auto">Note:</p>
<ul dir="auto">
<li>The RSA-PSS signature verification fails when deterministic signature is generated (with zero salt). Thus, the test for RSA-PSS was not changed to be a known answer test.</li>
</ul>
<h2 dir="auto">
<a id="user-content-checklist" class="anchor" href="#checklist" aria-hidden="true"></a>Checklist</h2>
<ul class="task-list" dir="auto">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" checked disabled> Commits have <code>Signed-off-by:</code> with name/author being identical to the commit author</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" checked disabled> Code modified for feature</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> Test suite updated with functionality tests</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> Test suite updated with negative tests</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> Documentation updated / NEWS entry present (for non-trivial changes)</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> CI timeout is 2h or higher (see Settings/CICD/General pipelines/Timeout)</li>
</ul>
<h2 dir="auto">
<a id="user-content-reviewers-checklist" class="anchor" href="#reviewers-checklist" aria-hidden="true"></a>Reviewer's checklist:</h2>
<ul class="task-list" dir="auto">
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> Any issues marked for closing are addressed</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> There is a test suite reasonably covering new functionality or modifications</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> Function naming, parameters, return values, types, etc., are consistent and according to <code>CONTRIBUTION.md</code>
</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> This feature/change has adequate documentation added</li>
<li class="task-list-item">
<input type="checkbox" class="task-list-item-checkbox" disabled> No obvious mistakes in the code</li>
</ul>
</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/-/merge_requests/1206">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/dee4373f2ea7fe837fc7932d5693ecdb/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/1206"}}</script>


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