mirror of
https://github.com/S2-/gitlit
synced 2025-08-04 05:10:05 +02:00
update dependencies
This commit is contained in:
29
node_modules/sshpk/lib/dhe.js
generated
vendored
29
node_modules/sshpk/lib/dhe.js
generated
vendored
@@ -8,6 +8,7 @@ module.exports = {
|
||||
|
||||
var assert = require('assert-plus');
|
||||
var crypto = require('crypto');
|
||||
var Buffer = require('safer-buffer').Buffer;
|
||||
var algs = require('./algs');
|
||||
var utils = require('./utils');
|
||||
var nacl;
|
||||
@@ -189,7 +190,7 @@ DiffieHellman.prototype.computeSecret = function (otherpk) {
|
||||
var secret = nacl.box.before(new Uint8Array(pub),
|
||||
new Uint8Array(priv));
|
||||
|
||||
return (new Buffer(secret));
|
||||
return (Buffer.from(secret));
|
||||
}
|
||||
|
||||
throw (new Error('Invalid algorithm: ' + this._algo));
|
||||
@@ -218,7 +219,7 @@ DiffieHellman.prototype.generateKey = function () {
|
||||
this._dh.generateKeys();
|
||||
|
||||
parts.push({name: 'curve',
|
||||
data: new Buffer(this._curve)});
|
||||
data: Buffer.from(this._curve)});
|
||||
parts.push({name: 'Q', data: this._dh.getPublicKey()});
|
||||
parts.push({name: 'd', data: this._dh.getPrivateKey()});
|
||||
this._key = new PrivateKey({
|
||||
@@ -236,14 +237,14 @@ DiffieHellman.prototype.generateKey = function () {
|
||||
priv = r.mod(n1).add(jsbn.ONE);
|
||||
pub = this._ecParams.getG().multiply(priv);
|
||||
|
||||
priv = new Buffer(priv.toByteArray());
|
||||
pub = new Buffer(this._ecParams.getCurve().
|
||||
priv = Buffer.from(priv.toByteArray());
|
||||
pub = Buffer.from(this._ecParams.getCurve().
|
||||
encodePointHex(pub), 'hex');
|
||||
|
||||
this._priv = new ECPrivate(this._ecParams, priv);
|
||||
|
||||
parts.push({name: 'curve',
|
||||
data: new Buffer(this._curve)});
|
||||
data: Buffer.from(this._curve)});
|
||||
parts.push({name: 'Q', data: pub});
|
||||
parts.push({name: 'd', data: priv});
|
||||
|
||||
@@ -258,8 +259,8 @@ DiffieHellman.prototype.generateKey = function () {
|
||||
|
||||
} else if (this._algo === 'curve25519') {
|
||||
var pair = nacl.box.keyPair();
|
||||
priv = new Buffer(pair.secretKey);
|
||||
pub = new Buffer(pair.publicKey);
|
||||
priv = Buffer.from(pair.secretKey);
|
||||
pub = Buffer.from(pair.publicKey);
|
||||
priv = Buffer.concat([priv, pub]);
|
||||
assert.strictEqual(priv.length, 64);
|
||||
assert.strictEqual(pub.length, 32);
|
||||
@@ -316,7 +317,7 @@ function ECPrivate(params, buffer) {
|
||||
ECPrivate.prototype.deriveSharedSecret = function (pubKey) {
|
||||
assert.ok(pubKey instanceof ECPublic);
|
||||
var S = pubKey._pub.multiply(this._priv);
|
||||
return (new Buffer(S.getX().toBigInteger().toByteArray()));
|
||||
return (Buffer.from(S.getX().toBigInteger().toByteArray()));
|
||||
};
|
||||
|
||||
function generateED25519() {
|
||||
@@ -324,8 +325,8 @@ function generateED25519() {
|
||||
nacl = require('tweetnacl');
|
||||
|
||||
var pair = nacl.sign.keyPair();
|
||||
var priv = new Buffer(pair.secretKey);
|
||||
var pub = new Buffer(pair.publicKey);
|
||||
var priv = Buffer.from(pair.secretKey);
|
||||
var pub = Buffer.from(pair.publicKey);
|
||||
assert.strictEqual(priv.length, 64);
|
||||
assert.strictEqual(pub.length, 32);
|
||||
|
||||
@@ -362,7 +363,7 @@ function generateECDSA(curve) {
|
||||
dh.generateKeys();
|
||||
|
||||
parts.push({name: 'curve',
|
||||
data: new Buffer(curve)});
|
||||
data: Buffer.from(curve)});
|
||||
parts.push({name: 'Q', data: dh.getPublicKey()});
|
||||
parts.push({name: 'd', data: dh.getPrivateKey()});
|
||||
|
||||
@@ -395,11 +396,11 @@ function generateECDSA(curve) {
|
||||
var priv = c.mod(n1).add(jsbn.ONE);
|
||||
var pub = ecParams.getG().multiply(priv);
|
||||
|
||||
priv = new Buffer(priv.toByteArray());
|
||||
pub = new Buffer(ecParams.getCurve().
|
||||
priv = Buffer.from(priv.toByteArray());
|
||||
pub = Buffer.from(ecParams.getCurve().
|
||||
encodePointHex(pub), 'hex');
|
||||
|
||||
parts.push({name: 'curve', data: new Buffer(curve)});
|
||||
parts.push({name: 'curve', data: Buffer.from(curve)});
|
||||
parts.push({name: 'Q', data: pub});
|
||||
parts.push({name: 'd', data: priv});
|
||||
|
||||
|
Reference in New Issue
Block a user