| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7c35055 commit bd5b61f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -85,11 +85,15 @@ const crypto = require('crypto'); | |||
| 85 | 85 | }, wrongBlockLength); | |
| 86 | 86 | } | |
| 87 | 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' }); | ||
| 88 | + { | ||
| 89 | + const v = crypto.constants.OPENSSL_VERSION_NUMBER; | ||
| 90 | + const hasOpenSSL3WithNewErrorMessage = (v >= 0x300000c0 && v <= 0x30100000) || (v >= 0x30100040 && v <= 0x30200000); | ||
| 91 | + assert.throws(() => { | ||
| 92 | + dh3.computeSecret(''); | ||
| 93 | + }, { message: common.hasOpenSSL3 && !hasOpenSSL3WithNewErrorMessage ? | ||
| 94 | + 'error:02800080:Diffie-Hellman routines::invalid secret' : | ||
| 95 | + 'Supplied key is too small' }); | ||
| 96 | + } | ||
| 93 | 97 | } | |
| 94 | 98 | ||
| 95 | 99 | // Through a fluke of history, g=0 defaults to DH_GENERATOR (2). | |
| Back | FazBrowse Home | New Git URL |
0 commit comments