| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0821b44 commit 4276516
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -397,7 +397,9 @@ const kSupportedAlgorithms = createSupportedAlgorithms(kAlgorithmDefinitions); | |||
| 397 | 397 | ||
| 398 | 398 | const simpleAlgorithmDictionaries = { | |
| 399 | 399 | AeadParams: { iv: 'BufferSource', additionalData: 'BufferSource' }, | |
| 400 | - RsaHashedKeyGenParams: { hash: 'HashAlgorithmIdentifier' }, | ||
| 400 | + // publicExponent is not strictly a BufferSource but it is a Uint8Array that we normalize | ||
| 401 | + // this way | ||
| 402 | + RsaHashedKeyGenParams: { hash: 'HashAlgorithmIdentifier', publicExponent: 'BufferSource' }, | ||
| 401 | 403 | EcKeyGenParams: {}, | |
| 402 | 404 | HmacKeyGenParams: { hash: 'HashAlgorithmIdentifier' }, | |
| 403 | 405 | RsaPssParams: {}, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -311,14 +311,20 @@ if (hasOpenSSL(3, 5)) { | |||
| 311 | 311 | assert.deepStrictEqual(privateKey.usages, privateUsages); | |
| 312 | 312 | assert.strictEqual(publicKey.algorithm.name, name); | |
| 313 | 313 | assert.strictEqual(publicKey.algorithm.modulusLength, modulusLength); | |
| 314 | - assert.deepStrictEqual(publicKey.algorithm.publicExponent, publicExponent); | ||
| 314 | + assert(publicKey.algorithm.publicExponent instanceof Uint8Array); | ||
| 315 | + assert.notStrictEqual(publicKey.algorithm.publicExponent, publicExponent); | ||
| 316 | + assert(!Buffer.isBuffer(publicKey.algorithm.publicExponent)); | ||
| 317 | + assert.deepStrictEqual(publicKey.algorithm.publicExponent, new Uint8Array(publicExponent)); | ||
| 315 | 318 | assert.strictEqual( | |
| 316 | 319 | KeyObject.from(publicKey).asymmetricKeyDetails.publicExponent, | |
| 317 | 320 | bigIntArrayToUnsignedBigInt(publicExponent)); | |
| 318 | 321 | assert.strictEqual(publicKey.algorithm.hash.name, hash); | |
| 319 | 322 | assert.strictEqual(privateKey.algorithm.name, name); | |
| 320 | 323 | assert.strictEqual(privateKey.algorithm.modulusLength, modulusLength); | |
| 321 | - assert.deepStrictEqual(privateKey.algorithm.publicExponent, publicExponent); | ||
| 324 | + assert(privateKey.algorithm.publicExponent instanceof Uint8Array); | ||
| 325 | + assert.notStrictEqual(privateKey.algorithm.publicExponent, publicExponent); | ||
| 326 | + assert(!Buffer.isBuffer(privateKey.algorithm.publicExponent)); | ||
| 327 | + assert.deepStrictEqual(privateKey.algorithm.publicExponent, new Uint8Array(publicExponent)); | ||
| 322 | 328 | assert.strictEqual( | |
| 323 | 329 | KeyObject.from(privateKey).asymmetricKeyDetails.publicExponent, | |
| 324 | 330 | bigIntArrayToUnsignedBigInt(publicExponent)); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments