Skip to content

Commit d8bace5

Browse files
committed
fix: Kdf keys should have an algorithm name of ‘HKDF’
The suite did not have a KDF, so this value was `undefined` which should never happen in practice. Tests should match expected situations.
1 parent cd355e9 commit d8bace5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/material-management/test/cryptographic_material.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ describe('decorateWebCryptoMaterial:Helpers', () => {
477477
it('Suite without the KDF is only derivable with the key', () => {
478478
const suite = new WebCryptoAlgorithmSuite(AlgorithmSuiteIdentifier.ALG_AES128_GCM_IV12_TAG16)
479479
const material = new WebCryptoEncryptionMaterial(suite, {})
480-
const keyKdf: any = { type: 'secret', algorithm: { name: suite.kdf }, usages: ['deriveKey'], extractable: false }
480+
const keyKdf: any = { type: 'secret', algorithm: { name: 'HKDF' }, usages: ['deriveKey'], extractable: false }
481481
const key: any = { type: 'secret', algorithm: { name: suite.encryption, length: suite.keyLength }, usages: ['encrypt'], extractable: false }
482482
expect(isValidCryptoKey(keyKdf, material)).to.equal(false)
483483
expect(isValidCryptoKey(key, material)).to.equal(true)

0 commit comments

Comments
 (0)