Skip to content

Commit 4bc9f37

Browse files
committed
sign: Use explicit_bzero to clear secret key material
Suggested in: ostreedev#3278 (comment) Signed-off-by: Daiki Ueno <dueno@redhat.com>
1 parent 1cc222e commit 4bc9f37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libostree/ostree-sign-ed25519.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "otcore.h"
2828
#include <libglnx.h>
2929
#include <ot-checksum-utils.h>
30+
#include <string.h>
3031

3132
#undef G_LOG_DOMAIN
3233
#define G_LOG_DOMAIN "OSTreeSign"
@@ -320,7 +321,7 @@ ostree_sign_ed25519_clear_keys (OstreeSign *self, GError **error)
320321
/* Clear secret key */
321322
if (sign->secret_key != NULL)
322323
{
323-
memset (sign->secret_key, 0, OSTREE_SIGN_ED25519_SECKEY_SIZE);
324+
explicit_bzero (sign->secret_key, OSTREE_SIGN_ED25519_SECKEY_SIZE);
324325
g_free (sign->secret_key);
325326
sign->secret_key = NULL;
326327
}

0 commit comments

Comments
 (0)