summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/OPENSSL_malloc.3
diff options
context:
space:
mode:
authorderaadt <>2016-11-29 18:16:09 +0000
committerderaadt <>2016-11-29 18:16:09 +0000
commita7b5951b864e40c785589bc521ac5029cc8b72fa (patch)
tree5829c82f8142a6fa1bf9040a6070d85ec5d71fc3 /src/lib/libcrypto/man/OPENSSL_malloc.3
parent89bdb96f757f9b8cebac7c925883617dee11e7d3 (diff)
downloadopenbsd-a7b5951b864e40c785589bc521ac5029cc8b72fa.tar.gz
openbsd-a7b5951b864e40c785589bc521ac5029cc8b72fa.tar.bz2
openbsd-a7b5951b864e40c785589bc521ac5029cc8b72fa.zip
seperate these descriptions into seperate files to reduce confusion.
discussed with jsing ok schwarze
Diffstat (limited to 'src/lib/libcrypto/man/OPENSSL_malloc.3')
-rw-r--r--src/lib/libcrypto/man/OPENSSL_malloc.3100
1 files changed, 8 insertions, 92 deletions
diff --git a/src/lib/libcrypto/man/OPENSSL_malloc.3 b/src/lib/libcrypto/man/OPENSSL_malloc.3
index 71313ce7c8..0b762f66b6 100644
--- a/src/lib/libcrypto/man/OPENSSL_malloc.3
+++ b/src/lib/libcrypto/man/OPENSSL_malloc.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: OPENSSL_malloc.3,v 1.2 2016/11/29 07:29:52 jmc Exp $ 1.\" $OpenBSD: OPENSSL_malloc.3,v 1.3 2016/11/29 18:16:09 deraadt Exp $
2.\" 2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -22,16 +22,10 @@
22.Nm OPENSSL_realloc , 22.Nm OPENSSL_realloc ,
23.Nm OPENSSL_free , 23.Nm OPENSSL_free ,
24.Nm OPENSSL_strdup , 24.Nm OPENSSL_strdup ,
25.Nm OPENSSL_cleanse ,
26.Nm CRYPTO_malloc , 25.Nm CRYPTO_malloc ,
27.Nm CRYPTO_realloc , 26.Nm CRYPTO_realloc ,
28.Nm CRYPTO_free , 27.Nm CRYPTO_free ,
29.Nm CRYPTO_strdup , 28.Nm CRYPTO_strdup ,
30.Nm CRYPTO_get_mem_functions ,
31.Nm CRYPTO_set_mem_functions ,
32.Nm CRYPTO_mem_ctrl ,
33.Nm CRYPTO_mem_leaks ,
34.Nm CRYPTO_mem_leaks_fp
35.Nd legacy OpenSSL memory allocation wrappers 29.Nd legacy OpenSSL memory allocation wrappers
36.Sh SYNOPSIS 30.Sh SYNOPSIS
37.In openssl/crypto.h 31.In openssl/crypto.h
@@ -52,11 +46,6 @@
52.Fo OPENSSL_strdup 46.Fo OPENSSL_strdup
53.Fa "const char *str" 47.Fa "const char *str"
54.Fc 48.Fc
55.Ft void
56.Fo OPENSSL_cleanse
57.Fa "void *ptr"
58.Fa "size_t len"
59.Fc
60.Ft void * 49.Ft void *
61.Fo CRYPTO_malloc 50.Fo CRYPTO_malloc
62.Fa "size_t num" 51.Fa "size_t num"
@@ -82,91 +71,18 @@
82.Fa "const char *file" 71.Fa "const char *file"
83.Fa "int line" 72.Fa "int line"
84.Fc 73.Fc
85.Ft void
86.Fo CRYPTO_get_mem_functions
87.Fa "void *(**m)(size_t)"
88.Fa "void *(**r)(void *, size_t)"
89.Fa "void (**f)(void *)"
90.Fc
91.Ft int
92.Fo CRYPTO_set_mem_functions
93.Fa "void *(*m)(size_t)"
94.Fa "void *(*r)(void *, size_t)"
95.Fa "void (*f)(void *)"
96.Fc
97.Ft int
98.Fo CRYPTO_mem_ctrl
99.Fa "int mode"
100.Fc
101.Ft void
102.Fo CRYPTO_mem_leaks
103.Fa "BIO *b"
104.Fc
105.Ft void
106.Fo CRYPTO_mem_leaks_fp
107.Fa "FILE *fp"
108.Fc
109.Sh DESCRIPTION 74.Sh DESCRIPTION
110Do not use any of the interfaces documented here. 75Do not use any of the interfaces documented here in new code.
111They are provided purely for compatibility with legacy application code. 76They are provided purely for compatibility with legacy application code.
112.Pp 77.Pp
113.Fn OPENSSL_malloc , 78All 8 of these functions are wrappers around the corresponding
114.Fn OPENSSL_realloc , 79standard
115.Fn OPENSSL_free ,
116and
117.Fn OPENSSL_strdup
118have the same semantics as
119.Xr malloc 3 ,
120.Xr realloc 3 ,
121.Xr free 3 ,
122and
123.Xr strdup 3 .
124They are wrapper macros around
125.Fn CRYPTO_malloc ,
126.Fn CRYPTO_realloc ,
127.Fn CRYPTO_free ,
128and
129.Fn CRYPTO_strdup ,
130which in turn are wrapper functions around
131.Xr malloc 3 , 80.Xr malloc 3 ,
132.Xr realloc 3 , 81.Xr realloc 3 ,
133.Xr free 3 , 82.Xr free 3 ,
134and 83and
135.Xr strdup 3 . 84.Xr strdup 3
136.Pp 85functions.
137.Fn OPENSSL_cleanse
138has the same semantics as and is a wrapper around
139.Xr explicit_bzero 3 .
140.Pp
141.Fn CRYPTO_get_mem_functions
142assigns pointers to the C library functions
143.Xr malloc 3 ,
144.Xr realloc 3 ,
145and
146.Xr free 3
147to those of its arguments that are not
148.Dv NULL .
149.Pp
150.Fn CRYPTO_set_mem_functions ,
151.Fn CRYPTO_mem_ctrl ,
152.Fn CRYPTO_mem_leaks ,
153and
154.Fn CRYPTO_mem_leaks_fp
155have no effect.
156.Sh RETURN VALUES 86.Sh RETURN VALUES
157.Fn OPENSSL_malloc , 87These functions return same type and value as the corresponding
158.Fn OPENSSL_realloc , 88standard functions.
159.Fn CRYPTO_malloc ,
160.Fn CRYPTO_realloc ,
161and
162.Fn OPENSSL_strdup
163return a pointer to allocated memory or
164.Dv NULL
165on error.
166.Pp
167.Fn CRYPTO_set_mem_functions
168always returns 0.
169.Pp
170.Fn CRYPTO_mem_ctrl
171always returns
172.Dv CRYPTO_MEM_CHECK_OFF .