summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2019-11-01 13:53:25 +0000
committerschwarze <>2019-11-01 13:53:25 +0000
commitdde794e63442523823f5350c736306ed75d40bb6 (patch)
treebe5362bd8f5cb2cca822b4a9b5713175601e2a97 /src
parent8791491d0d9a0c0e4dcf1d0a8877d39ea4b1e4cf (diff)
downloadopenbsd-dde794e63442523823f5350c736306ed75d40bb6.tar.gz
openbsd-dde794e63442523823f5350c736306ed75d40bb6.tar.bz2
openbsd-dde794e63442523823f5350c736306ed75d40bb6.zip
In rsa.h rev. 1.45, jsing@ provided the three
macros EVP_PKEY_CTX_set_rsa_pss_keygen_*(3); document them. Text mostly taken from the OpenSSL 1.1.1 branch, which is still under a free license, but rearranged to fit the structure of our manual pages.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.36
-rw-r--r--src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.364
2 files changed, 64 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 b/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
index 2bb6a3fd3b..7714cb0558 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_PKEY_CTX_ctrl.3,v 1.21 2019/11/01 12:02:58 schwarze Exp $ 1.\" $OpenBSD: EVP_PKEY_CTX_ctrl.3,v 1.22 2019/11/01 13:53:25 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100 3.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
4.\" Parts were split out into RSA_pkey_ctx_ctrl(3). 4.\" Parts were split out into RSA_pkey_ctx_ctrl(3).
@@ -250,6 +250,10 @@ and
250.Fn EVP_PKEY_CTX_get_signature_md 250.Fn EVP_PKEY_CTX_get_signature_md
251macros set and get the message digest type used in a signature. 251macros set and get the message digest type used in a signature.
252They can be used with the RSA, DSA, and ECDSA algorithms. 252They can be used with the RSA, DSA, and ECDSA algorithms.
253If the key is of the type
254.Dv EVP_PKEY_RSA_PSS
255and has usage restrictions, an error occurs if an attempt is made
256to set the digest to anything other than the restricted value.
253.Ss DSA parameters 257.Ss DSA parameters
254The macro 258The macro
255.Fn EVP_PKEY_CTX_set_dsa_paramgen_bits 259.Fn EVP_PKEY_CTX_set_dsa_paramgen_bits
diff --git a/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3 b/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3
index dea7fe754e..dbfd9c16f6 100644
--- a/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3
+++ b/src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3
@@ -1,12 +1,14 @@
1.\" $OpenBSD: RSA_pkey_ctx_ctrl.3,v 1.2 2019/11/01 12:45:36 schwarze Exp $ 1.\" $OpenBSD: RSA_pkey_ctx_ctrl.3,v 1.3 2019/11/01 13:53:25 schwarze Exp $
2.\" full merge up to: 2.\" full merge up to:
3.\" OpenSSL man3/EVP_PKEY_CTX_ctrl.pod 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.\" OpenSSL man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod
5.\" 87103969 Oct 1 14:11:57 2018 -0700
4.\" selective merge up to: 6.\" selective merge up to:
5.\" OpenSSL man3/EVP_PKEY_CTX_ctrl.pod df75c2b f Dec 9 01:02:36 2018 +0100 7.\" OpenSSL man3/EVP_PKEY_CTX_ctrl.pod df75c2b f Dec 9 01:02:36 2018 +0100
6.\" 8.\"
7.\" This file was written by Dr. Stephen Henson <steve@openssl.org> 9.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
8.\" and Antoine Salon <asalon@vmware.com>. 10.\" and Antoine Salon <asalon@vmware.com>.
9.\" Copyright (c) 2006, 2009, 2013, 2014, 2015, 2018 The OpenSSL Project. 11.\" Copyright (c) 2006, 2009, 2013, 2014, 2015, 2017, 2018 The OpenSSL Project.
10.\" All rights reserved. 12.\" All rights reserved.
11.\" 13.\"
12.\" Redistribution and use in source and binary forms, with or without 14.\" Redistribution and use in source and binary forms, with or without
@@ -69,7 +71,10 @@
69.Nm EVP_PKEY_CTX_set0_rsa_oaep_label , 71.Nm EVP_PKEY_CTX_set0_rsa_oaep_label ,
70.Nm EVP_PKEY_CTX_get0_rsa_oaep_label , 72.Nm EVP_PKEY_CTX_get0_rsa_oaep_label ,
71.Nm EVP_PKEY_CTX_set_rsa_pss_saltlen , 73.Nm EVP_PKEY_CTX_set_rsa_pss_saltlen ,
72.Nm EVP_PKEY_CTX_get_rsa_pss_saltlen 74.Nm EVP_PKEY_CTX_get_rsa_pss_saltlen ,
75.Nm EVP_PKEY_CTX_set_rsa_pss_keygen_md ,
76.Nm EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md ,
77.Nm EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen
73.Nd RSA private key control operations 78.Nd RSA private key control operations
74.Sh SYNOPSIS 79.Sh SYNOPSIS
75.In openssl/rsa.h 80.In openssl/rsa.h
@@ -142,6 +147,21 @@
142.Fa "EVP_PKEY_CTX *ctx" 147.Fa "EVP_PKEY_CTX *ctx"
143.Fa "int *plen" 148.Fa "int *plen"
144.Fc 149.Fc
150.Ft int
151.Fo EVP_PKEY_CTX_set_rsa_pss_keygen_md
152.Fa "EVP_PKEY_CTX *pctx"
153.Fa "const EVP_MD *md"
154.Fc
155.Ft int
156.Fo EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md
157.Fa "EVP_PKEY_CTX *pctx"
158.Fa "const EVP_MD *md"
159.Fc
160.Ft int
161.Fo EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen
162.Fa "EVP_PKEY_CTX *pctx"
163.Fa "int saltlen"
164.Fc
145.Sh DESCRIPTION 165.Sh DESCRIPTION
146The function 166The function
147.Fn RSA_pkey_ctx_ctrl 167.Fn RSA_pkey_ctx_ctrl
@@ -173,6 +193,8 @@ for OAEP padding (encrypt and decrypt only),
173for X9.31 padding (signature operations only) and 193for X9.31 padding (signature operations only) and
174.Dv RSA_PKCS1_PSS_PADDING 194.Dv RSA_PKCS1_PSS_PADDING
175(sign and verify only). 195(sign and verify only).
196Only the last one can be used with keys of the type
197.Dv EVP_PKEY_RSA_PSS .
176.Pp 198.Pp
177Two RSA padding modes behave differently if 199Two RSA padding modes behave differently if
178.Xr EVP_PKEY_CTX_set_signature_md 3 200.Xr EVP_PKEY_CTX_set_signature_md 3
@@ -196,14 +218,14 @@ macro retrieves the RSA padding mode for
196.Pp 218.Pp
197The 219The
198.Fn EVP_PKEY_CTX_set_rsa_keygen_bits 220.Fn EVP_PKEY_CTX_set_rsa_keygen_bits
199macro sets the RSA key length for RSA key generation to 221macro sets the RSA key length for RSA or RSA-PSS key generation to
200.Fa mbits . 222.Fa mbits .
201The smallest supported value is 512 bits. 223The smallest supported value is 512 bits.
202If not specified, 1024 bits is used. 224If not specified, 1024 bits is used.
203.Pp 225.Pp
204The 226The
205.Fn EVP_PKEY_CTX_set_rsa_keygen_pubexp 227.Fn EVP_PKEY_CTX_set_rsa_keygen_pubexp
206macro sets the public exponent value for RSA key generation to 228macro sets the public exponent value for RSA or RSA-PSS key generation to
207.Fa pubexp . 229.Fa pubexp .
208Currently, it should be an odd integer. 230Currently, it should be an odd integer.
209The 231The
@@ -221,6 +243,10 @@ The padding mode must have been set to
221.Dv RSA_PKCS1_OAEP_PADDING 243.Dv RSA_PKCS1_OAEP_PADDING
222or 244or
223.Dv RSA_PKCS1_PSS_PADDING . 245.Dv RSA_PKCS1_PSS_PADDING .
246If the key is of the type
247.Dv EVP_PKEY_RSA_PSS
248and has usage restrictions, an error occurs if an attempt is made
249to set the digest to anything other than the restricted value.
224.Pp 250.Pp
225The 251The
226.Fn EVP_PKEY_CTX_get_rsa_mgf1_md 252.Fn EVP_PKEY_CTX_get_rsa_mgf1_md
@@ -285,10 +311,38 @@ based on the PSS block structure.
285If this macro is not called a salt length value of -2 is used by 311If this macro is not called a salt length value of -2 is used by
286default. 312default.
287.Pp 313.Pp
314If the key has usage restrictions and an attempt is made to set the
315salt length below the minimum value, an error occurs.
316Also, if the key has usage restrictions,
317.Dv RSA_PSS_SALTLEN_AUTO
318is not supported for verification.
319.Pp
288The 320The
289.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen 321.Fn EVP_PKEY_CTX_get_rsa_pss_saltlen
290macro retrieves the RSA PSS salt length for 322macro retrieves the RSA PSS salt length for
291.Fa ctx . 323.Fa ctx .
324.Pp
325Optional parameter restrictions can be specified when generating a PSS
326key.
327If any restrictions are set using the macros described below,
328then all parameters are restricted.
329For example, setting a minimum salt length also restricts the digest and
330MGF1 algorithms.
331If any restrictions are in place, then they are reflected in the
332corresponding parameters of the public key when (for example) a
333certificate request is signed.
334.Pp
335.Fn EVP_PKEY_CTX_set_rsa_pss_keygen_md
336restricts the digest algorithm the generated key can use to
337.Fa md .
338.Pp
339.Fn EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md
340restricts the MGF1 algorithm the generated key can use to
341.Fa md .
342.Pp
343.Fn EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen
344restricts the minimum salt length to
345.Fa saltlen .
292.Sh RETURN VALUES 346.Sh RETURN VALUES
293These functions return a positive value for success or 0 or a negative 347These functions return a positive value for success or 0 or a negative
294value for failure. 348value for failure.