From dc77b39dd347e7f8b60a0f25a311fe5f06130579 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Thu, 17 Mar 2022 19:12:01 -0400 Subject: [PATCH] Fix error checking. - Newer object style not available in older platforms. - Using message regex style. --- tests/unit/rsa.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/unit/rsa.js b/tests/unit/rsa.js index f1493545..1cd9e072 100644 --- a/tests/unit/rsa.js +++ b/tests/unit/rsa.js @@ -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) { @@ -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() {