Skip to content

Commit a9fc8d9

Browse files
mhdawsontargos
authored andcommitted
test: fix test test-tls-dhe for OpenSSL32
Refs: #53382 - OpenSSL32 has a minimum dh key size by 2048 by default. - Adjust test to use larger 3072 key instead of 1024 when OpenSSL32 is present. Signed-off-by: Michael Dawson <midawson@redhat.com> PR-URL: #54903 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c4d0ca4 commit a9fc8d9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

test/parallel/test-tls-dhe.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ const dheCipher = 'DHE-RSA-AES128-SHA256';
4343
const ecdheCipher = 'ECDHE-RSA-AES128-SHA256';
4444
const ciphers = `${dheCipher}:${ecdheCipher}`;
4545

46-
// Test will emit a warning because the DH parameter size is < 2048 bits
47-
common.expectWarning('SecurityWarning',
48-
'DH parameter is less than 2048 bits');
46+
if (!common.hasOpenSSL(3, 2)) {
47+
// Test will emit a warning because the DH parameter size is < 2048 bits
48+
// when the test is run on versions lower than OpenSSL32
49+
common.expectWarning('SecurityWarning',
50+
'DH parameter is less than 2048 bits');
51+
}
4952

5053
function loadDHParam(n) {
5154
const keyname = `dh${n}.pem`;
@@ -104,7 +107,11 @@ function testCustomParam(keylen, expectedCipher) {
104107
}, /DH parameter is less than 1024 bits/);
105108

106109
// Custom DHE parameters are supported (but discouraged).
107-
await testCustomParam(1024, dheCipher);
110+
if (!common.hasOpenSSL(3, 2)) {
111+
await testCustomParam(1024, dheCipher);
112+
} else {
113+
await testCustomParam(3072, dheCipher);
114+
}
108115
await testCustomParam(2048, dheCipher);
109116

110117
// Invalid DHE parameters are discarded. ECDHE remains enabled.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy