summaryrefslogtreecommitdiffstats
path: root/digest-libc.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2015-01-15 02:21:31 +1100
committerDamien Miller <djm@mindrot.org>2015-01-15 02:28:36 +1100
commit72ef7c148c42db7d5632a29f137f8b87b579f2d9 (patch)
tree47954a387f4260cc8b1e0ff33bbbaf22fd6f11fc /digest-libc.c
parent4f38c61c68ae7e3f9ee4b3c38bc86cd39f65ece9 (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 'digest-libc.c')
-rw-r--r--digest-libc.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/digest-libc.c b/digest-libc.c
index 169ded07..a216e784 100644
--- a/digest-libc.c
+++ b/digest-libc.c
@@ -18,15 +18,19 @@
#include "includes.h"
+#ifndef WITH_OPENSSL
+
#include <sys/types.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
+#if 0
#include <md5.h>
#include <rmd160.h>
#include <sha1.h>
#include <sha2.h>
+#endif
#include "ssherr.h"
#include "sshbuf.h"
@@ -89,30 +93,30 @@ const struct ssh_digest digests[SSH_DIGEST_MAX] = {
"SHA256",
SHA256_BLOCK_LENGTH,
SHA256_DIGEST_LENGTH,
- sizeof(SHA2_CTX),
- (md_init_fn *) SHA256Init,
- (md_update_fn *) SHA256Update,
- (md_final_fn *) SHA256Final
+ sizeof(SHA256_CTX),
+ (md_init_fn *) SHA256_Init,
+ (md_update_fn *) SHA256_Update,
+ (md_final_fn *) SHA256_Final
},
{
SSH_DIGEST_SHA384,
"SHA384",
SHA384_BLOCK_LENGTH,
SHA384_DIGEST_LENGTH,
- sizeof(SHA2_CTX),
- (md_init_fn *) SHA384Init,
- (md_update_fn *) SHA384Update,
- (md_final_fn *) SHA384Final
+ sizeof(SHA384_CTX),
+ (md_init_fn *) SHA384_Init,
+ (md_update_fn *) SHA384_Update,
+ (md_final_fn *) SHA384_Final
},
{
SSH_DIGEST_SHA512,
"SHA512",
SHA512_BLOCK_LENGTH,
SHA512_DIGEST_LENGTH,
- sizeof(SHA2_CTX),
- (md_init_fn *) SHA512Init,
- (md_update_fn *) SHA512Update,
- (md_final_fn *) SHA512Final
+ sizeof(SHA512_CTX),
+ (md_init_fn *) SHA512_Init,
+ (md_update_fn *) SHA512_Update,
+ (md_final_fn *) SHA512_Final
}
};
@@ -257,3 +261,4 @@ ssh_digest_buffer(int alg, const struct sshbuf *b, u_char *d, size_t dlen)
{
return ssh_digest_memory(alg, sshbuf_ptr(b), sshbuf_len(b), d, dlen);
}
+#endif /* !WITH_OPENSSL */