Commit Graph

352 Commits

Author SHA1 Message Date
chris-j-h facee712eb Use value receiver for VaultWallet Store as no state change is performed 2019-08-19 16:44:17 +01:00
chris-j-h e9d71100af Mutex changes 2019-08-19 11:43:29 +01:00
chris-j-h 3f195484bd Get accts immediately on open; combine acct & key retrieval loops
* Don't wait for vaultPollingInterval before trying to retrieve accounts the first time

* Combine privateKeyRetrieval and accountRetrievalLoop

* Use indefinite timedUnlock in accountRetrievalLoop to reduce code duplication
2019-08-19 11:41:28 +01:00
chris-j-h d0cd4e231a gofmt 2019-08-16 15:43:25 +01:00
chris-j-h 19d634c0fd Add godoc 2019-08-16 15:37:29 +01:00
chris-j-h f7626e1341 Minor code and docs changes 2019-08-16 15:36:45 +01:00
chris-j-h 1530ae5dfb Zero keys before returning if an error is encountered during getKey 2019-08-16 14:49:41 +01:00
chris-j-h 3880653d9c Rename StorePrivateKeys config option to UnlockAll 2019-08-16 10:33:02 +01:00
chris-j-h 22a571adac Give tests more time to run, fixing failures when running with coverage 2019-08-15 16:45:10 +01:00
chris-j-h 1d61e7d3c3 Validate the correct key has been retrieved from Vault before signing 2019-08-15 13:54:59 +01:00
chris-j-h 38b4bcb975 Minor refactoring/code changes 2019-08-15 13:54:59 +01:00
chris-j-h 421e24cf9c Add mutexes for concurrency safety 2019-08-14 21:16:22 +01:00
chris-j-h fbacb43162 Refactor vault_wallet.go, moving Hashicorp specific code to new file 2019-08-13 10:15:51 +01:00
chris-j-h 6fd7ab01dc Bug fixes (incl. fix panic if no response from vault) 2019-08-13 09:55:59 +01:00
chris-j-h 2740e167ac Include individual Vault acct statuses (i.e. locked/unlocked) in status 2019-08-12 18:17:36 +01:00
chris-j-h e68ef0a561 Add Store to VaultWallet & create new accts through the geth CLI
* Implement Store for VaultWallet and use in CLI account creation

* Define Hashicorp Vault CLI flags

* Update account new usage with Vault CLI flags

* Export Vault Client and Secret config types
2019-08-12 17:26:12 +01:00
chris-j-h 28ad6812ba Add Lock/TimedUnlock for Hashicorp accts & expose in PrivateAccountAPI
* Vault keys can be retrieved and stored for a limited time, reducing the number of calls needed to the Vault server

* Existing timed unlocks can be overriden

* Unlocks can be indefinite, requiring an explicit call to lock
2019-08-07 13:16:43 +01:00
chris-j-h 2e86d84c7d Validate user-provided config and create hashicorpBackend on node start 2019-07-31 16:45:30 +01:00
chris-j-h c8b47deb09 Refactor retrieval of address and key from vault
* Create getSecretFromVault for common key and acct retrieval behaviour

* Use getKeyFromVault in privateKeyRetrievalLoop

* Create getAddressFromVault method to handle address retrieval
2019-07-31 13:05:00 +01:00
chris-j-h 307ad2dee1 Rename keyGetter to keyHandler 2019-07-31 12:31:34 +01:00
chris-j-h 131944e2a6 Implement SignWithPassphrase methods 2019-07-31 11:32:00 +01:00
chris-j-h b480978a0f Implement SignTx 2019-07-31 11:28:55 +01:00
chris-j-h 24c37842bf Merge branch 'master' of https://github.com/jpmorganchase/quorum into hashicorp-vault-tdd 2019-07-31 10:31:44 +01:00
chris-j-h 54910e7d9e Use milliseconds for vault retrieval loop polling interval
Allows for shorter sleeps in tests
2019-07-30 17:41:39 +01:00
chris-j-h 25a5fd5ce8 Implement SignHash and make updates to retrieval loops
* Introduce a keyGetter (final name TBD) to get signing keys either from memory or vault
* Update retrieval loops to use keyGetter data structure
2019-07-30 17:39:50 +01:00
chris-j-h 58673bbb60 Test that account and key retrieval loops stop once done 2019-07-18 11:20:09 +01:00
chris-j-h 7b40efebb9 Add loop to start retrieving keys from vault on wallet open if enabled 2019-07-18 11:06:09 +01:00
chris-j-h 2141b8e1bb Add loop to start retrieving accts from vault once wallet is opened 2019-07-17 17:52:23 +01:00
libby kent e0564f7b41 Adding QuorumPrivateTxSigner for signing and recovering private txs. (#767)
Refactor private transaction signing and add a QuorumPrivateTxSigner for signing and recovering private txs.
2019-07-11 13:32:19 -04:00
chris-j-h 2b79c5b964 Change hashicorpSecretData(require addr and key to be stored separately) 2019-07-10 15:57:30 +01:00
chris-j-h 871e722820 Move account handling to the vaultService
Also implement the unsupported Derive and SelfDerive methods
2019-07-08 16:43:04 +01:00
chris-j-h befd39c74c Implement Contains for vaultWallet 2019-07-08 13:54:25 +01:00
chris-j-h 98ff8b9a19 Implement Accounts for vaultWallet 2019-07-08 13:09:46 +01:00
chris-j-h 9aa1427846 Implement Close for vaultWallet 2019-07-08 13:09:45 +01:00
chris-j-h f297b1613a Send a wallet event to subscribers once vaultWallet is opened
Also:
* Update existing vaultWallet tests
* Reduce backend constructor test scope to check only created wlt urls
2019-07-08 10:15:03 +01:00
chris-j-h 961cdd08e4 Authenticate the hashicorp client during open() 2019-07-07 20:53:38 +01:00
chris-j-h 54b74b3d82 Implement open for hashicorp wallets to create a client 2019-07-07 16:44:50 +01:00
chris-j-h 3d7bf16754 Add vaultService to allow different vendor impls & impl Hashicorp status 2019-07-07 14:05:43 +01:00
chris-j-h a40c72f8a5 Add NewHashicorpBackend, hashicorp config types & start vaultWallet impl 2019-07-06 13:49:44 +01:00
chris-j-h 1916b8a865 Implement vaultBackend 2019-07-05 17:35:56 +01:00
amalraj.manigmail.com bc529a509d Merge branch 'goeth-1.8.18' into geth-upgrade-1.8.18
# Conflicts:
#	.github/CONTRIBUTING.md
#	.travis.yml
#	core/blockchain.go
#	core/vm/evm.go
#	core/vm/logger_test.go
#	eth/handler_test.go
#	eth/tracers/tracer_test.go
#	internal/ethapi/api.go
#	internal/web3ext/web3ext.go
#	p2p/discover/node.go
#	p2p/server.go
#	swarm/network/simulations/discovery/discovery_test.go
2019-01-29 19:08:14 +08:00
Wenbiao Zheng 6ff97bf2e5 accounts: wallet derivation path comment is mistaken (#17934) 2018-10-19 16:40:10 +03:00
Evgeny 331fa6d307 accounts/usbwallet: simplify code using -= operator (#17904) 2018-10-16 00:34:50 +02:00
Martin Holst Swende d5c7a6056a
cmd/clef: encrypt the master seed on disk (#17704)
* cmd/clef: encrypt master seed of clef

Signed-off-by: YaoZengzeng <yaozengzeng@zju.edu.cn>

* keystore: refactor for external use of encryption

* clef: utilize keystore encryption, check flags correctly

* clef: validate master password

* clef: add json wrapping around encrypted master seed
2018-10-09 11:05:41 +02:00
Jeremy Schlatter 5ed3960b9b accounts/abi/bind: stop using goimports in the binding generator (#17768) 2018-10-05 22:24:54 +02:00
amalraj.manigmail.com 47571689ee Merge remote-tracking branch 'remotes/goeth/release/1.8' into geth-upgrade-1.8.15_new
# Conflicts:
#	.travis.yml
#	README.md
#	cmd/utils/flags.go
#	consensus/consensus.go
#	consensus/ethash/consensus.go
#	consensus/ethash/ethash.go
#	core/blockchain.go
#	core/genesis_test.go
#	core/state/state_object.go
#	core/state_processor.go
#	core/vm/errors.go
#	core/vm/evm.go
#	core/vm/gas_table.go
#	core/vm/instructions_test.go
#	core/vm/interface.go
#	eth/api_tracer.go
#	eth/backend.go
#	eth/config.go
#	eth/filters/filter.go
#	les/backend.go
#	les/helper_test.go
#	miner/worker.go
#	params/config.go
#	params/version.go
2018-10-04 16:19:02 +08:00
Martin Holst Swende 96fd50be10 accounts/abi: fix panic in MethodById lookup. Fixes #17797 (#17798) 2018-10-01 14:17:36 +02:00
CDsigma a5aaab2f22 accounts/abi/bind/backends: fix typo (#17749) 2018-09-28 22:47:46 +02:00
amalraj.manigmail.com 72270b10c7 Merge remote-tracking branch 'remotes/origin/master' into geth-upgrade-1.8.12
# Conflicts:
#	.travis.yml
#	README.md
#	cmd/geth/genesis_test.go
#	core/genesis.go
#	core/genesis_test.go
#	core/state_processor.go
#	eth/config.go
#	eth/downloader/downloader_test.go
#	eth/protocol_test.go
#	params/config.go
2018-09-27 18:55:55 +08:00
gary rong d6254f827b all: protect self-mined block during reorg (#17656) 2018-09-20 15:09:30 +03:00