diff options
author | Damien Miller <djm@mindrot.org> | 2015-01-15 02:21:31 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-01-15 02:28:36 +1100 |
commit | 72ef7c148c42db7d5632a29f137f8b87b579f2d9 (patch) | |
tree | 47954a387f4260cc8b1e0ff33bbbaf22fd6f11fc /ssh-keysign.c | |
parent | 4f38c61c68ae7e3f9ee4b3c38bc86cd39f65ece9 (diff) |
support --without-openssl at configure time
Disables and removes dependency on OpenSSL. Many features don't
work and the set of crypto options is greatly restricted. This
will only work on system with native arc4random or /dev/urandom.
Considered highly experimental for now.
Diffstat (limited to 'ssh-keysign.c')
-rw-r--r-- | ssh-keysign.c | 6 |
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++) { |