| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c6f9afe commit f26cf09
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ all: \ | |||
| 24 | 24 | dh512.pem \ | |
| 25 | 25 | dh1024.pem \ | |
| 26 | 26 | dh2048.pem \ | |
| 27 | + dh3072.pem \ | ||
| 27 | 28 | dherror.pem \ | |
| 28 | 29 | dh_private.pem \ | |
| 29 | 30 | dh_public.pem \ | |
@@ -596,6 +597,9 @@ dh1024.pem: | |||
| 596 | 597 | dh2048.pem: | |
| 597 | 598 | openssl dhparam -out dh2048.pem 2048 | |
| 598 | 599 | ||
| 600 | + dh3072.pem: | ||
| 601 | + openssl dhparam -out dh3072.pem 3072 | ||
| 602 | + | ||
| 599 | 603 | dherror.pem: dh1024.pem | |
| 600 | 604 | sed 's/^[^-].*/AAAAAAAAAA/g' dh1024.pem > dherror.pem | |
| 601 | 605 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + -----BEGIN DH PARAMETERS----- | ||
| 2 | + MIIBiAKCAYEAmV6aZ8ADnmRQoF9aGlV1AmajCkoc2eEltua1KpGFrxM0cr99gcS9 | ||
| 3 | + /zxTDo8ixwPoHBOOBD+9MN6KbSJ+61xvu9yQ2qt8HfNcUI7QZxdVQ4ZHCQM3Jw8h | ||
| 4 | + BPHFgjpx8w/pteZ3+L42felUxbd8/qfDv+gKsfuxrm6Ht7zzKLfbX9oNdJwpxX7N | ||
| 5 | + yGP3nNadYDM/ZmvmEY8xh2dwLHSMaAP1gxuWiitdYXX60Yg6EFgIotznqbdW075D | ||
| 6 | + KccGTTseFx9gNbxYkW33qX/p5IAf3wRFmptiRWCol88NHTDqtQRs0nhVQ1R28tiL | ||
| 7 | + rQhSJLHLSa4esF+whfC64oXECr2AtarcKWG+LX1dEWI4SXqurnBPiBoyqfVWHS4b | ||
| 8 | + PVgR90LlBJoXqblhsVrd+CkJI7ULDJmSA/cpgCqXH6vSvhb40yr5rpU4vZz+zhHY | ||
| 9 | + CTXVpH95JD35PiZOfQYhfDA4LGvfICPLIH7E8YL5v2F6Xxsf8trI5KiAs1S3TN8b | ||
| 10 | + lsLV6og5VoPXAgEC | ||
| 11 | + -----END DH PARAMETERS----- | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,11 +35,12 @@ function test(size, err, next) { | |||
| 35 | 35 | }); | |
| 36 | 36 | ||
| 37 | 37 | server.listen(0, function() { | |
| 38 | - // Client set minimum DH parameter size to 2048 bits so that | ||
| 39 | - // it fails when it make a connection to the tls server where | ||
| 40 | - // dhparams is 1024 bits | ||
| 38 | + // Client set minimum DH parameter size to 2048 or 3072 bits | ||
| 39 | + // so that it fails when it makes a connection to the tls | ||
| 40 | + // server where is too small | ||
| 41 | + const minDHSize = common.hasOpenSSL(3, 2) ? 3072 : 2048; | ||
| 41 | 42 | const client = tls.connect({ | |
| 42 | - minDHSize: 2048, | ||
| 43 | + minDHSize: minDHSize, | ||
| 43 | 44 | port: this.address().port, | |
| 44 | 45 | rejectUnauthorized: false, | |
| 45 | 46 | maxVersion: 'TLSv1.2', | |
@@ -60,16 +61,27 @@ function test(size, err, next) { | |||
| 60 | 61 | // A client connection fails with an error when a client has an | |
| 61 | 62 | // 2048 bits minDHSize option and a server has 1024 bits dhparam | |
| 62 | 63 | function testDHE1024() { | |
| 63 | - test(1024, true, testDHE2048); | ||
| 64 | + test(1024, true, testDHE2048(false, null)); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + // Test a client connection when a client has an | ||
| 68 | + // 2048 bits minDHSize option | ||
| 69 | + function testDHE2048(expect_to_fail, next) { | ||
| 70 | + test(2048, expect_to_fail, next); | ||
| 64 | 71 | } | |
| 65 | 72 | ||
| 66 | 73 | // A client connection successes when a client has an | |
| 67 | - // 2048 bits minDHSize option and a server has 2048 bits dhparam | ||
| 68 | - function testDHE2048() { | ||
| 69 | - test(2048, false, null); | ||
| 74 | + // 3072 bits minDHSize option and a server has 3072 bits dhparam | ||
| 75 | + function testDHE3072() { | ||
| 76 | + test(3072, false, null); | ||
| 70 | 77 | } | |
| 71 | 78 | ||
| 72 | - testDHE1024(); | ||
| 79 | + if (common.hasOpenSSL(3, 2)) { | ||
| 80 | + // Minimum size for OpenSSL 3.2 is 2048 by default | ||
| 81 | + testDHE2048(true, testDHE3072); | ||
| 82 | + } else { | ||
| 83 | + testDHE1024(); | ||
| 84 | + } | ||
| 73 | 85 | ||
| 74 | 86 | assert.throws(() => test(512, true, common.mustNotCall()), | |
| 75 | 87 | /DH parameter is less than 1024 bits/); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments