diff options
author | schwarze <> | 2019-11-01 13:53:25 +0000 |
---|---|---|
committer | schwarze <> | 2019-11-01 13:53:25 +0000 |
commit | dde794e63442523823f5350c736306ed75d40bb6 (patch) | |
tree | be5362bd8f5cb2cca822b4a9b5713175601e2a97 /src | |
parent | 8791491d0d9a0c0e4dcf1d0a8877d39ea4b1e4cf (diff) | |
download | openbsd-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.3 | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/man/RSA_pkey_ctx_ctrl.3 | 64 |
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 |
251 | macros set and get the message digest type used in a signature. | 251 | macros set and get the message digest type used in a signature. |
252 | They can be used with the RSA, DSA, and ECDSA algorithms. | 252 | They can be used with the RSA, DSA, and ECDSA algorithms. |
253 | If the key is of the type | ||
254 | .Dv EVP_PKEY_RSA_PSS | ||
255 | and has usage restrictions, an error occurs if an attempt is made | ||
256 | to set the digest to anything other than the restricted value. | ||
253 | .Ss DSA parameters | 257 | .Ss DSA parameters |
254 | The macro | 258 | The 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 |
146 | The function | 166 | The function |
147 | .Fn RSA_pkey_ctx_ctrl | 167 | .Fn RSA_pkey_ctx_ctrl |
@@ -173,6 +193,8 @@ for OAEP padding (encrypt and decrypt only), | |||
173 | for X9.31 padding (signature operations only) and | 193 | for 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). |
196 | Only the last one can be used with keys of the type | ||
197 | .Dv EVP_PKEY_RSA_PSS . | ||
176 | .Pp | 198 | .Pp |
177 | Two RSA padding modes behave differently if | 199 | Two 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 |
197 | The | 219 | The |
198 | .Fn EVP_PKEY_CTX_set_rsa_keygen_bits | 220 | .Fn EVP_PKEY_CTX_set_rsa_keygen_bits |
199 | macro sets the RSA key length for RSA key generation to | 221 | macro sets the RSA key length for RSA or RSA-PSS key generation to |
200 | .Fa mbits . | 222 | .Fa mbits . |
201 | The smallest supported value is 512 bits. | 223 | The smallest supported value is 512 bits. |
202 | If not specified, 1024 bits is used. | 224 | If not specified, 1024 bits is used. |
203 | .Pp | 225 | .Pp |
204 | The | 226 | The |
205 | .Fn EVP_PKEY_CTX_set_rsa_keygen_pubexp | 227 | .Fn EVP_PKEY_CTX_set_rsa_keygen_pubexp |
206 | macro sets the public exponent value for RSA key generation to | 228 | macro sets the public exponent value for RSA or RSA-PSS key generation to |
207 | .Fa pubexp . | 229 | .Fa pubexp . |
208 | Currently, it should be an odd integer. | 230 | Currently, it should be an odd integer. |
209 | The | 231 | The |
@@ -221,6 +243,10 @@ The padding mode must have been set to | |||
221 | .Dv RSA_PKCS1_OAEP_PADDING | 243 | .Dv RSA_PKCS1_OAEP_PADDING |
222 | or | 244 | or |
223 | .Dv RSA_PKCS1_PSS_PADDING . | 245 | .Dv RSA_PKCS1_PSS_PADDING . |
246 | If the key is of the type | ||
247 | .Dv EVP_PKEY_RSA_PSS | ||
248 | and has usage restrictions, an error occurs if an attempt is made | ||
249 | to set the digest to anything other than the restricted value. | ||
224 | .Pp | 250 | .Pp |
225 | The | 251 | The |
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. | |||
285 | If this macro is not called a salt length value of -2 is used by | 311 | If this macro is not called a salt length value of -2 is used by |
286 | default. | 312 | default. |
287 | .Pp | 313 | .Pp |
314 | If the key has usage restrictions and an attempt is made to set the | ||
315 | salt length below the minimum value, an error occurs. | ||
316 | Also, if the key has usage restrictions, | ||
317 | .Dv RSA_PSS_SALTLEN_AUTO | ||
318 | is not supported for verification. | ||
319 | .Pp | ||
288 | The | 320 | The |
289 | .Fn EVP_PKEY_CTX_get_rsa_pss_saltlen | 321 | .Fn EVP_PKEY_CTX_get_rsa_pss_saltlen |
290 | macro retrieves the RSA PSS salt length for | 322 | macro retrieves the RSA PSS salt length for |
291 | .Fa ctx . | 323 | .Fa ctx . |
324 | .Pp | ||
325 | Optional parameter restrictions can be specified when generating a PSS | ||
326 | key. | ||
327 | If any restrictions are set using the macros described below, | ||
328 | then all parameters are restricted. | ||
329 | For example, setting a minimum salt length also restricts the digest and | ||
330 | MGF1 algorithms. | ||
331 | If any restrictions are in place, then they are reflected in the | ||
332 | corresponding parameters of the public key when (for example) a | ||
333 | certificate request is signed. | ||
334 | .Pp | ||
335 | .Fn EVP_PKEY_CTX_set_rsa_pss_keygen_md | ||
336 | restricts 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 | ||
340 | restricts the MGF1 algorithm the generated key can use to | ||
341 | .Fa md . | ||
342 | .Pp | ||
343 | .Fn EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen | ||
344 | restricts the minimum salt length to | ||
345 | .Fa saltlen . | ||
292 | .Sh RETURN VALUES | 346 | .Sh RETURN VALUES |
293 | These functions return a positive value for success or 0 or a negative | 347 | These functions return a positive value for success or 0 or a negative |
294 | value for failure. | 348 | value for failure. |