diff options
Diffstat (limited to 'lib/libcrypto/whrlpool')
-rw-r--r-- | lib/libcrypto/whrlpool/whirlpool.c | 5 | ||||
-rw-r--r-- | lib/libcrypto/whrlpool/whrlpool.h | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libcrypto/whrlpool/whirlpool.c b/lib/libcrypto/whrlpool/whirlpool.c index e1e0f7a8990..80e147c3b5c 100644 --- a/lib/libcrypto/whrlpool/whirlpool.c +++ b/lib/libcrypto/whrlpool/whirlpool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: whirlpool.c,v 1.2 2024/03/30 03:45:47 joshua Exp $ */ +/* $OpenBSD: whirlpool.c,v 1.3 2024/06/01 07:36:17 tb Exp $ */ /** * The Whirlpool hashing function. * @@ -846,10 +846,7 @@ unsigned char * WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md) { WHIRLPOOL_CTX ctx; - static unsigned char m[WHIRLPOOL_DIGEST_LENGTH]; - if (md == NULL) - md = m; WHIRLPOOL_Init(&ctx); WHIRLPOOL_Update(&ctx, inp, bytes); WHIRLPOOL_Final(md, &ctx); diff --git a/lib/libcrypto/whrlpool/whrlpool.h b/lib/libcrypto/whrlpool/whrlpool.h index 875d34f7d33..1b4fac1993d 100644 --- a/lib/libcrypto/whrlpool/whrlpool.h +++ b/lib/libcrypto/whrlpool/whrlpool.h @@ -1,4 +1,4 @@ -/* $OpenBSD: whrlpool.h,v 1.5 2014/07/10 22:45:58 jsing Exp $ */ +/* $OpenBSD: whrlpool.h,v 1.6 2024/06/01 07:36:17 tb Exp $ */ #include <stddef.h> @@ -28,10 +28,13 @@ typedef struct { #ifndef OPENSSL_NO_WHIRLPOOL int WHIRLPOOL_Init (WHIRLPOOL_CTX *c); -int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes); +int WHIRLPOOL_Update (WHIRLPOOL_CTX *c,const void *inp,size_t bytes) + __attribute__ ((__bounded__(__buffer__, 2, 3))); void WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c,const void *inp,size_t bits); int WHIRLPOOL_Final (unsigned char *md,WHIRLPOOL_CTX *c); -unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md); +unsigned char *WHIRLPOOL(const void *inp,size_t bytes,unsigned char *md) + __attribute__ ((__nonnull__(3))) + __attribute__ ((__bounded__(__buffer__, 1, 2))); #endif #ifdef __cplusplus |