summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/malloc-wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/malloc-wrapper.c')
-rw-r--r--src/lib/libcrypto/malloc-wrapper.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libcrypto/malloc-wrapper.c b/src/lib/libcrypto/malloc-wrapper.c
index cb9a31186d..4d57f00b23 100644
--- a/src/lib/libcrypto/malloc-wrapper.c
+++ b/src/lib/libcrypto/malloc-wrapper.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: malloc-wrapper.c,v 1.7 2018/05/13 13:49:04 jsing Exp $ */ 1/* $OpenBSD: malloc-wrapper.c,v 1.8 2023/07/08 08:28:23 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Bob Beck 3 * Copyright (c) 2014 Bob Beck
4 * 4 *
@@ -18,12 +18,15 @@
18#include <stdlib.h> 18#include <stdlib.h>
19#include <string.h> 19#include <string.h>
20 20
21#include <openssl/crypto.h>
22
21int 23int
22CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t), 24CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *, size_t),
23 void (*f)(void *)) 25 void (*f)(void *))
24{ 26{
25 return 0; 27 return 0;
26} 28}
29LCRYPTO_ALIAS(CRYPTO_set_mem_functions);
27 30
28int 31int
29CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int), 32CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int),
@@ -31,12 +34,14 @@ CRYPTO_set_mem_ex_functions(void *(*m)(size_t, const char *, int),
31{ 34{
32 return 0; 35 return 0;
33} 36}
37LCRYPTO_ALIAS(CRYPTO_set_mem_ex_functions);
34 38
35int 39int
36CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*f)(void *)) 40CRYPTO_set_locked_mem_functions(void *(*m)(size_t), void (*f)(void *))
37{ 41{
38 return 0; 42 return 0;
39} 43}
44LCRYPTO_ALIAS(CRYPTO_set_locked_mem_functions);
40 45
41int 46int
42CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int), 47CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int),
@@ -44,6 +49,7 @@ CRYPTO_set_locked_mem_ex_functions(void *(*m)(size_t, const char *, int),
44{ 49{
45 return 0; 50 return 0;
46} 51}
52LCRYPTO_ALIAS(CRYPTO_set_locked_mem_ex_functions);
47 53
48int 54int
49CRYPTO_set_mem_debug_functions(void (*m)(void *, int, const char *, int, int), 55CRYPTO_set_mem_debug_functions(void (*m)(void *, int, const char *, int, int),
@@ -52,6 +58,7 @@ CRYPTO_set_mem_debug_functions(void (*m)(void *, int, const char *, int, int),
52{ 58{
53 return 0; 59 return 0;
54} 60}
61LCRYPTO_ALIAS(CRYPTO_set_mem_debug_functions);
55 62
56 63
57void 64void
@@ -65,6 +72,7 @@ CRYPTO_get_mem_functions(void *(**m)(size_t), void *(**r)(void *, size_t),
65 if (f != NULL) 72 if (f != NULL)
66 *f = free; 73 *f = free;
67} 74}
75LCRYPTO_ALIAS(CRYPTO_get_mem_functions);
68 76
69void 77void
70CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int), 78CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int),
@@ -77,6 +85,7 @@ CRYPTO_get_mem_ex_functions(void *(**m)(size_t, const char *, int),
77 if (f != NULL) 85 if (f != NULL)
78 *f = free; 86 *f = free;
79} 87}
88LCRYPTO_ALIAS(CRYPTO_get_mem_ex_functions);
80 89
81void 90void
82CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *)) 91CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *))
@@ -86,6 +95,7 @@ CRYPTO_get_locked_mem_functions(void *(**m)(size_t), void (**f)(void *))
86 if (f != NULL) 95 if (f != NULL)
87 *f = free; 96 *f = free;
88} 97}
98LCRYPTO_ALIAS(CRYPTO_get_locked_mem_functions);
89 99
90void 100void
91CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int), 101CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int),
@@ -96,6 +106,7 @@ CRYPTO_get_locked_mem_ex_functions(void *(**m)(size_t, const char *, int),
96 if (f != NULL) 106 if (f != NULL)
97 *f = free; 107 *f = free;
98} 108}
109LCRYPTO_ALIAS(CRYPTO_get_locked_mem_ex_functions);
99 110
100void 111void
101CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int), 112CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int),
@@ -113,6 +124,7 @@ CRYPTO_get_mem_debug_functions(void (**m)(void *, int, const char *, int, int),
113 if (go != NULL) 124 if (go != NULL)
114 *go = NULL; 125 *go = NULL;
115} 126}
127LCRYPTO_ALIAS(CRYPTO_get_mem_debug_functions);
116 128
117 129
118void * 130void *
@@ -162,6 +174,7 @@ CRYPTO_realloc_clean(void *ptr, int old_len, int num, const char *file,
162 return NULL; 174 return NULL;
163 return recallocarray(ptr, old_len, num, 1); 175 return recallocarray(ptr, old_len, num, 1);
164} 176}
177LCRYPTO_ALIAS(CRYPTO_realloc_clean);
165 178
166void 179void
167CRYPTO_free(void *ptr) 180CRYPTO_free(void *ptr)
@@ -175,15 +188,18 @@ CRYPTO_remalloc(void *a, int num, const char *file, int line)
175 free(a); 188 free(a);
176 return malloc(num); 189 return malloc(num);
177} 190}
191LCRYPTO_ALIAS(CRYPTO_remalloc);
178 192
179void 193void
180CRYPTO_set_mem_debug_options(long bits) 194CRYPTO_set_mem_debug_options(long bits)
181{ 195{
182 return; 196 return;
183} 197}
198LCRYPTO_ALIAS(CRYPTO_set_mem_debug_options);
184 199
185long 200long
186CRYPTO_get_mem_debug_options(void) 201CRYPTO_get_mem_debug_options(void)
187{ 202{
188 return 0; 203 return 0;
189} 204}
205LCRYPTO_ALIAS(CRYPTO_get_mem_debug_options);