You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds support for the PSS padding scheme. Until now, the sign/verify
functions used the old EVP_Sign*/EVP_Verify* OpenSSL API, making it
impossible to change the padding scheme. Fixed by first computing the
message digest and then signing/verifying with a custom EVP_PKEY_CTX,
allowing us to specify options such as the padding scheme and the PSS
salt length.
Fixes: #1127
PR-URL: #11705
Reviewed-By: Shigeki Ohtsu <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
*`padding`: {integer} - Optional padding value for RSA, one of the following:
1107
+
*`crypto.constants.RSA_PKCS1_PADDING` (default)
1108
+
*`crypto.constants.RSA_PKCS1_PSS_PADDING`
1109
+
1110
+
Note that `RSA_PKCS1_PSS_PADDING` will use MGF1 with the same hash function
1111
+
used to verify the message as specified in section 3.1 of [RFC 4055][].
1112
+
*`saltLength`: {integer} - salt length for when padding is
1113
+
`RSA_PKCS1_PSS_PADDING`. The special value
1114
+
`crypto.constants.RSA_PSS_SALTLEN_DIGEST` sets the salt length to the digest
1115
+
size, `crypto.constants.RSA_PSS_SALTLEN_AUTO` (default) causes it to be
1116
+
determined automatically.
1117
+
1084
1118
The `signature` argument is the previously calculated signature for the data, in
1085
1119
the `signature_format` which can be `'latin1'`, `'hex'` or `'base64'`.
1086
1120
If a `signature_format` is specified, the `signature` is expected to be a
@@ -2047,6 +2081,21 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
2047
2081
<td><code>RSA_PKCS1_PSS_PADDING</code></td>
2048
2082
<td></td>
2049
2083
</tr>
2084
+
<tr>
2085
+
<td><code>RSA_PSS_SALTLEN_DIGEST</code></td>
2086
+
<td>Sets the salt length for `RSA_PKCS1_PSS_PADDING` to the digest size
2087
+
when signing or verifying.</td>
2088
+
</tr>
2089
+
<tr>
2090
+
<td><code>RSA_PSS_SALTLEN_MAX_SIGN</code></td>
2091
+
<td>Sets the salt length for `RSA_PKCS1_PSS_PADDING` to the maximum
2092
+
permissible value when signing data.</td>
2093
+
</tr>
2094
+
<tr>
2095
+
<td><code>RSA_PSS_SALTLEN_AUTO</code></td>
2096
+
<td>Causes the salt length for `RSA_PKCS1_PSS_PADDING` to be determined
2097
+
automatically when verifying a signature.</td>
2098
+
</tr>
2050
2099
<tr>
2051
2100
<td><code>POINT_CONVERSION_COMPRESSED</code></td>
2052
2101
<td></td>
@@ -2122,6 +2171,7 @@ the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.
2122
2171
[publicly trusted list of CAs]: https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt
0 commit comments