diff options
author | schwarze <> | 2015-11-11 21:15:15 +0000 |
---|---|---|
committer | schwarze <> | 2015-11-11 21:15:15 +0000 |
commit | 22f89c8c27130dce389c2cba215b4cdd0deadd22 (patch) | |
tree | df165a08270ef8df757ccda21dbd1c609633bd3f /src/lib | |
parent | 0241f6701aac0e95428b9f0899b07ba086aa7e71 (diff) | |
download | openbsd-22f89c8c27130dce389c2cba215b4cdd0deadd22.tar.gz openbsd-22f89c8c27130dce389c2cba215b4cdd0deadd22.tar.bz2 openbsd-22f89c8c27130dce389c2cba215b4cdd0deadd22.zip |
Convert five more manuals from POD to mdoc.
I found drafts of these in my tree, probably originally from
Max Fillinger, that just needed minor polishing.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/man/CONF_modules_free.3 | 56 | ||||
-rw-r--r-- | src/lib/libcrypto/man/CONF_modules_load_file.3 | 82 | ||||
-rw-r--r-- | src/lib/libcrypto/man/CRYPTO_set_ex_data.3 | 70 | ||||
-rw-r--r-- | src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 | 321 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/man/crypto.3 | 104 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/crypto/CONF_modules_free.pod | 47 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod | 60 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod | 56 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod | 210 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/crypto/crypto.pod | 85 |
11 files changed, 638 insertions, 463 deletions
diff --git a/src/lib/libcrypto/man/CONF_modules_free.3 b/src/lib/libcrypto/man/CONF_modules_free.3 new file mode 100644 index 0000000000..b09989d664 --- /dev/null +++ b/src/lib/libcrypto/man/CONF_modules_free.3 | |||
@@ -0,0 +1,56 @@ | |||
1 | .Dd $Mdocdate: November 11 2015 $ | ||
2 | .Dt CONF_MODULES_FREE 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm CONF_modules_free , | ||
6 | .Nm CONF_modules_finish , | ||
7 | .Nm CONF_modules_unload | ||
8 | .Nd OpenSSL configuration cleanup functions | ||
9 | .Sh SYNOPSIS | ||
10 | .In openssl/conf.h | ||
11 | .Ft void | ||
12 | .Fo CONF_modules_free | ||
13 | .Fa void | ||
14 | .Fc | ||
15 | .Ft void | ||
16 | .Fo CONF_modules_finish | ||
17 | .Fa void | ||
18 | .Fc | ||
19 | .Ft void | ||
20 | .Fo CONF_modules_unload | ||
21 | .Fa "int all" | ||
22 | .Fc | ||
23 | .Sh DESCRIPTION | ||
24 | .Fn CONF_modules_free | ||
25 | closes down and frees up all memory allocated by all configuration | ||
26 | modules. | ||
27 | .Pp | ||
28 | .Fn CONF_modules_finish | ||
29 | calls the configuration | ||
30 | .Sy finish | ||
31 | handler of each configuration module to free up any configuration | ||
32 | that module may have performed. | ||
33 | .Pp | ||
34 | .Fn CONF_modules_unload | ||
35 | finishes and unloads configuration modules. | ||
36 | If | ||
37 | .Fa all | ||
38 | is set to 0, only modules loaded from DSOs will be unloaded. | ||
39 | If | ||
40 | .Fa all | ||
41 | is 1, all modules, including builtin modules, will be unloaded. | ||
42 | .Sh NOTES | ||
43 | Normally applications will only call | ||
44 | .Fn CONF_modules_free | ||
45 | at application to tidy up any configuration performed. | ||
46 | .Sh RETURN VALUE | ||
47 | None of the functions return a value. | ||
48 | .Sh SEE ALSO | ||
49 | .Xr CONF_modules_load_file 3 , | ||
50 | .Xr OPENSSL_config 3 | ||
51 | .Sh HISTORY | ||
52 | .Fn CONF_modules_free , | ||
53 | .Fn CONF_modules_unload , | ||
54 | and | ||
55 | .Fn CONF_modules_finish | ||
56 | first appeared in OpenSSL 0.9.7. | ||
diff --git a/src/lib/libcrypto/man/CONF_modules_load_file.3 b/src/lib/libcrypto/man/CONF_modules_load_file.3 new file mode 100644 index 0000000000..b5de94411d --- /dev/null +++ b/src/lib/libcrypto/man/CONF_modules_load_file.3 | |||
@@ -0,0 +1,82 @@ | |||
1 | .Dd $Mdocdate: November 11 2015 $ | ||
2 | .Dt CONF_MODULES_LOAD_FILE 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm CONF_modules_load_file , | ||
6 | .Nm CONF_modules_load | ||
7 | .Nd OpenSSL configuration functions | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/conf.h | ||
10 | .Ft int | ||
11 | .Fo CONF_modules_load_file | ||
12 | .Fa "const char *filename" | ||
13 | .Fa "const char *appname" | ||
14 | .Fa "unsigned long flags" | ||
15 | .Fc | ||
16 | .Ft int | ||
17 | .Fo CONF_modules_load | ||
18 | .Fa "const CONF *cnf" | ||
19 | .Fa "const char *appname" | ||
20 | .Fa "unsigned long flags" | ||
21 | .Fc | ||
22 | .Sh DESCRIPTION | ||
23 | The function | ||
24 | .Fn CONF_modules_load_file | ||
25 | configures OpenSSL using file | ||
26 | .Fa filename | ||
27 | and application name | ||
28 | .Fa appname . | ||
29 | If | ||
30 | .Fa filename | ||
31 | is | ||
32 | .Dv NULL , | ||
33 | the standard OpenSSL configuration file is used. | ||
34 | If | ||
35 | .Fa appname | ||
36 | is | ||
37 | .Dv NULL , | ||
38 | the standard OpenSSL application name | ||
39 | .Qq openssl_conf | ||
40 | is used. | ||
41 | The behaviour can be cutomized using | ||
42 | .Fa flags . | ||
43 | .Pp | ||
44 | .Fn CONF_modules_load | ||
45 | is idential to | ||
46 | .Fn CONF_modules_load_file | ||
47 | except it reads configuration information from | ||
48 | .Fa cnf . | ||
49 | .Pp | ||
50 | The following | ||
51 | .Fa flags | ||
52 | are currently recognized: | ||
53 | .Bl -tag -width Ds | ||
54 | .It Dv CONF_MFLAGS_IGNORE_ERRORS | ||
55 | Ignore errors returned by individual configuration modules. | ||
56 | By default, the first module error is considered fatal and no further | ||
57 | modules are loaded. | ||
58 | .It Dv CONF_MFLAGS_SILENT | ||
59 | Do not add any error information. | ||
60 | By default, all module errors add error information to the error queue. | ||
61 | .It Dv CONF_MFLAGS_NO_DSO | ||
62 | Disable loading of configuration modules from DSOs. | ||
63 | .It Dv CONF_MFLAGS_IGNORE_MISSING_FILE | ||
64 | Let | ||
65 | .Fn CONF_modules_load_file | ||
66 | ignore missing configuration files. | ||
67 | By default, a missing configuration file returns an error. | ||
68 | .El | ||
69 | .Sh RETURN VALUES | ||
70 | These functions return 1 for success and zero or a negative value for | ||
71 | failure. | ||
72 | If module errors are not ignored, the return code will reflect the return | ||
73 | value of the failing module (this will always be zero or negative). | ||
74 | .Sh SEE ALSO | ||
75 | .Xr CONF_free 3 , | ||
76 | .Xr ERR 3 , | ||
77 | .Xr OPENSSL_config 3 | ||
78 | .Sh HISTORY | ||
79 | .Fn CONF_modules_load_file | ||
80 | and | ||
81 | .Fn CONF_modules_load | ||
82 | first appeared in OpenSSL 0.9.7. | ||
diff --git a/src/lib/libcrypto/man/CRYPTO_set_ex_data.3 b/src/lib/libcrypto/man/CRYPTO_set_ex_data.3 new file mode 100644 index 0000000000..1be42dedd9 --- /dev/null +++ b/src/lib/libcrypto/man/CRYPTO_set_ex_data.3 | |||
@@ -0,0 +1,70 @@ | |||
1 | .Dd $Mdocdate: November 11 2015 $ | ||
2 | .Dt CRYPTO_SET_EX_DATA 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm CRYPTO_set_ex_data , | ||
6 | .Nm CRYPTO_get_ex_data | ||
7 | .Nd internal application specific data functions | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/crypto.h | ||
10 | .Ft int | ||
11 | .Fo CRYPTO_set_ex_data | ||
12 | .Fa "CRYPTO_EX_DATA *r" | ||
13 | .Fa "int idx" | ||
14 | .Fa "void *arg" | ||
15 | .Fc | ||
16 | .Ft void * | ||
17 | .Fo CRYPTO_get_ex_data | ||
18 | .Fa "CRYPTO_EX_DATA *r" | ||
19 | .Fa "int idx" | ||
20 | .Fc | ||
21 | .Sh DESCRIPTION | ||
22 | Several OpenSSL structures can have application specific data attached | ||
23 | to them. | ||
24 | These functions are used internally by OpenSSL to manipulate application | ||
25 | specific data attached to a specific structure. | ||
26 | .Pp | ||
27 | These functions should only be used by applications to manipulate | ||
28 | .Vt CRYPTO_EX_DATA | ||
29 | structures passed to the | ||
30 | .Fn new_func , | ||
31 | .Fn free_func , | ||
32 | and | ||
33 | .Fn dup_func | ||
34 | callbacks: as passed to | ||
35 | .Xr RSA_get_ex_new_index 3 | ||
36 | for example. | ||
37 | .Pp | ||
38 | .Fn CRYPTO_set_ex_data | ||
39 | is used to set application specific data, the data is supplied in the | ||
40 | .Fa arg | ||
41 | parameter and its precise meaning is up to the application. | ||
42 | .Pp | ||
43 | .Fn CRYPTO_get_ex_data | ||
44 | is used to retrieve application specific data. | ||
45 | The data is returned to the application, this will be the same value as | ||
46 | supplied to a previous | ||
47 | .Fn CRYPTO_set_ex_data | ||
48 | call. | ||
49 | .Sh RETURN VALUES | ||
50 | .Fn CRYPTO_set_ex_data | ||
51 | returns 1 on success or 0 on failure. | ||
52 | .Pp | ||
53 | .Fn CRYPTO_get_ex_data | ||
54 | returns the application data or 0 on failure. | ||
55 | 0 may also be valid application data but currently it can only fail if | ||
56 | given an invalid | ||
57 | .Fa idx | ||
58 | parameter. | ||
59 | .Pp | ||
60 | On failure an error code can be obtained from | ||
61 | .Xr ERR_get_error 3 . | ||
62 | .Sh SEE ALSO | ||
63 | .Xr DH_get_ex_new_index 3 , | ||
64 | .Xr DSA_get_ex_new_index 3 , | ||
65 | .Xr RSA_get_ex_new_index 3 | ||
66 | .Sh HISTORY | ||
67 | .Fn CRYPTO_set_ex_data | ||
68 | and | ||
69 | .Fn CRYPTO_get_ex_data | ||
70 | have been available since SSLeay 0.9.0. | ||
diff --git a/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 b/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 new file mode 100644 index 0000000000..d6290852b5 --- /dev/null +++ b/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 | |||
@@ -0,0 +1,321 @@ | |||
1 | .Dd $Mdocdate: November 11 2015 $ | ||
2 | .Dt CRYPTO_SET_LOCKING_CALLBACK 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm CRYPTO_THREADID_set_callback , | ||
6 | .Nm CRYPTO_THREADID_get_callback , | ||
7 | .Nm CRYPTO_THREADID_current , | ||
8 | .Nm CRYPTO_THREADID_cmp , | ||
9 | .Nm CRYPTO_THREADID_cpy , | ||
10 | .Nm CRYPTO_THREADID_hash , | ||
11 | .Nm CRYPTO_set_locking_callback , | ||
12 | .Nm CRYPTO_num_locks , | ||
13 | .Nm CRYPTO_set_dynlock_create_callback , | ||
14 | .Nm CRYPTO_set_dynlock_lock_callback , | ||
15 | .Nm CRYPTO_set_dynlock_destroy_callback , | ||
16 | .Nm CRYPTO_get_new_dynlockid , | ||
17 | .Nm CRYPTO_destroy_dynlockid , | ||
18 | .Nm CRYPTO_lock | ||
19 | .Nd OpenSSL thread support | ||
20 | .Sh SYNOPSIS | ||
21 | .In openssl/crypto.h | ||
22 | .Bd -literal | ||
23 | /* Don't use this structure directly. */ | ||
24 | typedef struct crypto_threadid_st { | ||
25 | void *ptr; | ||
26 | unsigned long val; | ||
27 | } CRYPTO_THREADID; | ||
28 | /* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ | ||
29 | .Ed | ||
30 | .Pp | ||
31 | .Ft void | ||
32 | .Fo CRYPTO_THREADID_set_numeric | ||
33 | .Fa "CRYPTO_THREADID *id" | ||
34 | .Fa "unsigned long val" | ||
35 | .Fc | ||
36 | .Ft void | ||
37 | .Fo CRYPTO_THREADID_set_pointer | ||
38 | .Fa "CRYPTO_THREADID *id" | ||
39 | .Fa "void *ptr" | ||
40 | .Fc | ||
41 | .Ft int | ||
42 | .Fo CRYPTO_THREADID_set_callback | ||
43 | .Fa "void (*threadid_func)(CRYPTO_THREADID *)" | ||
44 | .Fc | ||
45 | .Ft void | ||
46 | .Fo "(*CRYPTO_THREADID_get_callback(void))" | ||
47 | .Fa "CRYPTO_THREADID *" | ||
48 | .Fc | ||
49 | .Ft void | ||
50 | .Fo CRYPTO_THREADID_current | ||
51 | .Fa "CRYPTO_THREADID *id" | ||
52 | .Fc | ||
53 | .Ft int | ||
54 | .Fo CRYPTO_THREADID_cmp | ||
55 | .Fa "const CRYPTO_THREADID *a" | ||
56 | .Fa "const CRYPTO_THREADID *b" | ||
57 | .Fc | ||
58 | .Ft void | ||
59 | .Fo CRYPTO_THREADID_cpy | ||
60 | .Fa "CRYPTO_THREADID *dest" | ||
61 | .Fa "const CRYPTO_THREADID *src" | ||
62 | .Fc | ||
63 | .Ft unsigned long | ||
64 | .Fo CRYPTO_THREADID_hash | ||
65 | .Fa "const CRYPTO_THREADID *id" | ||
66 | .Fc | ||
67 | .Ft int | ||
68 | .Fo CRYPTO_num_locks | ||
69 | .Fa void | ||
70 | .Fc | ||
71 | .Bd -literal | ||
72 | /* struct CRYPTO_dynlock_value needs to be defined by the user */ | ||
73 | struct CRYPTO_dynlock_value; | ||
74 | .Ed | ||
75 | .Pp | ||
76 | .Ft void | ||
77 | .Fo CRYPTO_set_dynlock_create_callback | ||
78 | .Fa "struct CRYPTO_dynlock_value *" | ||
79 | .Fa "(*dyn_create_function)(char *file, int line)" | ||
80 | .Fc | ||
81 | .Ft void | ||
82 | .Fo CRYPTO_set_dynlock_lock_callback | ||
83 | .Fa "void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l,\ | ||
84 | const char *file, int line)" | ||
85 | .Fc | ||
86 | .Ft void | ||
87 | .Fo CRYPTO_set_dynlock_destroy_callback | ||
88 | .Fa "void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l,\ | ||
89 | const char *file, int line)" | ||
90 | .Fc | ||
91 | .Ft int | ||
92 | .Fo CRYPTO_get_new_dynlockid | ||
93 | .Fa void | ||
94 | .Fc | ||
95 | .Ft void | ||
96 | .Fo CRYPTO_destroy_dynlockid | ||
97 | .Fa "int i" | ||
98 | .Fc | ||
99 | .Ft void | ||
100 | .Fo CRYPTO_lock | ||
101 | .Fa "int mode" | ||
102 | .Fa "int n" | ||
103 | .Fa "const char *file" | ||
104 | .Fa "int line" | ||
105 | .Fc | ||
106 | .Bd -literal | ||
107 | #define CRYPTO_w_lock(type) \e | ||
108 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) | ||
109 | #define CRYPTO_w_unlock(type) \e | ||
110 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) | ||
111 | #define CRYPTO_r_lock(type) \e | ||
112 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ, type, __FILE__, __LINE__) | ||
113 | #define CRYPTO_r_unlock(type) \e | ||
114 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ, type, __FILE__, __LINE__) | ||
115 | #define CRYPTO_add(addr,amount,type) \e | ||
116 | CRYPTO_add_lock(addr, amount, type, __FILE__, __LINE__) | ||
117 | .Ed | ||
118 | .Sh DESCRIPTION | ||
119 | OpenSSL can safely be used in multi-threaded applications provided that | ||
120 | at least two callback functions are set, | ||
121 | .Fn locking_function | ||
122 | and | ||
123 | .Fn threadid_func . | ||
124 | .Pp | ||
125 | .Fo locking_function | ||
126 | .Fa "int mode" | ||
127 | .Fa "int n" | ||
128 | .Fa "const char *file" | ||
129 | .Fa "int line" | ||
130 | .Fc | ||
131 | is needed to perform locking on shared data structures. | ||
132 | Note that OpenSSL uses a number of global data structures that will be | ||
133 | implicitly shared whenever multiple threads use OpenSSL. | ||
134 | Multi-threaded applications will crash at random if it is not set. | ||
135 | .Pp | ||
136 | .Fn locking_function | ||
137 | must be able to handle up to | ||
138 | .Fn CRYPTO_num_locks | ||
139 | different mutex locks. | ||
140 | It sets the | ||
141 | .Fa n Ns -th | ||
142 | lock if | ||
143 | .Fa mode | ||
144 | includes | ||
145 | .Dv CRYPTO_LOCK , | ||
146 | and releases it otherwise. | ||
147 | .Pp | ||
148 | .Fa file | ||
149 | and | ||
150 | .Fa line | ||
151 | are the file number of the function setting the lock. | ||
152 | They can be useful for debugging. | ||
153 | .Pp | ||
154 | .Fo threadid_func | ||
155 | .Fa "CRYPTO_THREADID *id" | ||
156 | .Fc | ||
157 | is needed to record the currently-executing thread's identifier into | ||
158 | .Fa id . | ||
159 | The implementation of this callback should not fill in | ||
160 | .Fa id | ||
161 | directly, but should use | ||
162 | .Fn CRYPTO_THREADID_set_numeric | ||
163 | if thread IDs are numeric, or | ||
164 | .Fn CRYPTO_THREADID_set_pointer | ||
165 | if they are pointer-based. | ||
166 | If the application does not register such a callback using | ||
167 | .Fn CRYPTO_THREADID_set_callback , | ||
168 | then a default implementation is used - on Windows and BeOS this uses | ||
169 | the system's default thread identifying APIs, and on all other platforms | ||
170 | it uses the address of | ||
171 | .Va errno . | ||
172 | The latter is satisfactory for thread-safety if and only if the platform | ||
173 | has a thread-local error number facility. | ||
174 | .Pp | ||
175 | Once | ||
176 | .Fn threadid_func | ||
177 | is registered, or if the built-in default implementation is to be used, | ||
178 | .Bl -bullet | ||
179 | .It | ||
180 | .Fn CRYPTO_THREADID_current | ||
181 | records the currently-executing thread ID into the given | ||
182 | .Fa id | ||
183 | object. | ||
184 | .It | ||
185 | .Fn CRYPTO_THREADID_cmp | ||
186 | compares two thread IDs (returning zero for equality, i.e. the same | ||
187 | semantics as | ||
188 | .Xr memcmp 3 ) . | ||
189 | .It | ||
190 | .Fn CRYPTO_THREADID_cpy | ||
191 | duplicates a thread ID value. | ||
192 | .It | ||
193 | .Fn CRYPTO_THREADID_hash | ||
194 | returns a numeric value usable as a hash-table key. | ||
195 | This is usually the exact numeric or pointer-based thread ID used | ||
196 | internally, however this also handles the unusual case where pointers | ||
197 | are larger than | ||
198 | .Vt long | ||
199 | variables and the platform's thread IDs are pointer-based \(em in | ||
200 | this case, mixing is done to attempt to produce a unique numeric | ||
201 | value even though it is not as wide as the platform's true thread | ||
202 | IDs. | ||
203 | .El | ||
204 | .Pp | ||
205 | Additionally, OpenSSL supports dynamic locks, and sometimes, some parts | ||
206 | of OpenSSL need it for better performance. | ||
207 | To enable this, the following is required: | ||
208 | .Bl -bullet | ||
209 | .It | ||
210 | Three additional callback functions, | ||
211 | .Fn dyn_create_function , | ||
212 | .Fn dyn_lock_function , | ||
213 | and | ||
214 | .Fn dyn_destroy_function . | ||
215 | .It | ||
216 | A structure defined with the data that each lock needs to handle. | ||
217 | .El | ||
218 | .Pp | ||
219 | .Vt struct CRYPTO_dynlock_value | ||
220 | has to be defined to contain whatever structure is needed to handle locks. | ||
221 | .Pp | ||
222 | .Fo dyn_create_function | ||
223 | .Fa "const char *file" | ||
224 | .Fa "int line" | ||
225 | .Fc | ||
226 | is needed to create a lock. | ||
227 | Multi-threaded applications might crash at random if it is not set. | ||
228 | .Pp | ||
229 | .Fo dyn_lock_function | ||
230 | .Fa "int mode" | ||
231 | .Fa "CRYPTO_dynlock *l" | ||
232 | .Fa "const char *file" | ||
233 | .Fa "int line" | ||
234 | .Fc | ||
235 | is needed to perform locking off dynamic lock numbered n. | ||
236 | Multi-threaded applications might crash at random if it is not set. | ||
237 | .Pp | ||
238 | .Fo dyn_destroy_function | ||
239 | .Fa "CRYPTO_dynlock *l" | ||
240 | .Fa "const char *file" | ||
241 | .Fa "int line" | ||
242 | .Fc | ||
243 | is needed to destroy the lock | ||
244 | .Fa l . | ||
245 | Multi-threaded applications might crash at random if it is not set. | ||
246 | .Pp | ||
247 | .Fn CRYPTO_get_new_dynlockid | ||
248 | is used to create locks. | ||
249 | It will call | ||
250 | .Fn dyn_create_function | ||
251 | for the actual creation. | ||
252 | .Pp | ||
253 | .Fn CRYPTO_destroy_dynlockid | ||
254 | is used to destroy locks. | ||
255 | It will call | ||
256 | .Fn dyn_destroy_function | ||
257 | for the actual destruction. | ||
258 | .Pp | ||
259 | .Fn CRYPTO_lock | ||
260 | is used to lock and unlock the locks. | ||
261 | .Fa mode | ||
262 | is a bitfield describing what should be done with the lock. | ||
263 | .Fa n | ||
264 | is the number of the lock as returned from | ||
265 | .Fn CRYPTO_get_new_dynlockid . | ||
266 | .Fa mode | ||
267 | can be combined from the following values. | ||
268 | These values are pairwise exclusive, with undefined behaviour if misused | ||
269 | (for example, | ||
270 | .Dv CRYPTO_READ | ||
271 | and | ||
272 | .Dv CRYPTO_WRITE | ||
273 | should not be used together): | ||
274 | .Bd -literal -offset indent | ||
275 | CRYPTO_LOCK 0x01 | ||
276 | CRYPTO_UNLOCK 0x02 | ||
277 | CRYPTO_READ 0x04 | ||
278 | CRYPTO_WRITE 0x08 | ||
279 | .Ed | ||
280 | .Sh RETURN VALUES | ||
281 | .Fn CRYPTO_num_locks | ||
282 | returns the required number of locks. | ||
283 | .Pp | ||
284 | .Fn CRYPTO_get_new_dynlockid | ||
285 | returns the index to the newly created lock. | ||
286 | .Pp | ||
287 | The other functions return no values. | ||
288 | .Sh NOTES | ||
289 | You can find out if OpenSSL was configured with thread support: | ||
290 | .Bd -literal -offset indent | ||
291 | #define OPENSSL_THREAD_DEFINES | ||
292 | #include <openssl/opensslconf.h> | ||
293 | #if defined(OPENSSL_THREADS) | ||
294 | /* thread support enabled */ | ||
295 | #else | ||
296 | /* no thread support */ | ||
297 | #endif | ||
298 | .Ed | ||
299 | .Pp | ||
300 | Also, dynamic locks are currently not used internally by OpenSSL, but | ||
301 | may do so in the future. | ||
302 | .Sh EXAMPLES | ||
303 | .Pa crypto/threads/mttest.c | ||
304 | shows examples of the callback functions on Solaris, Irix and Win32. | ||
305 | .Sh SEE ALSO | ||
306 | .Xr crypto 3 | ||
307 | .Sh HISTORY | ||
308 | .Fn CRYPTO_set_locking_callback | ||
309 | is available in all versions of SSLeay and OpenSSL. | ||
310 | .Fn CRYPTO_num_locks | ||
311 | was added in OpenSSL 0.9.4. | ||
312 | All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev. | ||
313 | .Vt CRYPTO_THREADID | ||
314 | and associated functions were introduced in OpenSSL 1.0.0 to replace | ||
315 | (actually, deprecate) the previous | ||
316 | .Fn CRYPTO_set_id_callback , | ||
317 | .Fn CRYPTO_get_id_callback , | ||
318 | and | ||
319 | .Fn CRYPTO_thread_id | ||
320 | functions which assumed thread IDs to always be represented by | ||
321 | .Vt unsigned long . | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 2c5ffbb8e4..ef5c1f9727 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.26 2015/11/11 18:36:48 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.27 2015/11/11 21:15:15 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> # for NOMAN | 3 | .include <bsd.own.mk> # for NOMAN |
4 | 4 | ||
@@ -69,13 +69,14 @@ MAN= \ | |||
69 | CMS_uncompress.3 \ | 69 | CMS_uncompress.3 \ |
70 | CMS_verify.3 \ | 70 | CMS_verify.3 \ |
71 | CMS_verify_receipt.3 \ | 71 | CMS_verify_receipt.3 \ |
72 | EVP_AEAD_CTX_init.3 \ | ||
73 | |||
74 | GENMAN= \ | ||
75 | CONF_modules_free.3 \ | 72 | CONF_modules_free.3 \ |
76 | CONF_modules_load_file.3 \ | 73 | CONF_modules_load_file.3 \ |
77 | CRYPTO_set_ex_data.3 \ | 74 | CRYPTO_set_ex_data.3 \ |
78 | CRYPTO_set_locking_callback.3 \ | 75 | CRYPTO_set_locking_callback.3 \ |
76 | EVP_AEAD_CTX_init.3 \ | ||
77 | crypto.3 \ | ||
78 | |||
79 | GENMAN= \ | ||
79 | DES_set_key.3 \ | 80 | DES_set_key.3 \ |
80 | DH_generate_key.3 \ | 81 | DH_generate_key.3 \ |
81 | DH_generate_parameters.3 \ | 82 | DH_generate_parameters.3 \ |
@@ -188,7 +189,6 @@ GENMAN= \ | |||
188 | X509_verify_cert.3 \ | 189 | X509_verify_cert.3 \ |
189 | bn.3 \ | 190 | bn.3 \ |
190 | bn_internal.3 \ | 191 | bn_internal.3 \ |
191 | crypto.3 \ | ||
192 | d2i_ASN1_OBJECT.3 \ | 192 | d2i_ASN1_OBJECT.3 \ |
193 | d2i_DHparams.3 \ | 193 | d2i_DHparams.3 \ |
194 | d2i_DSAPublicKey.3 \ | 194 | d2i_DSAPublicKey.3 \ |
diff --git a/src/lib/libcrypto/man/crypto.3 b/src/lib/libcrypto/man/crypto.3 new file mode 100644 index 0000000000..24d4ed1979 --- /dev/null +++ b/src/lib/libcrypto/man/crypto.3 | |||
@@ -0,0 +1,104 @@ | |||
1 | .Dd $Mdocdate: November 11 2015 $ | ||
2 | .Dt CRYPTO 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm crypto | ||
6 | .Nd OpenSSL cryptographic library | ||
7 | .Sh DESCRIPTION | ||
8 | The OpenSSL crypto library implements a wide range of cryptographic | ||
9 | algorithms used in various Internet standards. | ||
10 | The services provided by this library are used by the OpenSSL | ||
11 | implementations of SSL, TLS and S/MIME, and they have also been used to | ||
12 | implement SSH, OpenPGP, and other cryptographic standards. | ||
13 | .Sh OVERVIEW | ||
14 | .Sy libcrypto | ||
15 | consists of a number of sub-libraries that implement the individual | ||
16 | algorithms. | ||
17 | .Pp | ||
18 | The functionality includes symmetric encryption, public key cryptography | ||
19 | and key agreement, certificate handling, cryptographic hash functions | ||
20 | and a cryptographic pseudo-random number generator. | ||
21 | .Bl -tag -width Ds | ||
22 | .It SYMMETRIC CIPHERS | ||
23 | .Xr blowfish 3 , | ||
24 | cast, | ||
25 | .Xr des 3 , | ||
26 | idea, | ||
27 | rc2, | ||
28 | .Xr rc4 3 , | ||
29 | rc5 | ||
30 | .It PUBLIC KEY CRYPTOGRAPHY AND KEY AGREEMENT | ||
31 | .Xr dsa 3 , | ||
32 | .Xr dh 3 , | ||
33 | .Xr rsa 3 | ||
34 | .It CERTIFICATES | ||
35 | .Xr x509 3 , | ||
36 | x509v3 | ||
37 | .It AUTHENTICATION CODES, HASH FUNCTIONS | ||
38 | .Xr hmac 3 , | ||
39 | .Xr MD2 3 , | ||
40 | .Xr MD4 3 , | ||
41 | .Xr MD5 3 , | ||
42 | .Xr ripemd 3 , | ||
43 | .Xr sha 3 | ||
44 | .It AUXILIARY FUNCTIONS | ||
45 | .Xr ERR 3 , | ||
46 | .Xr threads 3 , | ||
47 | .Xr rand 3 , | ||
48 | .Xr OPENSSL_VERSION_NUMBER 3 | ||
49 | .It INPUT/OUTPUT, DATA ENCODING | ||
50 | asn1, | ||
51 | .Xr bio 3 , | ||
52 | .Xr evp 3 , | ||
53 | .Xr pem 3 , | ||
54 | pkcs7, | ||
55 | pkcs12 | ||
56 | .It INTERNAL FUNCTIONS | ||
57 | .Xr bn 3 , | ||
58 | .Xr buffer 3 , | ||
59 | .Xr ec 3 , | ||
60 | .Xr lhash 3 , | ||
61 | objects, | ||
62 | stack, | ||
63 | txt_db | ||
64 | .El | ||
65 | .Sh NOTES | ||
66 | Some of the newer functions follow a naming convention using the numbers | ||
67 | .Sq 0 | ||
68 | and | ||
69 | .Sq 1 . | ||
70 | For example the functions: | ||
71 | .Pp | ||
72 | .Ft int | ||
73 | .Fo X509_CRL_add0_revoked | ||
74 | .Fa "X509_CRL *crl" | ||
75 | .Fa "X509_REVOKED *rev" | ||
76 | .Fc | ||
77 | .br | ||
78 | .Ft int | ||
79 | .Fo X509_add1_trust_object | ||
80 | .Fa "X509 *x" | ||
81 | .Fa "ASN1_OBJECT *obj" | ||
82 | .Fc | ||
83 | .Pp | ||
84 | The | ||
85 | .Sq 0 | ||
86 | version uses the supplied structure pointer directly in the parent and | ||
87 | it will be freed up when the parent is freed. | ||
88 | In the above example | ||
89 | .Fa crl | ||
90 | would be freed but | ||
91 | .Fa rev | ||
92 | would not. | ||
93 | .Pp | ||
94 | The | ||
95 | .Sq 1 | ||
96 | function uses a copy of the supplied structure pointer (or in some cases | ||
97 | increases its link count) in the parent and so both | ||
98 | .Pf ( Fa x | ||
99 | and | ||
100 | .Fa obj | ||
101 | above) should be freed up. | ||
102 | .Sh SEE ALSO | ||
103 | .Xr openssl 1 , | ||
104 | .Xr ssl 3 | ||
diff --git a/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod b/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod deleted file mode 100644 index 803b2faab1..0000000000 --- a/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | CONF_modules_free, CONF_modules_finish, CONF_modules_unload - OpenSSL | ||
6 | configuration cleanup functions | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/conf.h> | ||
11 | |||
12 | void CONF_modules_free(void); | ||
13 | void CONF_modules_finish(void); | ||
14 | void CONF_modules_unload(int all); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | CONF_modules_free() closes down and frees up all memory allocated by all | ||
19 | configuration modules. | ||
20 | |||
21 | CONF_modules_finish() calls each configuration modules B<finish> handler | ||
22 | to free up any configuration that module may have performed. | ||
23 | |||
24 | CONF_modules_unload() finishes and unloads configuration modules. If | ||
25 | B<all> is set to B<0> only modules loaded from DSOs will be unloads. If | ||
26 | B<all> is B<1> all modules, including builtin modules will be unloaded. | ||
27 | |||
28 | =head1 NOTES | ||
29 | |||
30 | Normally applications will only call CONF_modules_free() at application to | ||
31 | tidy up any configuration performed. | ||
32 | |||
33 | =head1 RETURN VALUE | ||
34 | |||
35 | None of the functions return a value. | ||
36 | |||
37 | =head1 SEE ALSO | ||
38 | |||
39 | L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>, | ||
40 | L<CONF_modules_load_file(3)|CONF_modules_load_file(3)> | ||
41 | |||
42 | =head1 HISTORY | ||
43 | |||
44 | CONF_modules_free(), CONF_modules_unload(), and CONF_modules_finish() | ||
45 | first appeared in OpenSSL 0.9.7. | ||
46 | |||
47 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod b/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod deleted file mode 100644 index e663ac5bc9..0000000000 --- a/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | CONF_modules_load_file, CONF_modules_load - OpenSSL configuration functions | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | #include <openssl/conf.h> | ||
10 | |||
11 | int CONF_modules_load_file(const char *filename, const char *appname, | ||
12 | unsigned long flags); | ||
13 | int CONF_modules_load(const CONF *cnf, const char *appname, | ||
14 | unsigned long flags); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | The function CONF_modules_load_file() configures OpenSSL using file | ||
19 | B<filename> and application name B<appname>. If B<filename> is NULL | ||
20 | the standard OpenSSL configuration file is used. If B<appname> is | ||
21 | NULL the standard OpenSSL application name B<openssl_conf> is used. | ||
22 | The behaviour can be customized using B<flags>. | ||
23 | |||
24 | CONF_modules_load() is identical to CONF_modules_load_file() except it | ||
25 | read configuration information from B<cnf>. | ||
26 | |||
27 | =head1 NOTES | ||
28 | |||
29 | The following B<flags> are currently recognized: | ||
30 | |||
31 | B<CONF_MFLAGS_IGNORE_ERRORS> if set errors returned by individual | ||
32 | configuration modules are ignored. If not set the first module error is | ||
33 | considered fatal and no further modules are loads. | ||
34 | |||
35 | Normally any modules errors will add error information to the error queue. If | ||
36 | B<CONF_MFLAGS_SILENT> is set no error information is added. | ||
37 | |||
38 | If B<CONF_MFLAGS_NO_DSO> is set configuration module loading from DSOs is | ||
39 | disabled. | ||
40 | |||
41 | B<CONF_MFLAGS_IGNORE_MISSING_FILE> if set will make CONF_load_modules_file() | ||
42 | ignore missing configuration files. Normally a missing configuration file | ||
43 | return an error. | ||
44 | |||
45 | =head1 RETURN VALUE | ||
46 | |||
47 | These functions return 1 for success and a zero or negative value for | ||
48 | failure. If module errors are not ignored the return code will reflect the | ||
49 | return value of the failing module (this will always be zero or negative). | ||
50 | |||
51 | =head1 SEE ALSO | ||
52 | |||
53 | L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>, | ||
54 | L<CONF_free(3)|CONF_free(3)>, L<err(3)|err(3)> | ||
55 | |||
56 | =head1 HISTORY | ||
57 | |||
58 | CONF_modules_load_file and CONF_modules_load first appeared in OpenSSL 0.9.7. | ||
59 | |||
60 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod b/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod deleted file mode 100644 index 0c8b378854..0000000000 --- a/src/lib/libssl/src/doc/crypto/CRYPTO_set_ex_data.pod +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | CRYPTO_set_ex_data, CRYPTO_get_ex_data - internal application specific data | ||
6 | functions | ||
7 | |||
8 | =head1 SYNOPSIS | ||
9 | |||
10 | #include <openssl/crypto.h> | ||
11 | |||
12 | int CRYPTO_set_ex_data(CRYPTO_EX_DATA *r, int idx, void *arg); | ||
13 | |||
14 | void *CRYPTO_get_ex_data(CRYPTO_EX_DATA *r, int idx); | ||
15 | |||
16 | =head1 DESCRIPTION | ||
17 | |||
18 | Several OpenSSL structures can have application specific data attached to them. | ||
19 | These functions are used internally by OpenSSL to manipulate application | ||
20 | specific data attached to a specific structure. | ||
21 | |||
22 | These functions should only be used by applications to manipulate | ||
23 | B<CRYPTO_EX_DATA> structures passed to the B<new_func()>, B<free_func()> and | ||
24 | B<dup_func()> callbacks: as passed to B<RSA_get_ex_new_index()> for example. | ||
25 | |||
26 | B<CRYPTO_set_ex_data()> is used to set application specific data, the data is | ||
27 | supplied in the B<arg> parameter and its precise meaning is up to the | ||
28 | application. | ||
29 | |||
30 | B<CRYPTO_get_ex_data()> is used to retrieve application specific data. The data | ||
31 | is returned to the application, this will be the same value as supplied to | ||
32 | a previous B<CRYPTO_set_ex_data()> call. | ||
33 | |||
34 | =head1 RETURN VALUES | ||
35 | |||
36 | B<CRYPTO_set_ex_data()> returns 1 on success or 0 on failure. | ||
37 | |||
38 | B<CRYPTO_get_ex_data()> returns the application data or 0 on failure. 0 may | ||
39 | also be valid application data but currently it can only fail if given an | ||
40 | invalid B<idx> parameter. | ||
41 | |||
42 | On failure an error code can be obtained from | ||
43 | L<ERR_get_error(3)|ERR_get_error(3)>. | ||
44 | |||
45 | =head1 SEE ALSO | ||
46 | |||
47 | L<RSA_get_ex_new_index(3)|RSA_get_ex_new_index(3)>, | ||
48 | L<DSA_get_ex_new_index(3)|DSA_get_ex_new_index(3)>, | ||
49 | L<DH_get_ex_new_index(3)|DH_get_ex_new_index(3)> | ||
50 | |||
51 | =head1 HISTORY | ||
52 | |||
53 | CRYPTO_set_ex_data() and CRYPTO_get_ex_data() have been available since SSLeay | ||
54 | 0.9.0. | ||
55 | |||
56 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod b/src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod deleted file mode 100644 index 8f4cf4cb2d..0000000000 --- a/src/lib/libssl/src/doc/crypto/CRYPTO_set_locking_callback.pod +++ /dev/null | |||
@@ -1,210 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | CRYPTO_THREADID_set_callback, CRYPTO_THREADID_get_callback, | ||
6 | CRYPTO_THREADID_current, CRYPTO_THREADID_cmp, CRYPTO_THREADID_cpy, | ||
7 | CRYPTO_THREADID_hash, CRYPTO_set_locking_callback, CRYPTO_num_locks, | ||
8 | CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, | ||
9 | CRYPTO_set_dynlock_destroy_callback, CRYPTO_get_new_dynlockid, | ||
10 | CRYPTO_destroy_dynlockid, CRYPTO_lock - OpenSSL thread support | ||
11 | |||
12 | =head1 SYNOPSIS | ||
13 | |||
14 | #include <openssl/crypto.h> | ||
15 | |||
16 | /* Don't use this structure directly. */ | ||
17 | typedef struct crypto_threadid_st | ||
18 | { | ||
19 | void *ptr; | ||
20 | unsigned long val; | ||
21 | } CRYPTO_THREADID; | ||
22 | /* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ | ||
23 | void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val); | ||
24 | void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr); | ||
25 | int CRYPTO_THREADID_set_callback(void (*threadid_func)(CRYPTO_THREADID *)); | ||
26 | void (*CRYPTO_THREADID_get_callback(void))(CRYPTO_THREADID *); | ||
27 | void CRYPTO_THREADID_current(CRYPTO_THREADID *id); | ||
28 | int CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, | ||
29 | const CRYPTO_THREADID *b); | ||
30 | void CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, | ||
31 | const CRYPTO_THREADID *src); | ||
32 | unsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id); | ||
33 | |||
34 | int CRYPTO_num_locks(void); | ||
35 | |||
36 | /* struct CRYPTO_dynlock_value needs to be defined by the user */ | ||
37 | struct CRYPTO_dynlock_value; | ||
38 | |||
39 | void CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value * | ||
40 | (*dyn_create_function)(char *file, int line)); | ||
41 | void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function) | ||
42 | (int mode, struct CRYPTO_dynlock_value *l, | ||
43 | const char *file, int line)); | ||
44 | void CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function) | ||
45 | (struct CRYPTO_dynlock_value *l, const char *file, int line)); | ||
46 | |||
47 | int CRYPTO_get_new_dynlockid(void); | ||
48 | |||
49 | void CRYPTO_destroy_dynlockid(int i); | ||
50 | |||
51 | void CRYPTO_lock(int mode, int n, const char *file, int line); | ||
52 | |||
53 | #define CRYPTO_w_lock(type) \ | ||
54 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) | ||
55 | #define CRYPTO_w_unlock(type) \ | ||
56 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__) | ||
57 | #define CRYPTO_r_lock(type) \ | ||
58 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__) | ||
59 | #define CRYPTO_r_unlock(type) \ | ||
60 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__) | ||
61 | #define CRYPTO_add(addr,amount,type) \ | ||
62 | CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__) | ||
63 | |||
64 | =head1 DESCRIPTION | ||
65 | |||
66 | OpenSSL can safely be used in multi-threaded applications provided | ||
67 | that at least two callback functions are set, locking_function and | ||
68 | threadid_func. | ||
69 | |||
70 | locking_function(int mode, int n, const char *file, int line) is | ||
71 | needed to perform locking on shared data structures. | ||
72 | (Note that OpenSSL uses a number of global data structures that | ||
73 | will be implicitly shared whenever multiple threads use OpenSSL.) | ||
74 | Multi-threaded applications will crash at random if it is not set. | ||
75 | |||
76 | locking_function() must be able to handle up to CRYPTO_num_locks() | ||
77 | different mutex locks. It sets the B<n>-th lock if B<mode> & | ||
78 | B<CRYPTO_LOCK>, and releases it otherwise. | ||
79 | |||
80 | B<file> and B<line> are the file number of the function setting the | ||
81 | lock. They can be useful for debugging. | ||
82 | |||
83 | threadid_func(CRYPTO_THREADID *id) is needed to record the currently-executing | ||
84 | thread's identifier into B<id>. The implementation of this callback should not | ||
85 | fill in B<id> directly, but should use CRYPTO_THREADID_set_numeric() if thread | ||
86 | IDs are numeric, or CRYPTO_THREADID_set_pointer() if they are pointer-based. | ||
87 | If the application does not register such a callback using | ||
88 | CRYPTO_THREADID_set_callback(), then a default implementation is used - on | ||
89 | Windows and BeOS this uses the system's default thread identifying APIs, and on | ||
90 | all other platforms it uses the address of B<errno>. The latter is satisfactory | ||
91 | for thread-safety if and only if the platform has a thread-local error number | ||
92 | facility. | ||
93 | |||
94 | Once threadid_func() is registered, or if the built-in default implementation is | ||
95 | to be used; | ||
96 | |||
97 | =over 4 | ||
98 | |||
99 | =item * | ||
100 | CRYPTO_THREADID_current() records the currently-executing thread ID into the | ||
101 | given B<id> object. | ||
102 | |||
103 | =item * | ||
104 | CRYPTO_THREADID_cmp() compares two thread IDs (returning zero for equality, ie. | ||
105 | the same semantics as memcmp()). | ||
106 | |||
107 | =item * | ||
108 | CRYPTO_THREADID_cpy() duplicates a thread ID value, | ||
109 | |||
110 | =item * | ||
111 | CRYPTO_THREADID_hash() returns a numeric value usable as a hash-table key. This | ||
112 | is usually the exact numeric or pointer-based thread ID used internally, however | ||
113 | this also handles the unusual case where pointers are larger than 'long' | ||
114 | variables and the platform's thread IDs are pointer-based - in this case, mixing | ||
115 | is done to attempt to produce a unique numeric value even though it is not as | ||
116 | wide as the platform's true thread IDs. | ||
117 | |||
118 | =back | ||
119 | |||
120 | Additionally, OpenSSL supports dynamic locks, and sometimes, some parts | ||
121 | of OpenSSL need it for better performance. To enable this, the following | ||
122 | is required: | ||
123 | |||
124 | =over 4 | ||
125 | |||
126 | =item * | ||
127 | Three additional callback function, dyn_create_function, dyn_lock_function | ||
128 | and dyn_destroy_function. | ||
129 | |||
130 | =item * | ||
131 | A structure defined with the data that each lock needs to handle. | ||
132 | |||
133 | =back | ||
134 | |||
135 | struct CRYPTO_dynlock_value has to be defined to contain whatever structure | ||
136 | is needed to handle locks. | ||
137 | |||
138 | dyn_create_function(const char *file, int line) is needed to create a | ||
139 | lock. Multi-threaded applications might crash at random if it is not set. | ||
140 | |||
141 | dyn_lock_function(int mode, CRYPTO_dynlock *l, const char *file, int line) | ||
142 | is needed to perform locking off dynamic lock numbered n. Multi-threaded | ||
143 | applications might crash at random if it is not set. | ||
144 | |||
145 | dyn_destroy_function(CRYPTO_dynlock *l, const char *file, int line) is | ||
146 | needed to destroy the lock l. Multi-threaded applications might crash at | ||
147 | random if it is not set. | ||
148 | |||
149 | CRYPTO_get_new_dynlockid() is used to create locks. It will call | ||
150 | dyn_create_function for the actual creation. | ||
151 | |||
152 | CRYPTO_destroy_dynlockid() is used to destroy locks. It will call | ||
153 | dyn_destroy_function for the actual destruction. | ||
154 | |||
155 | CRYPTO_lock() is used to lock and unlock the locks. mode is a bitfield | ||
156 | describing what should be done with the lock. n is the number of the | ||
157 | lock as returned from CRYPTO_get_new_dynlockid(). mode can be combined | ||
158 | from the following values. These values are pairwise exclusive, with | ||
159 | undefined behaviour if misused (for example, CRYPTO_READ and CRYPTO_WRITE | ||
160 | should not be used together): | ||
161 | |||
162 | CRYPTO_LOCK 0x01 | ||
163 | CRYPTO_UNLOCK 0x02 | ||
164 | CRYPTO_READ 0x04 | ||
165 | CRYPTO_WRITE 0x08 | ||
166 | |||
167 | =head1 RETURN VALUES | ||
168 | |||
169 | CRYPTO_num_locks() returns the required number of locks. | ||
170 | |||
171 | CRYPTO_get_new_dynlockid() returns the index to the newly created lock. | ||
172 | |||
173 | The other functions return no values. | ||
174 | |||
175 | =head1 NOTES | ||
176 | |||
177 | You can find out if OpenSSL was configured with thread support: | ||
178 | |||
179 | #define OPENSSL_THREAD_DEFINES | ||
180 | #include <openssl/opensslconf.h> | ||
181 | #if defined(OPENSSL_THREADS) | ||
182 | // thread support enabled | ||
183 | #else | ||
184 | // no thread support | ||
185 | #endif | ||
186 | |||
187 | Also, dynamic locks are currently not used internally by OpenSSL, but | ||
188 | may do so in the future. | ||
189 | |||
190 | =head1 EXAMPLES | ||
191 | |||
192 | B<crypto/threads/mttest.c> shows examples of the callback functions on | ||
193 | Solaris, Irix and Win32. | ||
194 | |||
195 | =head1 HISTORY | ||
196 | |||
197 | CRYPTO_set_locking_callback() is | ||
198 | available in all versions of SSLeay and OpenSSL. | ||
199 | CRYPTO_num_locks() was added in OpenSSL 0.9.4. | ||
200 | All functions dealing with dynamic locks were added in OpenSSL 0.9.5b-dev. | ||
201 | B<CRYPTO_THREADID> and associated functions were introduced in OpenSSL 1.0.0 | ||
202 | to replace (actually, deprecate) the previous CRYPTO_set_id_callback(), | ||
203 | CRYPTO_get_id_callback(), and CRYPTO_thread_id() functions which assumed | ||
204 | thread IDs to always be represented by 'unsigned long'. | ||
205 | |||
206 | =head1 SEE ALSO | ||
207 | |||
208 | L<crypto(3)|crypto(3)> | ||
209 | |||
210 | =cut | ||
diff --git a/src/lib/libssl/src/doc/crypto/crypto.pod b/src/lib/libssl/src/doc/crypto/crypto.pod deleted file mode 100644 index bbd6ce9ea9..0000000000 --- a/src/lib/libssl/src/doc/crypto/crypto.pod +++ /dev/null | |||
@@ -1,85 +0,0 @@ | |||
1 | =pod | ||
2 | |||
3 | =head1 NAME | ||
4 | |||
5 | crypto - OpenSSL cryptographic library | ||
6 | |||
7 | =head1 SYNOPSIS | ||
8 | |||
9 | =head1 DESCRIPTION | ||
10 | |||
11 | The OpenSSL B<crypto> library implements a wide range of cryptographic | ||
12 | algorithms used in various Internet standards. The services provided | ||
13 | by this library are used by the OpenSSL implementations of SSL, TLS | ||
14 | and S/MIME, and they have also been used to implement SSH, OpenPGP, and | ||
15 | other cryptographic standards. | ||
16 | |||
17 | =head1 OVERVIEW | ||
18 | |||
19 | B<libcrypto> consists of a number of sub-libraries that implement the | ||
20 | individual algorithms. | ||
21 | |||
22 | The functionality includes symmetric encryption, public key | ||
23 | cryptography and key agreement, certificate handling, cryptographic | ||
24 | hash functions and a cryptographic pseudo-random number generator. | ||
25 | |||
26 | =over 4 | ||
27 | |||
28 | =item SYMMETRIC CIPHERS | ||
29 | |||
30 | L<blowfish(3)|blowfish(3)>, L<cast(3)|cast(3)>, L<des(3)|des(3)>, | ||
31 | L<idea(3)|idea(3)>, L<rc2(3)|rc2(3)>, L<rc4(3)|rc4(3)>, L<rc5(3)|rc5(3)> | ||
32 | |||
33 | =item PUBLIC KEY CRYPTOGRAPHY AND KEY AGREEMENT | ||
34 | |||
35 | L<dsa(3)|dsa(3)>, L<dh(3)|dh(3)>, L<rsa(3)|rsa(3)> | ||
36 | |||
37 | =item CERTIFICATES | ||
38 | |||
39 | L<x509(3)|x509(3)>, L<x509v3(3)|x509v3(3)> | ||
40 | |||
41 | =item AUTHENTICATION CODES, HASH FUNCTIONS | ||
42 | |||
43 | L<hmac(3)|hmac(3)>, L<md2(3)|md2(3)>, L<md4(3)|md4(3)>, | ||
44 | L<md5(3)|md5(3)>, L<ripemd(3)|ripemd(3)>, | ||
45 | L<sha(3)|sha(3)> | ||
46 | |||
47 | =item AUXILIARY FUNCTIONS | ||
48 | |||
49 | L<err(3)|err(3)>, L<threads(3)|threads(3)>, L<rand(3)|rand(3)>, | ||
50 | L<OPENSSL_VERSION_NUMBER(3)|OPENSSL_VERSION_NUMBER(3)> | ||
51 | |||
52 | =item INPUT/OUTPUT, DATA ENCODING | ||
53 | |||
54 | L<asn1(3)|asn1(3)>, L<bio(3)|bio(3)>, L<evp(3)|evp(3)>, L<pem(3)|pem(3)>, | ||
55 | L<pkcs7(3)|pkcs7(3)>, L<pkcs12(3)|pkcs12(3)> | ||
56 | |||
57 | =item INTERNAL FUNCTIONS | ||
58 | |||
59 | L<bn(3)|bn(3)>, L<buffer(3)|buffer(3)>, L<ec(3)|ec(3)>, L<lhash(3)|lhash(3)>, | ||
60 | L<objects(3)|objects(3)>, L<stack(3)|stack(3)>, | ||
61 | L<txt_db(3)|txt_db(3)> | ||
62 | |||
63 | =back | ||
64 | |||
65 | =head1 NOTES | ||
66 | |||
67 | Some of the newer functions follow a naming convention using the numbers | ||
68 | B<0> and B<1>. For example the functions: | ||
69 | |||
70 | int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); | ||
71 | int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); | ||
72 | |||
73 | The B<0> version uses the supplied structure pointer directly | ||
74 | in the parent and it will be freed up when the parent is freed. | ||
75 | In the above example B<crl> would be freed but B<rev> would not. | ||
76 | |||
77 | The B<1> function uses a copy of the supplied structure pointer | ||
78 | (or in some cases increases its link count) in the parent and | ||
79 | so both (B<x> and B<obj> above) should be freed up. | ||
80 | |||
81 | =head1 SEE ALSO | ||
82 | |||
83 | L<openssl(1)|openssl(1)>, L<ssl(3)|ssl(3)> | ||
84 | |||
85 | =cut | ||