We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6a05e8 commit 41ca113Copy full SHA for 41ca113
test/parallel/test-crypto-dh.js
@@ -85,11 +85,15 @@ const crypto = require('crypto');
85
}, wrongBlockLength);
86
}
87
88
- assert.throws(() => {
89
- dh3.computeSecret('');
90
- }, { message: common.hasOpenSSL3 ?
91
- 'error:02800080:Diffie-Hellman routines::invalid secret' :
92
- 'Supplied key is too small' });
+ {
+ const v = crypto.constants.OPENSSL_VERSION_NUMBER;
+ const hasOpenSSL3WithNewErrorMessage = (v >= 0x300000c0 && v <= 0x30100000) || (v >= 0x30100040 && v <= 0x30200000);
+ assert.throws(() => {
+ dh3.computeSecret('');
93
+ }, { message: common.hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ?
94
+ 'error:02800080:Diffie-Hellman routines::invalid secret' :
95
+ 'Supplied key is too small' });
96
+ }
97
98
99
// Through a fluke of history, g=0 defaults to DH_GENERATOR (2).
0 commit comments