summaryrefslogtreecommitdiff
path: root/src/lib
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
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')
-rw-r--r--src/lib/libcrypto/man/CRYPTO_get_mem_functions.379
-rw-r--r--src/lib/libcrypto/man/Makefile6
-rw-r--r--src/lib/libcrypto/man/OPENSSL_cleanse.337
-rw-r--r--src/lib/libcrypto/man/OPENSSL_malloc.3100
4 files changed, 128 insertions, 94 deletions
diff --git a/src/lib/libcrypto/man/CRYPTO_get_mem_functions.3 b/src/lib/libcrypto/man/CRYPTO_get_mem_functions.3
new file mode 100644
index 0000000000..a0bfb8a1d5
--- /dev/null
+++ b/src/lib/libcrypto/man/CRYPTO_get_mem_functions.3
@@ -0,0 +1,79 @@
1.\" $OpenBSD: CRYPTO_get_mem_functions.3,v 1.1 2016/11/29 18:16:09 deraadt Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
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.Dd $Mdocdate: November 29 2016 $
18.Dt CRYPTO_get_mem_functions 3
19.Os
20.Sh NAME
21.Nm CRYPTO_get_mem_functions ,
22.Nm CRYPTO_set_mem_functions ,
23.Nm CRYPTO_mem_ctrl ,
24.Nm CRYPTO_mem_leaks ,
25.Nm CRYPTO_mem_leaks_fp
26.Nd legacy OpenSSL memory allocation control
27.Sh SYNOPSIS
28.In openssl/crypto.h
29.Ft void
30.Fo CRYPTO_get_mem_functions
31.Fa "void *(**m)(size_t)"
32.Fa "void *(**r)(void *, size_t)"
33.Fa "void (**f)(void *)"
34.Fc
35.Ft int
36.Fo CRYPTO_set_mem_functions
37.Fa "void *(*m)(size_t)"
38.Fa "void *(*r)(void *, size_t)"
39.Fa "void (*f)(void *)"
40.Fc
41.Ft int
42.Fo CRYPTO_mem_ctrl
43.Fa "int mode"
44.Fc
45.Ft void
46.Fo CRYPTO_mem_leaks
47.Fa "BIO *b"
48.Fc
49.Ft void
50.Fo CRYPTO_mem_leaks_fp
51.Fa "FILE *fp"
52.Fc
53.Sh DESCRIPTION
54Do not use any of the interfaces documented here.
55They are provided purely for compatibility with legacy application code.
56.Pp
57.Fn CRYPTO_get_mem_functions
58assigns pointers to the C library functions
59.Xr malloc 3 ,
60.Xr realloc 3 ,
61and
62.Xr free 3
63to those of its arguments that are not
64.Dv NULL.
65.Pp
66.Fn CRYPTO_set_mem_functions ,
67.Fn CRYPTO_mem_ctrl ,
68.Fn CRYPTO_mem_leaks ,
69and
70.Fn CRYPTO_mem_leaks_fp
71have no effect.
72.Sh RETURN VALUES
73.Pp
74.Fn CRYPTO_set_mem_functions
75always returns 0.
76.Pp
77.Fn CRYPTO_mem_ctrl
78always returns
79.Dv CRYPTO_MEM_CHECK_OFF .
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index afec15edbf..f6dd178a0c 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.60 2016/11/29 00:07:45 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.61 2016/11/29 18:16:09 deraadt Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -57,6 +57,7 @@ MAN= \
57 BUF_MEM_new.3 \ 57 BUF_MEM_new.3 \
58 CONF_modules_free.3 \ 58 CONF_modules_free.3 \
59 CONF_modules_load_file.3 \ 59 CONF_modules_load_file.3 \
60 CRYPTO_get_mem_functions.3 \
60 CRYPTO_set_ex_data.3 \ 61 CRYPTO_set_ex_data.3 \
61 CRYPTO_set_locking_callback.3 \ 62 CRYPTO_set_locking_callback.3 \
62 DES_set_key.3 \ 63 DES_set_key.3 \
@@ -76,13 +77,13 @@ MAN= \
76 DSA_set_method.3 \ 77 DSA_set_method.3 \
77 DSA_sign.3 \ 78 DSA_sign.3 \
78 DSA_size.3 \ 79 DSA_size.3 \
80 ECDSA_SIG_new.3 \
79 EC_GFp_simple_method.3 \ 81 EC_GFp_simple_method.3 \
80 EC_GROUP_copy.3 \ 82 EC_GROUP_copy.3 \
81 EC_GROUP_new.3 \ 83 EC_GROUP_new.3 \
82 EC_KEY_new.3 \ 84 EC_KEY_new.3 \
83 EC_POINT_add.3 \ 85 EC_POINT_add.3 \
84 EC_POINT_new.3 \ 86 EC_POINT_new.3 \
85 ECDSA_SIG_new.3 \
86 ERR.3 \ 87 ERR.3 \
87 ERR_GET_LIB.3 \ 88 ERR_GET_LIB.3 \
88 ERR_clear_error.3 \ 89 ERR_clear_error.3 \
@@ -129,6 +130,7 @@ MAN= \
129 OCSP_response_status.3 \ 130 OCSP_response_status.3 \
130 OCSP_sendreq_new.3 \ 131 OCSP_sendreq_new.3 \
131 OPENSSL_VERSION_NUMBER.3 \ 132 OPENSSL_VERSION_NUMBER.3 \
133 OPENSSL_cleanse.3 \
132 OPENSSL_config.3 \ 134 OPENSSL_config.3 \
133 OPENSSL_load_builtin_modules.3 \ 135 OPENSSL_load_builtin_modules.3 \
134 OPENSSL_malloc.3 \ 136 OPENSSL_malloc.3 \
diff --git a/src/lib/libcrypto/man/OPENSSL_cleanse.3 b/src/lib/libcrypto/man/OPENSSL_cleanse.3
new file mode 100644
index 0000000000..b8fc7acad9
--- /dev/null
+++ b/src/lib/libcrypto/man/OPENSSL_cleanse.3
@@ -0,0 +1,37 @@
1.\" $OpenBSD: OPENSSL_cleanse.3,v 1.1 2016/11/29 18:16:09 deraadt Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
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.Dd $Mdocdate: November 29 2016 $
18.Dt OPENSSL_cleanse 3
19.Os
20.Sh NAME
21.Nm OPENSSL_cleanse
22.Nd OpenSSL memory cleaning operation
23.Sh SYNOPSIS
24.In openssl/crypto.h
25.Fc
26.Ft void
27.Fo OPENSSL_cleanse
28.Fa "void *ptr"
29.Fa "size_t len"
30.Fc
31.Sh DESCRIPTION
32Do not use any of the interfaces documented here.
33They are provided purely for compatibility with legacy application code.
34.Pp
35.Fn OPENSSL_cleanse
36has the same semantics as and is a wrapper around
37.Xr explicit_bzero 3 .
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 .