summaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2015-04-10 11:25:08 +0000
committerNick Mathewson <nickm@torproject.org>2015-04-23 09:06:58 -0400
commit196499da73afa5c8000154aafe36c10b9ee43901 (patch)
treefb6343334ed05db14dbe3e8a14a2e18ee1534d08 /src/or/rendclient.c
parentba2485f7df51b2daafaff8567320c34a22731e8e (diff)
downloadtor-196499da73afa5c8000154aafe36c10b9ee43901.tar.gz
tor-196499da73afa5c8000154aafe36c10b9ee43901.zip
Use a custom Base64 encoder with more control over the output format.
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 162e0ac53e..de66b6d66e 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -685,12 +685,13 @@ directory_get_from_hs_dir(const char *desc_id, const rend_data_t *rend_query)
if (rend_query->auth_type != REND_NO_AUTH) {
if (base64_encode(descriptor_cookie_base64,
sizeof(descriptor_cookie_base64),
- rend_query->descriptor_cookie, REND_DESC_COOKIE_LEN)<0) {
+ rend_query->descriptor_cookie, REND_DESC_COOKIE_LEN,
+ 0)<0) {
log_warn(LD_BUG, "Could not base64-encode descriptor cookie.");
return 0;
}
- /* Remove == signs and newline. */
- descriptor_cookie_base64[strlen(descriptor_cookie_base64)-3] = '\0';
+ /* Remove == signs. */
+ descriptor_cookie_base64[strlen(descriptor_cookie_base64)-2] = '\0';
} else {
strlcpy(descriptor_cookie_base64, "(none)",
sizeof(descriptor_cookie_base64));