summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2024-07-09 07:57:57 +0000
committertb <>2024-07-09 07:57:57 +0000
commita6ada5bd2f3f6412297acb6d3f9434c9bdd398b4 (patch)
tree73e429ad100161e53b1912c7c72c779ccff3d950 /src/lib
parentabe0e32c45fb6839a157ff15ac728e2a0786cc57 (diff)
downloadopenbsd-a6ada5bd2f3f6412297acb6d3f9434c9bdd398b4.tar.gz
openbsd-a6ada5bd2f3f6412297acb6d3f9434c9bdd398b4.tar.bz2
openbsd-a6ada5bd2f3f6412297acb6d3f9434c9bdd398b4.zip
Add bounded attributes to hmac.h
ok beck
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/hmac/hmac.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/lib/libcrypto/hmac/hmac.h b/src/lib/libcrypto/hmac/hmac.h
index abdd19450e..0f39009c9d 100644
--- a/src/lib/libcrypto/hmac/hmac.h
+++ b/src/lib/libcrypto/hmac/hmac.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: hmac.h,v 1.18 2024/06/01 07:36:16 tb Exp $ */ 1/* $OpenBSD: hmac.h,v 1.19 2024/07/09 07:57:57 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,6 +60,10 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__)
64#define __bounded__(x, y, z)
65#endif
66
63#ifdef OPENSSL_NO_HMAC 67#ifdef OPENSSL_NO_HMAC
64#error HMAC is disabled. 68#error HMAC is disabled.
65#endif 69#endif
@@ -78,14 +82,18 @@ HMAC_CTX *HMAC_CTX_new(void);
78void HMAC_CTX_free(HMAC_CTX *ctx); 82void HMAC_CTX_free(HMAC_CTX *ctx);
79int HMAC_CTX_reset(HMAC_CTX *ctx); 83int HMAC_CTX_reset(HMAC_CTX *ctx);
80 84
81int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, 85int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md)
82 const EVP_MD *md); /* deprecated */ 86 __attribute__ ((__bounded__(__buffer__, 2, 3)));
83int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, 87int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md,
84 ENGINE *impl); 88 ENGINE *impl)
85int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len); 89 __attribute__ ((__bounded__(__buffer__, 2, 3)));
90int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
91 __attribute__ ((__bounded__(__buffer__, 2, 3)));
86int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); 92int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
87unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, 93unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
88 const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len) 94 const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len)
95 __attribute__ ((__bounded__(__buffer__, 2, 3)))
96 __attribute__ ((__bounded__(__buffer__, 4, 5)))
89 __attribute__((__nonnull__ (6))); 97 __attribute__((__nonnull__ (6)));
90int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx); 98int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
91 99