[openssh-commits] [openssh] 04/04: upstream: Use ssh_mldsa44_ed25519_cleanup consistently to avoid
git+noreply at mindrot.org
git+noreply at mindrot.org
Thu Jul 30 18:02:51 AEST 2026
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit d8140f07061ad3460cd0d167c23781d79a961ccd
Author: brynet at openbsd.org <brynet at openbsd.org>
AuthorDate: Thu Jul 30 07:40:48 2026 +0000
upstream: Use ssh_mldsa44_ed25519_cleanup consistently to avoid
calling freezero with the wrong size.
With help from tb@
ok tb, dtucker@
OpenBSD-Commit-ID: 4de18532e448a62005e12c179786bec512b83fde
---
ssh-mldsa-eddsa.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/ssh-mldsa-eddsa.c b/ssh-mldsa-eddsa.c
index d5cb3d9a0..390b471db 100644
--- a/ssh-mldsa-eddsa.c
+++ b/ssh-mldsa-eddsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-mldsa-eddsa.c,v 1.3 2026/07/30 03:13:34 deraadt Exp $ */
+/* $OpenBSD: ssh-mldsa-eddsa.c,v 1.4 2026/07/30 07:40:48 brynet Exp $ */
/*
* Copyright (c) 2026 Damien Miller <djm at mindrot.org>
*
@@ -343,22 +343,15 @@ ssh_mldsa44_ed25519_deserialize_private(const char *ktype, struct sshbuf *b,
static int
ssh_mldsa44_ed25519_generate(struct sshkey *k, int bits)
{
- free(k->mldsa_ed25519_pk);
- free(k->mldsa_ed25519_sk);
- k->mldsa_ed25519_pk = NULL;
- k->mldsa_ed25519_sk = NULL;
+ ssh_mldsa44_ed25519_cleanup(k);
if ((k->mldsa_ed25519_pk = malloc(MLDSA44_ED25519_PK_SZ)) == NULL ||
(k->mldsa_ed25519_sk = malloc(MLDSA44_ED25519_SK_SZ)) == NULL) {
- free(k->mldsa_ed25519_pk);
- k->mldsa_ed25519_pk = NULL;
+ ssh_mldsa44_ed25519_cleanup(k);
return SSH_ERR_ALLOC_FAIL;
}
if (crypto_sign_mldsa44_ed25519_keygen(k->mldsa_ed25519_pk,
k->mldsa_ed25519_sk) != 0) {
- freezero(k->mldsa_ed25519_pk, MLDSA44_ED25519_PK_SZ);
- k->mldsa_ed25519_pk = NULL;
- freezero(k->mldsa_ed25519_sk, MLDSA44_ED25519_PK_SZ);
- k->mldsa_ed25519_sk = NULL;
+ ssh_mldsa44_ed25519_cleanup(k);
return SSH_ERR_CRYPTO_ERROR;
}
return 0;
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list