From d56fe77f5d8577f74e9d3de24ffbd0fded961ec0 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 14 Jan 2022 08:06:03 +0000 Subject: [PATCH] Remove HMAC_CTX_{init,cleanup}() and HMAC_init from public visibility In OpenSSL commit 32fd54a9a3 HMAC_CTX_cleanup() was integrated into HMAC_CTX_init(), then HMAC_CTX_init() was renamed to HMAC_CTX_reset() in dc0099e1. LibreSSL retained them for API compatibility with OpenSSL 1.0. Not many things use them anymore. In fact, some projects that didn't want to modify their code for OpenSSL 1.1 API compatibility used the removed functions to wrap the OpenSSL 1.1 API. We had to patch some of these and this will now no longer be necessary. Also remove HMAC_cleanup(). Nothing uses this. ok inoguchi jsing --- lib/libcrypto/hmac/hmac.h | 6 +----- lib/libcrypto/hmac/hmac_local.h | 5 ++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/hmac/hmac.h b/lib/libcrypto/hmac/hmac.h index 0fe894e7b1a..ff01ae26b0a 100644 --- a/lib/libcrypto/hmac/hmac.h +++ b/lib/libcrypto/hmac/hmac.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hmac.h,v 1.15 2022/01/14 08:04:14 tb Exp $ */ +/* $OpenBSD: hmac.h,v 1.16 2022/01/14 08:06:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,11 +76,7 @@ extern "C" { HMAC_CTX *HMAC_CTX_new(void); void HMAC_CTX_free(HMAC_CTX *ctx); -void HMAC_CTX_init(HMAC_CTX *ctx); int HMAC_CTX_reset(HMAC_CTX *ctx); -void HMAC_CTX_cleanup(HMAC_CTX *ctx); - -#define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx) /* deprecated */ int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md); /* deprecated */ diff --git a/lib/libcrypto/hmac/hmac_local.h b/lib/libcrypto/hmac/hmac_local.h index 8358d9fa8b9..5900bc1c2d1 100644 --- a/lib/libcrypto/hmac/hmac_local.h +++ b/lib/libcrypto/hmac/hmac_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hmac_local.h,v 1.2 2022/01/14 08:04:14 tb Exp $ */ +/* $OpenBSD: hmac_local.h,v 1.3 2022/01/14 08:06:03 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -75,6 +75,9 @@ struct hmac_ctx_st { unsigned char key[HMAC_MAX_MD_CBLOCK]; } /* HMAC_CTX */; +void HMAC_CTX_init(HMAC_CTX *ctx); +void HMAC_CTX_cleanup(HMAC_CTX *ctx); + __END_HIDDEN_DECLS #endif /* !HEADER_HMAC_LOCAL_H */ -- 2.20.1