diff options
Diffstat (limited to 'src/lib/libcrypto/evp/digest.c')
-rw-r--r-- | src/lib/libcrypto/evp/digest.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c index 7c129f025d..6615aa4a35 100644 --- a/src/lib/libcrypto/evp/digest.c +++ b/src/lib/libcrypto/evp/digest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: digest.c,v 1.36 2022/12/26 07:18:52 jmc Exp $ */ | 1 | /* $OpenBSD: digest.c,v 1.37 2023/07/07 13:54:45 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 | * |
@@ -130,6 +130,7 @@ EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type) | |||
130 | EVP_MD_CTX_init(ctx); | 130 | EVP_MD_CTX_init(ctx); |
131 | return EVP_DigestInit_ex(ctx, type, NULL); | 131 | return EVP_DigestInit_ex(ctx, type, NULL); |
132 | } | 132 | } |
133 | LCRYPTO_ALIAS(EVP_DigestInit); | ||
133 | 134 | ||
134 | int | 135 | int |
135 | EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) | 136 | EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) |
@@ -211,12 +212,14 @@ skip_to_init: | |||
211 | return 1; | 212 | return 1; |
212 | return ctx->digest->init(ctx); | 213 | return ctx->digest->init(ctx); |
213 | } | 214 | } |
215 | LCRYPTO_ALIAS(EVP_DigestInit_ex); | ||
214 | 216 | ||
215 | int | 217 | int |
216 | EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count) | 218 | EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count) |
217 | { | 219 | { |
218 | return ctx->update(ctx, data, count); | 220 | return ctx->update(ctx, data, count); |
219 | } | 221 | } |
222 | LCRYPTO_ALIAS(EVP_DigestUpdate); | ||
220 | 223 | ||
221 | /* The caller can assume that this removes any secret data from the context */ | 224 | /* The caller can assume that this removes any secret data from the context */ |
222 | int | 225 | int |
@@ -228,6 +231,7 @@ EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | |||
228 | EVP_MD_CTX_cleanup(ctx); | 231 | EVP_MD_CTX_cleanup(ctx); |
229 | return ret; | 232 | return ret; |
230 | } | 233 | } |
234 | LCRYPTO_ALIAS(EVP_DigestFinal); | ||
231 | 235 | ||
232 | /* The caller can assume that this removes any secret data from the context */ | 236 | /* The caller can assume that this removes any secret data from the context */ |
233 | int | 237 | int |
@@ -249,6 +253,7 @@ EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) | |||
249 | memset(ctx->md_data, 0, ctx->digest->ctx_size); | 253 | memset(ctx->md_data, 0, ctx->digest->ctx_size); |
250 | return ret; | 254 | return ret; |
251 | } | 255 | } |
256 | LCRYPTO_ALIAS(EVP_DigestFinal_ex); | ||
252 | 257 | ||
253 | int | 258 | int |
254 | EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) | 259 | EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) |
@@ -256,6 +261,7 @@ EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) | |||
256 | EVP_MD_CTX_init(out); | 261 | EVP_MD_CTX_init(out); |
257 | return EVP_MD_CTX_copy_ex(out, in); | 262 | return EVP_MD_CTX_copy_ex(out, in); |
258 | } | 263 | } |
264 | LCRYPTO_ALIAS(EVP_MD_CTX_copy); | ||
259 | 265 | ||
260 | int | 266 | int |
261 | EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) | 267 | EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) |
@@ -318,6 +324,7 @@ EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) | |||
318 | 324 | ||
319 | return 1; | 325 | return 1; |
320 | } | 326 | } |
327 | LCRYPTO_ALIAS(EVP_MD_CTX_copy_ex); | ||
321 | 328 | ||
322 | int | 329 | int |
323 | EVP_Digest(const void *data, size_t count, | 330 | EVP_Digest(const void *data, size_t count, |
@@ -335,12 +342,14 @@ EVP_Digest(const void *data, size_t count, | |||
335 | 342 | ||
336 | return ret; | 343 | return ret; |
337 | } | 344 | } |
345 | LCRYPTO_ALIAS(EVP_Digest); | ||
338 | 346 | ||
339 | EVP_MD_CTX * | 347 | EVP_MD_CTX * |
340 | EVP_MD_CTX_new(void) | 348 | EVP_MD_CTX_new(void) |
341 | { | 349 | { |
342 | return calloc(1, sizeof(EVP_MD_CTX)); | 350 | return calloc(1, sizeof(EVP_MD_CTX)); |
343 | } | 351 | } |
352 | LCRYPTO_ALIAS(EVP_MD_CTX_new); | ||
344 | 353 | ||
345 | void | 354 | void |
346 | EVP_MD_CTX_free(EVP_MD_CTX *ctx) | 355 | EVP_MD_CTX_free(EVP_MD_CTX *ctx) |
@@ -352,30 +361,35 @@ EVP_MD_CTX_free(EVP_MD_CTX *ctx) | |||
352 | 361 | ||
353 | free(ctx); | 362 | free(ctx); |
354 | } | 363 | } |
364 | LCRYPTO_ALIAS(EVP_MD_CTX_free); | ||
355 | 365 | ||
356 | void | 366 | void |
357 | EVP_MD_CTX_init(EVP_MD_CTX *ctx) | 367 | EVP_MD_CTX_init(EVP_MD_CTX *ctx) |
358 | { | 368 | { |
359 | memset(ctx, 0, sizeof(*ctx)); | 369 | memset(ctx, 0, sizeof(*ctx)); |
360 | } | 370 | } |
371 | LCRYPTO_ALIAS(EVP_MD_CTX_init); | ||
361 | 372 | ||
362 | int | 373 | int |
363 | EVP_MD_CTX_reset(EVP_MD_CTX *ctx) | 374 | EVP_MD_CTX_reset(EVP_MD_CTX *ctx) |
364 | { | 375 | { |
365 | return EVP_MD_CTX_cleanup(ctx); | 376 | return EVP_MD_CTX_cleanup(ctx); |
366 | } | 377 | } |
378 | LCRYPTO_ALIAS(EVP_MD_CTX_reset); | ||
367 | 379 | ||
368 | EVP_MD_CTX * | 380 | EVP_MD_CTX * |
369 | EVP_MD_CTX_create(void) | 381 | EVP_MD_CTX_create(void) |
370 | { | 382 | { |
371 | return EVP_MD_CTX_new(); | 383 | return EVP_MD_CTX_new(); |
372 | } | 384 | } |
385 | LCRYPTO_ALIAS(EVP_MD_CTX_create); | ||
373 | 386 | ||
374 | void | 387 | void |
375 | EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) | 388 | EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) |
376 | { | 389 | { |
377 | EVP_MD_CTX_free(ctx); | 390 | EVP_MD_CTX_free(ctx); |
378 | } | 391 | } |
392 | LCRYPTO_ALIAS(EVP_MD_CTX_destroy); | ||
379 | 393 | ||
380 | /* This call frees resources associated with the context */ | 394 | /* This call frees resources associated with the context */ |
381 | int | 395 | int |
@@ -404,6 +418,7 @@ EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) | |||
404 | 418 | ||
405 | return 1; | 419 | return 1; |
406 | } | 420 | } |
421 | LCRYPTO_ALIAS(EVP_MD_CTX_cleanup); | ||
407 | 422 | ||
408 | int | 423 | int |
409 | EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr) | 424 | EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr) |
@@ -427,3 +442,4 @@ EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr) | |||
427 | } | 442 | } |
428 | return ret; | 443 | return ret; |
429 | } | 444 | } |
445 | LCRYPTO_ALIAS(EVP_MD_CTX_ctrl); | ||