From 11cba2a4523fda447e2554ea457484655bedc831 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 23 Jul 2019 21:51:22 +1000 Subject: 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. --- digest-libc.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'digest-libc.c') 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 #include +#endif +#ifdef HAVE_SHA1_H #include +#endif +#ifdef HAVE_SHA2_H #include #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 } }; -- cgit v1.2.1