summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-06-01 11:24:55 -0400
committerNick Mathewson <nickm@torproject.org>2015-06-01 11:24:55 -0400
commit3d653dff5e891c1e547ef7eacbc991410a98c1cb (patch)
treeb8169c115b1092c92ae871b1d6d08d9060a13454 /src/or/router.c
parent3028507e96a51f2058e7ce6678ac8f2d8ab1b502 (diff)
downloadtor-3d653dff5e891c1e547ef7eacbc991410a98c1cb.tar.gz
tor-3d653dff5e891c1e547ef7eacbc991410a98c1cb.zip
Add a master-key-ed25519 line for convenience
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 6868e7b996..0903eb2082 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2406,6 +2406,7 @@ router_dump_router_to_string(routerinfo_t *router,
if (emit_ed_sigs) {
/* Encode ed25519 signing cert */
char ed_cert_base64[256];
+ char ed_fp_base64[ED25519_BASE64_LEN+1];
if (base64_encode(ed_cert_base64, sizeof(ed_cert_base64),
(const char*)router->signing_key_cert->encoded,
router->signing_key_cert->encoded_len,
@@ -2413,10 +2414,17 @@ router_dump_router_to_string(routerinfo_t *router,
log_err(LD_BUG,"Couldn't base64-encode signing key certificate!");
goto err;
}
+ if (ed25519_public_to_base64(ed_fp_base64,
+ &router->signing_key_cert->signing_key)<0) {
+ log_err(LD_BUG,"Couldn't base64-encode identity key\n");
+ goto err;
+ }
tor_asprintf(&ed_cert_line, "identity-ed25519\n"
"-----BEGIN ED25519 CERT-----\n"
"%s"
- "-----END ED25519 CERT-----\n", ed_cert_base64);
+ "-----END ED25519 CERT-----\n"
+ "master-key-ed25519 %s\n",
+ ed_cert_base64, ed_fp_base64);
}
/* PEM-encode the onion key */