-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
1 & 2. so the attack case you're suggesting is Alice opens up her vault V, Bob gains access to the signer RPCs, creates a new vault W with a randomised password and moves all of Alice's keys from V into W? this is a much greater argument for (2) than (1), however since (2) is ultimately reducible to multiple (1)s, it makes little sense to require the password for (2) and not (1).
|
@gavofyork
Currently both secret and meta for vault accounts are encrypted with the same password (which is also vault password && it is the same for all accounts from this vault) => if Bob will change password for Alice' vault or move accounts from Alice' vault to Bob's vault, it will get "full access" to both the secret and meta. Maybe I'm wrong && missing something? Could you please explain?
|
OK - looks like I have an issue here:
Meta must be encrypted with vault password && every account still will have its own password (to encrypt secret). Then everything seems logical. I'll update PR |
Changes outline:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grubmles about RPC namespace.
rpc/src/v1/traits/parity.rs
Outdated
|
||
/// Create new vault. | ||
#[rpc(name = "parity_newVault")] | ||
fn create_vault(&self, String, String) -> Result<bool, Error>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those methods should be part of parity_accounts
namespace (so that they are not expoed to dapps by default)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks for clarification
ethstore/src/ethstore.rs
Outdated
fn account_ref(&self, address: &Address) -> Result<StoreAccountRef, Error> { | ||
self.reload_accounts()?; | ||
self.cache.read().keys() | ||
.filter(|r| &r.address == address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find()
instead of filter.nth(0)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
we probably want an rpc to list vaults; either by logging vaults or deriving from the directory structure. can be a different PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good in general but i'd like to see more comprehensive test coverage to ensure all operations behave correctly with respect to all others.
let request = r#"{"jsonrpc": "2.0", "method": "parity_changeVaultPassword", "params":["vault1", "password2"], "id": 1}"#; | ||
let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; | ||
|
||
assert_eq!(tester.io.handle_request_sync(request), Some(response.to_owned())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should test that you can open with new password
let request = format!(r#"{{"jsonrpc": "2.0", "method": "parity_changeVault", "params":["0x{}", "vault1"], "id": 1}}"#, address.hex()); | ||
let response = r#"{"jsonrpc":"2.0","result":true,"id":1}"#; | ||
|
||
assert_eq!(tester.io.handle_request_sync(&request), Some(response.to_owned())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should test that it no longer appears when old vault open and does appear when new vault open.
|
|
ok - missed those additional tests. should be good. |
This is second part of work on vaults (https://github.com/ethcore/parity/issues/3501).
Outline: new RPCs are introduced + meta for 'vault accounts' is populated with
vault
field.I have changed some RPCs + have couple of concerns:
parity_changeVaultPassword(name, new)
changed toparity_changeVaultPassword(name, old, new)
. To me it is strange that, for example, copying account, signing message, etc. require account password && this action does not. So anyone with access to RPC could create vault && move all available accounts there, even if he had no access to these accounts => get full access to the account. Please insist, if you think that's ok - I'll change back to proposed prototype.parity_changeVault(address, newVault)
changed toparity_changeVault(address, newVault, oldPassword, newPassword)
because of same reasons as above. Again - this is just my proposal && it can be reverted to original prototype.parity_getAddressMeta
RPC method. I haven't found one on master - so most probably it is in development, or will be created in future. So I'm addingvault
field to account'meta
field at the lowest level possible (inVaultDiskDirectory
)cp vault1 vault2
. Inparity_changeVault
there's no argument, which is responsible for 'origin vault' => currently I've selected approach similar to the one, selected inEthMultiStore
- choose the first matching account (matching here means that address && password are the same). Maybe there should be another way to deal with this? Another argument forparity_changeVault
or move all matching accounts? Please ping me, if you think I've selected wrong way.