aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/trove_2020_0034
-rw-r--r--src/feature/hs/hs_service.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/changes/trove_2020_003 b/changes/trove_2020_003
new file mode 100644
index 0000000000..aa1a8f1c78
--- /dev/null
+++ b/changes/trove_2020_003
@@ -0,0 +1,4 @@
+ o Minor bugfixes (onion services v3):
+ - Fix assertion failure that could result from a corrupted ADD_ONION control
+ port command. Found by Saibato. Fixes bug 33137; bugfix on
+ 0.3.3.1-alpha. This issue is also being tracked as TROVE-2020-003.
diff --git a/src/feature/hs/hs_service.c b/src/feature/hs/hs_service.c
index 7e150599fc..6d32cae86c 100644
--- a/src/feature/hs/hs_service.c
+++ b/src/feature/hs/hs_service.c
@@ -3578,6 +3578,12 @@ hs_service_add_ephemeral(ed25519_secret_key_t *sk, smartlist_t *ports,
goto err;
}
+ if (ed25519_validate_pubkey(&service->keys.identity_pk) < 0) {
+ log_warn(LD_CONFIG, "Bad ed25519 private key was provided");
+ ret = RSAE_BADPRIVKEY;
+ goto err;
+ }
+
/* Make sure we have at least one port. */
if (smartlist_len(service->config.ports) == 0) {
log_warn(LD_CONFIG, "At least one VIRTPORT/TARGET must be specified "