summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2021-11-13 17:26:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2021-11-13 17:26:14 +0000
commit5b0c434897db3af1f88a87896a4ae1d8cdfe76ae (patch)
tree61c37b12ee3ef27a391901018e1b5d4b8604699b /usr.bin/ssh
parent70a3a19bf7c1eadbea59383f7f5fbe44617088c3 (diff)
It really looks like pledge "stdio dns" is possible earlier.
Discussed with mestre
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/ssh-keysign.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/ssh/ssh-keysign.c b/usr.bin/ssh/ssh-keysign.c
index f0815d202d5..1d7807ac651 100644
--- a/usr.bin/ssh/ssh-keysign.c
+++ b/usr.bin/ssh/ssh-keysign.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keysign.c,v 1.68 2021/11/10 06:25:08 djm Exp $ */
+/* $OpenBSD: ssh-keysign.c,v 1.69 2021/11/13 17:26:13 deraadt Exp $ */
/*
* Copyright (c) 2002 Markus Friedl. All rights reserved.
*
@@ -208,6 +208,9 @@ main(int argc, char **argv)
fatal("ssh-keysign not enabled in %s",
_PATH_HOST_CONFIG_FILE);
+ if (pledge("stdio dns", NULL) != 0)
+ fatal("%s: pledge: %s", __progname, strerror(errno));
+
for (i = found = 0; i < NUM_KEYTYPES; i++) {
if (key_fd[i] != -1)
found = 1;
@@ -218,6 +221,7 @@ main(int argc, char **argv)
#ifdef WITH_OPENSSL
OpenSSL_add_all_algorithms();
#endif
+
found = 0;
for (i = 0; i < NUM_KEYTYPES; i++) {
keys[i] = NULL;
@@ -236,9 +240,6 @@ main(int argc, char **argv)
if (!found)
fatal("no hostkey found");
- if (pledge("stdio dns", NULL) != 0)
- fatal("%s: pledge: %s", __progname, strerror(errno));
-
if ((b = sshbuf_new()) == NULL)
fatal("%s: sshbuf_new failed", __progname);
if (ssh_msg_recv(STDIN_FILENO, b) < 0)