diff options
author | Darren Tucker <dtucker@dtucker.net> | 2019-07-23 21:51:22 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2019-07-23 22:06:24 +1000 |
commit | 11cba2a4523fda447e2554ea457484655bedc831 (patch) | |
tree | 93ec07a9e0db784b0a729eb339d74a5a2c40ea9d /digest-libc.c | |
parent | 09159594a3bbd363429ee6fafde57ce77986dd7c (diff) |
Re-apply portability changes to current sha2.{c,h}.
Rather than attempt to apply 14 years' worth of changes to OpenBSD's sha2
I imported the current versions directly then re-applied the portability
changes. This also allowed re-syncing digest-libc.c against upstream.
Diffstat (limited to 'digest-libc.c')
-rw-r--r-- | digest-libc.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/digest-libc.c b/digest-libc.c index c2b0b240..12737e5d 100644 --- a/digest-libc.c +++ b/digest-libc.c @@ -28,7 +28,11 @@ #if 0 #include <md5.h> #include <rmd160.h> +#endif +#ifdef HAVE_SHA1_H #include <sha1.h> +#endif +#ifdef HAVE_SHA2_H #include <sha2.h> #endif @@ -83,30 +87,30 @@ const struct ssh_digest digests[SSH_DIGEST_MAX] = { "SHA256", SHA256_BLOCK_LENGTH, SHA256_DIGEST_LENGTH, - sizeof(SHA256_CTX), - (md_init_fn *) SHA256_Init, - (md_update_fn *) SHA256_Update, - (md_final_fn *) SHA256_Final + sizeof(SHA2_CTX), + (md_init_fn *) SHA256Init, + (md_update_fn *) SHA256Update, + (md_final_fn *) SHA256Final }, { SSH_DIGEST_SHA384, "SHA384", SHA384_BLOCK_LENGTH, SHA384_DIGEST_LENGTH, - sizeof(SHA384_CTX), - (md_init_fn *) SHA384_Init, - (md_update_fn *) SHA384_Update, - (md_final_fn *) SHA384_Final + sizeof(SHA2_CTX), + (md_init_fn *) SHA384Init, + (md_update_fn *) SHA384Update, + (md_final_fn *) SHA384Final }, { SSH_DIGEST_SHA512, "SHA512", SHA512_BLOCK_LENGTH, SHA512_DIGEST_LENGTH, - sizeof(SHA512_CTX), - (md_init_fn *) SHA512_Init, - (md_update_fn *) SHA512_Update, - (md_final_fn *) SHA512_Final + sizeof(SHA2_CTX), + (md_init_fn *) SHA512Init, + (md_update_fn *) SHA512Update, + (md_final_fn *) SHA512Final } }; |