Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Core
Tor
Commits
3695ef63
Commit
3695ef63
authored
Sep 07, 2018
by
George Kadianakis
Committed by
David Goulet
Sep 07, 2018
Browse files
HSv3: Don't assert when reading bad client-side privkeys.
parent
6583d1e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/feature/hs/hs_client.c
View file @
3695ef63
...
...
@@ -1500,6 +1500,12 @@ parse_auth_file_content(const char *client_key_str)
goto
err
;
}
if
(
strlen
(
seckey_b32
)
!=
BASE32_NOPAD_LEN
(
CURVE25519_PUBKEY_LEN
))
{
log_warn
(
LD_REND
,
"Client authorization encoded base32 private key "
"length is invalid: %s"
,
seckey_b32
);
goto
err
;
}
auth
=
tor_malloc_zero
(
sizeof
(
hs_client_service_authorization_t
));
if
(
base32_decode
((
char
*
)
auth
->
enc_seckey
.
secret_key
,
sizeof
(
auth
->
enc_seckey
.
secret_key
),
...
...
src/test/test_hs_client.c
View file @
3695ef63
...
...
@@ -660,7 +660,9 @@ test_parse_auth_file_content(void *arg)
"x:zdsyvn2jq534ugyiuzgjy4267jbtzcjbsgedhshzx5mforyxtryq"
));
/* Some malformed string. */
tt_assert
(
!
parse_auth_file_content
(
"xx:descriptor:x25519:aa=="
));
/* Bigger key than it should be */
tt_assert
(
!
parse_auth_file_content
(
"xx:descriptor:x25519:"
"vjqea4jbhwwc4hto7ekyvqfbeodghbaq6nxi45hz4wr3qvhqv3yqa"
));
done:
tor_free
(
auth
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment