diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-23 08:26:44 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-23 08:26:44 -0400 |
commit | b3112a6d26d4f142e3007994ce8da6d7517287bb (patch) | |
tree | fd555d9408056d22ce467e22a08ffc83a9b555c7 /src/feature/relay/router.c | |
parent | 9cd20e82763af43424085cf651dd4b08e69967e1 (diff) | |
parent | 8763d96d20f33ca7367effb77fb5d7ab30c39766 (diff) | |
download | tor-b3112a6d26d4f142e3007994ce8da6d7517287bb.tar.gz tor-b3112a6d26d4f142e3007994ce8da6d7517287bb.zip |
Merge branch 'remove-padding-fix-7869-v2'
Diffstat (limited to 'src/feature/relay/router.c')
-rw-r--r-- | src/feature/relay/router.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index 4a0a4203aa..206545bdec 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -2936,11 +2936,9 @@ router_dump_router_to_string(routerinfo_t *router, } if (router->onion_curve25519_pkey) { - char kbuf[128]; - base64_encode(kbuf, sizeof(kbuf), - (const char *)router->onion_curve25519_pkey->public_key, - CURVE25519_PUBKEY_LEN, BASE64_ENCODE_MULTILINE); - smartlist_add_asprintf(chunks, "ntor-onion-key %s", kbuf); + char kbuf[CURVE25519_BASE64_PADDED_LEN + 1]; + curve25519_public_to_base64(kbuf, router->onion_curve25519_pkey, false); + smartlist_add_asprintf(chunks, "ntor-onion-key %s\n", kbuf); } else { /* Authorities will start rejecting relays without ntor keys in 0.2.9 */ log_err(LD_BUG, "A relay must have an ntor onion key"); |