summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2023-09-10 16:04:15 +0000
committerschwarze <>2023-09-10 16:04:15 +0000
commitbf15262a311df853b072fcf1dedb7cc8735057ea (patch)
tree120ac6d0a8707899b6a002a11980ab122244989b /src/lib
parent7a7b5cccf8e56b16dfcbe7c5f1ecafa8a735e6c6 (diff)
downloadopenbsd-bf15262a311df853b072fcf1dedb7cc8735057ea.tar.gz
openbsd-bf15262a311df853b072fcf1dedb7cc8735057ea.tar.bz2
openbsd-bf15262a311df853b072fcf1dedb7cc8735057ea.zip
Mention EVP_PKEY_encrypt_old(3) and EVP_PKEY_decrypt_old(3) because
some software still calls them. Put them here because despite the function and header names, they are really specific to RSA. Besides, this avoids a distraction in the more important EVP_PKEY_encrypt(3) and EVP_PKEY_decrypt(3) manual pages.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/RSA_public_encrypt.394
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
78encrypts the 112encrypts 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
134is the padding mode that was used to encrypt the data. 168is the padding mode that was used to encrypt the data.
169.Pp
170.Fn EVP_PKEY_encrypt_old
171is a deprecated wrapper around
172.Fn RSA_public_encrypt
173that uses the
174.Vt RSA
175public key stored in
176.Fa pkey
177and
178.Dv RSA_PKCS1_PADDING .
179.Pp
180.Fn EVP_PKEY_decrypt_old
181is a deprecated wrapper around
182.Fn RSA_private_decrypt
183that uses the
184.Vt RSA
185private key stored in
186.Fa pkey
187and
188.Dv RSA_PKCS1_PADDING .
135.Sh RETURN VALUES 189.Sh RETURN VALUES
136.Fn RSA_public_encrypt 190.Fn RSA_public_encrypt
137returns the size of the encrypted data (i.e.\& 191and
192.Fn EVP_PKEY_encrypt_old
193return 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
196and
197.Fn EVP_PKEY_decrypt_old
140returns the size of the recovered plaintext. 198returns the size of the recovered plaintext.
141.Pp 199On error, \-1 is returned; the error codes can be obtained by
142On 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
202In addition to the return values documented above,
203.Fn EVP_PKEY_encrypt_old
204may return 0 if the
205.Xr EVP_PKEY_id 3
206of
207.Fa pkey
208is 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
154appeared in SSLeay 0.4 or earlier and have been available since 222appeared 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
226and
227.Fn EVP_PKEY_decrypt
228first appeared in SSLeay 0.9.0 and have been available since
229.Ox 2.4 .
230There were renamed to
231.Fn EVP_PKEY_encrypt_old
232and
233.Fn EVP_PKEY_decrypt_old
234in OpenSSL 1.0.0 and
235.Ox 4.9 .
236.Pp
157.Dv RSA_NO_PADDING 237.Dv RSA_NO_PADDING
158is available since SSLeay 0.9.0. 238is available since SSLeay 0.9.0.
159OAEP was added in OpenSSL 0.9.2b. 239OAEP was added in OpenSSL 0.9.2b.