Skip to content

Bug 1612: Add optional HsIdKeypair to OnionServiceConfig

morgan requested to merge morgan/arti:bug_1612 into main

Resovles #1612 (closed)

Allows programmatically constructing OnionServices with an externally generated/stored HsIdKeypair. Adds an id_keypair member to the OnionServiceConfig type, but directs serde to ignore (I presume this will prevent users from setting this member from a .toml config file; not sure if that is desired but it's the patch's intention).

This patch requires a pair of additional features:

  • implementation of Clone, PartialEq, and Eq for HsIdKeypair (required to be stored on an OnionServiceConfig)
  • addition of an overwrite flag to KeyMgr::insert() with identical semantisc to KeyMgr::generate()'s overwrite flag; the intention of this flag is to simplify+encapsulate the logic which I think makes sense in the OnionServiceBuilder::build() method, namely that it should be considered an error to try to change an existing onion-service's ed25519 key (and therefore service-id)
Edited by morgan

Merge request reports