[openssh-commits] [openssh] 01/01: Use SHA.*_HMAC_BLOCK_SIZE if needed.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Dec 23 11:36:26 AEDT 2021


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 1c9853a68b2319f2e5f929179735e8fbb9988a67
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Wed Dec 22 19:33:10 2021 +1100

    Use SHA.*_HMAC_BLOCK_SIZE if needed.
    
    If the platform has a native SHA2, does not define SHA.*_BLOCK_LENGTH
    but does define SHA.*_HMAC_BLOCK_SIZE (eg Solaris) then use the latter.
    Should fix --without-openssl build on Solaris.
---
 digest-libc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/digest-libc.c b/digest-libc.c
index 86a1dbf2..6e77a449 100644
--- a/digest-libc.c
+++ b/digest-libc.c
@@ -36,6 +36,16 @@
 #include <sha2.h>
 #endif
 
+#if !defined(SHA256_BLOCK_LENGTH) && defined(SHA256_HMAC_BLOCK_SIZE)
+#define SHA256_BLOCK_LENGTH SHA256_HMAC_BLOCK_SIZE
+#endif
+#if !defined(SHA384_BLOCK_LENGTH) && defined(SHA512_HMAC_BLOCK_SIZE)
+#define SHA384_BLOCK_LENGTH SHA512_HMAC_BLOCK_SIZE
+#endif
+#if !defined(SHA512_BLOCK_LENGTH) && defined(SHA512_HMAC_BLOCK_SIZE)
+#define SHA512_BLOCK_LENGTH SHA512_HMAC_BLOCK_SIZE
+#endif
+
 #include "ssherr.h"
 #include "sshbuf.h"
 #include "digest.h"

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list