summaryrefslogtreecommitdiff
path: root/ssh-keysign.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-06-05 06:41:44 +0100
committerColin Watson <cjwatson@debian.org>2019-06-09 22:09:07 +0100
commit865a97e05b6aab1619e1c8eeb33ccb8f9a9e48d3 (patch)
tree7bb2128eb663180bacfabca88f26d26bf0733824 /ssh-keysign.c
parentba627ba172d6649919baedff5ba2789610da382a (diff)
parent7d50f9e5be88179325983a1f58c9d51bb58f025a (diff)
New upstream release (8.0p1)
Diffstat (limited to 'ssh-keysign.c')
-rw-r--r--ssh-keysign.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/ssh-keysign.c b/ssh-keysign.c
index 744ecb4f9..601f6ca72 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keysign.c,v 1.55 2018/07/27 05:34:42 dtucker Exp $ */ 1/* $OpenBSD: ssh-keysign.c,v 1.56 2018/11/23 05:08:07 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2002 Markus Friedl. All rights reserved. 3 * Copyright (c) 2002 Markus Friedl. All rights reserved.
4 * 4 *
@@ -40,6 +40,7 @@
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41#include <openssl/rand.h> 41#include <openssl/rand.h>
42#include <openssl/rsa.h> 42#include <openssl/rsa.h>
43#include "openbsd-compat/openssl-compat.h"
43#endif 44#endif
44 45
45#include "xmalloc.h" 46#include "xmalloc.h"
@@ -58,8 +59,6 @@
58#include "sshkey.h" 59#include "sshkey.h"
59#include "ssherr.h" 60#include "ssherr.h"
60 61
61struct ssh *active_state = NULL; /* XXX needed for linking */
62
63extern char *__progname; 62extern char *__progname;
64 63
65static int 64static int
@@ -173,9 +172,6 @@ main(int argc, char **argv)
173 u_char *signature, *data, rver; 172 u_char *signature, *data, rver;
174 char *host, *fp; 173 char *host, *fp;
175 size_t slen, dlen; 174 size_t slen, dlen;
176#ifdef WITH_OPENSSL
177 u_int32_t rnd[256];
178#endif
179 175
180 ssh_malloc_init(); /* must be called before any mallocs */ 176 ssh_malloc_init(); /* must be called before any mallocs */
181 if (pledge("stdio rpath getpw dns id", NULL) != 0) 177 if (pledge("stdio rpath getpw dns id", NULL) != 0)
@@ -210,7 +206,8 @@ main(int argc, char **argv)
210 206
211 /* verify that ssh-keysign is enabled by the admin */ 207 /* verify that ssh-keysign is enabled by the admin */
212 initialize_options(&options); 208 initialize_options(&options);
213 (void)read_config_file(_PATH_HOST_CONFIG_FILE, pw, "", "", &options, 0); 209 (void)read_config_file(_PATH_HOST_CONFIG_FILE, pw, "", "",
210 &options, 0, NULL);
214 fill_default_options(&options); 211 fill_default_options(&options);
215 if (options.enable_ssh_keysign != 1) 212 if (options.enable_ssh_keysign != 1)
216 fatal("ssh-keysign not enabled in %s", 213 fatal("ssh-keysign not enabled in %s",
@@ -223,12 +220,6 @@ main(int argc, char **argv)
223 if (found == 0) 220 if (found == 0)
224 fatal("could not open any host key"); 221 fatal("could not open any host key");
225 222
226#ifdef WITH_OPENSSL
227 OpenSSL_add_all_algorithms();
228 arc4random_buf(rnd, sizeof(rnd));
229 RAND_seed(rnd, sizeof(rnd));
230#endif
231
232 found = 0; 223 found = 0;
233 for (i = 0; i < NUM_KEYTYPES; i++) { 224 for (i = 0; i < NUM_KEYTYPES; i++) {
234 keys[i] = NULL; 225 keys[i] = NULL;