summaryrefslogtreecommitdiff
path: root/lib/libcrypto
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2023-05-27 18:33:35 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2023-05-27 18:33:35 +0000
commit3430f0d51d88c38022a047882bfb9e8994252af5 (patch)
treee5d2734dc24bd8440bd0e798a4d0b647541226e0 /lib/libcrypto
parent82b28af923d82d9b73c507777257e13460c32a02 (diff)
Add HASH_NO_UPDATE and HASH_NO_TRANSFORM to md32_common.h
This makes it possible to still use minimal parts of md32_common.h, while disabling the update and transform functions. ok beck@ tb@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r--lib/libcrypto/md32_common.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libcrypto/md32_common.h b/lib/libcrypto/md32_common.h
index cce4cfb0f7e..ccd6db53fb3 100644
--- a/lib/libcrypto/md32_common.h
+++ b/lib/libcrypto/md32_common.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md32_common.h,v 1.24 2023/04/12 04:54:15 jsing Exp $ */
+/* $OpenBSD: md32_common.h,v 1.25 2023/05/27 18:33:34 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1999-2007 The OpenSSL Project. All rights reserved.
*
@@ -127,10 +127,10 @@
#error "HASH_CTX must be defined!"
#endif
-#ifndef HASH_UPDATE
+#if !defined(HASH_UPDATE) && !defined(HASH_NO_UPDATE)
#error "HASH_UPDATE must be defined!"
#endif
-#ifndef HASH_TRANSFORM
+#if !defined(HASH_TRANSFORM) && !defined(HASH_NO_TRANSFORM)
#error "HASH_TRANSFORM must be defined!"
#endif
#if !defined(HASH_FINAL) && !defined(HASH_NO_FINAL)
@@ -206,6 +206,7 @@
* Time for some action:-)
*/
+#ifndef HASH_NO_UPDATE
int
HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
{
@@ -259,13 +260,14 @@ HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len)
}
return 1;
}
+#endif
-
+#ifndef HASH_NO_TRANSFORM
void HASH_TRANSFORM (HASH_CTX *c, const unsigned char *data)
{
HASH_BLOCK_DATA_ORDER (c, data, 1);
}
-
+#endif
#ifndef HASH_NO_FINAL
int HASH_FINAL (unsigned char *md, HASH_CTX *c)