diff options
| author | schwarze <> | 2018-04-15 17:02:03 +0000 |
|---|---|---|
| committer | schwarze <> | 2018-04-15 17:02:03 +0000 |
| commit | 2e8a8076843788f75a575d4d38dfd4dcf9874870 (patch) | |
| tree | 9e18009b3c6be0ebc7dcf5101e962cea04369f89 /src/lib/libcrypto/man/ENGINE_new.3 | |
| parent | 4540016d0d76686970d33dcc0d6967279b24b7f8 (diff) | |
| download | openbsd-2e8a8076843788f75a575d4d38dfd4dcf9874870.tar.gz openbsd-2e8a8076843788f75a575d4d38dfd4dcf9874870.tar.bz2 openbsd-2e8a8076843788f75a575d4d38dfd4dcf9874870.zip | |
Rewrite the ENGINE_*(3) documentation from scratch - step 2,
covering the remaining functions that were documented in engine(3),
except for seven functions that are completely pointless and that
were merely listed but not really documented.
Diffstat (limited to 'src/lib/libcrypto/man/ENGINE_new.3')
| -rw-r--r-- | src/lib/libcrypto/man/ENGINE_new.3 | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ENGINE_new.3 b/src/lib/libcrypto/man/ENGINE_new.3 new file mode 100644 index 0000000000..ab875ce662 --- /dev/null +++ b/src/lib/libcrypto/man/ENGINE_new.3 | |||
| @@ -0,0 +1,154 @@ | |||
| 1 | .\" $OpenBSD: ENGINE_new.3,v 1.1 2018/04/15 17:02:03 schwarze Exp $ | ||
| 2 | .\" content checked up to: | ||
| 3 | .\" OpenSSL ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 | ||
| 4 | .\" | ||
| 5 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | ||
| 6 | .\" | ||
| 7 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 8 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 9 | .\" copyright notice and this permission notice appear in all copies. | ||
| 10 | .\" | ||
| 11 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 12 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 13 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 14 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 15 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 16 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 17 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 18 | .\" | ||
| 19 | .Dd $Mdocdate: April 15 2018 $ | ||
| 20 | .Dt ENGINE_NEW 3 | ||
| 21 | .Os | ||
| 22 | .Sh NAME | ||
| 23 | .Nm ENGINE_new , | ||
| 24 | .Nm ENGINE_up_ref , | ||
| 25 | .Nm ENGINE_free , | ||
| 26 | .Nm ENGINE_set_destroy_function , | ||
| 27 | .Nm ENGINE_get_destroy_function | ||
| 28 | .Nd create and destroy ENGINE objects | ||
| 29 | .Sh SYNOPSIS | ||
| 30 | .In openssl/engine.h | ||
| 31 | .Ft ENGINE * | ||
| 32 | .Fn ENGINE_new void | ||
| 33 | .Ft int | ||
| 34 | .Fo ENGINE_up_ref | ||
| 35 | .Fa "ENGINE *e" | ||
| 36 | .Fc | ||
| 37 | .Ft int | ||
| 38 | .Fo ENGINE_free | ||
| 39 | .Fa "ENGINE *e" | ||
| 40 | .Fc | ||
| 41 | .Ft typedef int | ||
| 42 | .Fo (*ENGINE_GEN_INT_FUNC_PTR) | ||
| 43 | .Fa "ENGINE *e" | ||
| 44 | .Fc | ||
| 45 | .Ft int | ||
| 46 | .Fo ENGINE_set_destroy_function | ||
| 47 | .Fa "ENGINE *e" | ||
| 48 | .Fa "ENGINE_GEN_INT_FUNC_PTR destroy_f" | ||
| 49 | .Fc | ||
| 50 | .Ft ENGINE_GEN_INT_FUNC_PTR | ||
| 51 | .Fo ENGINE_get_destroy_function | ||
| 52 | .Fa "const ENGINE *e" | ||
| 53 | .Fc | ||
| 54 | .Sh DESCRIPTION | ||
| 55 | .Fn ENGINE_new | ||
| 56 | allocates and initializes an empty | ||
| 57 | .Vt ENGINE | ||
| 58 | object and sets its structural reference count to 1 | ||
| 59 | and its functional reference count to 0. | ||
| 60 | For more information about the functional reference count, see the | ||
| 61 | .Xr ENGINE_init 3 | ||
| 62 | manual page. | ||
| 63 | .Pp | ||
| 64 | Many functions increment the structural reference count by 1 | ||
| 65 | when successful. | ||
| 66 | Some of them, including | ||
| 67 | .Xr ENGINE_get_first 3 , | ||
| 68 | .Xr ENGINE_get_last 3 , | ||
| 69 | .Xr ENGINE_get_next 3 , | ||
| 70 | .Xr ENGINE_get_prev 3 , | ||
| 71 | and | ||
| 72 | .Xr ENGINE_by_id 3 , | ||
| 73 | do so because they return a structural reference to the user. | ||
| 74 | Other functions, including | ||
| 75 | .Xr ENGINE_add 3 , | ||
| 76 | .Xr ENGINE_init 3 , | ||
| 77 | .Xr ENGINE_get_cipher_engine 3 , | ||
| 78 | .Xr ENGINE_get_digest_engine 3 , | ||
| 79 | and the | ||
| 80 | .Xr ENGINE_get_default_RSA 3 | ||
| 81 | and | ||
| 82 | .Xr ENGINE_set_default 3 | ||
| 83 | families of functions | ||
| 84 | do so when they store a structural refence internally. | ||
| 85 | .Pp | ||
| 86 | .Fn ENGINE_up_ref | ||
| 87 | explicitly increment the structural reference count by 1. | ||
| 88 | .Pp | ||
| 89 | .Fn ENGINE_free | ||
| 90 | decrements the structural reference count by 1, | ||
| 91 | and if it reaches 0, the optional | ||
| 92 | .Fa destroy_f | ||
| 93 | previously installed with | ||
| 94 | .Fn ENGINE_set_destroy_function | ||
| 95 | is called, if one is installed, and both the memory used internally by | ||
| 96 | .Fa e | ||
| 97 | and | ||
| 98 | .Fa e | ||
| 99 | itself are freed. | ||
| 100 | If | ||
| 101 | .Fa e | ||
| 102 | is a | ||
| 103 | .Dv NULL | ||
| 104 | pointer, no action occurs. | ||
| 105 | .Pp | ||
| 106 | Many functions internally call the equivalent of | ||
| 107 | .Fn ENGINE_free . | ||
| 108 | Some of them, including | ||
| 109 | .Xr ENGINE_get_next 3 | ||
| 110 | and | ||
| 111 | .Xr ENGINE_get_prev 3 , | ||
| 112 | thus invalidate the structural reference passed in by the user. | ||
| 113 | Other functions, including | ||
| 114 | .Xr ENGINE_finish 3 , | ||
| 115 | .Xr ENGINE_remove 3 , | ||
| 116 | and the | ||
| 117 | .Xr ENGINE_set_default 3 | ||
| 118 | family of functions | ||
| 119 | do so when an internally stored structural reference is no longer needed. | ||
| 120 | .Pp | ||
| 121 | .Fn ENGINE_set_destroy_function | ||
| 122 | installs a callback function that will be called by | ||
| 123 | .Fn ENGINE_free , | ||
| 124 | but only when | ||
| 125 | .Fa e | ||
| 126 | actually gets destroyed, | ||
| 127 | not when only its reference count gets decremented. | ||
| 128 | The value returned from the | ||
| 129 | .Fa destroy_f | ||
| 130 | will be ignored. | ||
| 131 | .Sh RETURN VALUES | ||
| 132 | .Fn ENGINE_new | ||
| 133 | returns a structural reference to the new | ||
| 134 | .Vt ENGINE | ||
| 135 | object or | ||
| 136 | .Dv NULL | ||
| 137 | if an error occurs. | ||
| 138 | .Pp | ||
| 139 | .Fn ENGINE_up_ref | ||
| 140 | returns 0 if | ||
| 141 | .Fa e | ||
| 142 | is | ||
| 143 | .Dv NULL | ||
| 144 | and 1 otherwise. | ||
| 145 | .Pp | ||
| 146 | .Fn ENGINE_free | ||
| 147 | and | ||
| 148 | .Fn ENGINE_set_destroy_function | ||
| 149 | always return 1. | ||
| 150 | .Pp | ||
| 151 | .Fn ENGINE_get_destroy_function | ||
| 152 | returns a function pointer to the callback, or | ||
| 153 | .Dv NULL | ||
| 154 | if none is installed. | ||
