diff options
author | Tobias Nießen <tniessen@tnie.de> | 2017-03-06 02:41:26 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2017-04-01 14:27:52 +0300 |
commit | 0e710aada401b1cf89b284d8469d112ddf277fe0 (patch) | |
tree | 446fc73f722084de1ea667273f5a2c1d8612be1f /src/node_constants.cc | |
parent | c68da89694b1ff4682131ed6b825e596188cc4ed (diff) |
crypto: add sign/verify support for RSASSA-PSS
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: https://github.com/nodejs/node/issues/1127
PR-URL: https://github.com/nodejs/node/pull/11705
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_constants.cc')
-rw-r--r-- | src/node_constants.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/node_constants.cc b/src/node_constants.cc index 5bde53fcdf1..8bc95392f26 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -997,6 +997,18 @@ void DefineOpenSSLConstants(Local<Object> target) { NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PSS_PADDING); #endif +#ifdef RSA_PSS_SALTLEN_DIGEST + NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_DIGEST); +#endif + +#ifdef RSA_PSS_SALTLEN_MAX_SIGN + NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_MAX_SIGN); +#endif + +#ifdef RSA_PSS_SALTLEN_AUTO + NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_AUTO); +#endif + #if HAVE_OPENSSL // NOTE: These are not defines NODE_DEFINE_CONSTANT(target, POINT_CONVERSION_COMPRESSED); |