diff options
| author | beck <> | 2022-11-11 11:25:18 +0000 |
|---|---|---|
| committer | beck <> | 2022-11-11 11:25:18 +0000 |
| commit | 0ba6b15619d4e4feafccdbd0226ee99b70553a11 (patch) | |
| tree | ed6caa2922a04c9566669564e9dda8a563bf522a /src/lib/libcrypto/hmac/hmac.c | |
| parent | e917fd8e13a8b1acf3b53461d4ba34d7022a216e (diff) | |
| download | openbsd-0ba6b15619d4e4feafccdbd0226ee99b70553a11.tar.gz openbsd-0ba6b15619d4e4feafccdbd0226ee99b70553a11.tar.bz2 openbsd-0ba6b15619d4e4feafccdbd0226ee99b70553a11.zip | |
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@
Diffstat (limited to 'src/lib/libcrypto/hmac/hmac.c')
| -rw-r--r-- | src/lib/libcrypto/hmac/hmac.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 @@ | |||
| 1 | /* $OpenBSD: hmac.c,v 1.28 2022/05/05 18:29:34 tb Exp $ */ | 1 | /* $OpenBSD: hmac.c,v 1.29 2022/11/11 11:25:18 beck 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 | * |
| @@ -134,6 +134,7 @@ HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, | |||
| 134 | err: | 134 | err: |
| 135 | return 0; | 135 | return 0; |
| 136 | } | 136 | } |
| 137 | LCRYPTO_ALIAS(HMAC_Init_ex) | ||
| 137 | 138 | ||
| 138 | int | 139 | int |
| 139 | HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md) | 140 | 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) | |||
| 151 | 152 | ||
| 152 | return EVP_DigestUpdate(&ctx->md_ctx, data, len); | 153 | return EVP_DigestUpdate(&ctx->md_ctx, data, len); |
| 153 | } | 154 | } |
| 155 | LCRYPTO_ALIAS(HMAC_Update) | ||
| 154 | 156 | ||
| 155 | int | 157 | int |
| 156 | HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) | 158 | 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) | |||
| 173 | err: | 175 | err: |
| 174 | return 0; | 176 | return 0; |
| 175 | } | 177 | } |
| 178 | LCRYPTO_ALIAS(HMAC_Final) | ||
| 176 | 179 | ||
| 177 | HMAC_CTX * | 180 | HMAC_CTX * |
| 178 | HMAC_CTX_new(void) | 181 | HMAC_CTX_new(void) |
| @@ -186,6 +189,7 @@ HMAC_CTX_new(void) | |||
| 186 | 189 | ||
| 187 | return ctx; | 190 | return ctx; |
| 188 | } | 191 | } |
| 192 | LCRYPTO_ALIAS(HMAC_CTX_new) | ||
| 189 | 193 | ||
| 190 | void | 194 | void |
| 191 | HMAC_CTX_free(HMAC_CTX *ctx) | 195 | HMAC_CTX_free(HMAC_CTX *ctx) |
| @@ -197,6 +201,7 @@ HMAC_CTX_free(HMAC_CTX *ctx) | |||
| 197 | 201 | ||
| 198 | free(ctx); | 202 | free(ctx); |
| 199 | } | 203 | } |
| 204 | LCRYPTO_ALIAS(HMAC_CTX_free) | ||
| 200 | 205 | ||
| 201 | int | 206 | int |
| 202 | HMAC_CTX_reset(HMAC_CTX *ctx) | 207 | HMAC_CTX_reset(HMAC_CTX *ctx) |
| @@ -231,6 +236,7 @@ HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx) | |||
| 231 | err: | 236 | err: |
| 232 | return 0; | 237 | return 0; |
| 233 | } | 238 | } |
| 239 | LCRYPTO_ALIAS(HMAC_CTX_copy) | ||
| 234 | 240 | ||
| 235 | void | 241 | void |
| 236 | HMAC_CTX_cleanup(HMAC_CTX *ctx) | 242 | HMAC_CTX_cleanup(HMAC_CTX *ctx) |
| @@ -248,12 +254,14 @@ HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags) | |||
| 248 | EVP_MD_CTX_set_flags(&ctx->o_ctx, flags); | 254 | EVP_MD_CTX_set_flags(&ctx->o_ctx, flags); |
| 249 | EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); | 255 | EVP_MD_CTX_set_flags(&ctx->md_ctx, flags); |
| 250 | } | 256 | } |
| 257 | LCRYPTO_ALIAS(HMAC_CTX_set_flags) | ||
| 251 | 258 | ||
| 252 | const EVP_MD * | 259 | const EVP_MD * |
| 253 | HMAC_CTX_get_md(const HMAC_CTX *ctx) | 260 | HMAC_CTX_get_md(const HMAC_CTX *ctx) |
| 254 | { | 261 | { |
| 255 | return ctx->md; | 262 | return ctx->md; |
| 256 | } | 263 | } |
| 264 | LCRYPTO_ALIAS(HMAC_CTX_get_md) | ||
| 257 | 265 | ||
| 258 | unsigned char * | 266 | unsigned char * |
| 259 | HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, | 267 | HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, |
| @@ -282,3 +290,4 @@ err: | |||
| 282 | HMAC_CTX_cleanup(&c); | 290 | HMAC_CTX_cleanup(&c); |
| 283 | return NULL; | 291 | return NULL; |
| 284 | } | 292 | } |
| 293 | LCRYPTO_ALIAS(HMAC) | ||
