diff options
Diffstat (limited to 'src/lib/libcrypto/crypto_memory.c')
| -rw-r--r-- | src/lib/libcrypto/crypto_memory.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/lib/libcrypto/crypto_memory.c b/src/lib/libcrypto/crypto_memory.c new file mode 100644 index 0000000000..e294b11fa3 --- /dev/null +++ b/src/lib/libcrypto/crypto_memory.c | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | /* $OpenBSD: crypto_memory.c,v 1.1 2024/11/06 04:08:26 tb Exp $ */ | ||
| 2 | /* | ||
| 3 | * Copyright (c) 2014 Bob Beck | ||
| 4 | * | ||
| 5 | * Permission to use, copy, modify, and distribute this software for any | ||
| 6 | * purpose with or without fee is hereby granted, provided that the above | ||
| 7 | * copyright notice and this permission notice appear in all copies. | ||
| 8 | * | ||
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | */ | ||
| 17 | #include <stdio.h> | ||
| 18 | #include <stdlib.h> | ||
| 19 | #include <string.h> | ||
| 20 | |||
| 21 | #include <openssl/crypto.h> | ||
| 22 | |||
| 23 | int | ||
| 24 | CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), | ||
| 25 | void (*f)(void *)) | ||
| 26 | { | ||
| 27 | return 0; | ||
| 28 | } | ||
| 29 | LCRYPTO_ALIAS(CRYPTO_set_mem_functions); | ||
| 30 | |||
| 31 | int | ||
| 32 | CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), | ||
| 33 | void *(*r)(void *, size_t, const char *, int), void (*f)(void *)) | ||
| 34 | { | ||
| 35 | return 0; | ||
| 36 | } | ||
| 37 | LCRYPTO_ALIAS(CRYPTO_set_mem_ex_functions); | ||
| 38 | |||
| 39 | void * | ||
| 40 | CRYPTO_malloc(size_t num, const char *file, int line) | ||
| 41 | { | ||
| 42 | return malloc(num); | ||
| 43 | } | ||
| 44 | LCRYPTO_ALIAS(CRYPTO_malloc); | ||
| 45 | |||
| 46 | char * | ||
| 47 | CRYPTO_strdup(const char *str, const char *file, int line) | ||
| 48 | { | ||
| 49 | return strdup(str); | ||
| 50 | } | ||
| 51 | LCRYPTO_ALIAS(CRYPTO_strdup); | ||
| 52 | |||
| 53 | void | ||
| 54 | CRYPTO_free(void *ptr, const char *file, int line) | ||
| 55 | { | ||
| 56 | free(ptr); | ||
| 57 | } | ||
| 58 | LCRYPTO_ALIAS(CRYPTO_free); | ||
