summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2019-11-01 12:45:36 +0000
committerschwarze <>2019-11-01 12:45:36 +0000
commit8791491d0d9a0c0e4dcf1d0a8877d39ea4b1e4cf (patch)
tree07a1f29e51efb16db3e584a6796536eb1e255bd8 /src/lib
parentc486619b21445153ea79c808f81279ffd3efde9c (diff)
downloadopenbsd-8791491d0d9a0c0e4dcf1d0a8877d39ea4b1e4cf.tar.gz
openbsd-8791491d0d9a0c0e4dcf1d0a8877d39ea4b1e4cf.tar.bz2
openbsd-8791491d0d9a0c0e4dcf1d0a8877d39ea4b1e4cf.zip
move the PSS macros to the end in preparation for adding more macros,
reduce text duplication by forming subsections, and some minor corrections
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.395
1 files changed, 45 insertions, 50 deletions
diff --git a/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3 b/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3
index 866c63ad81..dea7fe754e 100644
--- a/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3
+++ b/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3
@@ -1,8 +1,8 @@
1.\" $OpenBSD: RSA_pkey_ctx_ctrl.3,v 1.1 2019/11/01 12:02:58 schwarze Exp $ 1.\" $OpenBSD: RSA_pkey_ctx_ctrl.3,v 1.2 2019/11/01 12:45:36 schwarze Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL man3/EVP_PKEY_CTX_ctrl 99d63d46 Oct 26 13:56:48 2016 -0400 3.\" OpenSSL man3/EVP_PKEY_CTX_ctrl.pod 99d63d46 Oct 26 13:56:48 2016 -0400
4.\" selective merge up to: 4.\" selective merge up to:
5.\" OpenSSL man3/EVP_PKEY_CTX_ctrl df75c2b f Dec 9 01:02:36 2018 +0100 5.\" OpenSSL man3/EVP_PKEY_CTX_ctrl.pod df75c2b f Dec 9 01:02:36 2018 +0100
6.\" 6.\"
7.\" This file was written by Dr. Stephen Henson <steve@openssl.org> 7.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
8.\" and Antoine Salon <asalon@vmware.com>. 8.\" and Antoine Salon <asalon@vmware.com>.
@@ -60,8 +60,6 @@
60.Nm RSA_pkey_ctx_ctrl , 60.Nm RSA_pkey_ctx_ctrl ,
61.Nm EVP_PKEY_CTX_set_rsa_padding , 61.Nm EVP_PKEY_CTX_set_rsa_padding ,
62.Nm EVP_PKEY_CTX_get_rsa_padding , 62.Nm EVP_PKEY_CTX_get_rsa_padding ,
63.Nm EVP_PKEY_CTX_set_rsa_pss_saltlen ,
64.Nm EVP_PKEY_CTX_get_rsa_pss_saltlen ,
65.Nm EVP_PKEY_CTX_set_rsa_keygen_bits , 63.Nm EVP_PKEY_CTX_set_rsa_keygen_bits ,
66.Nm EVP_PKEY_CTX_set_rsa_keygen_pubexp , 64.Nm EVP_PKEY_CTX_set_rsa_keygen_pubexp ,
67.Nm EVP_PKEY_CTX_set_rsa_mgf1_md , 65.Nm EVP_PKEY_CTX_set_rsa_mgf1_md ,
@@ -69,7 +67,9 @@
69.Nm EVP_PKEY_CTX_set_rsa_oaep_md , 67.Nm EVP_PKEY_CTX_set_rsa_oaep_md ,
70.Nm EVP_PKEY_CTX_get_rsa_oaep_md , 68.Nm EVP_PKEY_CTX_get_rsa_oaep_md ,
71.Nm EVP_PKEY_CTX_set0_rsa_oaep_label , 69.Nm EVP_PKEY_CTX_set0_rsa_oaep_label ,
72.Nm EVP_PKEY_CTX_get0_rsa_oaep_label 70.Nm EVP_PKEY_CTX_get0_rsa_oaep_label ,
71.Nm EVP_PKEY_CTX_set_rsa_pss_saltlen ,
72.Nm EVP_PKEY_CTX_get_rsa_pss_saltlen
73.Nd RSA private key control operations 73.Nd RSA private key control operations
74.Sh SYNOPSIS 74.Sh SYNOPSIS
75.In openssl/rsa.h 75.In openssl/rsa.h
@@ -92,16 +92,6 @@
92.Fa "int *ppad" 92.Fa "int *ppad"
93.Fc 93.Fc
94.Ft int 94.Ft int
95.Fo EVP_PKEY_CTX_set_rsa_pss_saltlen
96.Fa "EVP_PKEY_CTX *ctx"
97.Fa "int len"
98.Fc
99.Ft int
100.Fo EVP_PKEY_CTX_get_rsa_pss_saltlen
101.Fa "EVP_PKEY_CTX *ctx"
102.Fa "int *plen"
103.Fc
104.Ft int
105.Fo EVP_PKEY_CTX_set_rsa_keygen_bits 95.Fo EVP_PKEY_CTX_set_rsa_keygen_bits
106.Fa "EVP_PKEY_CTX *ctx" 96.Fa "EVP_PKEY_CTX *ctx"
107.Fa "int mbits" 97.Fa "int mbits"
@@ -142,6 +132,16 @@
142.Fa "EVP_PKEY_CTX *ctx" 132.Fa "EVP_PKEY_CTX *ctx"
143.Fa "unsigned char **plabel" 133.Fa "unsigned char **plabel"
144.Fc 134.Fc
135.Ft int
136.Fo EVP_PKEY_CTX_set_rsa_pss_saltlen
137.Fa "EVP_PKEY_CTX *ctx"
138.Fa "int len"
139.Fc
140.Ft int
141.Fo EVP_PKEY_CTX_get_rsa_pss_saltlen
142.Fa "EVP_PKEY_CTX *ctx"
143.Fa "int *plen"
144.Fc
145.Sh DESCRIPTION 145.Sh DESCRIPTION
146The function 146The function
147.Fn RSA_pkey_ctx_ctrl 147.Fn RSA_pkey_ctx_ctrl
@@ -175,7 +175,7 @@ for X9.31 padding (signature operations only) and
175(sign and verify only). 175(sign and verify only).
176.Pp 176.Pp
177Two RSA padding modes behave differently if 177Two RSA padding modes behave differently if
178.Fn EVP_PKEY_CTX_set_signature_md 178.Xr EVP_PKEY_CTX_set_signature_md 3
179is used. 179is used.
180If this macro is called for PKCS#1 padding, the plaintext buffer is an 180If this macro is called for PKCS#1 padding, the plaintext buffer is an
181actual digest value and is encapsulated in a 181actual digest value and is encapsulated in a
@@ -195,26 +195,6 @@ macro retrieves the RSA padding mode for
195.Fa ctx . 195.Fa ctx .
196.Pp 196.Pp
197The 197The
198.Fn EVP_PKEY_CTX_set_rsa_pss_saltlen
199macro sets the RSA PSS salt length to
200.Fa len .
201As its name implies, it is only supported for PSS padding.
202Two special values are supported: -1 sets the salt length to the digest
203length.
204When signing -2 sets the salt length to the maximum permissible value.
205When verifying -2 causes the salt length to be automatically determined
206based on the PSS block structure.
207If this macro is not called a salt length value of -2 is used by
208default.
209.Pp
210The
211.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen
212macro retrieves the RSA PSS salt length for
213.Fa ctx .
214The padding mode must have been set to
215.Dv RSA_PKCS1_PSS_PADDING .
216.Pp
217The
218.Fn EVP_PKEY_CTX_set_rsa_keygen_bits 198.Fn EVP_PKEY_CTX_set_rsa_keygen_bits
219macro sets the RSA key length for RSA key generation to 199macro sets the RSA key length for RSA key generation to
220.Fa mbits . 200.Fa mbits .
@@ -251,20 +231,19 @@ The padding mode must have been set to
251.Dv RSA_PKCS1_OAEP_PADDING 231.Dv RSA_PKCS1_OAEP_PADDING
252or 232or
253.Dv RSA_PKCS1_PSS_PADDING . 233.Dv RSA_PKCS1_PSS_PADDING .
234.Ss Optimal asymmetric encryption padding
235The following macros require that the padding mode was set to
236.Dv RSA_PKCS1_OAEP_PADDING .
254.Pp 237.Pp
255The 238The
256.Fn EVP_PKEY_CTX_set_rsa_oaep_md 239.Fn EVP_PKEY_CTX_set_rsa_oaep_md
257macro sets the message digest type used in RSA OAEP to 240macro sets the message digest type used in RSA OAEP to
258.Fa md . 241.Fa md .
259The padding mode must have been set to
260.Dv RSA_PKCS1_OAEP_PADDING .
261.Pp 242.Pp
262The 243The
263.Fn EVP_PKEY_CTX_get_rsa_oaep_md 244.Fn EVP_PKEY_CTX_get_rsa_oaep_md
264macro gets the message digest type used in RSA OAEP to 245macro gets the message digest type used in RSA OAEP to
265.Pf * Fa md . 246.Pf * Fa pmd .
266The padding mode must have been set to
267.Dv RSA_PKCS1_OAEP_PADDING .
268.Pp 247.Pp
269The 248The
270.Fn EVP_PKEY_CTX_set0_rsa_oaep_label 249.Fn EVP_PKEY_CTX_set0_rsa_oaep_label
@@ -282,18 +261,34 @@ is 0, the label is cleared.
282The library takes ownership of the label so the caller should not 261The library takes ownership of the label so the caller should not
283free the original memory pointed to by 262free the original memory pointed to by
284.Fa label . 263.Fa label .
285The padding mode must have been set to
286.Dv RSA_PKCS1_OAEP_PADDING .
287.Pp 264.Pp
288The 265The
289.Fn EVP_PKEY_CTX_get0_rsa_oaep_label 266.Fn EVP_PKEY_CTX_get0_rsa_oaep_label
290macro gets the RSA OAEP label to 267macro gets the RSA OAEP label to
291.Pf * Fa plabel . 268.Pf * Fa plabel .
292The return value is the label length. 269The return value is the label length.
293The padding mode must have been set to
294.Dv RSA_PKCS1_OAEP_PADDING .
295The resulting pointer is owned by the library and should not be 270The resulting pointer is owned by the library and should not be
296freed by the caller. 271freed by the caller.
272.Ss Probabilistic signature scheme
273The following macros require that the padding mode was set to
274.Dv RSA_PKCS1_PSS_PADDING .
275.Pp
276The
277.Fn EVP_PKEY_CTX_set_rsa_pss_saltlen
278macro sets the RSA PSS salt length to
279.Fa len .
280Two special values are supported: -1 sets the salt length to the digest
281length.
282When signing -2 sets the salt length to the maximum permissible value.
283When verifying -2 causes the salt length to be automatically determined
284based on the PSS block structure.
285If this macro is not called a salt length value of -2 is used by
286default.
287.Pp
288The
289.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen
290macro retrieves the RSA PSS salt length for
291.Fa ctx .
297.Sh RETURN VALUES 292.Sh RETURN VALUES
298These functions return a positive value for success or 0 or a negative 293These functions return a positive value for success or 0 or a negative
299value for failure. 294value for failure.
@@ -315,19 +310,19 @@ supported by the public key algorithm.
315.Sh HISTORY 310.Sh HISTORY
316The functions 311The functions
317.Fn EVP_PKEY_CTX_set_rsa_padding , 312.Fn EVP_PKEY_CTX_set_rsa_padding ,
318.Fn EVP_PKEY_CTX_set_rsa_pss_saltlen ,
319.Fn EVP_PKEY_CTX_set_rsa_keygen_bits , 313.Fn EVP_PKEY_CTX_set_rsa_keygen_bits ,
314.Fn EVP_PKEY_CTX_set_rsa_keygen_pubexp ,
320and 315and
321.Fn EVP_PKEY_CTX_set_rsa_keygen_pubexp 316.Fn EVP_PKEY_CTX_set_rsa_pss_saltlen
322first appeared in OpenSSL 1.0.0 and have been available since 317first appeared in OpenSSL 1.0.0 and have been available since
323.Ox 4.9 . 318.Ox 4.9 .
324.Pp 319.Pp
325The functions 320The functions
326.Fn EVP_PKEY_CTX_get_rsa_padding , 321.Fn EVP_PKEY_CTX_get_rsa_padding ,
327.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen ,
328.Fn EVP_PKEY_CTX_set_rsa_mgf1_md , 322.Fn EVP_PKEY_CTX_set_rsa_mgf1_md ,
323.Fn EVP_PKEY_CTX_get_rsa_mgf1_md ,
329and 324and
330.Fn EVP_PKEY_CTX_get_rsa_mgf1_md 325.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen
331first appeared in OpenSSL 1.0.1 and have been available since 326first appeared in OpenSSL 1.0.1 and have been available since
332.Ox 5.3 . 327.Ox 5.3 .
333.Pp 328.Pp