From f9311e8921d92c5efca767227a497ab63280ac39 Mon Sep 17 00:00:00 2001
From: "djm@openbsd.org" <djm@openbsd.org>
Date: Thu, 11 Jan 2024 01:51:16 +0000
Subject: upstream: ensure key_fd is filled when DSA is disabled; spotted by

tb@

OpenBSD-Commit-ID: 9dd417b6eec3cf67e870f147464a8d93f076dce7

Reference:https://anongit.mindrot.org/openssh.git/patch/?id=f9311e8921d92c5efca767227a497ab63280ac39
Conflict:4e838120a759(upstream: make DSA key support compile-time optional)
---
 ssh-keysign.c     |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)
 create mode 100644 ssh-keysign.c.rej

diff --git a/ssh-keysign.c b/ssh-keysign.c
index 8b3c9a2..d4f9fd9 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keysign.c,v 1.71 2022/08/01 11:09:26 djm Exp $ */
+/* $OpenBSD: ssh-keysign.c,v 1.73 2024/01/11 01:51:16 djm Exp $ */
 /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *
@@ -186,6 +186,9 @@ main(int argc, char **argv)
 	if (fd > 2)
 		close(fd);
 
+	for (i = 0; i < NUM_KEYTYPES; i++)
+		key_fd[i] = -1;
+
 	i = 0;
 	/* XXX This really needs to read sshd_config for the paths */
 	key_fd[i++] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
-- 
2.33.0

