From: djm@openbsd.org Date: Thu, 30 Jul 2026 03:39:39 +0000 (+0000) Subject: upstream: pass back errors from ed25519 key generation, which X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fopenssh-portable.git 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 --- 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 * @@ -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; }