Compare commits

...

2 Commits

Author SHA1 Message Date
Hendrik Hofstadt c3bfaedf96 Update to latest Tendermint 2019-02-10 10:12:13 +01:00
Hendrik Hofstadt bdfc9308de Remove Consensus Hearbeat 2018-11-30 09:19:44 +01:00
3 changed files with 24 additions and 52 deletions

46
Gopkg.lock generated
View File

@ -2,10 +2,9 @@
[[projects]]
branch = "master"
name = "github.com/btcsuite/btcd"
packages = ["btcec"]
revision = "67e573d211ace594f1366b4ce9d39726c4b19bd0"
revision = "ed77733ec07dfc8a513741138419b8d9d3de9d2d"
[[projects]]
name = "github.com/certusone/yubihsm-go"
@ -33,6 +32,12 @@
]
revision = "34d48bb938155e3b408f014835ee1f6e3b4c2672"
[[projects]]
name = "github.com/ethereum/go-ethereum"
packages = ["crypto/secp256k1"]
revision = "7fa3509e2eaf1a4ebc12344590e5699406690f15"
version = "v1.8.22"
[[projects]]
name = "github.com/go-kit/kit"
packages = [
@ -92,26 +97,11 @@
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
version = "v0.8.0"
[[projects]]
name = "github.com/tendermint/btcd"
packages = ["btcec"]
revision = "e5840949ff4fff0c56f9b6a541e22b63581ea9df"
[[projects]]
branch = "master"
name = "github.com/tendermint/ed25519"
packages = [
".",
"edwards25519",
"extra25519"
]
revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057"
[[projects]]
name = "github.com/tendermint/go-amino"
packages = ["."]
revision = "faa6e731944e2b7b6a46ad202902851e8ce85bee"
version = "v0.12.0"
revision = "dc14acf9ef15f85828bfbc561ed9dd9d2a284885"
version = "v0.14.1"
[[projects]]
name = "github.com/tendermint/tendermint"
@ -130,22 +120,24 @@
"libs/pubsub",
"libs/pubsub/query",
"types",
"types/time"
"types/time",
"version"
]
revision = "d419fffe18531317c28c29a292ad7d253f6cafdf"
version = "v0.24.0"
revision = "28d75ec8016b7fb043735cbe4c4d92ec73355de7"
version = "v0.30.0"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = [
"ed25519",
"ed25519/internal/edwards25519",
"pbkdf2",
"ripemd160"
]
revision = "0c41d7ab0a0ee717d4590a44bcb987dfd9e183eb"
revision = "3764759f34a542a3aef74d6b02e35be7ab893bba"
source = "https://github.com/tendermint/crypto"
[[projects]]
branch = "release-branch.go1.11"
name = "golang.org/x/net"
packages = [
"context",
@ -156,7 +148,7 @@
"internal/timeseries",
"trace"
]
revision = "c39426892332e1bb5ec0a434a079bf82f5d30c54"
revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f"
[[projects]]
name = "golang.org/x/text"
@ -220,6 +212,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "67414e714c2545c1a8679288655315fa603e148f48459c727d031bbf164c4d4e"
inputs-digest = "38dc72851dc7c05fc4ea2e24199d93496cf4c96c5f2215927b21850a61c47337"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -26,11 +26,12 @@
[[constraint]]
name = "github.com/tendermint/tendermint"
version = "^v0.24.0"
version = "^v0.30.0"
[[override]]
name = "golang.org/x/net"
branch = "release-branch.go1.11"
name = "golang.org/x/crypto"
source = "https://github.com/tendermint/crypto"
revision = "3764759f34a542a3aef74d6b02e35be7ab893bba"
[[constraint]]
name = "github.com/certusone/yubihsm-go"

23
hsm.go
View File

@ -60,13 +60,6 @@ func (a *AiakosPV) OnStop() {
a.hsmSessionManager.Destroy()
}
// GetAddress returns the address of the validator.
// Implements PrivValidator.
func (a *AiakosPV) GetAddress() types.Address {
pubKey := a.GetPubKey()
return pubKey.Address()
}
// GetPubKey returns the public key of the validator.
// Implements PrivValidator.
func (a *AiakosPV) GetPubKey() crypto.PubKey {
@ -135,19 +128,6 @@ func (a *AiakosPV) SignProposal(chainID string, proposal *types.Proposal) error
return nil
}
// SignHeartbeat signs a canonical representation of the heartbeat, along with the chainID.
// Implements PrivValidator.
func (a *AiakosPV) SignHeartbeat(chainID string, heartbeat *types.Heartbeat) error {
signature, err := a.signBytes(heartbeat.SignBytes(chainID))
if err != nil {
return err
}
heartbeat.Signature = signature
return nil
}
// ImportKey imports a Eddsa private key to the specified key slot on the HSM.
// This fails if the key slot already contains a key.
// This should be used for testing purposes only. Wrap and import keys in production.
@ -191,8 +171,7 @@ func (a *AiakosPV) signBytes(data []byte) ([]byte, error) {
return nil, errors.New("invalid response type")
}
// TODO replace with ed25519.SignatureSize once tendermint is upgraded to >=v0.24.0
if len(parsedResp.Signature) != 64 {
if len(parsedResp.Signature) != ed25519.SignatureSize {
a.Logger.Error("invalid signature length", "size", len(parsedResp.Signature))
return nil, errors.New("invalid signature length")
}