| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2a85cc7 commit 3f66109
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -205,3 +205,15 @@ for (let n = 1; n < 256; n += 1) { | |||
| 205 | 205 | if (common.hasFipsCrypto && n < 12) continue; | |
| 206 | 206 | crypto.createCipheriv('aes-128-gcm', Buffer.alloc(16), Buffer.alloc(n)); | |
| 207 | 207 | } | |
| 208 | + | ||
| 209 | + { | ||
| 210 | + // Passing an invalid cipher name should throw. | ||
| 211 | + assert.throws( | ||
| 212 | + () => crypto.createCipheriv('aes-127', Buffer.alloc(16), null), | ||
| 213 | + /Unknown cipher/); | ||
| 214 | + | ||
| 215 | + // Passing a key with an invalid length should throw. | ||
| 216 | + assert.throws( | ||
| 217 | + () => crypto.createCipheriv('aes-128-ecb', Buffer.alloc(17), null), | ||
| 218 | + /Invalid key length/); | ||
| 219 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -449,3 +449,9 @@ common.expectsError( | |||
| 449 | 449 | assert.deepStrictEqual(h.digest('latin1'), ''); | |
| 450 | 450 | } | |
| 451 | 451 | } | |
| 452 | + | ||
| 453 | + { | ||
| 454 | + assert.throws( | ||
| 455 | + () => crypto.createHmac('sha7', 'key'), | ||
| 456 | + /Unknown message digest/); | ||
| 457 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -363,3 +363,9 @@ common.expectsError( | |||
| 363 | 363 | assert.throws(() => verify.verify('test', input), errObj); | |
| 364 | 364 | }); | |
| 365 | 365 | } | |
| 366 | + | ||
| 367 | + { | ||
| 368 | + assert.throws( | ||
| 369 | + () => crypto.createSign('sha8'), | ||
| 370 | + /Unknown message digest/); | ||
| 371 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments