diff options
| -rw-r--r-- | src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 | 393 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/ERR.3 | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/crypto.3 | 7 |
3 files changed, 87 insertions, 318 deletions
diff --git a/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 b/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 index c00fb75dc2..d6676819ef 100644 --- a/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 +++ b/src/lib/libcrypto/man/CRYPTO_set_locking_callback.3 | |||
| @@ -1,110 +1,37 @@ | |||
| 1 | .\" $OpenBSD: CRYPTO_set_locking_callback.3,v 1.10 2018/03/27 17:35:50 schwarze Exp $ | 1 | .\" $OpenBSD: CRYPTO_set_locking_callback.3,v 1.11 2019/03/10 14:50:05 schwarze Exp $ |
| 2 | .\" OpenSSL doc/crypto/threads.pod fb552ac6 Sep 30 23:43:01 2009 +0000 | 2 | .\" OpenSSL doc/crypto/threads.pod fb552ac6 Sep 30 23:43:01 2009 +0000 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>, | 4 | .\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org> |
| 5 | .\" Richard Levitte <levitte@openssl.org>, Bodo Moeller <bodo@openssl.org>, | ||
| 6 | .\" and Geoff Thorpe <geoff@openssl.org>. | ||
| 7 | .\" Copyright (c) 2000, 2001, 2005, 2006, 2008, 2009 The OpenSSL Project. | ||
| 8 | .\" All rights reserved. | ||
| 9 | .\" | 5 | .\" |
| 10 | .\" Redistribution and use in source and binary forms, with or without | 6 | .\" Permission to use, copy, modify, and distribute this software for any |
| 11 | .\" modification, are permitted provided that the following conditions | 7 | .\" purpose with or without fee is hereby granted, provided that the above |
| 12 | .\" are met: | 8 | .\" copyright notice and this permission notice appear in all copies. |
| 13 | .\" | 9 | .\" |
| 14 | .\" 1. Redistributions of source code must retain the above copyright | 10 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 15 | .\" notice, this list of conditions and the following disclaimer. | 11 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 12 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 13 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 14 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | 17 | .\" |
| 17 | .\" 2. Redistributions in binary form must reproduce the above copyright | 18 | .Dd $Mdocdate: March 10 2019 $ |
| 18 | .\" notice, this list of conditions and the following disclaimer in | ||
| 19 | .\" the documentation and/or other materials provided with the | ||
| 20 | .\" distribution. | ||
| 21 | .\" | ||
| 22 | .\" 3. All advertising materials mentioning features or use of this | ||
| 23 | .\" software must display the following acknowledgment: | ||
| 24 | .\" "This product includes software developed by the OpenSSL Project | ||
| 25 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 26 | .\" | ||
| 27 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 28 | .\" endorse or promote products derived from this software without | ||
| 29 | .\" prior written permission. For written permission, please contact | ||
| 30 | .\" openssl-core@openssl.org. | ||
| 31 | .\" | ||
| 32 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 33 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 34 | .\" permission of the OpenSSL Project. | ||
| 35 | .\" | ||
| 36 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 37 | .\" acknowledgment: | ||
| 38 | .\" "This product includes software developed by the OpenSSL Project | ||
| 39 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 40 | .\" | ||
| 41 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 42 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 43 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 44 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 45 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 46 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 47 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 48 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 49 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 50 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 51 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 52 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 53 | .\" | ||
| 54 | .Dd $Mdocdate: March 27 2018 $ | ||
| 55 | .Dt CRYPTO_SET_LOCKING_CALLBACK 3 | 19 | .Dt CRYPTO_SET_LOCKING_CALLBACK 3 |
| 56 | .Os | 20 | .Os |
| 57 | .Sh NAME | 21 | .Sh NAME |
| 58 | .Nm CRYPTO_THREADID_set_numeric , | ||
| 59 | .Nm CRYPTO_THREADID_set_pointer , | ||
| 60 | .Nm CRYPTO_THREADID_set_callback , | ||
| 61 | .Nm CRYPTO_THREADID_get_callback , | ||
| 62 | .Nm CRYPTO_THREADID_current , | 22 | .Nm CRYPTO_THREADID_current , |
| 63 | .Nm CRYPTO_THREADID_cmp , | 23 | .Nm CRYPTO_THREADID_cmp , |
| 64 | .Nm CRYPTO_THREADID_cpy , | 24 | .Nm CRYPTO_THREADID_cpy , |
| 65 | .Nm CRYPTO_THREADID_hash , | 25 | .Nm CRYPTO_THREADID_hash , |
| 66 | .Nm CRYPTO_num_locks , | ||
| 67 | .Nm CRYPTO_set_dynlock_create_callback , | ||
| 68 | .Nm CRYPTO_set_dynlock_lock_callback , | ||
| 69 | .Nm CRYPTO_set_dynlock_destroy_callback , | ||
| 70 | .Nm CRYPTO_get_new_dynlockid , | ||
| 71 | .Nm CRYPTO_destroy_dynlockid , | ||
| 72 | .Nm CRYPTO_lock , | 26 | .Nm CRYPTO_lock , |
| 73 | .Nm CRYPTO_w_lock , | 27 | .Nm CRYPTO_w_lock , |
| 74 | .Nm CRYPTO_w_unlock , | 28 | .Nm CRYPTO_w_unlock , |
| 75 | .Nm CRYPTO_r_lock , | 29 | .Nm CRYPTO_r_lock , |
| 76 | .Nm CRYPTO_r_unlock , | 30 | .Nm CRYPTO_r_unlock , |
| 77 | .Nm CRYPTO_add | 31 | .Nm CRYPTO_add |
| 78 | .Nd OpenSSL thread support | 32 | .Nd thread support |
| 79 | .Sh SYNOPSIS | 33 | .Sh SYNOPSIS |
| 80 | .In openssl/crypto.h | 34 | .In openssl/crypto.h |
| 81 | .Bd -literal | ||
| 82 | /* Don't use this structure directly. */ | ||
| 83 | typedef struct crypto_threadid_st { | ||
| 84 | void *ptr; | ||
| 85 | unsigned long val; | ||
| 86 | } CRYPTO_THREADID; | ||
| 87 | /* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */ | ||
| 88 | .Ed | ||
| 89 | .Pp | ||
| 90 | .Ft void | ||
| 91 | .Fo CRYPTO_THREADID_set_numeric | ||
| 92 | .Fa "CRYPTO_THREADID *id" | ||
| 93 | .Fa "unsigned long val" | ||
| 94 | .Fc | ||
| 95 | .Ft void | ||
| 96 | .Fo CRYPTO_THREADID_set_pointer | ||
| 97 | .Fa "CRYPTO_THREADID *id" | ||
| 98 | .Fa "void *ptr" | ||
| 99 | .Fc | ||
| 100 | .Ft int | ||
| 101 | .Fo CRYPTO_THREADID_set_callback | ||
| 102 | .Fa "void (*threadid_func)(CRYPTO_THREADID *)" | ||
| 103 | .Fc | ||
| 104 | .Ft void | ||
| 105 | .Fo "(*CRYPTO_THREADID_get_callback(void))" | ||
| 106 | .Fa "CRYPTO_THREADID *" | ||
| 107 | .Fc | ||
| 108 | .Ft void | 35 | .Ft void |
| 109 | .Fo CRYPTO_THREADID_current | 36 | .Fo CRYPTO_THREADID_current |
| 110 | .Fa "CRYPTO_THREADID *id" | 37 | .Fa "CRYPTO_THREADID *id" |
| @@ -123,45 +50,19 @@ typedef struct crypto_threadid_st { | |||
| 123 | .Fo CRYPTO_THREADID_hash | 50 | .Fo CRYPTO_THREADID_hash |
| 124 | .Fa "const CRYPTO_THREADID *id" | 51 | .Fa "const CRYPTO_THREADID *id" |
| 125 | .Fc | 52 | .Fc |
| 126 | .Ft int | ||
| 127 | .Fo CRYPTO_num_locks | ||
| 128 | .Fa void | ||
| 129 | .Fc | ||
| 130 | .Bd -literal | ||
| 131 | /* struct CRYPTO_dynlock_value needs to be defined by the user */ | ||
| 132 | struct CRYPTO_dynlock_value; | ||
| 133 | .Ed | ||
| 134 | .Pp | ||
| 135 | .Ft void | ||
| 136 | .Fo CRYPTO_set_dynlock_create_callback | ||
| 137 | .Fa "struct CRYPTO_dynlock_value *" | ||
| 138 | .Fa "(*dyn_create_function)(char *file, int line)" | ||
| 139 | .Fc | ||
| 140 | .Ft void | ||
| 141 | .Fo CRYPTO_set_dynlock_lock_callback | ||
| 142 | .Fa "void (*dyn_lock_function)(int mode, struct CRYPTO_dynlock_value *l,\ | ||
| 143 | const char *file, int line)" | ||
| 144 | .Fc | ||
| 145 | .Ft void | ||
| 146 | .Fo CRYPTO_set_dynlock_destroy_callback | ||
| 147 | .Fa "void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l,\ | ||
| 148 | const char *file, int line)" | ||
| 149 | .Fc | ||
| 150 | .Ft int | ||
| 151 | .Fo CRYPTO_get_new_dynlockid | ||
| 152 | .Fa void | ||
| 153 | .Fc | ||
| 154 | .Ft void | ||
| 155 | .Fo CRYPTO_destroy_dynlockid | ||
| 156 | .Fa "int i" | ||
| 157 | .Fc | ||
| 158 | .Ft void | 53 | .Ft void |
| 159 | .Fo CRYPTO_lock | 54 | .Fo CRYPTO_lock |
| 160 | .Fa "int mode" | 55 | .Fa "int mode" |
| 161 | .Fa "int n" | 56 | .Fa "int type" |
| 162 | .Fa "const char *file" | 57 | .Fa "const char *file" |
| 163 | .Fa "int line" | 58 | .Fa "int line" |
| 164 | .Fc | 59 | .Fc |
| 60 | .Ft int | ||
| 61 | .Fo CRYPTO_add | ||
| 62 | .Fa "int *p" | ||
| 63 | .Fa "int amount" | ||
| 64 | .Fa "int type" | ||
| 65 | .Fc | ||
| 165 | .Bd -literal | 66 | .Bd -literal |
| 166 | #define CRYPTO_w_lock(type) \e | 67 | #define CRYPTO_w_lock(type) \e |
| 167 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) | 68 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE, type, __FILE__, __LINE__) |
| @@ -171,200 +72,89 @@ struct CRYPTO_dynlock_value; | |||
| 171 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ, type, __FILE__, __LINE__) | 72 | CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ, type, __FILE__, __LINE__) |
| 172 | #define CRYPTO_r_unlock(type) \e | 73 | #define CRYPTO_r_unlock(type) \e |
| 173 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ, type, __FILE__, __LINE__) | 74 | CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ, type, __FILE__, __LINE__) |
| 174 | #define CRYPTO_add(addr,amount,type) \e | ||
| 175 | CRYPTO_add_lock(addr, amount, type, __FILE__, __LINE__) | ||
| 176 | .Ed | 75 | .Ed |
| 177 | .Sh DESCRIPTION | 76 | .Sh DESCRIPTION |
| 178 | OpenSSL can safely be used in multi-threaded applications provided that | 77 | These functions are obsolete. |
| 179 | at least two callback functions are set, | ||
| 180 | .Fn locking_function | ||
| 181 | and | ||
| 182 | .Fn threadid_func . | ||
| 183 | .Pp | ||
| 184 | .Fo locking_function | ||
| 185 | .Fa "int mode" | ||
| 186 | .Fa "int n" | ||
| 187 | .Fa "const char *file" | ||
| 188 | .Fa "int line" | ||
| 189 | .Fc | ||
| 190 | is needed to perform locking on shared data structures. | ||
| 191 | Note that OpenSSL uses a number of global data structures that will be | ||
| 192 | implicitly shared whenever multiple threads use OpenSSL. | ||
| 193 | Multi-threaded applications will crash at random if it is not set. | ||
| 194 | .Pp | ||
| 195 | .Fn locking_function | ||
| 196 | must be able to handle up to | ||
| 197 | .Fn CRYPTO_num_locks | ||
| 198 | different mutex locks. | ||
| 199 | It sets the | ||
| 200 | .Fa n Ns -th | ||
| 201 | lock if | ||
| 202 | .Fa mode | ||
| 203 | includes | ||
| 204 | .Dv CRYPTO_LOCK , | ||
| 205 | and releases it otherwise. | ||
| 206 | .Pp | 78 | .Pp |
| 207 | .Fa file | 79 | .Fn CRYPTO_THREADID_current |
| 208 | and | 80 | stores a unique identifier of the currently executing thread |
| 209 | .Fa line | 81 | into the opaque object |
| 210 | are the file number of the function setting the lock. | ||
| 211 | They can be useful for debugging. | ||
| 212 | .Pp | ||
| 213 | .Fo threadid_func | ||
| 214 | .Fa "CRYPTO_THREADID *id" | ||
| 215 | .Fc | ||
| 216 | is needed to record the currently-executing thread's identifier into | ||
| 217 | .Fa id . | 82 | .Fa id . |
| 218 | The implementation of this callback should not fill in | ||
| 219 | .Fa id | ||
| 220 | directly, but should use | ||
| 221 | .Fn CRYPTO_THREADID_set_numeric | ||
| 222 | if thread IDs are numeric, or | ||
| 223 | .Fn CRYPTO_THREADID_set_pointer | ||
| 224 | if they are pointer-based. | ||
| 225 | If the application does not register such a callback using | ||
| 226 | .Fn CRYPTO_THREADID_set_callback , | ||
| 227 | then a default implementation is used - on Windows and BeOS this uses | ||
| 228 | the system's default thread identifying APIs, and on all other platforms | ||
| 229 | it uses the address of | ||
| 230 | .Va errno . | ||
| 231 | The latter is satisfactory for thread-safety if and only if the platform | ||
| 232 | has a thread-local error number facility. | ||
| 233 | .Pp | 83 | .Pp |
| 234 | Once | ||
| 235 | .Fn threadid_func | ||
| 236 | is registered, or if the built-in default implementation is to be used, | ||
| 237 | .Bl -bullet | ||
| 238 | .It | ||
| 239 | .Fn CRYPTO_THREADID_current | ||
| 240 | records the currently-executing thread ID into the given | ||
| 241 | .Fa id | ||
| 242 | object. | ||
| 243 | .It | ||
| 244 | .Fn CRYPTO_THREADID_cmp | ||
| 245 | compares two thread IDs (returning zero for equality, i.e. the same | ||
| 246 | semantics as | ||
| 247 | .Xr memcmp 3 ) . | ||
| 248 | .It | ||
| 249 | .Fn CRYPTO_THREADID_cpy | 84 | .Fn CRYPTO_THREADID_cpy |
| 250 | duplicates a thread ID value. | 85 | copies the contents of |
| 251 | .It | 86 | .Fa src |
| 252 | .Fn CRYPTO_THREADID_hash | 87 | to |
| 253 | returns a numeric value usable as a hash-table key. | 88 | .Fa dest . |
| 254 | This is usually the exact numeric or pointer-based thread ID used | ||
| 255 | internally, however this also handles the unusual case where pointers | ||
| 256 | are larger than | ||
| 257 | .Vt long | ||
| 258 | variables and the platform's thread IDs are pointer-based \(em in | ||
| 259 | this case, mixing is done to attempt to produce a unique numeric | ||
| 260 | value even though it is not as wide as the platform's true thread | ||
| 261 | IDs. | ||
| 262 | .El | ||
| 263 | .Pp | ||
| 264 | Additionally, OpenSSL supports dynamic locks and, sometimes, some parts | ||
| 265 | of OpenSSL need it for better performance. | ||
| 266 | To enable this, the following is required: | ||
| 267 | .Bl -bullet | ||
| 268 | .It | ||
| 269 | Three additional callback functions, | ||
| 270 | .Fn dyn_create_function , | ||
| 271 | .Fn dyn_lock_function , | ||
| 272 | and | ||
| 273 | .Fn dyn_destroy_function . | ||
| 274 | .It | ||
| 275 | A structure defined with the data that each lock needs to handle. | ||
| 276 | .El | ||
| 277 | .Pp | ||
| 278 | .Vt struct CRYPTO_dynlock_value | ||
| 279 | has to be defined to contain whatever structure is needed to handle locks. | ||
| 280 | .Pp | ||
| 281 | .Fo dyn_create_function | ||
| 282 | .Fa "const char *file" | ||
| 283 | .Fa "int line" | ||
| 284 | .Fc | ||
| 285 | is needed to create a lock. | ||
| 286 | Multi-threaded applications might crash at random if it is not set. | ||
| 287 | .Pp | ||
| 288 | .Fo dyn_lock_function | ||
| 289 | .Fa "int mode" | ||
| 290 | .Fa "CRYPTO_dynlock *l" | ||
| 291 | .Fa "const char *file" | ||
| 292 | .Fa "int line" | ||
| 293 | .Fc | ||
| 294 | is needed to perform locking off dynamic lock numbered n. | ||
| 295 | Multi-threaded applications might crash at random if it is not set. | ||
| 296 | .Pp | ||
| 297 | .Fo dyn_destroy_function | ||
| 298 | .Fa "CRYPTO_dynlock *l" | ||
| 299 | .Fa "const char *file" | ||
| 300 | .Fa "int line" | ||
| 301 | .Fc | ||
| 302 | is needed to destroy the lock | ||
| 303 | .Fa l . | ||
| 304 | Multi-threaded applications might crash at random if it is not set. | ||
| 305 | .Pp | ||
| 306 | .Fn CRYPTO_get_new_dynlockid | ||
| 307 | is used to create locks. | ||
| 308 | It will call | ||
| 309 | .Fn dyn_create_function | ||
| 310 | for the actual creation. | ||
| 311 | .Pp | ||
| 312 | .Fn CRYPTO_destroy_dynlockid | ||
| 313 | is used to destroy locks. | ||
| 314 | It will call | ||
| 315 | .Fn dyn_destroy_function | ||
| 316 | for the actual destruction. | ||
| 317 | .Pp | 89 | .Pp |
| 318 | .Fn CRYPTO_lock | 90 | .Fn CRYPTO_lock |
| 319 | is used to lock and unlock the locks. | 91 | locks or unlocks a mutex lock. |
| 92 | .Pp | ||
| 320 | .Fa mode | 93 | .Fa mode |
| 321 | is a bitfield describing what should be done with the lock. | 94 | is a bitfield describing what should be done with the lock. |
| 322 | .Fa n | 95 | For each call, either |
| 323 | is the number of the lock as returned from | 96 | .Dv CRYPTO_LOCK |
| 324 | .Fn CRYPTO_get_new_dynlockid . | 97 | or |
| 325 | .Fa mode | 98 | .Dv CRYPTO_UNLOCK |
| 326 | can be combined from the following values. | 99 | must be included. |
| 327 | These values are pairwise exclusive, with undefined behaviour if misused | 100 | In the LibreSSL implementation, |
| 328 | (for example, | ||
| 329 | .Dv CRYPTO_READ | 101 | .Dv CRYPTO_READ |
| 330 | and | 102 | and |
| 331 | .Dv CRYPTO_WRITE | 103 | .Dv CRYPTO_WRITE |
| 332 | should not be used together): | 104 | are ignored. |
| 333 | .Bd -literal -offset indent | 105 | .Pp |
| 334 | CRYPTO_LOCK 0x01 | 106 | .Fa type |
| 335 | CRYPTO_UNLOCK 0x02 | 107 | is a number in the range 0 <= |
| 336 | CRYPTO_READ 0x04 | 108 | .Fa type No < Dv CRYPTO_NUM_LOCKS |
| 337 | CRYPTO_WRITE 0x08 | 109 | identifying a particular lock. |
| 338 | .Ed | 110 | Currently, the value of |
| 111 | .Dv CRYPTO_NUM_LOCKS | ||
| 112 | is 41. | ||
| 113 | .Pp | ||
| 114 | The | ||
| 115 | .Ar file | ||
| 116 | and | ||
| 117 | .Ar line | ||
| 118 | arguments are ignored. | ||
| 339 | .Pp | 119 | .Pp |
| 340 | You can find out if OpenSSL was configured with thread support: | 120 | In the LibreSSL implementation, |
| 341 | .Bd -literal -offset indent | 121 | .Fn CRYPTO_lock |
| 342 | #define OPENSSL_THREAD_DEFINES | 122 | is a wrapper around |
| 343 | #include <openssl/opensslconf.h> | 123 | .Xr pthread_mutex_lock 3 |
| 344 | #if defined(OPENSSL_THREADS) | 124 | and |
| 345 | /* thread support enabled */ | 125 | .Xr pthread_mutex_unlock 3 . |
| 346 | #else | ||
| 347 | /* no thread support */ | ||
| 348 | #endif | ||
| 349 | .Ed | ||
| 350 | .Pp | 126 | .Pp |
| 351 | Also, dynamic locks are currently not used internally by OpenSSL, but | 127 | .Fn CRYPTO_add |
| 352 | may do so in the future. | 128 | locks the lock number |
| 129 | .Fa type , | ||
| 130 | adds | ||
| 131 | .Fa amount | ||
| 132 | to | ||
| 133 | .Pf * Fa p , | ||
| 134 | and unlocks the lock number | ||
| 135 | .Fa type | ||
| 136 | again. | ||
| 353 | .Sh RETURN VALUES | 137 | .Sh RETURN VALUES |
| 354 | .Fn CRYPTO_num_locks | 138 | .Fn CRYPTO_THREADID_cmp |
| 355 | returns the required number of locks. | 139 | returns 0 if |
| 140 | .Fa a | ||
| 141 | and | ||
| 142 | .Fa b | ||
| 143 | refer to the same thread or a non-zero value otherwise. | ||
| 356 | .Pp | 144 | .Pp |
| 357 | .Fn CRYPTO_get_new_dynlockid | 145 | .Fn CRYPTO_THREADID_hash |
| 358 | returns the index to the newly created lock. | 146 | returns a numeric value usable as a hash-table key. |
| 147 | In the LibreSSL implementation, it is the value returned from | ||
| 148 | .Xr pthread_self 3 | ||
| 149 | for the thread | ||
| 150 | .Fa id . | ||
| 359 | .Pp | 151 | .Pp |
| 360 | The other functions return no values. | 152 | .Fn CRYPTO_add |
| 361 | .Sh EXAMPLES | 153 | returns the new value of |
| 362 | .Pa crypto/threads/mttest.c | 154 | .Pf * Fa p . |
| 363 | shows examples of the callback functions on Solaris, Irix and Win32. | ||
| 364 | .Sh SEE ALSO | 155 | .Sh SEE ALSO |
| 365 | .Xr crypto 3 | 156 | .Xr crypto 3 |
| 366 | .Sh HISTORY | 157 | .Sh HISTORY |
| 367 | .Fn CRYPTO_set_locking_callback , | ||
| 368 | .Fn CRYPTO_lock , | 158 | .Fn CRYPTO_lock , |
| 369 | .Fn CRYPTO_w_lock , | 159 | .Fn CRYPTO_w_lock , |
| 370 | .Fn CRYPTO_w_unlock , | 160 | .Fn CRYPTO_w_unlock , |
| @@ -377,23 +167,6 @@ first appeared in SSLeay 0.6.2. | |||
| 377 | These functions have been available since | 167 | These functions have been available since |
| 378 | .Ox 2.4 . | 168 | .Ox 2.4 . |
| 379 | .Pp | 169 | .Pp |
| 380 | .Fn CRYPTO_num_locks | ||
| 381 | first appeared in OpenSSL 0.9.4 and have been available since | ||
| 382 | .Ox 2.6 . | ||
| 383 | .Pp | ||
| 384 | .Fn CRYPTO_set_dynlock_create_callback , | ||
| 385 | .Fn CRYPTO_set_dynlock_lock_callback , | ||
| 386 | .Fn CRYPTO_set_dynlock_destroy_callback , | ||
| 387 | .Fn CRYPTO_get_new_dynlockid , | ||
| 388 | and | ||
| 389 | .Fn CRYPTO_destroy_dynlockid | ||
| 390 | first appeared in OpenSSL 0.9.6 and have been available since | ||
| 391 | .Ox 2.9 . | ||
| 392 | .Pp | ||
| 393 | .Fn CRYPTO_THREADID_set_numeric , | ||
| 394 | .Fn CRYPTO_THREADID_set_pointer , | ||
| 395 | .Fn CRYPTO_THREADID_set_callback , | ||
| 396 | .Fn CRYPTO_THREADID_get_callback , | ||
| 397 | .Fn CRYPTO_THREADID_current , | 170 | .Fn CRYPTO_THREADID_current , |
| 398 | .Fn CRYPTO_THREADID_cmp , | 171 | .Fn CRYPTO_THREADID_cmp , |
| 399 | .Fn CRYPTO_THREADID_cpy , | 172 | .Fn CRYPTO_THREADID_cpy , |
diff --git a/src/lib/libcrypto/man/ERR.3 b/src/lib/libcrypto/man/ERR.3 index 973ba2713a..63787f1fa5 100644 --- a/src/lib/libcrypto/man/ERR.3 +++ b/src/lib/libcrypto/man/ERR.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: ERR.3,v 1.5 2016/11/23 17:54:15 schwarze Exp $ | 1 | .\" $OpenBSD: ERR.3,v 1.6 2019/03/10 14:50:05 schwarze Exp $ |
| 2 | .\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 | 2 | .\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and |
| @@ -49,7 +49,7 @@ | |||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 51 | .\" | 51 | .\" |
| 52 | .Dd $Mdocdate: November 23 2016 $ | 52 | .Dd $Mdocdate: March 10 2019 $ |
| 53 | .Dt ERR 3 | 53 | .Dt ERR 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -200,7 +200,6 @@ The hash tables can be obtained by calling | |||
| 200 | and | 200 | and |
| 201 | .Fn ERR_get_string_table . | 201 | .Fn ERR_get_string_table . |
| 202 | .Sh SEE ALSO | 202 | .Sh SEE ALSO |
| 203 | .Xr CRYPTO_set_locking_callback 3 , | ||
| 204 | .Xr ERR_clear_error 3 , | 203 | .Xr ERR_clear_error 3 , |
| 205 | .Xr ERR_error_string 3 , | 204 | .Xr ERR_error_string 3 , |
| 206 | .Xr ERR_get_error 3 , | 205 | .Xr ERR_get_error 3 , |
diff --git a/src/lib/libcrypto/man/crypto.3 b/src/lib/libcrypto/man/crypto.3 index cbc8f1169c..3a009ed32c 100644 --- a/src/lib/libcrypto/man/crypto.3 +++ b/src/lib/libcrypto/man/crypto.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: crypto.3,v 1.18 2018/02/27 20:43:41 schwarze Exp $ | 1 | .\" $OpenBSD: crypto.3,v 1.19 2019/03/10 14:50:05 schwarze Exp $ |
| 2 | .\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100 | 2 | .\" OpenSSL a9c85cea Nov 11 09:33:55 2016 +0100 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> and |
| @@ -49,7 +49,7 @@ | |||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 51 | .\" | 51 | .\" |
| 52 | .Dd $Mdocdate: February 27 2018 $ | 52 | .Dd $Mdocdate: March 10 2019 $ |
| 53 | .Dt CRYPTO 3 | 53 | .Dt CRYPTO 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -116,9 +116,6 @@ configuration file handling: see | |||
| 116 | error reporting: see | 116 | error reporting: see |
| 117 | .Xr ERR 3 | 117 | .Xr ERR 3 |
| 118 | .It | 118 | .It |
| 119 | thread support: see | ||
| 120 | .Xr CRYPTO_set_locking_callback 3 | ||
| 121 | .It | ||
| 122 | .Xr OCSP_REQUEST_new 3 | 119 | .Xr OCSP_REQUEST_new 3 |
| 123 | .El | 120 | .El |
| 124 | .Pp | 121 | .Pp |
