Skip to content

Commit 534562f

Browse files
codebyteredanielleadams
authored andcommitted
test: make more crypto tests work with BoringSSL
PR-URL: #46429 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent f969cc3 commit 534562f

4 files changed

+10
-10
lines changed

test/parallel/test-tls-cert-chains-concat.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ connect({
2525
assert.strictEqual(peer.subject.emailAddress, '[email protected]');
2626
assert.strictEqual(peer.subject.CN, 'Ádám Lippai');
2727
assert.strictEqual(peer.issuer.CN, 'ca3');
28-
assert.strictEqual(peer.serialNumber, '5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE');
28+
assert.match(peer.serialNumber, /5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE/i);
2929

3030
const next = pair.client.conn.getPeerCertificate(true).issuerCertificate;
3131
const root = next.issuerCertificate;
3232
delete next.issuerCertificate;
3333
debug('next:\n', next);
3434
assert.strictEqual(next.subject.CN, 'ca3');
3535
assert.strictEqual(next.issuer.CN, 'ca1');
36-
assert.strictEqual(next.serialNumber, '147D36C1C2F74206DE9FAB5F2226D78ADB00A425');
36+
assert.match(next.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A425/i);
3737

3838
debug('root:\n', root);
3939
assert.strictEqual(root.subject.CN, 'ca1');
4040
assert.strictEqual(root.issuer.CN, 'ca1');
41-
assert.strictEqual(root.serialNumber, '4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229');
41+
assert.match(root.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i);
4242

4343
// No client cert, so empty object returned.
4444
assert.deepStrictEqual(pair.server.conn.getPeerCertificate(), {});

test/parallel/test-tls-cert-chains-in-ca.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ connect({
3030

3131
const peer = pair.client.conn.getPeerCertificate();
3232
debug('peer:\n', peer);
33-
assert.strictEqual(peer.serialNumber, '5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE');
33+
assert.match(peer.serialNumber, /5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE/i);
3434

3535
const next = pair.client.conn.getPeerCertificate(true).issuerCertificate;
3636
const root = next.issuerCertificate;
3737
delete next.issuerCertificate;
3838
debug('next:\n', next);
39-
assert.strictEqual(next.serialNumber, '147D36C1C2F74206DE9FAB5F2226D78ADB00A425');
39+
assert.match(next.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A425/i);
4040

4141
debug('root:\n', root);
42-
assert.strictEqual(root.serialNumber, '4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229');
42+
assert.match(root.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i);
4343

4444
return cleanup();
4545
});

test/parallel/test-tls-empty-sni-context.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const options = {
1616
const server = tls.createServer(options, (c) => {
1717
assert.fail('Should not be called');
1818
}).on('tlsClientError', common.mustCall((err, c) => {
19-
assert.match(err.message, /SSL_use_certificate:passed a null parameter/i);
19+
assert.match(err.message, /passed a null parameter/i);
2020
server.close();
2121
})).listen(0, common.mustCall(() => {
2222
const c = tls.connect({

test/parallel/test-tls-set-ciphers-error.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ const fixtures = require('../common/fixtures');
1515
ciphers: 'aes256-sha'
1616
};
1717
assert.throws(() => tls.createServer(options, common.mustNotCall()),
18-
/no cipher match/i);
18+
/no[_ ]cipher[_ ]match/i);
1919
options.ciphers = 'FOOBARBAZ';
2020
assert.throws(() => tls.createServer(options, common.mustNotCall()),
21-
/no cipher match/i);
21+
/no[_ ]cipher[_ ]match/i);
2222
options.ciphers = 'TLS_not_a_cipher';
2323
assert.throws(() => tls.createServer(options, common.mustNotCall()),
24-
/no cipher match/i);
24+
/no[_ ]cipher[_ ]match/i);
2525
}

0 commit comments

Comments
 (0)