Skip to content

Commit dc77b39

Browse files
committed
Fix error checking.
- Newer object style not available in older platforms. - Using message regex style.
1 parent bb822c0 commit dc77b39

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/unit/rsa.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,8 @@ var UTIL = require('../../lib/util');
829829

830830
ASSERT.throws(function() {
831831
publicKey.verify(md.digest().getBytes(), S);
832-
}, {
833-
message: 'Unparsed DER bytes remain after ASN.1 parsing.'
834-
});
832+
},
833+
/^Error: Unparsed DER bytes remain after ASN.1 parsing.$/);
835834
}
836835

837836
function _checkBadDigestInfo(publicKey, S, skipTailingGarbage) {
@@ -842,9 +841,8 @@ var UTIL = require('../../lib/util');
842841
publicKey.verify(md.digest().getBytes(), S, undefined, {
843842
_parseAllDigestBytes: !skipTailingGarbage
844843
});
845-
}, {
846-
message: 'ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.'
847-
});
844+
},
845+
/^Error: ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.$/);
848846
}
849847

850848
it('should check DigestInfo structure', function() {

0 commit comments

Comments
 (0)