From 82edebfebf97d22d9a4d8b2654fd154accb67912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Tue, 30 Jul 2019 12:19:08 +0200 Subject: [PATCH] test: add test for OAEP hash mismatch PR-URL: https://github.com/nodejs/node/pull/28335 Fixes: https://github.com/nodejs/node/issues/25756 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Sam Roberts --- test/parallel/test-crypto-rsa-dsa.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/parallel/test-crypto-rsa-dsa.js b/test/parallel/test-crypto-rsa-dsa.js index 9a90fb3ce3d40f..c773aae829481e 100644 --- a/test/parallel/test-crypto-rsa-dsa.js +++ b/test/parallel/test-crypto-rsa-dsa.js @@ -193,6 +193,11 @@ test_rsa('RSA_PKCS1_OAEP_PADDING', undefined, 'sha1'); test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha1', undefined); test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha256', 'sha256'); test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha512', 'sha512'); +common.expectsError(() => { + test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha256', 'sha512'); +}, { + code: 'ERR_OSSL_RSA_OAEP_DECODING_ERROR' +}); // The following RSA-OAEP test cases were created using the WebCrypto API to // ensure compatibility when using non-SHA1 hash functions.