Apply updated webcrypto-core
This commit is contained in:
parent
5b93440ce9
commit
1baede1ae4
|
@ -6,7 +6,7 @@ export class Pbkdf2Provider extends core.Pbkdf2Provider {
|
||||||
|
|
||||||
public async onDeriveBits(algorithm: Pbkdf2Params, baseKey: PbkdfCryptoKey, length: number): Promise<ArrayBuffer> {
|
public async onDeriveBits(algorithm: Pbkdf2Params, baseKey: PbkdfCryptoKey, length: number): Promise<ArrayBuffer> {
|
||||||
return new Promise<ArrayBuffer>((resolve, reject) => {
|
return new Promise<ArrayBuffer>((resolve, reject) => {
|
||||||
const salt = this.prepareData(algorithm.salt);
|
const salt = core.BufferSourceConverter.toArrayBuffer(algorithm.salt);
|
||||||
const hash = (algorithm.hash as Algorithm).name.replace("-", "");
|
const hash = (algorithm.hash as Algorithm).name.replace("-", "");
|
||||||
crypto.pbkdf2(baseKey.data, Buffer.from(salt), algorithm.iterations, length >> 3, hash, (err, derivedBits) => {
|
crypto.pbkdf2(baseKey.data, Buffer.from(salt), algorithm.iterations, length >> 3, hash, (err, derivedBits) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Reference in New Issue