mirror of https://github.com/certusone/aiakos.git
Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
Hendrik Hofstadt | c3bfaedf96 | |
Hendrik Hofstadt | bdfc9308de |
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
name = "github.com/btcsuite/btcd"
|
name = "github.com/btcsuite/btcd"
|
||||||
packages = ["btcec"]
|
packages = ["btcec"]
|
||||||
revision = "67e573d211ace594f1366b4ce9d39726c4b19bd0"
|
revision = "ed77733ec07dfc8a513741138419b8d9d3de9d2d"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/certusone/yubihsm-go"
|
name = "github.com/certusone/yubihsm-go"
|
||||||
|
@ -33,6 +32,12 @@
|
||||||
]
|
]
|
||||||
revision = "34d48bb938155e3b408f014835ee1f6e3b4c2672"
|
revision = "34d48bb938155e3b408f014835ee1f6e3b4c2672"
|
||||||
|
|
||||||
|
[[projects]]
|
||||||
|
name = "github.com/ethereum/go-ethereum"
|
||||||
|
packages = ["crypto/secp256k1"]
|
||||||
|
revision = "7fa3509e2eaf1a4ebc12344590e5699406690f15"
|
||||||
|
version = "v1.8.22"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/go-kit/kit"
|
name = "github.com/go-kit/kit"
|
||||||
packages = [
|
packages = [
|
||||||
|
@ -92,26 +97,11 @@
|
||||||
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
|
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
|
||||||
version = "v0.8.0"
|
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]]
|
[[projects]]
|
||||||
name = "github.com/tendermint/go-amino"
|
name = "github.com/tendermint/go-amino"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "faa6e731944e2b7b6a46ad202902851e8ce85bee"
|
revision = "dc14acf9ef15f85828bfbc561ed9dd9d2a284885"
|
||||||
version = "v0.12.0"
|
version = "v0.14.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/tendermint/tendermint"
|
name = "github.com/tendermint/tendermint"
|
||||||
|
@ -130,22 +120,24 @@
|
||||||
"libs/pubsub",
|
"libs/pubsub",
|
||||||
"libs/pubsub/query",
|
"libs/pubsub/query",
|
||||||
"types",
|
"types",
|
||||||
"types/time"
|
"types/time",
|
||||||
|
"version"
|
||||||
]
|
]
|
||||||
revision = "d419fffe18531317c28c29a292ad7d253f6cafdf"
|
revision = "28d75ec8016b7fb043735cbe4c4d92ec73355de7"
|
||||||
version = "v0.24.0"
|
version = "v0.30.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
name = "golang.org/x/crypto"
|
name = "golang.org/x/crypto"
|
||||||
packages = [
|
packages = [
|
||||||
|
"ed25519",
|
||||||
|
"ed25519/internal/edwards25519",
|
||||||
"pbkdf2",
|
"pbkdf2",
|
||||||
"ripemd160"
|
"ripemd160"
|
||||||
]
|
]
|
||||||
revision = "0c41d7ab0a0ee717d4590a44bcb987dfd9e183eb"
|
revision = "3764759f34a542a3aef74d6b02e35be7ab893bba"
|
||||||
|
source = "https://github.com/tendermint/crypto"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "release-branch.go1.11"
|
|
||||||
name = "golang.org/x/net"
|
name = "golang.org/x/net"
|
||||||
packages = [
|
packages = [
|
||||||
"context",
|
"context",
|
||||||
|
@ -156,7 +148,7 @@
|
||||||
"internal/timeseries",
|
"internal/timeseries",
|
||||||
"trace"
|
"trace"
|
||||||
]
|
]
|
||||||
revision = "c39426892332e1bb5ec0a434a079bf82f5d30c54"
|
revision = "292b43bbf7cb8d35ddf40f8d5100ef3837cced3f"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "golang.org/x/text"
|
name = "golang.org/x/text"
|
||||||
|
@ -220,6 +212,6 @@
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "67414e714c2545c1a8679288655315fa603e148f48459c727d031bbf164c4d4e"
|
inputs-digest = "38dc72851dc7c05fc4ea2e24199d93496cf4c96c5f2215927b21850a61c47337"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
|
|
@ -26,11 +26,12 @@
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/tendermint/tendermint"
|
name = "github.com/tendermint/tendermint"
|
||||||
version = "^v0.24.0"
|
version = "^v0.30.0"
|
||||||
|
|
||||||
[[override]]
|
[[override]]
|
||||||
name = "golang.org/x/net"
|
name = "golang.org/x/crypto"
|
||||||
branch = "release-branch.go1.11"
|
source = "https://github.com/tendermint/crypto"
|
||||||
|
revision = "3764759f34a542a3aef74d6b02e35be7ab893bba"
|
||||||
|
|
||||||
[[constraint]]
|
[[constraint]]
|
||||||
name = "github.com/certusone/yubihsm-go"
|
name = "github.com/certusone/yubihsm-go"
|
||||||
|
|
23
hsm.go
23
hsm.go
|
@ -60,13 +60,6 @@ func (a *AiakosPV) OnStop() {
|
||||||
a.hsmSessionManager.Destroy()
|
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.
|
// GetPubKey returns the public key of the validator.
|
||||||
// Implements PrivValidator.
|
// Implements PrivValidator.
|
||||||
func (a *AiakosPV) GetPubKey() crypto.PubKey {
|
func (a *AiakosPV) GetPubKey() crypto.PubKey {
|
||||||
|
@ -135,19 +128,6 @@ func (a *AiakosPV) SignProposal(chainID string, proposal *types.Proposal) error
|
||||||
return nil
|
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.
|
// 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 fails if the key slot already contains a key.
|
||||||
// This should be used for testing purposes only. Wrap and import keys in production.
|
// 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")
|
return nil, errors.New("invalid response type")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO replace with ed25519.SignatureSize once tendermint is upgraded to >=v0.24.0
|
if len(parsedResp.Signature) != ed25519.SignatureSize {
|
||||||
if len(parsedResp.Signature) != 64 {
|
|
||||||
a.Logger.Error("invalid signature length", "size", len(parsedResp.Signature))
|
a.Logger.Error("invalid signature length", "size", len(parsedResp.Signature))
|
||||||
return nil, errors.New("invalid signature length")
|
return nil, errors.New("invalid signature length")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue