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
fd6bec92
Commit
fd6bec92
authored
Apr 14, 2018
by
haxxpop
Committed by
David Goulet
Sep 07, 2018
Browse files
test: HS v3 descriptor encoding with client authorization
Signed-off-by:
David Goulet
<
dgoulet@torproject.org
>
parent
fa50aee3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/test_hs_descriptor.c
View file @
fd6bec92
...
...
@@ -291,7 +291,6 @@ static void
test_encode_descriptor
(
void
*
arg
)
{
int
ret
;
char
*
encoded
=
NULL
;
ed25519_keypair_t
signing_kp
;
hs_descriptor_t
*
desc
=
NULL
;
...
...
@@ -300,13 +299,31 @@ test_encode_descriptor(void *arg)
ret
=
ed25519_keypair_generate
(
&
signing_kp
,
0
);
tt_int_op
(
ret
,
OP_EQ
,
0
);
desc
=
hs_helper_build_hs_desc_with_ip
(
&
signing_kp
);
ret
=
hs_desc_encode_descriptor
(
desc
,
&
signing_kp
,
NULL
,
&
encoded
);
tt_int_op
(
ret
,
OP_EQ
,
0
);
tt_assert
(
encoded
);
{
char
*
encoded
=
NULL
;
ret
=
hs_desc_encode_descriptor
(
desc
,
&
signing_kp
,
NULL
,
&
encoded
);
tt_int_op
(
ret
,
OP_EQ
,
0
);
tt_assert
(
encoded
);
tor_free
(
encoded
);
}
{
char
*
encoded
=
NULL
;
uint8_t
descriptor_cookie
[
HS_DESC_DESCRIPTOR_COOKIE_LEN
];
crypto_strongest_rand
(
descriptor_cookie
,
sizeof
(
descriptor_cookie
));
ret
=
hs_desc_encode_descriptor
(
desc
,
&
signing_kp
,
descriptor_cookie
,
&
encoded
);
tt_int_op
(
ret
,
OP_EQ
,
0
);
tt_assert
(
encoded
);
tor_free
(
encoded
);
}
done:
hs_descriptor_free
(
desc
);
tor_free
(
encoded
);
}
static
void
...
...
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