Bug 1612: Add optional HsIdKeypair to OnionServiceConfig
Compare changes
Files
8+ 14
− 0
@@ -371,6 +371,20 @@ impl HsIdKeypair {
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:
Clone
, PartialEq
, and Eq
for HsIdKeypair
(required to be stored on an OnionServiceConfig
)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)