From: jsing Date: Sat, 27 May 2023 18:33:34 +0000 (+0000) Subject: Add HASH_NO_UPDATE and HASH_NO_TRANSFORM to md32_common.h X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5c37d65133eb6befb48c053ca9b6488786306217;p=openbsd 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@ --- 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)