Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

secret store separated from util #1304

Merged
merged 30 commits into from
Jun 19, 2016
Merged

secret store separated from util #1304

merged 30 commits into from
Jun 19, 2016

Conversation

debris
Copy link
Collaborator

@debris debris commented Jun 16, 2016

In this PR is separated secret store from util. It's now a part of standalone library ethstore. The library itself is much more modular than it used to be.

Few key features:

  • independent CLI for managing secrets
  • secrets never leave secret store (removed function account_secret).
  • removed time unlocking

What further improvements this pr enables:

  • possible connection to secret store via ipc
  • new encryptions / file formats could be easily added

todo:
This pr allows us to remove much more than 2k lines of code. I will do this in next prs.

@debris debris added the A0-pleasereview 🤓 Pull request needs code review. label Jun 16, 2016

let from = GethDirectory::create(dir_type).unwrap();
let to = DiskDirectory::create(self.keys_path()).unwrap();
import_accounts(&from, &to).expect("TODO: error here");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty easy TODO

@NikVolf NikVolf added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 16, 2016
Some(res)

let sender = request.from;
if let Err(_) = accounts.unlock_account_temporarily(sender, pass) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't attacker who is spamming send transaction request take advantage of this temporal unlock?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlikely, temp unlock unlocks account only for 1 signing.

But, because this code may appear suspicious, I will alter it to sign the transaction directly, without unlocking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this one could be attacker's one? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep :)

@debris debris added A0-pleasereview 🤓 Pull request needs code review. and removed A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Jun 18, 2016
@debris
Copy link
Collaborator Author

debris commented Jun 18, 2016

Fixed most of the issues. For remaining one mentioned by Nikolay, created a separate issue.

@arkpar
Copy link
Collaborator

arkpar commented Jun 18, 2016

As discussed in slack, key store should be kept in parity repo

@gavofyork gavofyork added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 18, 2016
@debris
Copy link
Collaborator Author

debris commented Jun 18, 2016

update the pr. ethstore is now a part of parity repo.
should ethkey be also included here?

@debris debris added A0-pleasereview 🤓 Pull request needs code review. and removed A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Jun 19, 2016
@gavofyork
Copy link
Contributor

(yes, but i think you already did it)

@NikVolf NikVolf added A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jun 19, 2016
@gavofyork gavofyork added A0-pleasereview 🤓 Pull request needs code review. A8-looksgood 🦄 Pull request is reviewed well. and removed A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. A0-pleasereview 🤓 Pull request needs code review. labels Jun 19, 2016
@gavofyork gavofyork merged commit 6b074e8 into master Jun 19, 2016
@gavofyork gavofyork deleted the new_sstore branch June 19, 2016 22:10
arkpar pushed a commit that referenced this pull request Jun 20, 2016
* bump rust-crypto

* initial version of account provider utilizing secret store

* update lazy_static to latest version

* AccountProvider accounts method

* new AccountProvider tests in progress

* basic tests for new AccountProvider

* ethcore compiles with new account provider and secret store

* ethcore-rpc build now compiling with new AccountProvider

* most rpc tests passing with new accounts_provider

* fixed basic_authority tests

* fixed eth_transaction_count rpc test

* fixed mocked/eth.rs tests

* fixed personal tests

* fixed personal signer rpc tests

* removed warnings

* parity compiling fine with new sstore

* fixed import direction

* do not unlock temporarily when we have the password

* removed TODO in account import

* display warning on auto account import failure

* fixed compiling of ethstore on windows

* ethstore as a part of parity repo

* added ethkey
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants