summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Bevenius <daniel.bevenius@gmail.com>2019-09-02 10:36:39 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2019-09-05 05:53:59 +0200
commit17d87d522c674362a4769d20c05cb0f1daf10e7f (patch)
tree60d54902ad064b945a473b89c95044b89bd31d7f /src
parent02c74e72eacc34fa90ae85983900a5d93f13b6c8 (diff)
downloadandroid-node-v8-17d87d522c674362a4769d20c05cb0f1daf10e7f.tar.gz
android-node-v8-17d87d522c674362a4769d20c05cb0f1daf10e7f.tar.bz2
android-node-v8-17d87d522c674362a4769d20c05cb0f1daf10e7f.zip
src: fix ValidateDSAParameters when fips is enabled
Currently, the following compilation errors are generated when configuring --openssl-is-fips: ../src/node_crypto.cc: In function ‘bool node::crypto::ValidateDSAParameters(EVP_PKEY*)’: ../src/node_crypto.cc:4886:55: error: ‘pkey’ was not declared in this scope if (FIPS_mode() && EVP_PKEY_DSA == EVP_PKEY_base_id(pkey.get())) { ^~~~ ../src/node_crypto.cc:4886:55: note: suggested alternative: ‘key’ if (FIPS_mode() && EVP_PKEY_DSA == EVP_PKEY_base_id(pkey.get())) { ^~~~ key ../src/node_crypto.cc:4898:35: error: expected ‘;’ before ‘}’ token (L == 3072 && N == 256) ^ ; } This commit fixes the errors, and after this compilation is successful. PR-URL: https://github.com/nodejs/node/pull/29407 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_crypto.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 65683b70d8..b1d8145e6d 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -4883,8 +4883,8 @@ static AllocatedBuffer Node_SignFinal(Environment* env,
static inline bool ValidateDSAParameters(EVP_PKEY* key) {
#ifdef NODE_FIPS_MODE
/* Validate DSA2 parameters from FIPS 186-4 */
- if (FIPS_mode() && EVP_PKEY_DSA == EVP_PKEY_base_id(pkey.get())) {
- DSA* dsa = EVP_PKEY_get0_DSA(pkey.get());
+ if (FIPS_mode() && EVP_PKEY_DSA == EVP_PKEY_base_id(key)) {
+ DSA* dsa = EVP_PKEY_get0_DSA(key);
const BIGNUM* p;
DSA_get0_pqg(dsa, &p, nullptr, nullptr);
size_t L = BN_num_bits(p);
@@ -4895,7 +4895,7 @@ static inline bool ValidateDSAParameters(EVP_PKEY* key) {
return (L == 1024 && N == 160) ||
(L == 2048 && N == 224) ||
(L == 2048 && N == 256) ||
- (L == 3072 && N == 256)
+ (L == 3072 && N == 256);
}
#endif // NODE_FIPS_MODE