From 83e73dadd90af52585df1bcce4e5b84da25fe19e Mon Sep 17 00:00:00 2001 From: beck <> Date: Fri, 11 Nov 2022 11:25:18 +0000 Subject: Add support for symbol hiding disabled by default. Fully explained in libcrypto/README. TL;DR make sure libcrypto and libssl's function calls internally and to each other are via symbol names that won't get overridden by linking other libraries. Mostly work by guenther@, which will currently be gated behind a build setting NAMESPACE=yes. once we convert all the symbols to this method we will do a major bump and pick up the changes. ok tb@ jsing@ --- src/lib/libcrypto/hmac/hmac.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/hmac') diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c index 3421119b7e..b195ca680b 100644 --- a/src/lib/libcrypto/hmac/hmac.c +++ b/src/lib/libcrypto/hmac/hmac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hmac.c,v 1.28 2022/05/05 18:29:34 tb Exp $ */ +/* $OpenBSD: hmac.c,v 1.29 2022/11/11 11:25:18 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -134,6 +134,7 @@ HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, err: return 0; } +LCRYPTO_ALIAS(HMAC_Init_ex) int HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md) @@ -151,6 +152,7 @@ HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len) return EVP_DigestUpdate(&ctx->md_ctx, data, len); } +LCRYPTO_ALIAS(HMAC_Update) int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) @@ -173,6 +175,7 @@ HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) err: return 0; } +LCRYPTO_ALIAS(HMAC_Final) HMAC_CTX * HMAC_CTX_new(void) @@ -186,6 +189,7 @@ HMAC_CTX_new(void) return ctx; } +LCRYPTO_ALIAS(HMAC_CTX_new) void HMAC_CTX_free(HMAC_CTX *ctx) @@ -197,6 +201,7 @@ HMAC_CTX_free(HMAC_CTX *ctx) free(ctx); } +LCRYPTO_ALIAS(HMAC_CTX_free) int HMAC_CTX_reset(HMAC_CTX *ctx) @@ -231,6 +236,7 @@ HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx) err: return 0; } +LCRYPTO_ALIAS(HMAC_CTX_copy) void HMAC_CTX_cleanup(HMAC_CTX *ctx) @@ -248,12 +254,14 @@ HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags) EVP_MD_CTX_set_flags(&ctx->o_ctx, flags); EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); } +LCRYPTO_ALIAS(HMAC_CTX_set_flags) const EVP_MD * HMAC_CTX_get_md(const HMAC_CTX *ctx) { return ctx->md; } +LCRYPTO_ALIAS(HMAC_CTX_get_md) unsigned char * HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, @@ -282,3 +290,4 @@ err: HMAC_CTX_cleanup(&c); return NULL; } +LCRYPTO_ALIAS(HMAC) -- cgit v1.2.3-55-g6feb