fix: update to the new crypto.randomBytes method

This commit is contained in:
Friedel Ziegelmayer 2017-01-22 17:08:15 +01:00
parent e1a398206c
commit 73d0b41249
2 changed files with 1 additions and 5 deletions

View File

@ -18,7 +18,7 @@ const nonceSize = 16
exports.createProposal = (state) => {
state.proposal.out = {
rand: support.randomBytes(nonceSize),
rand: crypto.randomBytes(nonceSize),
pubkey: state.key.local.public.bytes,
exchanges: support.exchanges.join(','),
ciphers: support.ciphers.join(','),

View File

@ -76,10 +76,6 @@ function makeCipher (cipherType, iv, key, callback) {
callback(new Error(`unrecognized cipher type: ${cipherType}`))
}
exports.randomBytes = (nonceSize) => {
return Buffer.from(crypto.webcrypto.getRandomValues(new Uint8Array(nonceSize)))
}
exports.selectBest = (local, remote, cb) => {
exports.digest(Buffer.concat([
remote.pubKeyBytes,