Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test,crypto: make crypto tests work with BoringSSL
  • Loading branch information
codebytere committed Oct 22, 2024
commit 9e75a3f52e9300af6ad2585c5b46c01319fdc0b1
4 changes: 2 additions & 2 deletions test/parallel/test-crypto-dh-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ for (const g of [-1, 1]) {
const ex = {
code: 'ERR_OSSL_DH_BAD_GENERATOR',
name: 'Error',
message: /bad generator/,
message: /(?:bad[_ ]generator)/i,
};
assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex);
assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex);
Expand All @@ -55,7 +55,7 @@ for (const g of [Buffer.from([]),
const ex = {
code: 'ERR_OSSL_DH_BAD_GENERATOR',
name: 'Error',
message: /bad generator/,
message: /(?:bad[_ ]generator)/i,
};
assert.throws(() => crypto.createDiffieHellman('abcdef', g), ex);
assert.throws(() => crypto.createDiffieHellman('abcdef', 'hex', g), ex);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-crypto-private-decrypt-gh32240.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const pkeyEncrypted =
pair.privateKey.export({
type: 'pkcs1',
format: 'pem',
cipher: 'aes128',
cipher: 'aes-128-cbc',
passphrase: 'secret',
});

Expand Down
9 changes: 2 additions & 7 deletions test/parallel/test-tls-getcertificate-x509.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ const server = tls.createServer(options, function(cleartext) {
server.once('secureConnection', common.mustCall(function(socket) {
const cert = socket.getX509Certificate();
assert(cert instanceof X509Certificate);
assert.strictEqual(
cert.serialNumber,
'5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE');
assert.match(cert.serialNumber, /5B75D77EDC7FB5B7FA9F1424DA4C64FB815DCBDE/i);
}));

server.listen(0, common.mustCall(function() {
Expand All @@ -33,10 +31,7 @@ server.listen(0, common.mustCall(function() {
const peerCert = socket.getPeerX509Certificate();
assert(peerCert.issuerCertificate instanceof X509Certificate);
assert.strictEqual(peerCert.issuerCertificate.issuerCertificate, undefined);
assert.strictEqual(
peerCert.issuerCertificate.serialNumber,
'147D36C1C2F74206DE9FAB5F2226D78ADB00A425'
);
assert.match(peerCert.issuerCertificate.serialNumber, /147D36C1C2F74206DE9FAB5F2226D78ADB00A425/i);
server.close();
}));
socket.end('Hello');
Expand Down