mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-31 19:02:59 +01:00
Fixed bun runtime.
This commit is contained in:
parent
f5db077355
commit
3435e8cfb9
2 changed files with 10 additions and 4 deletions
|
@ -1,7 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const {Buffer} = require('buffer');
|
const {Buffer} = require('buffer');
|
||||||
const crypto = require('./crypto');
|
const crypto = require('node:crypto')
|
||||||
|
const cryptoHelper = require('./crypto')
|
||||||
const db = require('../db/DB');
|
const db = require('../db/DB');
|
||||||
const log4js = require('log4js');
|
const log4js = require('log4js');
|
||||||
|
|
||||||
|
@ -30,8 +31,7 @@ class Hkdf extends Kdf {
|
||||||
}
|
}
|
||||||
|
|
||||||
async derive(p, info) {
|
async derive(p, info) {
|
||||||
return Buffer.from(
|
return Buffer.from(await cryptoHelper.hkdf(p.digest, p.secret, p.salt, info, p.keyLen)).toString('hex');
|
||||||
await crypto.hkdf(p.digest, p.secret, p.salt, info, p.keyLen)).toString('hex');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,13 @@
|
||||||
|
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
|
|
||||||
const newMethod = async (...args) => new Promise((resolve) => crypto.hkdf(...args, resolve));
|
const newMethod = async (...args) => new Promise((resolve, reject) => crypto.hkdf(...args, (err, result)=>{
|
||||||
|
if(err){
|
||||||
|
return reject(err)
|
||||||
|
} else {
|
||||||
|
return resolve(result)
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Promisified version of Node.js's crypto.hkdf.
|
* Promisified version of Node.js's crypto.hkdf.
|
||||||
|
|
Loading…
Reference in a new issue