Skip to content

Commit

Permalink
Fix error checking.
Browse files Browse the repository at this point in the history
- Newer object style not available in older platforms.
- Using message regex style.
  • Loading branch information
davidlehn committed Mar 17, 2022
1 parent bb822c0 commit dc77b39
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/unit/rsa.js
Expand Up @@ -829,9 +829,8 @@ var UTIL = require('../../lib/util');

ASSERT.throws(function() {
publicKey.verify(md.digest().getBytes(), S);
}, {
message: 'Unparsed DER bytes remain after ASN.1 parsing.'
});
},
/^Error: Unparsed DER bytes remain after ASN.1 parsing.$/);
}

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

it('should check DigestInfo structure', function() {
Expand Down

0 comments on commit dc77b39

Please sign in to comment.