Skip to content

Commit

Permalink
test: make more crypto tests work with BoringSSL
Browse files Browse the repository at this point in the history
PR-URL: #46429
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
codebytere authored and danielleadams committed Apr 3, 2023
1 parent f969cc3 commit 534562f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-tls-cert-chains-concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ connect({
assert.strictEqual(peer.subject.emailAddress, '[email protected]');
assert.strictEqual(peer.subject.CN, 'Ádám Lippai');
assert.strictEqual(peer.issuer.CN, 'ca3');
assert.strictEqual(peer.serialNumber, '5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE');
assert.match(peer.serialNumber, /5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE/i);

const next = pair.client.conn.getPeerCertificate(true).issuerCertificate;
const root = next.issuerCertificate;
delete next.issuerCertificate;
debug('next:\n', next);
assert.strictEqual(next.subject.CN, 'ca3');
assert.strictEqual(next.issuer.CN, 'ca1');
assert.strictEqual(next.serialNumber, '147D36C1C2F74206DE9FAB5F2226D78ADB00A425');
assert.match(next.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A425/i);

debug('root:\n', root);
assert.strictEqual(root.subject.CN, 'ca1');
assert.strictEqual(root.issuer.CN, 'ca1');
assert.strictEqual(root.serialNumber, '4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229');
assert.match(root.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i);

// No client cert, so empty object returned.
assert.deepStrictEqual(pair.server.conn.getPeerCertificate(), {});
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-tls-cert-chains-in-ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ connect({

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

const next = pair.client.conn.getPeerCertificate(true).issuerCertificate;
const root = next.issuerCertificate;
delete next.issuerCertificate;
debug('next:\n', next);
assert.strictEqual(next.serialNumber, '147D36C1C2F74206DE9FAB5F2226D78ADB00A425');
assert.match(next.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A425/i);

debug('root:\n', root);
assert.strictEqual(root.serialNumber, '4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229');
assert.match(root.serialNumber, /4AB16C8DFD6A7D0D2DFCABDF9C4B0E92C6AD0229/i);

return cleanup();
});
2 changes: 1 addition & 1 deletion test/parallel/test-tls-empty-sni-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const options = {
const server = tls.createServer(options, (c) => {
assert.fail('Should not be called');
}).on('tlsClientError', common.mustCall((err, c) => {
assert.match(err.message, /SSL_use_certificate:passed a null parameter/i);
assert.match(err.message, /passed a null parameter/i);
server.close();
})).listen(0, common.mustCall(() => {
const c = tls.connect({
Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-tls-set-ciphers-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const fixtures = require('../common/fixtures');
ciphers: 'aes256-sha'
};
assert.throws(() => tls.createServer(options, common.mustNotCall()),
/no cipher match/i);
/no[_ ]cipher[_ ]match/i);
options.ciphers = 'FOOBARBAZ';
assert.throws(() => tls.createServer(options, common.mustNotCall()),
/no cipher match/i);
/no[_ ]cipher[_ ]match/i);
options.ciphers = 'TLS_not_a_cipher';
assert.throws(() => tls.createServer(options, common.mustNotCall()),
/no cipher match/i);
/no[_ ]cipher[_ ]match/i);
}

0 comments on commit 534562f

Please sign in to comment.