| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6e30204 commit 11b4d50
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -206,7 +206,7 @@ void New(const FunctionCallbackInfo<Value>& args) { | |||
| 206 | 206 | } | |
| 207 | 207 | } | |
| 208 | 208 | ||
| 209 | - #ifndef OPENSSL_IS_BORINGSSL | ||
| 209 | + #if NCRYPTO_USE_OPENSSL3_PROVIDER | ||
| 210 | 210 | if (BN_num_bits(bn_p.get()) >= 512 && BN_cmp(bn_g.get(), bn_p.get()) >= 0) { | |
| 211 | 211 | PutDhError(DH_R_BAD_GENERATOR); | |
| 212 | 212 | return ThrowCryptoError(env, ERR_get_error(), "Invalid generator"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ const { hasOpenSSL } = require('../common/crypto'); | |||
| 9 | 9 | const { | |
| 10 | 10 | DH_CHECK_P_NOT_PRIME, | |
| 11 | 11 | DH_CHECK_P_NOT_SAFE_PRIME, | |
| 12 | + DH_NOT_SUITABLE_GENERATOR, | ||
| 12 | 13 | } = crypto.constants; | |
| 13 | 14 | ||
| 14 | 15 | // Second OAKLEY group, see | |
@@ -76,6 +77,11 @@ if (hasOpenSSL(3)) { | |||
| 76 | 77 | () => crypto.createDiffieHellman(Buffer.from(p, 'hex'), | |
| 77 | 78 | Buffer.from(p, 'hex')), | |
| 78 | 79 | { code: 'ERR_OSSL_DH_BAD_GENERATOR' }); | |
| 80 | + } else if (!process.features.openssl_is_boringssl) { | ||
| 81 | + assert.strictEqual( | ||
| 82 | + crypto.createDiffieHellman(Buffer.from(p, 'hex'), | ||
| 83 | + Buffer.from(p, 'hex')).verifyError, | ||
| 84 | + DH_NOT_SUITABLE_GENERATOR); | ||
| 79 | 85 | } | |
| 80 | 86 | ||
| 81 | 87 | const availableCurves = new Set(crypto.getCurves()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments