Skip to content

Commit 42e1970

Browse files
kapouerljharb
authored andcommitted
[Tests] log when openssl doesn't support cipher
This fixes #37.
1 parent 75ce1d5 commit 42e1970

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: test/index.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ fixtures.valid.ec.forEach(function (f) {
6666
}
6767

6868
(nCrypto.getHashes().includes(f.scheme) ? test : test.skip)(f.message, function (t) {
69-
var nSign = nCrypto.createSign(f.scheme);
69+
var nSign;
70+
try {
71+
nSign = nCrypto.createSign(f.scheme);
72+
} catch (ex) {
73+
console.info('skipping unsupported scheme', f.scheme);
74+
t.end();
75+
return;
76+
}
7077
var bSign = bCrypto.createSign(f.scheme);
71-
7278
var bSig = bSign.update(message).sign(priv);
7379
var nSig = nSign.update(message).sign(priv);
7480
t.notEqual(bSig.toString('hex'), nSig.toString('hex'), 'not equal sigs');
@@ -82,6 +88,7 @@ fixtures.valid.ec.forEach(function (f) {
8288

8389
t.end();
8490
});
91+
8592
if (f.scheme !== 'DSA' && f.scheme.toLowerCase().indexOf('dsa') === -1) {
8693
test(f.message + ' named rsa through', function (t) {
8794
var scheme = 'RSA-' + f.scheme.toUpperCase();

0 commit comments

Comments
 (0)