-
Notifications
You must be signed in to change notification settings - Fork 1.7k
SecretStore: secretstore_signRawHash method #7336
Conversation
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.
lgtm
@@ -100,7 +101,29 @@ fn rpc_secretstore_shadow_decrypt() { | |||
} | |||
|
|||
#[test] | |||
fn rpc_secretstore_sign_servers_set() { | |||
fn rpc_secretstore_servers_set_hash() { | |||
let deps = Dependencies::new(); |
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.
You can consider using new jsonrpc_test
:
https://github.com/paritytech/jsonrpc/blob/master/test/src/lib.rs#L28
@@ -627,6 +626,7 @@ impl ApiSet { | |||
public_list.insert(Api::ParityAccounts); | |||
public_list.insert(Api::ParitySet); | |||
public_list.insert(Api::Signer); | |||
public_list.insert(Api::SecretStore); |
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.
just a question. Above you've added a comment SecretStore (UNSAFE: arbitrary hash signing)
, but here SecretStore
is added to a SafeContext
. Isn't it contradictory?
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 was also confused a bit :) If I understood correctly, there are:
- safe/unsafe APIs
- safe/unsafe API Contexts
So: SecretStore API is unsafe => it is only enabled when API context is safe. Here's couple of proofs I've found:
- https://github.com/paritytech/parity/blob/master/parity/rpc_apis.rs#L148 (reveres proof)
- ParityAccounts API, which is also unsafe, is included to the
SafeContext
API set
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.
Yes, indeed that the reasoning, although It's extremely confusing (sorry about that:() Feel free to rename it.
closes #7248
Overview:
secretstore_signRawHash
methodsecretstore_signServersSet
(semantics is changed also)secretstore
API set as unsafe, because it now allows to sign any passed raw hash (without prepending with the prefix && without applying hash function)secretstore_signRawHash
can now be used to sign the server key id, which was initially intended to be akeccak256(document_contents)
. It also should be used to sign the servers set hash after calling thesecretstore_serversSetHash
method.