diff options
| author | schwarze <> | 2018-04-18 01:07:38 +0000 |
|---|---|---|
| committer | schwarze <> | 2018-04-18 01:07:38 +0000 |
| commit | cc294651e05fd30bc4da64428f737517337a2b80 (patch) | |
| tree | 973ad8bc910e76d0653fd3a236b72173cd228808 | |
| parent | bd01d4824e311a5cdae5cdc67d969217389f1957 (diff) | |
| download | openbsd-cc294651e05fd30bc4da64428f737517337a2b80.tar.gz openbsd-cc294651e05fd30bc4da64428f737517337a2b80.tar.bz2 openbsd-cc294651e05fd30bc4da64428f737517337a2b80.zip | |
* Do not document the non-existent function RSA_null_method(3).
* Add three missing const qualifiers to function prototypes.
* Correct the argument type of RSA_new_method(3).
* Remove duplicate decsription of RSA_flags(3) and RSA_new_method(3).
* Make the description of method selection simpler, more precise,
and more concise.
* Correct description of the return value of RSA_set_method(3).
* Stop referencing engine(3).
| -rw-r--r-- | src/lib/libcrypto/man/RSA_set_method.3 | 148 |
1 files changed, 43 insertions, 105 deletions
diff --git a/src/lib/libcrypto/man/RSA_set_method.3 b/src/lib/libcrypto/man/RSA_set_method.3 index 9c5314e6f2..b4724e3e6d 100644 --- a/src/lib/libcrypto/man/RSA_set_method.3 +++ b/src/lib/libcrypto/man/RSA_set_method.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: RSA_set_method.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ | 1 | .\" $OpenBSD: RSA_set_method.3,v 1.12 2018/04/18 01:07:38 schwarze Exp $ |
| 2 | .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> |
| @@ -50,7 +50,7 @@ | |||
| 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 50 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 51 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 52 | .\" | 52 | .\" |
| 53 | .Dd $Mdocdate: March 27 2018 $ | 53 | .Dd $Mdocdate: April 18 2018 $ |
| 54 | .Dt RSA_SET_METHOD 3 | 54 | .Dt RSA_SET_METHOD 3 |
| 55 | .Os | 55 | .Os |
| 56 | .Sh NAME | 56 | .Sh NAME |
| @@ -59,7 +59,6 @@ | |||
| 59 | .Nm RSA_set_method , | 59 | .Nm RSA_set_method , |
| 60 | .Nm RSA_get_method , | 60 | .Nm RSA_get_method , |
| 61 | .Nm RSA_PKCS1_SSLeay , | 61 | .Nm RSA_PKCS1_SSLeay , |
| 62 | .Nm RSA_null_method , | ||
| 63 | .Nm RSA_flags , | 62 | .Nm RSA_flags , |
| 64 | .Nm RSA_new_method | 63 | .Nm RSA_new_method |
| 65 | .Nd select RSA method | 64 | .Nd select RSA method |
| @@ -69,78 +68,65 @@ | |||
| 69 | .Fo RSA_set_default_method | 68 | .Fo RSA_set_default_method |
| 70 | .Fa "const RSA_METHOD *meth" | 69 | .Fa "const RSA_METHOD *meth" |
| 71 | .Fc | 70 | .Fc |
| 72 | .Ft RSA_METHOD * | 71 | .Ft const RSA_METHOD * |
| 73 | .Fn RSA_get_default_method void | 72 | .Fn RSA_get_default_method void |
| 74 | .Ft int | 73 | .Ft int |
| 75 | .Fo RSA_set_method | 74 | .Fo RSA_set_method |
| 76 | .Fa "RSA *rsa" | 75 | .Fa "RSA *rsa" |
| 77 | .Fa "const RSA_METHOD *meth" | 76 | .Fa "const RSA_METHOD *meth" |
| 78 | .Fc | 77 | .Fc |
| 79 | .Ft RSA_METHOD * | 78 | .Ft const RSA_METHOD * |
| 80 | .Fo RSA_get_method | 79 | .Fo RSA_get_method |
| 81 | .Fa "const RSA *rsa" | 80 | .Fa "const RSA *rsa" |
| 82 | .Fc | 81 | .Fc |
| 83 | .Ft RSA_METHOD * | 82 | .Ft const RSA_METHOD * |
| 84 | .Fn RSA_PKCS1_SSLeay void | 83 | .Fn RSA_PKCS1_SSLeay void |
| 85 | .Ft RSA_METHOD * | ||
| 86 | .Fn RSA_null_method void | ||
| 87 | .Ft int | 84 | .Ft int |
| 88 | .Fo RSA_flags | 85 | .Fo RSA_flags |
| 89 | .Fa "const RSA *rsa" | 86 | .Fa "const RSA *rsa" |
| 90 | .Fc | 87 | .Fc |
| 91 | .Ft RSA * | 88 | .Ft RSA * |
| 92 | .Fo RSA_new_method | 89 | .Fo RSA_new_method |
| 93 | .Fa "RSA_METHOD *meth" | 90 | .Fa "ENGINE *engine" |
| 94 | .Fc | 91 | .Fc |
| 95 | .Sh DESCRIPTION | 92 | .Sh DESCRIPTION |
| 96 | An | 93 | An |
| 97 | .Vt RSA_METHOD | 94 | .Vt RSA_METHOD |
| 98 | specifies the functions that OpenSSL uses for RSA operations. | 95 | object contains pointers to the functions used for RSA operations. |
| 99 | By modifying the method, alternative implementations such as hardware | 96 | By default, the internal implementation returned by |
| 100 | accelerators may be used. | 97 | .Fn RSA_PKCS1_SSLeay |
| 101 | See the | 98 | is used. |
| 102 | .Sx CAVEATS | 99 | By selecting another method, alternative implementations |
| 103 | section for how these RSA API functions are affected by the use of | 100 | such as hardware accelerators may be used. |
| 104 | .Xr engine 3 | ||
| 105 | API calls. | ||
| 106 | .Pp | ||
| 107 | Initially, the default | ||
| 108 | .Vt RSA_METHOD | ||
| 109 | is the OpenSSL internal implementation, as returned by | ||
| 110 | .Fn RSA_PKCS1_SSLeay . | ||
| 111 | .Pp | 101 | .Pp |
| 112 | .Fn RSA_set_default_method | 102 | .Fn RSA_set_default_method |
| 113 | makes | 103 | selects |
| 114 | .Fa meth | 104 | .Fa meth |
| 115 | the default method for all | 105 | as the default method for all |
| 116 | .Vt RSA | 106 | .Vt RSA |
| 117 | structures created later. | 107 | structures created later. |
| 118 | .Sy NB : | 108 | If any |
| 119 | This is true only whilst no | ||
| 120 | .Vt ENGINE | 109 | .Vt ENGINE |
| 121 | has been set as a default for RSA, so this function is no longer | 110 | was registered with |
| 122 | recommended. | 111 | .Xr ENGINE_register_RSA 3 |
| 112 | that can be successfully initialized, it overrides the default. | ||
| 123 | .Pp | 113 | .Pp |
| 124 | .Fn RSA_get_default_method | 114 | .Fn RSA_get_default_method |
| 125 | returns a pointer to the current default | 115 | returns a pointer to the current default method, |
| 126 | .Vt RSA_METHOD . | 116 | even if it is actually overridded by an |
| 127 | However, the meaningfulness of this result is dependent on whether | 117 | .Vt ENGINE . |
| 128 | the | ||
| 129 | .Xr engine 3 | ||
| 130 | API is being used, so this function is no longer recommended. | ||
| 131 | .Pp | 118 | .Pp |
| 132 | .Fn RSA_set_method | 119 | .Fn RSA_set_method |
| 133 | selects | 120 | selects |
| 134 | .Fa meth | 121 | .Fa meth |
| 135 | to perform all operations using the key | 122 | to perform all operations using the key |
| 136 | .Fa rsa . | 123 | .Fa rsa . |
| 137 | This will replace the | 124 | This replaces the |
| 138 | .Vt RSA_METHOD | 125 | .Vt RSA_METHOD |
| 139 | used by the RSA key, and if the previous method was supplied by an | 126 | used by the RSA key, and if the previous method was supplied by an |
| 140 | .Vt ENGINE , | 127 | .Vt ENGINE , |
| 141 | the handle to that | 128 | .Xr ENGINE_finish 3 |
| 142 | .Vt ENGINE | 129 | is called on it. |
| 143 | will be released during the change. | ||
| 144 | It is possible to have RSA keys that only work with certain | 130 | It is possible to have RSA keys that only work with certain |
| 145 | .Vt RSA_METHOD | 131 | .Vt RSA_METHOD |
| 146 | implementations (e.g. from an | 132 | implementations (e.g. from an |
| @@ -175,34 +161,23 @@ section. | |||
| 175 | allocates and initializes an | 161 | allocates and initializes an |
| 176 | .Vt RSA | 162 | .Vt RSA |
| 177 | structure so that | 163 | structure so that |
| 178 | .Fa meth | 164 | .Fa engine |
| 179 | will be used for the RSA operations. | 165 | is used for the RSA operations. |
| 180 | If | 166 | If |
| 181 | .Sy engine | 167 | .Fa engine |
| 182 | is NULL, the default ENGINE for RSA operations is used and, if no | 168 | is |
| 183 | default ENGINE is set, the RSA_METHOD controlled by | 169 | .Dv NULL , |
| 170 | .Xr ENGINE_get_default_RSA 3 | ||
| 171 | is used. | ||
| 172 | If that returns | ||
| 173 | .Dv NULL , | ||
| 174 | the default method controlled by | ||
| 184 | .Fn RSA_set_default_method | 175 | .Fn RSA_set_default_method |
| 185 | is used. | 176 | is used. |
| 186 | .Pp | 177 | .Pp |
| 187 | .Fn RSA_flags | 178 | The |
| 188 | returns the | 179 | .Dv RSA_METHOD |
| 189 | .Sy flags | 180 | structure is defined as follows: |
| 190 | that are set for | ||
| 191 | .Fa rsa Ns 's | ||
| 192 | current method. | ||
| 193 | .Pp | ||
| 194 | .Fn RSA_new_method | ||
| 195 | allocates and initializes an | ||
| 196 | .Vt RSA | ||
| 197 | structure so that | ||
| 198 | .Fa meth | ||
| 199 | will be used for the RSA operations. | ||
| 200 | If | ||
| 201 | .Fa meth | ||
| 202 | is | ||
| 203 | .Dv NULL , | ||
| 204 | the default method is used. | ||
| 205 | .Sh THE RSA_METHOD STRUCTURE | ||
| 206 | .Bd -literal | 181 | .Bd -literal |
| 207 | typedef struct rsa_meth_st | 182 | typedef struct rsa_meth_st |
| 208 | { | 183 | { |
| @@ -265,30 +240,15 @@ typedef struct rsa_meth_st | |||
| 265 | .Ed | 240 | .Ed |
| 266 | .Sh RETURN VALUES | 241 | .Sh RETURN VALUES |
| 267 | .Fn RSA_PKCS1_SSLeay , | 242 | .Fn RSA_PKCS1_SSLeay , |
| 268 | .Fn RSA_null_method , | 243 | .Fn RSA_get_default_method , |
| 269 | .Fn RSA_get_default_method | ||
| 270 | and | 244 | and |
| 271 | .Fn RSA_get_method | 245 | .Fn RSA_get_method |
| 272 | return pointers to the respective | 246 | return pointers to the respective |
| 273 | .Vt RSA_METHOD . | 247 | .Vt RSA_METHOD . |
| 274 | .Pp | 248 | .Pp |
| 275 | .Fn RSA_set_method | 249 | .Fn RSA_set_method |
| 276 | returns a pointer to the old | 250 | returns 1 on success or 0 on failure. |
| 277 | .Vt RSA_METHOD | 251 | Currently, it cannot fail. |
| 278 | implementation that was replaced. | ||
| 279 | However, this return value should probably be ignored because if it was | ||
| 280 | supplied by an | ||
| 281 | .Vt ENGINE , | ||
| 282 | the pointer could be invalidated at any time if the | ||
| 283 | .Vt ENGINE | ||
| 284 | is unloaded. | ||
| 285 | In fact, it could be unloaded as a result of the | ||
| 286 | .Fn RSA_set_method | ||
| 287 | function releasing its handle to the | ||
| 288 | .Vt ENGINE . | ||
| 289 | For this reason, the return type may be replaced with a | ||
| 290 | .Vt void | ||
| 291 | declaration in a future release. | ||
| 292 | .Pp | 252 | .Pp |
| 293 | .Fn RSA_new_method | 253 | .Fn RSA_new_method |
| 294 | returns | 254 | returns |
| @@ -298,6 +258,9 @@ and sets an error code that can be obtained by | |||
| 298 | if the allocation fails. | 258 | if the allocation fails. |
| 299 | Otherwise it returns a pointer to the newly allocated structure. | 259 | Otherwise it returns a pointer to the newly allocated structure. |
| 300 | .Sh SEE ALSO | 260 | .Sh SEE ALSO |
| 261 | .Xr ENGINE_get_default_RSA 3 , | ||
| 262 | .Xr ENGINE_register_RSA 3 , | ||
| 263 | .Xr ENGINE_set_default_RSA 3 , | ||
| 301 | .Xr RSA_meth_new 3 , | 264 | .Xr RSA_meth_new 3 , |
| 302 | .Xr RSA_new 3 | 265 | .Xr RSA_new 3 |
| 303 | .Sh HISTORY | 266 | .Sh HISTORY |
| @@ -323,31 +286,6 @@ components of | |||
| 323 | .Vt RSA_METHOD | 286 | .Vt RSA_METHOD |
| 324 | first appeared in OpenSSL 0.9.4 and have been available since | 287 | first appeared in OpenSSL 0.9.4 and have been available since |
| 325 | .Ox 2.6 . | 288 | .Ox 2.6 . |
| 326 | .Pp | ||
| 327 | .Fn RSA_null_method | ||
| 328 | first appeared in OpenSSL 0.9.5 and has been available since | ||
| 329 | .Ox 2.7 . | ||
| 330 | .Sh CAVEATS | ||
| 331 | As of version 0.9.7, | ||
| 332 | .Vt RSA_METHOD | ||
| 333 | implementations are grouped together with other algorithmic APIs (e.g.\& | ||
| 334 | .Vt DSA_METHOD | ||
| 335 | or | ||
| 336 | .Vt EVP_CIPHER ) | ||
| 337 | into | ||
| 338 | .Vt ENGINE | ||
| 339 | modules. | ||
| 340 | If a default | ||
| 341 | .Vt ENGINE | ||
| 342 | is specified for RSA functionality using an | ||
| 343 | .Xr engine 3 | ||
| 344 | API function, that will override any RSA defaults set using the RSA | ||
| 345 | API, i.e.\& | ||
| 346 | .Fn RSA_set_default_method . | ||
| 347 | For this reason, the | ||
| 348 | .Xr engine 3 | ||
| 349 | API is the recommended way to control default implementations for | ||
| 350 | use in RSA and other cryptographic algorithms. | ||
| 351 | .Sh BUGS | 289 | .Sh BUGS |
| 352 | The behaviour of | 290 | The behaviour of |
| 353 | .Fn RSA_flags | 291 | .Fn RSA_flags |
