diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-08-03 16:00:18 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-08 20:29:34 -0400 |
commit | f106af3c41dffdc8576c52399a61d34116b78f38 (patch) | |
tree | 42e5dbbf88c551ce0462111f15da3248ca6da726 /src/or/hs_descriptor.c | |
parent | d88984a137b9f06fd72f57636b6ec321044c8908 (diff) | |
download | tor-f106af3c41dffdc8576c52399a61d34116b78f38.tar.gz tor-f106af3c41dffdc8576c52399a61d34116b78f38.zip |
Make ed25519 id keys optional for IPs and RPs.
Diffstat (limited to 'src/or/hs_descriptor.c')
-rw-r--r-- | src/or/hs_descriptor.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c index 700d1b0cfc..430e2f6f99 100644 --- a/src/or/hs_descriptor.c +++ b/src/or/hs_descriptor.c @@ -2471,9 +2471,17 @@ hs_desc_link_specifier_new(const extend_info_t *info, uint8_t type) ls->u.ap.port = info->port; break; case LS_LEGACY_ID: + /* Bug out if the identity digest is not set */ + if (BUG(tor_mem_is_zero(info->identity_digest, + sizeof(info->identity_digest)))) { + goto err; + } memcpy(ls->u.legacy_id, info->identity_digest, sizeof(ls->u.legacy_id)); break; case LS_ED25519_ID: + if (ed25519_public_key_is_zero(&info->ed_identity)) { + goto err; + } memcpy(ls->u.ed25519_id, info->ed_identity.pubkey, sizeof(ls->u.ed25519_id)); break; |