1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-04 05:10:05 +02:00

update dependencies

This commit is contained in:
s2
2018-10-10 15:11:12 +02:00
parent da4083f574
commit 5c55c54b71
90877 changed files with 339776 additions and 33677 deletions

View File

@@ -9,6 +9,7 @@ var nacl;
var stream = require('stream');
var util = require('util');
var assert = require('assert-plus');
var Buffer = require('safer-buffer').Buffer;
var Signature = require('./signature');
function Verifier(key, hashAlgo) {
@@ -33,7 +34,7 @@ Verifier.prototype._write = function (chunk, enc, cb) {
Verifier.prototype.update = function (chunk) {
if (typeof (chunk) === 'string')
chunk = new Buffer(chunk, 'binary');
chunk = Buffer.from(chunk, 'binary');
this.chunks.push(chunk);
};
@@ -45,7 +46,7 @@ Verifier.prototype.verify = function (signature, fmt) {
sig = signature.toBuffer('raw');
} else if (typeof (signature) === 'string') {
sig = new Buffer(signature, 'base64');
sig = Buffer.from(signature, 'base64');
} else if (Signature.isSignature(signature, [1, 0])) {
throw (new Error('signature was created by too old ' +
@@ -81,7 +82,7 @@ Signer.prototype._write = function (chunk, enc, cb) {
Signer.prototype.update = function (chunk) {
if (typeof (chunk) === 'string')
chunk = new Buffer(chunk, 'binary');
chunk = Buffer.from(chunk, 'binary');
this.chunks.push(chunk);
};
@@ -90,7 +91,7 @@ Signer.prototype.sign = function () {
new Uint8Array(Buffer.concat(this.chunks)),
new Uint8Array(Buffer.concat([
this.key.part.k.data, this.key.part.A.data])));
var sigBuf = new Buffer(sig);
var sigBuf = Buffer.from(sig);
var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw');
sigObj.hashAlgorithm = 'sha512';
return (sigObj);