diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-04-13 14:14:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-04-13 14:14:41 -0400 |
commit | e22a8d9c956f838138a7e5bc0714b1bb99f0e2a5 (patch) | |
tree | 158c80ae7e12fbb09e8bbff3f0ae5eb4a7691a46 /src/feature/control | |
parent | 80031db32abebaf4d0a91c01db258fcdbd54a471 (diff) | |
parent | 55cb6c3fcdbeac31a88bcc62c0dbe5ded4605176 (diff) | |
download | tor-e22a8d9c956f838138a7e5bc0714b1bb99f0e2a5.tar.gz tor-e22a8d9c956f838138a7e5bc0714b1bb99f0e2a5.zip |
Merge branch 'maint-0.4.3'
Diffstat (limited to 'src/feature/control')
-rw-r--r-- | src/feature/control/control_hs.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/feature/control/control_hs.c b/src/feature/control/control_hs.c index d3cd363f63..f5b331de9a 100644 --- a/src/feature/control/control_hs.c +++ b/src/feature/control/control_hs.c @@ -50,11 +50,18 @@ parse_private_key_from_control_port(const char *client_privkey_str, if (base64_decode((char*)privkey->secret_key, sizeof(privkey->secret_key), key_blob, - strlen(key_blob)) != sizeof(privkey->secret_key)) { + strlen(key_blob)) != sizeof(privkey->secret_key)) { control_printf_endreply(conn, 512, "Failed to decode x25519 private key"); goto err; } + if (fast_mem_is_zero((const char*)privkey->secret_key, + sizeof(privkey->secret_key))) { + control_printf_endreply(conn, 553, + "Invalid private key \"%s\"", key_blob); + goto err; + } + retval = 0; err: |