1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
.\" $OpenBSD: CRYPTO_get_mem_functions.3,v 1.6 2018/08/24 19:17:38 tb Exp $
.\"
.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: August 24 2018 $
.Dt CRYPTO_GET_MEM_FUNCTIONS 3
.Os
.Sh NAME
.Nm CRYPTO_get_mem_functions ,
.Nm CRYPTO_set_mem_functions ,
.Nm CRYPTO_mem_ctrl ,
.Nm CRYPTO_mem_leaks ,
.Nm CRYPTO_mem_leaks_fp ,
.Nm CRYPTO_mem_leaks_cb
.Nd legacy OpenSSL memory allocation control
.Sh SYNOPSIS
.In openssl/crypto.h
.Ft void
.Fo CRYPTO_get_mem_functions
.Fa "void *(**m)(size_t)"
.Fa "void *(**r)(void *, size_t)"
.Fa "void (**f)(void *)"
.Fc
.Ft int
.Fo CRYPTO_set_mem_functions
.Fa "void *(*m)(size_t)"
.Fa "void *(*r)(void *, size_t)"
.Fa "void (*f)(void *)"
.Fc
.Ft int
.Fo CRYPTO_mem_ctrl
.Fa "int mode"
.Fc
.Ft int
.Fo CRYPTO_mem_leaks
.Fa "BIO *b"
.Fc
.Ft int
.Fo CRYPTO_mem_leaks_fp
.Fa "FILE *fp"
.Fc
.Ft typedef int *
.Fo CRYPTO_MEM_LEAK_CB
.Fa "unsigned long"
.Fa "const char *"
.Fa int
.Fa int
.Fa "void *"
.Fc
.Ft int
.Fo CRYPTO_mem_leaks_cb
.Fa "CRYPTO_MEM_LEAK_CB *cb"
.Fc
.Sh DESCRIPTION
Do not use any of the interfaces documented here.
They are provided purely for compatibility with legacy application code.
.Pp
.Fn CRYPTO_get_mem_functions
assigns pointers to the C library functions
.Xr malloc 3 ,
.Xr realloc 3 ,
and
.Xr free 3
to those of its arguments that are not
.Dv NULL .
.Pp
.Fn CRYPTO_set_mem_functions ,
.Fn CRYPTO_mem_ctrl ,
.Fn CRYPTO_mem_leaks ,
.Fn CRYPTO_mem_leaks_fp ,
and
.Fn CRYPTO_mem_leaks_cb
have no effect.
.Sh RETURN VALUES
.Fn CRYPTO_set_mem_functions
always returns 0.
.Pp
.Fn CRYPTO_mem_ctrl
always returns
.Dv CRYPTO_MEM_CHECK_OFF .
.Pp
.Fn CRYPTO_mem_leaks ,
.Fn CRYPTO_mem_leaks_fp ,
and
.Fn CRYPTO_mem_leaks_cb
always return -1.
.Sh HISTORY
.Fn CRYPTO_mem_ctrl ,
.Fn CRYPTO_mem_leaks ,
and
.Fn CRYPTO_mem_leaks_fp
first appeared in SSLeay 0.6.4.
.Fn CRYPTO_get_mem_functions
and
.Fn CRYPTO_set_mem_functions
first appeared in SSLeay 0.6.5.
.Fn CRYPTO_mem_leaks_cb
first appeared in SSLeay 0.6.6.
All these functions have all been available since
.Ox 2.4 .
|