diff options
Diffstat (limited to 'src/lib/libcrypto/crypto.h')
| -rw-r--r-- | src/lib/libcrypto/crypto.h | 80 |
1 files changed, 1 insertions, 79 deletions
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h index f37ec3106d..19732ced32 100644 --- a/src/lib/libcrypto/crypto.h +++ b/src/lib/libcrypto/crypto.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: crypto.h,v 1.65 2024/03/02 09:15:03 tb Exp $ */ | 1 | /* $OpenBSD: crypto.h,v 1.66 2024/03/02 11:28:46 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -272,26 +272,10 @@ DECLARE_STACK_OF(void) | |||
| 272 | #endif | 272 | #endif |
| 273 | 273 | ||
| 274 | int CRYPTO_mem_ctrl(int mode); | 274 | int CRYPTO_mem_ctrl(int mode); |
| 275 | int CRYPTO_is_mem_check_on(void); | ||
| 276 | |||
| 277 | /* for applications */ | ||
| 278 | #define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) | ||
| 279 | #define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) | ||
| 280 | 275 | ||
| 281 | #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,NULL,0) | 276 | #define OPENSSL_malloc(num) CRYPTO_malloc((int)num,NULL,0) |
| 282 | #define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0) | 277 | #define OPENSSL_strdup(str) CRYPTO_strdup((str),NULL,0) |
| 283 | #define OPENSSL_realloc(addr,num) \ | ||
| 284 | CRYPTO_realloc((char *)addr,(int)num,NULL,0) | ||
| 285 | #define OPENSSL_realloc_clean(addr,old_num,num) \ | ||
| 286 | CRYPTO_realloc_clean(addr,old_num,num,NULL,0) | ||
| 287 | #define OPENSSL_remalloc(addr,num) \ | ||
| 288 | CRYPTO_remalloc((char **)addr,(int)num,NULL,0) | ||
| 289 | #define OPENSSL_freeFunc CRYPTO_free | ||
| 290 | #define OPENSSL_free(addr) CRYPTO_free(addr) | 278 | #define OPENSSL_free(addr) CRYPTO_free(addr) |
| 291 | |||
| 292 | #define OPENSSL_malloc_locked(num) \ | ||
| 293 | CRYPTO_malloc_locked((int)num,NULL,0) | ||
| 294 | #define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr) | ||
| 295 | #endif | 279 | #endif |
| 296 | 280 | ||
| 297 | const char *OpenSSL_version(int type); | 281 | const char *OpenSSL_version(int type); |
| @@ -376,87 +360,25 @@ void (*CRYPTO_get_dynlock_destroy_callback(void))(struct CRYPTO_dynlock_value *l | |||
| 376 | /* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- | 360 | /* CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- |
| 377 | * call the latter last if you need different functions */ | 361 | * call the latter last if you need different functions */ |
| 378 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *)); | 362 | int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), void (*f)(void *)); |
| 379 | int CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*free_func)(void *)); | ||
| 380 | int CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), | 363 | int CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), |
| 381 | void *(*r)(void *, size_t, const char *, int), void (*f)(void *)); | 364 | void *(*r)(void *, size_t, const char *, int), void (*f)(void *)); |
| 382 | int CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int), | ||
| 383 | void (*free_func)(void *)); | ||
| 384 | int CRYPTO_set_mem_debug_functions( | ||
| 385 | void (*m)(void *, int, const char *, int, int), | ||
| 386 | void (*r)(void *, void *, int, const char *, int, int), | ||
| 387 | void (*f)(void *, int), void (*so)(long), long (*go)(void)); | ||
| 388 | void CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t), | ||
| 389 | void (**f)(void *)); | ||
| 390 | void CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)); | ||
| 391 | void CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int), | ||
| 392 | void *(**r)(void *, size_t, const char *, int), void (**f)(void *)); | ||
| 393 | void CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int), | ||
| 394 | void (**f)(void *)); | ||
| 395 | void CRYPTO_get_mem_debug_functions( | ||
| 396 | void (**m)(void *, int, const char *, int, int), | ||
| 397 | void (**r)(void *, void *, int, const char *, int, int), | ||
| 398 | void (**f)(void *, int), void (**so)(long), long (**go)(void)); | ||
| 399 | 365 | ||
| 400 | #ifndef LIBRESSL_INTERNAL | 366 | #ifndef LIBRESSL_INTERNAL |
| 401 | void *CRYPTO_malloc_locked(int num, const char *file, int line); | ||
| 402 | void CRYPTO_free_locked(void *ptr); | ||
| 403 | void *CRYPTO_malloc(int num, const char *file, int line); | 367 | void *CRYPTO_malloc(int num, const char *file, int line); |
| 404 | char *CRYPTO_strdup(const char *str, const char *file, int line); | 368 | char *CRYPTO_strdup(const char *str, const char *file, int line); |
| 405 | void CRYPTO_free(void *ptr); | 369 | void CRYPTO_free(void *ptr); |
| 406 | void *CRYPTO_realloc(void *addr, int num, const char *file, int line); | ||
| 407 | #endif | 370 | #endif |
| 408 | 371 | ||
| 409 | void *CRYPTO_realloc_clean(void *addr, int old_num, int num, | ||
| 410 | const char *file, int line); | ||
| 411 | void *CRYPTO_remalloc(void *addr, int num, const char *file, int line); | ||
| 412 | |||
| 413 | #ifndef LIBRESSL_INTERNAL | 372 | #ifndef LIBRESSL_INTERNAL |
| 414 | void OPENSSL_cleanse(void *ptr, size_t len); | 373 | void OPENSSL_cleanse(void *ptr, size_t len); |
| 415 | #endif | 374 | #endif |
| 416 | 375 | ||
| 417 | void CRYPTO_set_mem_debug_options(long bits); | ||
| 418 | long CRYPTO_get_mem_debug_options(void); | ||
| 419 | |||
| 420 | #define CRYPTO_push_info(info) \ | 376 | #define CRYPTO_push_info(info) \ |
| 421 | CRYPTO_push_info_(info, NULL, 0); | 377 | CRYPTO_push_info_(info, NULL, 0); |
| 422 | int CRYPTO_push_info_(const char *info, const char *file, int line); | 378 | int CRYPTO_push_info_(const char *info, const char *file, int line); |
| 423 | int CRYPTO_pop_info(void); | 379 | int CRYPTO_pop_info(void); |
| 424 | int CRYPTO_remove_all_info(void); | 380 | int CRYPTO_remove_all_info(void); |
| 425 | 381 | ||
| 426 | |||
| 427 | /* Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro; | ||
| 428 | * used as default in CRYPTO_MDEBUG compilations): */ | ||
| 429 | /* The last argument has the following significance: | ||
| 430 | * | ||
| 431 | * 0: called before the actual memory allocation has taken place | ||
| 432 | * 1: called after the actual memory allocation has taken place | ||
| 433 | */ | ||
| 434 | void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line, int before_p) | ||
| 435 | __attribute__ ((deprecated)); | ||
| 436 | void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file, int line, int before_p) | ||
| 437 | __attribute__ ((deprecated)); | ||
| 438 | void CRYPTO_dbg_free(void *addr, int before_p) | ||
| 439 | __attribute__ ((deprecated)); | ||
| 440 | /* Tell the debugging code about options. By default, the following values | ||
| 441 | * apply: | ||
| 442 | * | ||
| 443 | * 0: Clear all options. | ||
| 444 | * V_CRYPTO_MDEBUG_TIME (1): Set the "Show Time" option. | ||
| 445 | * V_CRYPTO_MDEBUG_THREAD (2): Set the "Show Thread Number" option. | ||
| 446 | * V_CRYPTO_MDEBUG_ALL (3): 1 + 2 | ||
| 447 | */ | ||
| 448 | void CRYPTO_dbg_set_options(long bits) | ||
| 449 | __attribute__ ((deprecated)); | ||
| 450 | long CRYPTO_dbg_get_options(void) | ||
| 451 | __attribute__ ((deprecated)); | ||
| 452 | |||
| 453 | |||
| 454 | int CRYPTO_mem_leaks_fp(FILE *); | ||
| 455 | int CRYPTO_mem_leaks(struct bio_st *bio); | ||
| 456 | /* unsigned long order, char *file, int line, int num_bytes, char *addr */ | ||
| 457 | typedef int *CRYPTO_MEM_LEAK_CB(unsigned long, const char *, int, int, void *); | ||
| 458 | int CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb); | ||
| 459 | |||
| 460 | /* | 382 | /* |
| 461 | * Because this is a public header, use a portable method of indicating the | 383 | * Because this is a public header, use a portable method of indicating the |
| 462 | * function does not return, rather than __dead. | 384 | * function does not return, rather than __dead. |
