<!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: #666;">
<a href="https://gitlab.com/tobhe">Tobias Heider</a> created a merge request: <a href="https://gitlab.com/gnutls/gnutls/-/merge_requests/1554">!1554</a>
</p>
<p>
</p>
<div class="branch">
Project:Branches: tobhe/gnutls:gmp_alloc to gnutls/gnutls:master
</div>
<div class="author">
Author: Tobias Heider
</div>
<div class="assignee">
Assignees: 
</div>
<div class="reviewer">
Reviewers: 
</div>
<div class="approvers">

</div>

<div>
<p dir="auto">I am trying to figure out to make sure that all intermediate products of cryptographic operations (e.g. private key generation) are safely zeroized.  FIPS140-3 requires zeroization of all intermediate key generation values as well as the internal RBG state, but I think this would also be useful hardening for normal operation.</p>
<p dir="auto">gnutls outsources these cryptographic operations to nettle, which in turn uses GMP internally to
store a lot of sensitive data.
The <a href="http://www.lysator.liu.se/~nisse/nettle/nettle.html#index-rsa_005fprivate_005fkey_005fclear" rel="nofollow noreferrer noopener" target="_blank">nettle documentation</a> for the <code>rsa_private_key_clear()</code> function mentions that the
caller can change the default behavior by overriding the GMP allocator as described <a href="https://gmplib.org/manual/Custom-Allocation#Custom-Allocation" rel="nofollow noreferrer noopener" target="_blank">here</a>.</p>
<p dir="auto">This MR replaces the GMP <code>realloc()</code> and <code>free()</code> functions with safe alternatives that use
<code>explicit_bzero()</code> to zeroize any discarded memory.</p>
<p dir="auto">Feedback and ideas for improvement welcome</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/1554">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/e2fd861fcfcba9dbede1a0f9d7a2fb9d/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/1554"}}</script>


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