Skip to content

Commit 82edebf

Browse files
tniessentargos
authored andcommitted
test: add test for OAEP hash mismatch
PR-URL: #28335 Fixes: #25756 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent 54197ea commit 82edebf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/parallel/test-crypto-rsa-dsa.js

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ test_rsa('RSA_PKCS1_OAEP_PADDING', undefined, 'sha1');
193193
test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha1', undefined);
194194
test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha256', 'sha256');
195195
test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha512', 'sha512');
196+
common.expectsError(() => {
197+
test_rsa('RSA_PKCS1_OAEP_PADDING', 'sha256', 'sha512');
198+
}, {
199+
code: 'ERR_OSSL_RSA_OAEP_DECODING_ERROR'
200+
});
196201

197202
// The following RSA-OAEP test cases were created using the WebCrypto API to
198203
// ensure compatibility when using non-SHA1 hash functions.

0 commit comments

Comments
 (0)