summaryrefslogtreecommitdiff
path: root/ssh-keysign.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keysign.c')
-rw-r--r--ssh-keysign.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ssh-keysign.c b/ssh-keysign.c
index d59f115fc..821939997 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -35,9 +35,11 @@
35#include <string.h> 35#include <string.h>
36#include <unistd.h> 36#include <unistd.h>
37 37
38#ifdef WITH_OPENSSL
38#include <openssl/evp.h> 39#include <openssl/evp.h>
39#include <openssl/rand.h> 40#include <openssl/rand.h>
40#include <openssl/rsa.h> 41#include <openssl/rsa.h>
42#endif
41 43
42#include "xmalloc.h" 44#include "xmalloc.h"
43#include "log.h" 45#include "log.h"
@@ -161,7 +163,9 @@ main(int argc, char **argv)
161 u_char *signature, *data; 163 u_char *signature, *data;
162 char *host, *fp; 164 char *host, *fp;
163 u_int slen, dlen; 165 u_int slen, dlen;
166#ifdef WITH_OPENSSL
164 u_int32_t rnd[256]; 167 u_int32_t rnd[256];
168#endif
165 169
166 /* Ensure that stdin and stdout are connected */ 170 /* Ensure that stdin and stdout are connected */
167 if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2) 171 if ((fd = open(_PATH_DEVNULL, O_RDWR)) < 2)
@@ -204,9 +208,11 @@ main(int argc, char **argv)
204 if (found == 0) 208 if (found == 0)
205 fatal("could not open any host key"); 209 fatal("could not open any host key");
206 210
211#ifdef WITH_OPENSSL
207 OpenSSL_add_all_algorithms(); 212 OpenSSL_add_all_algorithms();
208 arc4random_buf(rnd, sizeof(rnd)); 213 arc4random_buf(rnd, sizeof(rnd));
209 RAND_seed(rnd, sizeof(rnd)); 214 RAND_seed(rnd, sizeof(rnd));
215#endif
210 216
211 found = 0; 217 found = 0;
212 for (i = 0; i < NUM_KEYTYPES; i++) { 218 for (i = 0; i < NUM_KEYTYPES; i++) {