]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Use SHA.*_HMAC_BLOCK_SIZE if needed.
authorDarren Tucker <dtucker@dtucker.net>
Wed, 22 Dec 2021 08:33:10 +0000 (19:33 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 23 Dec 2021 00:36:08 +0000 (11:36 +1100)
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

index 86a1dbf291a83ddba710c34eed1e5930786d4009..6e77a4492dd40e378153b69a9d45abc1cd1f6a69 100644 (file)
 #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"