diff options
| author | schwarze <> | 2019-06-08 09:53:15 +0000 |
|---|---|---|
| committer | schwarze <> | 2019-06-08 09:53:15 +0000 |
| commit | c7efff3e254b868e292d5726e03e83b957c0dd15 (patch) | |
| tree | 19f63916a773468b6ac2c1b73fbac3a6aff56964 /src | |
| parent | 75842177a9c23b09df0eb4e427a0a4a120a095c4 (diff) | |
| download | openbsd-c7efff3e254b868e292d5726e03e83b957c0dd15.tar.gz openbsd-c7efff3e254b868e292d5726e03e83b957c0dd15.tar.bz2 openbsd-c7efff3e254b868e292d5726e03e83b957c0dd15.zip | |
In rsa.h rev. 1.40, gilles@ provided several new RSA_METHOD accessors.
Update the documentation.
OK tb@ jmc@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/RSA_generate_key.3 | 5 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/RSA_meth_new.3 | 454 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/RSA_new.3 | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/RSA_set_method.3 | 67 | ||||
| -rw-r--r-- | src/lib/libcrypto/man/RSA_sign.3 | 5 |
5 files changed, 499 insertions, 46 deletions
diff --git a/src/lib/libcrypto/man/RSA_generate_key.3 b/src/lib/libcrypto/man/RSA_generate_key.3 index 3ac3885f13..80bae6824c 100644 --- a/src/lib/libcrypto/man/RSA_generate_key.3 +++ b/src/lib/libcrypto/man/RSA_generate_key.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: RSA_generate_key.3,v 1.11 2018/03/27 17:35:50 schwarze Exp $ | 1 | .\" $OpenBSD: RSA_generate_key.3,v 1.12 2019/06/08 09:53:15 schwarze Exp $ |
| 2 | .\" OpenSSL RSA_generate_key.pod bb6c5e7f Feb 5 10:29:22 2017 -0500 | 2 | .\" OpenSSL RSA_generate_key.pod bb6c5e7f Feb 5 10:29:22 2017 -0500 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. |
| @@ -48,7 +48,7 @@ | |||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 50 | .\" | 50 | .\" |
| 51 | .Dd $Mdocdate: March 27 2018 $ | 51 | .Dd $Mdocdate: June 8 2019 $ |
| 52 | .Dt RSA_GENERATE_KEY 3 | 52 | .Dt RSA_GENERATE_KEY 3 |
| 53 | .Os | 53 | .Os |
| 54 | .Sh NAME | 54 | .Sh NAME |
| @@ -144,6 +144,7 @@ The error codes can be obtained by | |||
| 144 | .Xr BN_generate_prime 3 , | 144 | .Xr BN_generate_prime 3 , |
| 145 | .Xr ERR_get_error 3 , | 145 | .Xr ERR_get_error 3 , |
| 146 | .Xr RSA_get0_key 3 , | 146 | .Xr RSA_get0_key 3 , |
| 147 | .Xr RSA_meth_set_keygen 3 , | ||
| 147 | .Xr RSA_new 3 | 148 | .Xr RSA_new 3 |
| 148 | .Sh HISTORY | 149 | .Sh HISTORY |
| 149 | .Fn RSA_generate_key | 150 | .Fn RSA_generate_key |
diff --git a/src/lib/libcrypto/man/RSA_meth_new.3 b/src/lib/libcrypto/man/RSA_meth_new.3 index 137e0cad87..8faab9490d 100644 --- a/src/lib/libcrypto/man/RSA_meth_new.3 +++ b/src/lib/libcrypto/man/RSA_meth_new.3 | |||
| @@ -1,10 +1,11 @@ | |||
| 1 | .\" $OpenBSD: RSA_meth_new.3,v 1.3 2018/09/12 15:09:22 jmc Exp $ | 1 | .\" $OpenBSD: RSA_meth_new.3,v 1.4 2019/06/08 09:53:15 schwarze Exp $ |
| 2 | .\" selective merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400 | 2 | .\" full merge up to: OpenSSL a970b14f Jul 31 18:58:40 2017 -0400 |
| 3 | .\" selective merge up to: OpenSSL 24907560 Sep 17 07:47:42 2018 +1000 | ||
| 3 | .\" | 4 | .\" |
| 4 | .\" This file is a derived work. | 5 | .\" This file is a derived work. |
| 5 | .\" The changes are covered by the following Copyright and license: | 6 | .\" The changes are covered by the following Copyright and license: |
| 6 | .\" | 7 | .\" |
| 7 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | 8 | .\" Copyright (c) 2018, 2019 Ingo Schwarze <schwarze@openbsd.org> |
| 8 | .\" | 9 | .\" |
| 9 | .\" Permission to use, copy, modify, and distribute this software for any | 10 | .\" Permission to use, copy, modify, and distribute this software for any |
| 10 | .\" purpose with or without fee is hereby granted, provided that the above | 11 | .\" purpose with or without fee is hereby granted, provided that the above |
| @@ -65,18 +66,41 @@ | |||
| 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 67 | .\" | 68 | .\" |
| 68 | .Dd $Mdocdate: September 12 2018 $ | 69 | .Dd $Mdocdate: June 8 2019 $ |
| 69 | .Dt RSA_METH_NEW 3 | 70 | .Dt RSA_METH_NEW 3 |
| 70 | .Os | 71 | .Os |
| 71 | .Sh NAME | 72 | .Sh NAME |
| 72 | .Nm RSA_meth_new , | 73 | .Nm RSA_meth_new , |
| 73 | .Nm RSA_meth_dup , | 74 | .Nm RSA_meth_dup , |
| 74 | .Nm RSA_meth_free , | 75 | .Nm RSA_meth_free , |
| 75 | .Nm RSA_meth_get_finish , | 76 | .Nm RSA_meth_get0_name , |
| 76 | .Nm RSA_meth_set1_name , | 77 | .Nm RSA_meth_set1_name , |
| 78 | .Nm RSA_meth_get_flags , | ||
| 79 | .Nm RSA_meth_set_flags , | ||
| 80 | .Nm RSA_meth_get0_app_data , | ||
| 81 | .Nm RSA_meth_set0_app_data , | ||
| 82 | .Nm RSA_meth_get_init , | ||
| 83 | .Nm RSA_meth_set_init , | ||
| 84 | .Nm RSA_meth_get_finish , | ||
| 77 | .Nm RSA_meth_set_finish , | 85 | .Nm RSA_meth_set_finish , |
| 86 | .Nm RSA_meth_get_pub_enc , | ||
| 87 | .Nm RSA_meth_set_pub_enc , | ||
| 88 | .Nm RSA_meth_get_pub_dec , | ||
| 89 | .Nm RSA_meth_set_pub_dec , | ||
| 90 | .Nm RSA_meth_get_priv_enc , | ||
| 78 | .Nm RSA_meth_set_priv_enc , | 91 | .Nm RSA_meth_set_priv_enc , |
| 79 | .Nm RSA_meth_set_priv_dec | 92 | .Nm RSA_meth_get_priv_dec , |
| 93 | .Nm RSA_meth_set_priv_dec , | ||
| 94 | .Nm RSA_meth_get_sign , | ||
| 95 | .Nm RSA_meth_set_sign , | ||
| 96 | .Nm RSA_meth_get_verify , | ||
| 97 | .Nm RSA_meth_set_verify , | ||
| 98 | .Nm RSA_meth_get_mod_exp , | ||
| 99 | .Nm RSA_meth_set_mod_exp , | ||
| 100 | .Nm RSA_meth_get_bn_mod_exp , | ||
| 101 | .Nm RSA_meth_set_bn_mod_exp , | ||
| 102 | .Nm RSA_meth_get_keygen , | ||
| 103 | .Nm RSA_meth_set_keygen | ||
| 80 | .Nd build up RSA methods | 104 | .Nd build up RSA methods |
| 81 | .Sh SYNOPSIS | 105 | .Sh SYNOPSIS |
| 82 | .In openssl/rsa.h | 106 | .In openssl/rsa.h |
| @@ -93,30 +117,177 @@ | |||
| 93 | .Fo RSA_meth_free | 117 | .Fo RSA_meth_free |
| 94 | .Fa "RSA_METHOD *meth" | 118 | .Fa "RSA_METHOD *meth" |
| 95 | .Fc | 119 | .Fc |
| 120 | .Ft const char * | ||
| 121 | .Fo RSA_meth_get0_name | ||
| 122 | .Fa "const RSA_METHOD *meth" | ||
| 123 | .Fc | ||
| 96 | .Ft int | 124 | .Ft int |
| 97 | .Fo RSA_meth_set1_name | 125 | .Fo RSA_meth_set1_name |
| 98 | .Fa "RSA_METHOD *meth" | 126 | .Fa "RSA_METHOD *meth" |
| 99 | .Fa "const char *name" | 127 | .Fa "const char *name" |
| 100 | .Fc | 128 | .Fc |
| 101 | .Ft int | 129 | .Ft int |
| 102 | .Fn "(*RSA_meth_get_finish(const RSA_METHOD *meth))" "RSA *rsa" | 130 | .Fo RSA_meth_get_flags |
| 131 | .Fa "const RSA_METHOD *meth" | ||
| 132 | .Fc | ||
| 133 | .Ft int | ||
| 134 | .Fo RSA_meth_set_flags | ||
| 135 | .Fa "RSA_METHOD *meth" | ||
| 136 | .Fa "int flags" | ||
| 137 | .Fc | ||
| 138 | .Ft void * | ||
| 139 | .Fo RSA_meth_get0_app_data | ||
| 140 | .Fa "const RSA_METHOD *meth" | ||
| 141 | .Fc | ||
| 142 | .Ft int | ||
| 143 | .Fo RSA_meth_set0_app_data | ||
| 144 | .Fa "RSA_METHOD *meth" | ||
| 145 | .Fa "void *app_data" | ||
| 146 | .Fc | ||
| 147 | .Ft int | ||
| 148 | .Fo "(*RSA_meth_get_init(const RSA_METHOD *meth))" | ||
| 149 | .Fa "RSA *rsa" | ||
| 150 | .Fc | ||
| 151 | .Ft int | ||
| 152 | .Fo "RSA_meth_set_init" | ||
| 153 | .Fa "RSA_METHOD *meth" | ||
| 154 | .Fa "int (*init)(RSA *rsa)" | ||
| 155 | .Fc | ||
| 156 | .Ft int | ||
| 157 | .Fo "(*RSA_meth_get_finish(const RSA_METHOD *meth))" | ||
| 158 | .Fa "RSA *rsa" | ||
| 159 | .Fc | ||
| 103 | .Ft int | 160 | .Ft int |
| 104 | .Fo RSA_meth_set_finish | 161 | .Fo RSA_meth_set_finish |
| 105 | .Fa "RSA_METHOD *meth" | 162 | .Fa "RSA_METHOD *meth" |
| 106 | .Fa "int (*finish)(RSA *rsa)" | 163 | .Fa "int (*finish)(RSA *rsa)" |
| 107 | .Fc | 164 | .Fc |
| 108 | .Ft int | 165 | .Ft int |
| 166 | .Fo "(*RSA_meth_get_pub_enc(const RSA_METHOD *meth))" | ||
| 167 | .Fa "int flen" | ||
| 168 | .Fa "const unsigned char *from" | ||
| 169 | .Fa "unsigned char *to" | ||
| 170 | .Fa "RSA *rsa" | ||
| 171 | .Fa "int padding" | ||
| 172 | .Fc | ||
| 173 | .Ft int | ||
| 174 | .Fo RSA_meth_set_pub_enc | ||
| 175 | .Fa "RSA_METHOD *meth" | ||
| 176 | .Fa "int (*pub_enc)(int flen, const unsigned char *from,\ | ||
| 177 | unsigned char *to, RSA *rsa, int padding)" | ||
| 178 | .Fc | ||
| 179 | .Ft int | ||
| 180 | .Fo "(*RSA_meth_get_pub_dec(const RSA_METHOD *meth))" | ||
| 181 | .Fa "int flen" | ||
| 182 | .Fa "const unsigned char *from" | ||
| 183 | .Fa "unsigned char *to" | ||
| 184 | .Fa "RSA *rsa" | ||
| 185 | .Fa "int padding" | ||
| 186 | .Fc | ||
| 187 | .Ft int | ||
| 188 | .Fo RSA_meth_set_pub_dec | ||
| 189 | .Fa "RSA_METHOD *meth" | ||
| 190 | .Fa "int (*pub_dec)(int flen, const unsigned char *from,\ | ||
| 191 | unsigned char *to, RSA *rsa, int padding)" | ||
| 192 | .Fc | ||
| 193 | .Ft int | ||
| 194 | .Fo "(*RSA_meth_get_priv_enc(const RSA_METHOD *meth))" | ||
| 195 | .Fa "int flen" | ||
| 196 | .Fa "const unsigned char *from" | ||
| 197 | .Fa "unsigned char *to" | ||
| 198 | .Fa "RSA *rsa" | ||
| 199 | .Fa "int padding" | ||
| 200 | .Fc | ||
| 201 | .Ft int | ||
| 109 | .Fo RSA_meth_set_priv_enc | 202 | .Fo RSA_meth_set_priv_enc |
| 110 | .Fa "RSA_METHOD *meth" | 203 | .Fa "RSA_METHOD *meth" |
| 111 | .Fa "int (*priv_enc)(int flen, const unsigned char *from,\ | 204 | .Fa "int (*priv_enc)(int flen, const unsigned char *from,\ |
| 112 | unsigned char *to, RSA *rsa, int padding)" | 205 | unsigned char *to, RSA *rsa, int padding)" |
| 113 | .Fc | 206 | .Fc |
| 114 | .Ft int | 207 | .Ft int |
| 208 | .Fo "(*RSA_meth_get_priv_dec(const RSA_METHOD *meth))" | ||
| 209 | .Fa "int flen" | ||
| 210 | .Fa "const unsigned char *from" | ||
| 211 | .Fa "unsigned char *to" | ||
| 212 | .Fa "RSA *rsa" | ||
| 213 | .Fa "int padding" | ||
| 214 | .Fc | ||
| 215 | .Ft int | ||
| 115 | .Fo RSA_meth_set_priv_dec | 216 | .Fo RSA_meth_set_priv_dec |
| 116 | .Fa "RSA_METHOD *meth" | 217 | .Fa "RSA_METHOD *meth" |
| 117 | .Fa "int (*priv_dec)(int flen, const unsigned char *from,\ | 218 | .Fa "int (*priv_dec)(int flen, const unsigned char *from,\ |
| 118 | unsigned char *to, RSA *rsa, int padding)" | 219 | unsigned char *to, RSA *rsa, int padding)" |
| 119 | .Fc | 220 | .Fc |
| 221 | .Ft int | ||
| 222 | .Fo "(*RSA_meth_get_sign(const RSA_METHOD *meth))" | ||
| 223 | .Fa "int type" | ||
| 224 | .Fa "const unsigned char *m" | ||
| 225 | .Fa "unsigned int m_length" | ||
| 226 | .Fa "unsigned char *sigret" | ||
| 227 | .Fa "unsigned int *siglen" | ||
| 228 | .Fa "const RSA *rsa" | ||
| 229 | .Fc | ||
| 230 | .Ft int | ||
| 231 | .Fo RSA_meth_set_sign | ||
| 232 | .Fa "RSA_METHOD *rsa" | ||
| 233 | .Fa "int (*sign)(int type, const unsigned char *m, unsigned int m_length,\ | ||
| 234 | unsigned char *sigret, unsigned int *siglen, const RSA *rsa)" | ||
| 235 | .Fc | ||
| 236 | .Ft int | ||
| 237 | .Fo "(*RSA_meth_get_verify(const RSA_METHOD *meth))" | ||
| 238 | .Fa "int dtype" | ||
| 239 | .Fa "const unsigned char *m" | ||
| 240 | .Fa "unsigned int m_length" | ||
| 241 | .Fa "const unsigned char *sigbuf" | ||
| 242 | .Fa "unsigned int siglen" | ||
| 243 | .Fa "const RSA *rsa" | ||
| 244 | .Fc | ||
| 245 | .Ft int | ||
| 246 | .Fo RSA_meth_set_verify | ||
| 247 | .Fa "RSA_METHOD *rsa" | ||
| 248 | .Fa "int (*verify)(int dtype, const unsigned char *m,\ | ||
| 249 | unsigned int m_length, const unsigned char *sigbuf,\ | ||
| 250 | unsigned int siglen, const RSA *rsa)" | ||
| 251 | .Fc | ||
| 252 | .Ft int | ||
| 253 | .Fo "(*RSA_meth_get_mod_exp(const RSA_METHOD *meth))" | ||
| 254 | .Fa "BIGNUM *r0" | ||
| 255 | .Fa "const BIGNUM *i" | ||
| 256 | .Fa "RSA *rsa" | ||
| 257 | .Fa "BN_CTX *ctx" | ||
| 258 | .Fc | ||
| 259 | .Ft int | ||
| 260 | .Fo RSA_meth_set_mod_exp | ||
| 261 | .Fa "RSA_METHOD *meth" | ||
| 262 | .Fa "int (*mod_exp)(BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx)" | ||
| 263 | .Fc | ||
| 264 | .Ft int | ||
| 265 | .Fo "(*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))" | ||
| 266 | .Fa "BIGNUM *r" | ||
| 267 | .Fa "const BIGNUM *a" | ||
| 268 | .Fa "const BIGNUM *p" | ||
| 269 | .Fa "const BIGNUM *m" | ||
| 270 | .Fa "BN_CTX *ctx" | ||
| 271 | .Fa "BN_MONT_CTX *m_ctx" | ||
| 272 | .Fc | ||
| 273 | .Ft int | ||
| 274 | .Fo RSA_meth_set_bn_mod_exp | ||
| 275 | .Fa "RSA_METHOD *meth" | ||
| 276 | .Fa "int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\ | ||
| 277 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx)" | ||
| 278 | .Fc | ||
| 279 | .Ft int | ||
| 280 | .Fo "(*RSA_meth_get_keygen(const RSA_METHOD *meth))" | ||
| 281 | .Fa "RSA *rsa" | ||
| 282 | .Fa "int bits" | ||
| 283 | .Fa "BIGNUM *e" | ||
| 284 | .Fa "BN_GENCB *cb" | ||
| 285 | .Fc | ||
| 286 | .Ft int | ||
| 287 | .Fo RSA_meth_set_keygen | ||
| 288 | .Fa "RSA_METHOD *meth" | ||
| 289 | .Fa "int (*keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb)" | ||
| 290 | .Fc | ||
| 120 | .Sh DESCRIPTION | 291 | .Sh DESCRIPTION |
| 121 | The | 292 | The |
| 122 | .Vt RSA_METHOD | 293 | .Vt RSA_METHOD |
| @@ -137,11 +308,15 @@ object constructed from this | |||
| 137 | .Vt RSA_METHOD | 308 | .Vt RSA_METHOD |
| 138 | will have the given | 309 | will have the given |
| 139 | .Fa flags | 310 | .Fa flags |
| 140 | set by default. | 311 | set by default, as if they were set with |
| 312 | .Xr RSA_set_flags 3 . | ||
| 141 | .Pp | 313 | .Pp |
| 142 | .Fn RSA_meth_dup | 314 | .Fn RSA_meth_dup |
| 143 | creates a deep copy of | 315 | creates a deep copy of |
| 144 | .Fa meth . | 316 | .Fa meth , |
| 317 | except that a pointer stored into it with | ||
| 318 | .Fn RSA_meth_set0_app_data | ||
| 319 | is copied as a pointer without creating a copy of its content. | ||
| 145 | This might be useful for creating a new | 320 | This might be useful for creating a new |
| 146 | .Vt RSA_METHOD | 321 | .Vt RSA_METHOD |
| 147 | based on an existing one, but with some differences. | 322 | based on an existing one, but with some differences. |
| @@ -149,15 +324,80 @@ based on an existing one, but with some differences. | |||
| 149 | .Fn RSA_meth_free | 324 | .Fn RSA_meth_free |
| 150 | destroys | 325 | destroys |
| 151 | .Fa meth | 326 | .Fa meth |
| 152 | and frees any memory associated with it. | 327 | and frees any memory associated with it, |
| 328 | except that memory pointed to by a pointer set with | ||
| 329 | .Fn RSA_meth_set0_app_data | ||
| 330 | is not freed. | ||
| 331 | If | ||
| 332 | .Fa meth | ||
| 333 | is | ||
| 334 | .Dv NULL , | ||
| 335 | no action occurs. | ||
| 153 | .Pp | 336 | .Pp |
| 337 | .Fn RSA_meth_get0_name | ||
| 338 | returns an internal pointer to the name of | ||
| 339 | .Fa meth . | ||
| 154 | .Fn RSA_meth_set1_name | 340 | .Fn RSA_meth_set1_name |
| 155 | Stores a copy of the NUL-terminated | 341 | stores a copy of the NUL-terminated |
| 156 | .Fa name | 342 | .Fa name |
| 157 | in the | 343 | in the |
| 158 | .Vt RSA_METHOD | 344 | .Vt RSA_METHOD |
| 159 | object after freeing the previously stored | 345 | object after freeing the previously stored name. |
| 160 | .Fa name . | 346 | Method names are ignored by the default RSA implementation |
| 347 | but can be used by alternative implementations | ||
| 348 | and by the application program. | ||
| 349 | .Pp | ||
| 350 | .Fn RSA_meth_get_flags | ||
| 351 | retrieves the flags from | ||
| 352 | .Fa meth . | ||
| 353 | Flags are documented in | ||
| 354 | .Xr RSA_test_flags 3 . | ||
| 355 | .Fn RSA_meth_set_flags | ||
| 356 | overwrites all flags in | ||
| 357 | .Fa meth . | ||
| 358 | Unlike | ||
| 359 | .Xr RSA_set_flags 3 , | ||
| 360 | it does not preserve any flags that were set before the call. | ||
| 361 | .Pp | ||
| 362 | .Fn RSA_meth_get0_app_data | ||
| 363 | and | ||
| 364 | .Fn RSA_meth_set0_app_data | ||
| 365 | get and set a pointer to implementation-specific data. | ||
| 366 | The function | ||
| 367 | .Fn RSA_meth_free | ||
| 368 | does not | ||
| 369 | .Xr free 3 | ||
| 370 | the memory pointed to by | ||
| 371 | .Fa app_data . | ||
| 372 | The default RSA implementation does not use | ||
| 373 | .Fa app_data . | ||
| 374 | .Pp | ||
| 375 | .Fn RSA_meth_get_init | ||
| 376 | and | ||
| 377 | .Fn RSA_meth_set_init | ||
| 378 | get and set an optional function used when creating a new | ||
| 379 | .Vt RSA | ||
| 380 | object. | ||
| 381 | Unless | ||
| 382 | .Fa init | ||
| 383 | is | ||
| 384 | .Dv NULL , | ||
| 385 | it will be called at the end of | ||
| 386 | .Xr RSA_new 3 , | ||
| 387 | .Xr RSA_new_method 3 , | ||
| 388 | and | ||
| 389 | .Xr RSA_set_method 3 , | ||
| 390 | passing a pointer to the newly allocated or reset | ||
| 391 | .Vt RSA | ||
| 392 | object as an argument. | ||
| 393 | The default RSA implementation, | ||
| 394 | .Xr RSA_PKCS1_SSLeay 3 , | ||
| 395 | contains an | ||
| 396 | .Fa init | ||
| 397 | function equivalent to calling | ||
| 398 | .Xr RSA_set_flags 3 | ||
| 399 | with an argument of | ||
| 400 | .Dv RSA_FLAG_CACHE_PUBLIC | RSA_FLAG_CACHE_PRIVATE . | ||
| 161 | .Pp | 401 | .Pp |
| 162 | .Fn RSA_meth_get_finish | 402 | .Fn RSA_meth_get_finish |
| 163 | and | 403 | and |
| @@ -170,24 +410,125 @@ Unless | |||
| 170 | is | 410 | is |
| 171 | .Dv NULL , | 411 | .Dv NULL , |
| 172 | it will be called from | 412 | it will be called from |
| 413 | .Xr RSA_set_method 3 | ||
| 414 | and from | ||
| 173 | .Xr RSA_free 3 . | 415 | .Xr RSA_free 3 . |
| 174 | It takes the same argument | 416 | It takes the same argument as |
| 417 | .Xr RSA_free 3 | ||
| 175 | and is intended to do RSA implementation specific cleanup. | 418 | and is intended to do RSA implementation specific cleanup. |
| 176 | The memory used by the | 419 | The memory used by the |
| 177 | .Vt RSA | 420 | .Vt RSA |
| 178 | object itself should not be freed by the | 421 | object itself should not be freed by the |
| 179 | .Fa finish | 422 | .Fa finish |
| 180 | function. | 423 | function. |
| 424 | The default RSA implementation contains a | ||
| 425 | .Fa finish | ||
| 426 | function freeing the memory used by the | ||
| 427 | .Dv RSA_FLAG_CACHE_PUBLIC | ||
| 428 | and | ||
| 429 | .Dv RSA_FLAG_CACHE_PRIVATE | ||
| 430 | caches. | ||
| 181 | .Pp | 431 | .Pp |
| 182 | .Fn RSA_meth_set_priv_enc | 432 | .Fn RSA_meth_get_pub_enc , |
| 433 | .Fn RSA_meth_set_pub_enc , | ||
| 434 | .Fn RSA_meth_get_pub_dec , | ||
| 435 | .Fn RSA_meth_set_pub_dec , | ||
| 436 | .Fn RSA_meth_get_priv_enc , | ||
| 437 | .Fn RSA_meth_set_priv_enc , | ||
| 438 | .Fn RSA_meth_get_priv_dec , | ||
| 183 | and | 439 | and |
| 184 | .Fn RSA_meth_set_priv_dec | 440 | .Fn RSA_meth_set_priv_dec |
| 185 | set the functions used for private key encryption and decryption. | 441 | get and set the mandatory functions |
| 442 | used for public and private key encryption and decryption. | ||
| 186 | These functions will be called from | 443 | These functions will be called from |
| 444 | .Xr RSA_public_encrypt 3 , | ||
| 445 | .Xr RSA_public_decrypt 3 , | ||
| 446 | .Xr RSA_private_encrypt 3 , | ||
| 447 | and | ||
| 448 | .Xr RSA_private_decrypt 3 , | ||
| 449 | respectively, and take the same parameters as those. | ||
| 450 | .Pp | ||
| 451 | .Fn RSA_meth_get_sign , | ||
| 452 | .Fn RSA_meth_set_sign , | ||
| 453 | .Fn RSA_meth_get_verify , | ||
| 454 | and | ||
| 455 | .Fn RSA_meth_set_verify | ||
| 456 | get and set the optional functions | ||
| 457 | used for creating and verifying an RSA signature. | ||
| 458 | If the flag | ||
| 459 | .Dv RSA_FLAG_SIGN_VER | ||
| 460 | is set on the | ||
| 461 | .Vt RSA | ||
| 462 | object in question and | ||
| 463 | .Fa sign | ||
| 464 | or | ||
| 465 | .Fa verify | ||
| 466 | is not | ||
| 467 | .Dv NULL , | ||
| 468 | it will be called from | ||
| 469 | .Xr RSA_sign 3 | ||
| 470 | or | ||
| 471 | .Xr RSA_verify 3 , | ||
| 472 | respectively, and take the same parameters as those. | ||
| 473 | Otherwise, | ||
| 474 | .Xr RSA_private_encrypt 3 | ||
| 475 | or | ||
| 476 | .Xr RSA_public_decrypt 3 | ||
| 477 | will be used instead. | ||
| 478 | .Pp | ||
| 479 | .Fn RSA_meth_get_mod_exp | ||
| 480 | and | ||
| 481 | .Fn RSA_meth_set_mod_exp | ||
| 482 | get and set the function used for CRT computations involving the | ||
| 483 | .Fa p , | ||
| 484 | .Fa q , | ||
| 485 | .Fa dmp1 , | ||
| 486 | .Fa dmq1 , | ||
| 487 | and | ||
| 488 | .Fa iqmp | ||
| 489 | fields of an | ||
| 490 | .Vt RSA | ||
| 491 | object. | ||
| 492 | It is used by the default RSA implementation during | ||
| 493 | .Xr RSA_private_encrypt 3 | ||
| 494 | and | ||
| 187 | .Xr RSA_private_decrypt 3 | 495 | .Xr RSA_private_decrypt 3 |
| 496 | when the required components of the private key are available | ||
| 497 | or when the | ||
| 498 | .Dv RSA_FLAG_EXT_PKEY | ||
| 499 | flag is set. | ||
| 500 | .Pp | ||
| 501 | .Fn RSA_meth_get_bn_mod_exp | ||
| 502 | and | ||
| 503 | .Fn RSA_meth_set_bn_mod_exp | ||
| 504 | get and set the function used for CRT computations, | ||
| 505 | specifically the value r = | ||
| 506 | .Fa a | ||
| 507 | \(ha | ||
| 508 | .Fa p | ||
| 509 | mod | ||
| 510 | .Fa m . | ||
| 511 | It is used by the default RSA implementation during | ||
| 512 | .Xr RSA_public_encrypt 3 | ||
| 188 | and | 513 | and |
| 514 | .Xr RSA_public_decrypt 3 | ||
| 515 | and as a fallback during | ||
| 189 | .Xr RSA_private_encrypt 3 | 516 | .Xr RSA_private_encrypt 3 |
| 190 | and take the same parameters as those. | 517 | and |
| 518 | .Xr RSA_private_decrypt 3 . | ||
| 519 | .Pp | ||
| 520 | .Fn RSA_meth_get_keygen | ||
| 521 | and | ||
| 522 | .Fn RSA_meth_set_keygen | ||
| 523 | get and set the optional function used for generating a new RSA key pair. | ||
| 524 | Unless | ||
| 525 | .Fa keygen | ||
| 526 | is | ||
| 527 | .Dv NULL , | ||
| 528 | it will be called from | ||
| 529 | .Xr RSA_generate_key_ex 3 | ||
| 530 | and takes the same parameters. | ||
| 531 | Otherwise, a builtin default implementation is used. | ||
| 191 | .Sh RETURN VALUES | 532 | .Sh RETURN VALUES |
| 192 | .Fn RSA_meth_new | 533 | .Fn RSA_meth_new |
| 193 | and | 534 | and |
| @@ -198,20 +539,87 @@ object or | |||
| 198 | .Dv NULL | 539 | .Dv NULL |
| 199 | on failure. | 540 | on failure. |
| 200 | .Pp | 541 | .Pp |
| 542 | .Fn RSA_meth_get0_name | ||
| 543 | returns an internal pointer which must not be freed by the caller. | ||
| 544 | .Pp | ||
| 545 | .Fn RSA_meth_get_flags | ||
| 546 | returns zero or more | ||
| 547 | .Dv RSA_FLAG_* | ||
| 548 | constants OR'ed together, or 0 if no flags are set in | ||
| 549 | .Fa meth . | ||
| 550 | .Pp | ||
| 551 | .Fn RSA_meth_get0_app_data | ||
| 552 | returns the pointer that was earlier passed to | ||
| 553 | .Fn RSA_meth_set0_app_data | ||
| 554 | or | ||
| 555 | .Dv NULL | ||
| 556 | otherwise. | ||
| 557 | .Pp | ||
| 558 | All other | ||
| 559 | .Fn RSA_meth_get_* | ||
| 560 | functions return the appropriate function pointer that has been set | ||
| 561 | with the corresponding | ||
| 562 | .Fn RSA_meth_set_* | ||
| 563 | function, or | ||
| 564 | .Dv NULL | ||
| 565 | if no such pointer has been set in | ||
| 566 | .Fa meth . | ||
| 567 | .Pp | ||
| 201 | All | 568 | All |
| 202 | .Fn RSA_meth_set* | 569 | .Fn RSA_meth_set* |
| 203 | functions return 1 on success or 0 on failure. | 570 | functions return 1 on success or 0 on failure. |
| 571 | In the current implementation, only | ||
| 572 | .Fn RSA_meth_set1_name | ||
| 573 | can actually fail. | ||
| 204 | .Sh SEE ALSO | 574 | .Sh SEE ALSO |
| 575 | .Xr RSA_generate_key_ex 3 , | ||
| 205 | .Xr RSA_new 3 , | 576 | .Xr RSA_new 3 , |
| 206 | .Xr RSA_private_decrypt 3 , | ||
| 207 | .Xr RSA_private_encrypt 3 , | 577 | .Xr RSA_private_encrypt 3 , |
| 208 | .Xr RSA_set_method 3 | 578 | .Xr RSA_public_encrypt 3 , |
| 579 | .Xr RSA_set_flags 3 , | ||
| 580 | .Xr RSA_set_method 3 , | ||
| 581 | .Xr RSA_sign 3 | ||
| 209 | .Sh HISTORY | 582 | .Sh HISTORY |
| 210 | These functions first appeared in OpenSSL 1.1.0. | 583 | These functions first appeared in OpenSSL 1.1.0. |
| 211 | .Fn RSA_meth_get_finish | 584 | .Fn RSA_meth_new , |
| 585 | .Fn RSA_meth_dup , | ||
| 586 | .Fn RSA_meth_free , | ||
| 587 | .Fn RSA_meth_set_finish , | ||
| 588 | .Fn RSA_meth_set_priv_enc , | ||
| 212 | and | 589 | and |
| 213 | .Fn RSA_meth_set1_name | 590 | .Fn RSA_meth_set_priv_dec |
| 214 | have been available since | 591 | have been available since |
| 592 | .Ox 6.3 , | ||
| 593 | .Fn RSA_meth_set1_name | ||
| 594 | and | ||
| 595 | .Fn RSA_meth_get_finish | ||
| 596 | since | ||
| 215 | .Ox 6.4 , | 597 | .Ox 6.4 , |
| 216 | all the other functions since | 598 | and |
| 217 | .Ox 6.3 . | 599 | .Fn RSA_meth_get0_name , |
| 600 | .Fn RSA_meth_get_flags , | ||
| 601 | .Fn RSA_meth_set_flags , | ||
| 602 | .Fn RSA_meth_get0_app_data , | ||
| 603 | .Fn RSA_meth_set0_app_data , | ||
| 604 | .Fn RSA_meth_get_init , | ||
| 605 | .Fn RSA_meth_set_init , | ||
| 606 | .Fn RSA_meth_set_finish , | ||
| 607 | .Fn RSA_meth_get_pub_enc , | ||
| 608 | .Fn RSA_meth_set_pub_enc , | ||
| 609 | .Fn RSA_meth_get_pub_dec , | ||
| 610 | .Fn RSA_meth_set_pub_dec , | ||
| 611 | .Fn RSA_meth_get_priv_enc , | ||
| 612 | .Fn RSA_meth_get_priv_dec , | ||
| 613 | .Fn RSA_meth_get_sign , | ||
| 614 | .Fn RSA_meth_set_sign , | ||
| 615 | .Fn RSA_meth_get_verify , | ||
| 616 | .Fn RSA_meth_set_verify , | ||
| 617 | .Fn RSA_meth_get_mod_exp , | ||
| 618 | .Fn RSA_meth_set_mod_exp , | ||
| 619 | .Fn RSA_meth_get_bn_mod_exp , | ||
| 620 | .Fn RSA_meth_set_bn_mod_exp , | ||
| 621 | .Fn RSA_meth_get_keygen , | ||
| 622 | and | ||
| 623 | .Fn RSA_meth_set_keygen | ||
| 624 | since | ||
| 625 | .Ox 6.6 . | ||
diff --git a/src/lib/libcrypto/man/RSA_new.3 b/src/lib/libcrypto/man/RSA_new.3 index 8f0e2c2a5e..7e40c11987 100644 --- a/src/lib/libcrypto/man/RSA_new.3 +++ b/src/lib/libcrypto/man/RSA_new.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: RSA_new.3,v 1.11 2019/06/06 01:06:59 schwarze Exp $ | 1 | .\" $OpenBSD: RSA_new.3,v 1.12 2019/06/08 09:53:15 schwarze Exp $ |
| 2 | .\" OpenSSL doc/man3/RSA_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" OpenSSL doc/man3/RSA_new.pod 99d63d46 Oct 26 13:56:48 2016 -0400 |
| 3 | .\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 | 3 | .\" OpenSSL doc/crypto/rsa.pod 35d2e327 Jun 3 16:19:49 2016 -0400 |
| 4 | .\" | 4 | .\" |
| @@ -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: June 6 2019 $ | 52 | .Dd $Mdocdate: June 8 2019 $ |
| 53 | .Dt RSA_NEW 3 | 53 | .Dt RSA_NEW 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -88,7 +88,15 @@ increments the reference count by 1. | |||
| 88 | .Pp | 88 | .Pp |
| 89 | .Fn RSA_free | 89 | .Fn RSA_free |
| 90 | decrements the reference count by 1. | 90 | decrements the reference count by 1. |
| 91 | If it reaches 0, it frees the | 91 | If it reaches 0, it calls the optional |
| 92 | .Fa finish | ||
| 93 | function set up with | ||
| 94 | .Xr RSA_meth_set_finish 3 , | ||
| 95 | calls | ||
| 96 | .Xr ENGINE_finish 3 | ||
| 97 | if | ||
| 98 | .Fa rsa | ||
| 99 | uses an engine, and frees the | ||
| 92 | .Vt RSA | 100 | .Vt RSA |
| 93 | structure and its components. | 101 | structure and its components. |
| 94 | The key is erased before the memory is returned to the system. | 102 | The key is erased before the memory is returned to the system. |
diff --git a/src/lib/libcrypto/man/RSA_set_method.3 b/src/lib/libcrypto/man/RSA_set_method.3 index 524430b6f8..53d41f5516 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.13 2019/05/20 06:04:45 jmc Exp $ | 1 | .\" $OpenBSD: RSA_set_method.3,v 1.14 2019/06/08 09:53:15 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: May 20 2019 $ | 53 | .Dd $Mdocdate: June 8 2019 $ |
| 54 | .Dt RSA_SET_METHOD 3 | 54 | .Dt RSA_SET_METHOD 3 |
| 55 | .Os | 55 | .Os |
| 56 | .Sh NAME | 56 | .Sh NAME |
| @@ -121,12 +121,25 @@ selects | |||
| 121 | .Fa meth | 121 | .Fa meth |
| 122 | to perform all operations using the key | 122 | to perform all operations using the key |
| 123 | .Fa rsa . | 123 | .Fa rsa . |
| 124 | This replaces the | 124 | This replaces the previous |
| 125 | .Vt RSA_METHOD | 125 | .Vt RSA_METHOD |
| 126 | used by the RSA key, and if the previous method was supplied by an | 126 | used by the RSA key, calling the |
| 127 | .Fa finish | ||
| 128 | function set up with | ||
| 129 | .Xr RSA_meth_set_finish 3 | ||
| 130 | if any, and if the previous method was supplied by an | ||
| 127 | .Vt ENGINE , | 131 | .Vt ENGINE , |
| 128 | .Xr ENGINE_finish 3 | 132 | .Xr ENGINE_finish 3 |
| 129 | is called on it. | 133 | is called on it. |
| 134 | If | ||
| 135 | .Fa meth | ||
| 136 | contains an | ||
| 137 | .Fa init | ||
| 138 | function set up with | ||
| 139 | .Xr RSA_meth_set_init 3 , | ||
| 140 | that function is called just before returning from | ||
| 141 | .Fn RSA_set_method . | ||
| 142 | .Pp | ||
| 130 | It is possible to have RSA keys that only work with certain | 143 | It is possible to have RSA keys that only work with certain |
| 131 | .Vt RSA_METHOD | 144 | .Vt RSA_METHOD |
| 132 | implementations (e.g. from an | 145 | implementations (e.g. from an |
| @@ -148,14 +161,19 @@ to be valid as long as the RSA key itself is valid and does not | |||
| 148 | have its implementation changed by | 161 | have its implementation changed by |
| 149 | .Fn RSA_set_method . | 162 | .Fn RSA_set_method . |
| 150 | .Pp | 163 | .Pp |
| 164 | The misleadingly named function | ||
| 151 | .Fn RSA_flags | 165 | .Fn RSA_flags |
| 152 | returns the flags that are set for the current | 166 | returns the flags that are set for the current |
| 153 | .Vt RSA_METHOD | 167 | .Vt RSA_METHOD |
| 154 | of | 168 | of |
| 155 | .Fa rsa . | 169 | .Fa rsa . |
| 170 | The flags used by | ||
| 171 | .Fa rsa | ||
| 172 | itself can instead be tested with | ||
| 173 | .Xr RSA_test_flags 3 . | ||
| 156 | See the | 174 | See the |
| 157 | .Sx BUGS | 175 | .Sx BUGS |
| 158 | section. | 176 | section for more details. |
| 159 | .Pp | 177 | .Pp |
| 160 | .Fn RSA_new_method | 178 | .Fn RSA_new_method |
| 161 | allocates and initializes an | 179 | allocates and initializes an |
| @@ -175,6 +193,18 @@ the default method controlled by | |||
| 175 | .Fn RSA_set_default_method | 193 | .Fn RSA_set_default_method |
| 176 | is used. | 194 | is used. |
| 177 | .Pp | 195 | .Pp |
| 196 | The initial | ||
| 197 | .Fa flags | ||
| 198 | are copied from the | ||
| 199 | .Vt RSA_METHOD | ||
| 200 | object used and will not be affected by later changes to that object, | ||
| 201 | but may be modified by the optional | ||
| 202 | .Fa init | ||
| 203 | function which may have been set up with | ||
| 204 | .Xr RSA_meth_set_init 3 | ||
| 205 | and which is called just before returning from | ||
| 206 | .Fn RSA_new_method . | ||
| 207 | .Pp | ||
| 178 | The | 208 | The |
| 179 | .Dv RSA_METHOD | 209 | .Dv RSA_METHOD |
| 180 | structure is defined as follows: | 210 | structure is defined as follows: |
| @@ -185,27 +215,28 @@ typedef struct rsa_meth_st | |||
| 185 | const char *name; | 215 | const char *name; |
| 186 | 216 | ||
| 187 | /* encrypt */ | 217 | /* encrypt */ |
| 188 | int (*rsa_pub_enc)(int flen, unsigned char *from, | 218 | int (*rsa_pub_enc)(int flen, const unsigned char *from, |
| 189 | unsigned char *to, RSA *rsa, int padding); | 219 | unsigned char *to, RSA *rsa, int padding); |
| 190 | 220 | ||
| 191 | /* verify arbitrary data */ | 221 | /* verify arbitrary data */ |
| 192 | int (*rsa_pub_dec)(int flen, unsigned char *from, | 222 | int (*rsa_pub_dec)(int flen, const unsigned char *from, |
| 193 | unsigned char *to, RSA *rsa, int padding); | 223 | unsigned char *to, RSA *rsa, int padding); |
| 194 | 224 | ||
| 195 | /* sign arbitrary data */ | 225 | /* sign arbitrary data */ |
| 196 | int (*rsa_priv_enc)(int flen, unsigned char *from, | 226 | int (*rsa_priv_enc)(int flen, const unsigned char *from, |
| 197 | unsigned char *to, RSA *rsa, int padding); | 227 | unsigned char *to, RSA *rsa, int padding); |
| 198 | 228 | ||
| 199 | /* decrypt */ | 229 | /* decrypt */ |
| 200 | int (*rsa_priv_dec)(int flen, unsigned char *from, | 230 | int (*rsa_priv_dec)(int flen, const unsigned char *from, |
| 201 | unsigned char *to, RSA *rsa, int padding); | 231 | unsigned char *to, RSA *rsa, int padding); |
| 202 | 232 | ||
| 203 | /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some | 233 | /* compute r0 = r0 ^ I mod rsa->n (May be NULL for some |
| 204 | implementations) */ | 234 | implementations) */ |
| 205 | int (*rsa_mod_exp)(BIGNUM *r0, BIGNUM *I, RSA *rsa); | 235 | int (*rsa_mod_exp)(BIGNUM *r0, const BIGNUM *I, RSA *rsa, |
| 236 | BN_CTX *ctx); | ||
| 206 | 237 | ||
| 207 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ | 238 | /* compute r = a ^ p mod m (May be NULL for some implementations) */ |
| 208 | int (*bn_mod_exp)(BIGNUM *r, BIGNUM *a, const BIGNUM *p, | 239 | int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, |
| 209 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | 240 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); |
| 210 | 241 | ||
| 211 | /* called at RSA_new */ | 242 | /* called at RSA_new */ |
| @@ -218,7 +249,6 @@ typedef struct rsa_meth_st | |||
| 218 | * operations, even if p,q,dmp1,dmq1,iqmp | 249 | * operations, even if p,q,dmp1,dmq1,iqmp |
| 219 | * are NULL | 250 | * are NULL |
| 220 | * RSA_FLAG_SIGN_VER - enable rsa_sign and rsa_verify | 251 | * RSA_FLAG_SIGN_VER - enable rsa_sign and rsa_verify |
| 221 | * RSA_METHOD_FLAG_NO_CHECK - don't check pub/private match | ||
| 222 | */ | 252 | */ |
| 223 | int flags; | 253 | int flags; |
| 224 | 254 | ||
| @@ -227,14 +257,19 @@ typedef struct rsa_meth_st | |||
| 227 | /* sign. For backward compatibility, this is used only | 257 | /* sign. For backward compatibility, this is used only |
| 228 | * if (flags & RSA_FLAG_SIGN_VER) | 258 | * if (flags & RSA_FLAG_SIGN_VER) |
| 229 | */ | 259 | */ |
| 230 | int (*rsa_sign)(int type, unsigned char *m, unsigned int m_len, | 260 | int (*rsa_sign)(int type, const unsigned char *m, |
| 231 | unsigned char *sigret, unsigned int *siglen, RSA *rsa); | 261 | unsigned int m_len, unsigned char *sigret, |
| 262 | unsigned int *siglen, const RSA *rsa); | ||
| 232 | 263 | ||
| 233 | /* verify. For backward compatibility, this is used only | 264 | /* verify. For backward compatibility, this is used only |
| 234 | * if (flags & RSA_FLAG_SIGN_VER) | 265 | * if (flags & RSA_FLAG_SIGN_VER) |
| 235 | */ | 266 | */ |
| 236 | int (*rsa_verify)(int type, unsigned char *m, unsigned int m_len, | 267 | int (*rsa_verify)(int type, const unsigned char *m, |
| 237 | unsigned char *sigbuf, unsigned int siglen, RSA *rsa); | 268 | unsigned int m_len, const unsigned char *sigbuf, |
| 269 | unsigned int siglen, const RSA *rsa); | ||
| 270 | |||
| 271 | /* called at RSA_generate_key_ex; may be NULL */ | ||
| 272 | int (*rsa_keygen)(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); | ||
| 238 | 273 | ||
| 239 | } RSA_METHOD; | 274 | } RSA_METHOD; |
| 240 | .Ed | 275 | .Ed |
diff --git a/src/lib/libcrypto/man/RSA_sign.3 b/src/lib/libcrypto/man/RSA_sign.3 index 80e0b0e957..166f2310a5 100644 --- a/src/lib/libcrypto/man/RSA_sign.3 +++ b/src/lib/libcrypto/man/RSA_sign.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: RSA_sign.3,v 1.6 2018/03/27 17:35:50 schwarze Exp $ | 1 | .\" $OpenBSD: RSA_sign.3,v 1.7 2019/06/08 09:53:15 schwarze Exp $ |
| 2 | .\" OpenSSL aa90ca11 Aug 20 15:48:56 2016 -0400 | 2 | .\" OpenSSL aa90ca11 Aug 20 15:48:56 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>. |
| @@ -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: March 27 2018 $ | 52 | .Dd $Mdocdate: June 8 2019 $ |
| 53 | .Dt RSA_SIGN 3 | 53 | .Dt RSA_SIGN 3 |
| 54 | .Os | 54 | .Os |
| 55 | .Sh NAME | 55 | .Sh NAME |
| @@ -133,6 +133,7 @@ The error codes can be obtained by | |||
| 133 | .Xr ERR_get_error 3 . | 133 | .Xr ERR_get_error 3 . |
| 134 | .Sh SEE ALSO | 134 | .Sh SEE ALSO |
| 135 | .Xr ERR_get_error 3 , | 135 | .Xr ERR_get_error 3 , |
| 136 | .Xr RSA_meth_set_sign 3 , | ||
| 136 | .Xr RSA_new 3 , | 137 | .Xr RSA_new 3 , |
| 137 | .Xr RSA_private_encrypt 3 , | 138 | .Xr RSA_private_encrypt 3 , |
| 138 | .Xr RSA_public_decrypt 3 | 139 | .Xr RSA_public_decrypt 3 |
