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 0e1ce20

Browse filesBrowse files
zecksontargos
authored andcommitted
test: rsa-pss generateKeyPairSync invalid option hash
PR-URL: #27883 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent d406785 commit 0e1ce20
Copy full SHA for 0e1ce20

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+14
-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
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,20 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
999999
});
10001000
}
10011001

1002+
// Invalid hash value.
1003+
for (const hashValue of [123, true, {}, []]) {
1004+
common.expectsError(() => {
1005+
generateKeyPairSync('rsa-pss', {
1006+
modulusLength: 4096,
1007+
hash: hashValue
1008+
});
1009+
}, {
1010+
type: TypeError,
1011+
code: 'ERR_INVALID_OPT_VALUE',
1012+
message: `The value "${hashValue}" is invalid for option "hash"`
1013+
});
1014+
}
1015+
10021016
// Invalid private key type.
10031017
for (const type of ['foo', 'spki']) {
10041018
common.expectsError(() => {

0 commit comments

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