[openssh-commits] [openssh] 06/06: upstream: pass back errors from ed25519 key generation, which

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Jul 30 13:49:53 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 4b5860ed27f758c9d8156714cbd8a62562420907
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Thu Jul 30 03:39:39 2026 +0000

    upstream: pass back errors from ed25519 key generation, which
    
    theoretically can fail. From Dimitri John Ledkov via GHPR702.
    
    ok deraadt@ dtucker@
    
    OpenBSD-Commit-ID: 1ecdd981c3f89393092949ff5e96662946fc5040
---
 ssh-ed25519.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ssh-ed25519.c b/ssh-ed25519.c
index 2369c3af0..8228f2830 100644
--- a/ssh-ed25519.c
+++ b/ssh-ed25519.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-ed25519.c,v 1.22 2026/02/14 00:18:34 jsg Exp $ */
+/* $OpenBSD: ssh-ed25519.c,v 1.23 2026/07/30 03:39:39 djm Exp $ */
 /*
  * Copyright (c) 2013 Markus Friedl <markus at openbsd.org>
  *
@@ -83,7 +83,8 @@ ssh_ed25519_generate(struct sshkey *k, int bits)
 	if ((k->ed25519_pk = malloc(ED25519_PK_SZ)) == NULL ||
 	    (k->ed25519_sk = malloc(ED25519_SK_SZ)) == NULL)
 		return SSH_ERR_ALLOC_FAIL;
-	crypto_sign_ed25519_keypair(k->ed25519_pk, k->ed25519_sk);
+	if (crypto_sign_ed25519_keypair(k->ed25519_pk, k->ed25519_sk) != 0)
+		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