Socket
Socket
Sign inDemoInstall

tendermint

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tendermint - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

28

lib/verify.js

@@ -6,8 +6,6 @@ 'use strict';

// TODO: try to load native ed25519 implementation, fall back to supercop.js
var secp256k1 = require('secp256k1');
var _require = require('./hash.js'),
getBlockHash = _require.getBlockHash,
getValidatorSetHash = _require.getValidatorSetHash,
sha256 = _require.sha256;
getValidatorSetHash = _require.getValidatorSetHash;

@@ -158,3 +156,2 @@ var _require2 = require('./pubkey.js'),

validatorsByAddress[validator.address] = validator;
validator.voting_power = safeParseInt(validator.voting_power);
}

@@ -198,18 +195,5 @@ } catch (err) {

var pubKey = Buffer.from(_validator.pub_key.value, 'base64');
var pubKeyType = _validator.pub_key.type;
var validSignature = void 0;
switch (pubKeyType) {
case 'tendermint/PubKeyEd25519':
validSignature = ed25519.verify(signature, signBytes, pubKey);
break;
case 'tendermint/PubKeySecp256k1':
validSignature = secp256k1.verify(sha256(signBytes), signature, pubKey);
break;
default:
throw Error('Unknown pubkey type "' + _validator.pub_key.type + '"');
}
if (validSignature !== true) {
// TODO: support secp256k1 sigs
if (!ed25519.verify(signature, signBytes, pubKey)) {
throw Error('Invalid precommit signature');

@@ -272,5 +256,5 @@ }

var votingPower = safeParseInt(validator.voting_power);
verifyPositiveInt(votingPower);
if (votingPower === 0) {
validator.voting_power = safeParseInt(validator.voting_power);
verifyPositiveInt(validator.voting_power);
if (validator.voting_power === 0) {
throw Error('Validator voting power must be > 0');

@@ -277,0 +261,0 @@ }

{
"name": "tendermint",
"version": "3.3.0",
"version": "3.4.0",
"description": "A light client which talks to your Tendermint node over RPC",

@@ -23,3 +23,2 @@ "main": "index.js",

"pumpify": "^1.3.5",
"secp256k1": "^3.5.2",
"supercop.js": "^2.0.1",

@@ -26,0 +25,0 @@ "varstruct": "^6.1.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc