Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a2707d0

Browse filesBrowse files
tniessenruyadorno
authored andcommitted
test: add coverage for invalid RSA-PSS digests
PR-URL: #44271 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8cf6499 commit a2707d0
Copy full SHA for a2707d0

File tree

Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-crypto-keygen.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-crypto-keygen.js
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,24 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
16541654
}
16551655
);
16561656
}
1657+
1658+
assert.throws(() => generateKeyPair('rsa-pss', {
1659+
modulusLength: 512,
1660+
hashAlgorithm: 'sha2',
1661+
}, common.mustNotCall()), {
1662+
name: 'TypeError',
1663+
code: 'ERR_CRYPTO_INVALID_DIGEST',
1664+
message: 'md specifies an invalid digest'
1665+
});
1666+
1667+
assert.throws(() => generateKeyPair('rsa-pss', {
1668+
modulusLength: 512,
1669+
mgf1HashAlgorithm: 'sha2',
1670+
}, common.mustNotCall()), {
1671+
name: 'TypeError',
1672+
code: 'ERR_CRYPTO_INVALID_DIGEST',
1673+
message: 'mgf1_md specifies an invalid digest'
1674+
});
16571675
}
16581676

16591677
// Passing an empty passphrase string should not cause OpenSSL's default

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.