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

SecretStore: expose restore_key_public in HTTP API #10241

Merged
merged 2 commits into from
Jun 5, 2019

Conversation

svyatonik
Copy link
Collaborator

closes #10240

This is already exposed in on-chain API. Server key' public is returned unencrypted (as in GenerateServerKey call).

Upon receiving request, key version negotiation session starts (this looks like an redundant overhead, when key is available on the node, but it solves some problems internally). The session ends up in version + common part of key data agreement.

The key is returned only if requested by its author. This is controversial, because it differs from the on-chain API (anyone can request public portion of server key). But in on-chain API server key' public is already available to anyone who's watching contract. In HTTP API it is only available to the author.

cc @ngyam

@svyatonik svyatonik added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 24, 2019
@5chdn 5chdn added this to the 2.4 milestone Jan 24, 2019
@5chdn 5chdn modified the milestones: 2.4, 2.5, 2.6 Feb 21, 2019
@soc1c soc1c modified the milestones: 2.5, 2.6 Apr 2, 2019
@dvdplm dvdplm requested a review from grbIzl June 4, 2019 17:31
@dvdplm dvdplm added the A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. label Jun 4, 2019
@dvdplm
Copy link
Collaborator

dvdplm commented Jun 4, 2019

@svyatonik need rebase

@svyatonik svyatonik added A8-looksgood 🦄 Pull request is reviewed well. and removed A7-looksgoodtestsfail 🤖 Pull request is reviewed well, but cannot be merged due to tests failing. labels Jun 5, 2019
Copy link
Collaborator

@grbIzl grbIzl left a comment

Choose a reason for hiding this comment

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

Lgtm

@dvdplm dvdplm merged commit 6be4536 into master Jun 5, 2019
dvdplm added a commit that referenced this pull request Jun 6, 2019
* master:
  SecretStore: non-blocking wait of session completion (#10303)
  removed secret_store folder (#10722)
  SecretStore: expose restore_key_public in HTTP API (#10241)
  Revert "enable lto for release builds (#10717)" (#10721)
@ordian ordian deleted the ss_expose_retrieve_server_public branch June 17, 2019 08:16
dvdplm added a commit that referenced this pull request Jun 17, 2019
* master:
  updater: fix static id hashes initialization (#10755)
  Use fewer threads for snapshotting (#10752)
  Die error_chain, die (#10747)
  Fix deprectation warnings on nightly (#10746)
  fix docker tags for publishing (#10741)
  DevP2p: Get node IP address and udp port from Socket, if not included in PING packet (#10705)
  ethcore: enable ECIP-1054 for classic (#10731)
  Stop breaking out of loop if a non-canonical hash is found (#10729)
  Refactor Clique stepping (#10691)
  Use RUSTFLAGS to set the optimization level (#10719)
  SecretStore: non-blocking wait of session completion (#10303)
  removed secret_store folder (#10722)
  SecretStore: expose restore_key_public in HTTP API (#10241)
  Revert "enable lto for release builds (#10717)" (#10721)
  enable lto for release builds (#10717)
  Merge `Notifier` and `TransactionsPoolNotifier` (#10591)
dvdplm added a commit that referenced this pull request Jun 18, 2019
* master:
  Enable aesni (#10756)
  remove support of old SS db formats (#10757)
  [devp2p] Don't use `rust-crypto` (#10714)
  updater: fix static id hashes initialization (#10755)
  Use fewer threads for snapshotting (#10752)
  Die error_chain, die (#10747)
  Fix deprectation warnings on nightly (#10746)
  fix docker tags for publishing (#10741)
  DevP2p: Get node IP address and udp port from Socket, if not included in PING packet (#10705)
  ethcore: enable ECIP-1054 for classic (#10731)
  Stop breaking out of loop if a non-canonical hash is found (#10729)
  Refactor Clique stepping (#10691)
  Use RUSTFLAGS to set the optimization level (#10719)
  SecretStore: non-blocking wait of session completion (#10303)
  removed secret_store folder (#10722)
  SecretStore: expose restore_key_public in HTTP API (#10241)
  Revert "enable lto for release builds (#10717)" (#10721)
  enable lto for release builds (#10717)
  Merge `Notifier` and `TransactionsPoolNotifier` (#10591)
@vieiralc
Copy link

How can I retrieve the public portion of the server key?

@svyatonik
Copy link
Collaborator Author

@vieiralc Something like that:

curl -X GET http://localhost:8082/server/0000000000000000000000000000000000000000000000000000000000005002/24fb44509d9b7770915568621fe64bd6dd7035c6e15878a795e324489ba79daa43fb2c49da5ed46eeca2357d3acb5ddf61d6afc1c90ca3f2a5791f72ab093cda01

where 0000000000000000000000000000000000000000000000000000000000005002 is the server key id and 24fb44509d9b7770915568621fe64bd6dd7035c6e15878a795e324489ba79daa43fb2c49da5ed46eeca2357d3acb5ddf61d6afc1c90ca3f2a5791f72ab093cda01 is the key author' signature server key id

@niklasad1 niklasad1 added B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. B1-patch-beta 🕷🕷 labels Oct 10, 2019
@soc1c soc1c mentioned this pull request Nov 5, 2019
36 tasks
s3krit pushed a commit that referenced this pull request Nov 11, 2019
* ropsten #6631425 foundation #8798209 (#11201)
* [stable] builtin, istanbul and mordor testnet backports (#11234)
  * ethcore-builtin (#10850)
  * [builtin]: support `multiple prices and activations` in chain spec (#11039)
  * [chain specs]: activate `Istanbul` on mainnet (#11228)
  * ethcore/res: add mordor testnet configuration (#11200)
* Update list of bootnodes for xDai chain (#11236)
* ethcore: remove `test-helper feat` from build (#11047)
* Secret store: fix Instant::now() related race in net_keep_alive (#11155) (#11159)
* [stable]: backport #10691 and #10683 (#11143)
  * Fix compiler warning (that will become an error) (#10683)
  * Refactor Clique stepping (#10691)
* Add Constantinople eips to the dev (instant_seal) config (#10809)
* Add cargo-remote dir to .gitignore (?)
* Insert explicit warning into the panic hook (#11225)
* Fix docker centos build (#11226)
* Update MIX bootnodes. (#11203)
* Use provided usd-per-eth value if an endpoint is specified (#11209)
* Add new line after writing block to hex file. (#10984)
* Type annotation for next_key() matching of json filter options (#11192) (but no `FilterOption` in 2.5 so…)
* Upgrade jsonrpc to latest (#11206)
* [CI] check evmbin build (#11096)
* Correct EIP-712 encoding (#11092)
* [client]: Fix for incorrectly dropped consensus messages (#11086)
* Fix block detail updating (#11015)
* Switching sccache from local to Redis (#10971)
* Made ecrecover implementation trait public (#11188)
* [dependencies]: jsonrpc `14.0.1` (#11183)
* [receipt]: add `sender` & `receiver` to `RichReceipts` (#11179)
* [ethcore/builtin]: do not panic in blake2pricer on short input (#11180)
* util Host: fix a double Read Lock bug in fn Host::session_readable() (#11175)
* ethcore client: fix a double Read Lock bug in fn Client::logs() (#11172)
* Change how RPCs eth_call and eth_estimateGas handle "Pending" (#11127)
* Cleanup stratum a bit (#11161)
* Upgrade to jsonrpc v14 (#11151)
* SecretStore: expose restore_key_public in HTTP API (#10241)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-pleasereview 🤓 Pull request needs code review. A8-looksgood 🦄 Pull request is reviewed well. B0-patch-stable 🕷 Pull request should also be back-ported to the stable branch. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Secret Store] support for retrieving public portion of already generated server key
7 participants