diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/RSA_public_encrypt.3 | 94 |
1 files changed, 87 insertions, 7 deletions
diff --git a/src/lib/libcrypto/man/RSA_public_encrypt.3 b/src/lib/libcrypto/man/RSA_public_encrypt.3 index b1b4d2a478..be3afdf402 100644 --- a/src/lib/libcrypto/man/RSA_public_encrypt.3 +++ b/src/lib/libcrypto/man/RSA_public_encrypt.3 | |||
| @@ -1,7 +1,24 @@ | |||
| 1 | .\" $OpenBSD: RSA_public_encrypt.3,v 1.12 2019/06/10 14:58:48 schwarze Exp $ | 1 | .\" $OpenBSD: RSA_public_encrypt.3,v 1.13 2023/09/10 16:04:15 schwarze Exp $ |
| 2 | .\" OpenSSL RSA_public_encrypt.pod 1e3f62a3 Jul 17 16:47:13 2017 +0200 | 2 | .\" OpenSSL RSA_public_encrypt.pod 1e3f62a3 Jul 17 16:47:13 2017 +0200 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org>. | 4 | .\" This file is a derived work. |
| 5 | .\" The changes are covered by the following Copyright and license: | ||
| 6 | .\" | ||
| 7 | .\" Copyright (c) 2023 Ingo Schwarze <schwarze@openbsd.org> | ||
| 8 | .\" | ||
| 9 | .\" 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 | .\" copyright notice and this permission notice appear in all copies. | ||
| 12 | .\" | ||
| 13 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 14 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 15 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 16 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 17 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 20 | .\" | ||
| 21 | .\" The original file was written by Ulf Moeller <ulf@openssl.org>. | ||
| 5 | .\" Copyright (c) 2000, 2004 The OpenSSL Project. All rights reserved. | 22 | .\" Copyright (c) 2000, 2004 The OpenSSL Project. All rights reserved. |
| 6 | .\" | 23 | .\" |
| 7 | .\" Redistribution and use in source and binary forms, with or without | 24 | .\" Redistribution and use in source and binary forms, with or without |
| @@ -48,12 +65,14 @@ | |||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 50 | .\" | 67 | .\" |
| 51 | .Dd $Mdocdate: June 10 2019 $ | 68 | .Dd $Mdocdate: September 10 2023 $ |
| 52 | .Dt RSA_PUBLIC_ENCRYPT 3 | 69 | .Dt RSA_PUBLIC_ENCRYPT 3 |
| 53 | .Os | 70 | .Os |
| 54 | .Sh NAME | 71 | .Sh NAME |
| 55 | .Nm RSA_public_encrypt , | 72 | .Nm RSA_public_encrypt , |
| 56 | .Nm RSA_private_decrypt | 73 | .Nm RSA_private_decrypt , |
| 74 | .Nm EVP_PKEY_encrypt_old , | ||
| 75 | .Nm EVP_PKEY_decrypt_old | ||
| 57 | .Nd RSA public key cryptography | 76 | .Nd RSA public key cryptography |
| 58 | .Sh SYNOPSIS | 77 | .Sh SYNOPSIS |
| 59 | .In openssl/rsa.h | 78 | .In openssl/rsa.h |
| @@ -73,6 +92,21 @@ | |||
| 73 | .Fa "RSA *rsa" | 92 | .Fa "RSA *rsa" |
| 74 | .Fa "int padding" | 93 | .Fa "int padding" |
| 75 | .Fc | 94 | .Fc |
| 95 | .In openssl/evp.h | ||
| 96 | .Ft int | ||
| 97 | .Fo EVP_PKEY_encrypt_old | ||
| 98 | .Fa "unsigned char *to" | ||
| 99 | .Fa "const unsigned char *from" | ||
| 100 | .Fa "int flen" | ||
| 101 | .Fa "EVP_PKEY *pkey" | ||
| 102 | .Fc | ||
| 103 | .Ft int | ||
| 104 | .Fo EVP_PKEY_decrypt_old | ||
| 105 | .Fa "unsigned char *to" | ||
| 106 | .Fa "const unsigned char *from" | ||
| 107 | .Fa "int flen" | ||
| 108 | .Fa "EVP_PKEY *pkey" | ||
| 109 | .Fc | ||
| 76 | .Sh DESCRIPTION | 110 | .Sh DESCRIPTION |
| 77 | .Fn RSA_public_encrypt | 111 | .Fn RSA_public_encrypt |
| 78 | encrypts the | 112 | encrypts the |
| @@ -132,16 +166,50 @@ must point to a memory section large enough to hold the decrypted data | |||
| 132 | .Fn RSA_size rsa ) . | 166 | .Fn RSA_size rsa ) . |
| 133 | .Fa padding | 167 | .Fa padding |
| 134 | is the padding mode that was used to encrypt the data. | 168 | is the padding mode that was used to encrypt the data. |
| 169 | .Pp | ||
| 170 | .Fn EVP_PKEY_encrypt_old | ||
| 171 | is a deprecated wrapper around | ||
| 172 | .Fn RSA_public_encrypt | ||
| 173 | that uses the | ||
| 174 | .Vt RSA | ||
| 175 | public key stored in | ||
| 176 | .Fa pkey | ||
| 177 | and | ||
| 178 | .Dv RSA_PKCS1_PADDING . | ||
| 179 | .Pp | ||
| 180 | .Fn EVP_PKEY_decrypt_old | ||
| 181 | is a deprecated wrapper around | ||
| 182 | .Fn RSA_private_decrypt | ||
| 183 | that uses the | ||
| 184 | .Vt RSA | ||
| 185 | private key stored in | ||
| 186 | .Fa pkey | ||
| 187 | and | ||
| 188 | .Dv RSA_PKCS1_PADDING . | ||
| 135 | .Sh RETURN VALUES | 189 | .Sh RETURN VALUES |
| 136 | .Fn RSA_public_encrypt | 190 | .Fn RSA_public_encrypt |
| 137 | returns the size of the encrypted data (i.e.\& | 191 | and |
| 192 | .Fn EVP_PKEY_encrypt_old | ||
| 193 | return the size of the encrypted data (i.e.\& | ||
| 138 | .Fn RSA_size rsa ) . | 194 | .Fn RSA_size rsa ) . |
| 139 | .Fn RSA_private_decrypt | 195 | .Fn RSA_private_decrypt |
| 196 | and | ||
| 197 | .Fn EVP_PKEY_decrypt_old | ||
| 140 | returns the size of the recovered plaintext. | 198 | returns the size of the recovered plaintext. |
| 141 | .Pp | 199 | On error, \-1 is returned; the error codes can be obtained by |
| 142 | On error, -1 is returned; the error codes can be obtained by | ||
| 143 | .Xr ERR_get_error 3 . | 200 | .Xr ERR_get_error 3 . |
| 201 | .Pp | ||
| 202 | In addition to the return values documented above, | ||
| 203 | .Fn EVP_PKEY_encrypt_old | ||
| 204 | may return 0 if the | ||
| 205 | .Xr EVP_PKEY_id 3 | ||
| 206 | of | ||
| 207 | .Fa pkey | ||
| 208 | is not | ||
| 209 | .Dv EVP_PKEY_RSA . | ||
| 144 | .Sh SEE ALSO | 210 | .Sh SEE ALSO |
| 211 | .Xr EVP_PKEY_decrypt 3 , | ||
| 212 | .Xr EVP_PKEY_encrypt 3 , | ||
| 145 | .Xr RSA_meth_set_priv_dec 3 , | 213 | .Xr RSA_meth_set_priv_dec 3 , |
| 146 | .Xr RSA_new 3 , | 214 | .Xr RSA_new 3 , |
| 147 | .Xr RSA_size 3 | 215 | .Xr RSA_size 3 |
| @@ -154,6 +222,18 @@ and | |||
| 154 | appeared in SSLeay 0.4 or earlier and have been available since | 222 | appeared in SSLeay 0.4 or earlier and have been available since |
| 155 | .Ox 2.4 . | 223 | .Ox 2.4 . |
| 156 | .Pp | 224 | .Pp |
| 225 | .Fn EVP_PKEY_encrypt | ||
| 226 | and | ||
| 227 | .Fn EVP_PKEY_decrypt | ||
| 228 | first appeared in SSLeay 0.9.0 and have been available since | ||
| 229 | .Ox 2.4 . | ||
| 230 | There were renamed to | ||
| 231 | .Fn EVP_PKEY_encrypt_old | ||
| 232 | and | ||
| 233 | .Fn EVP_PKEY_decrypt_old | ||
| 234 | in OpenSSL 1.0.0 and | ||
| 235 | .Ox 4.9 . | ||
| 236 | .Pp | ||
| 157 | .Dv RSA_NO_PADDING | 237 | .Dv RSA_NO_PADDING |
| 158 | is available since SSLeay 0.9.0. | 238 | is available since SSLeay 0.9.0. |
| 159 | OAEP was added in OpenSSL 0.9.2b. | 239 | OAEP was added in OpenSSL 0.9.2b. |
