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
83c8419e
Commit
83c8419e
authored
May 22, 2018
by
haxxpop
Committed by
David Goulet
Sep 07, 2018
Browse files
hs-v3: Rename client_pk to client_auth_pk
Signed-off-by:
David Goulet
<
dgoulet@torproject.org
>
parent
9f975e99
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/feature/hs/hs_descriptor.c
View file @
83c8419e
...
...
@@ -2851,7 +2851,7 @@ hs_desc_build_fake_authorized_client(hs_desc_authorized_client_t *client_out)
* cookie, build the auth client so we can then encode the descriptor for
* publication. client_out must be already allocated. */
void
hs_desc_build_authorized_client
(
const
curve25519_public_key_t
*
client_pk
,
hs_desc_build_authorized_client
(
const
curve25519_public_key_t
*
client_
auth_
pk
,
const
curve25519_secret_key_t
*
auth_ephemeral_sk
,
const
uint8_t
*
descriptor_cookie
,
...
...
@@ -2863,20 +2863,21 @@ hs_desc_build_authorized_client(const curve25519_public_key_t *client_pk,
crypto_cipher_t
*
cipher
;
crypto_xof_t
*
xof
;
tor_assert
(
client_pk
);
tor_assert
(
client_
auth_
pk
);
tor_assert
(
auth_ephemeral_sk
);
tor_assert
(
descriptor_cookie
);
tor_assert
(
client_out
);
tor_assert
(
!
tor_mem_is_zero
((
char
*
)
auth_ephemeral_sk
,
sizeof
(
*
auth_ephemeral_sk
)));
tor_assert
(
!
tor_mem_is_zero
((
char
*
)
client_pk
,
sizeof
(
*
client_pk
)));
tor_assert
(
!
tor_mem_is_zero
((
char
*
)
client_auth_pk
,
sizeof
(
*
client_auth_pk
)));
tor_assert
(
!
tor_mem_is_zero
((
char
*
)
descriptor_cookie
,
HS_DESC_DESCRIPTOR_COOKIE_LEN
));
/* Calculate x25519(hs_y, client_X) */
curve25519_handshake
(
secret_seed
,
auth_ephemeral_sk
,
client_pk
);
client_
auth_
pk
);
/* Calculate KEYS = KDF(SECRET_SEED, 40) */
xof
=
crypto_xof_new
();
...
...
src/feature/hs/hs_descriptor.h
View file @
83c8419e
...
...
@@ -304,7 +304,8 @@ link_specifier_t *hs_desc_lspec_to_trunnel(
void
hs_desc_build_fake_authorized_client
(
hs_desc_authorized_client_t
*
client_out
);
void
hs_desc_build_authorized_client
(
const
curve25519_public_key_t
*
client_pk
,
void
hs_desc_build_authorized_client
(
const
curve25519_public_key_t
*
client_auth_pk
,
const
curve25519_secret_key_t
*
auth_ephemeral_sk
,
const
uint8_t
*
descriptor_cookie
,
...
...
src/test/test_hs_descriptor.c
View file @
83c8419e
...
...
@@ -868,7 +868,7 @@ test_build_authorized_client(void *arg)
uint8_t
descriptor_cookie
[
HS_DESC_DESCRIPTOR_COOKIE_LEN
];
curve25519_secret_key_t
auth_ephemeral_sk
;
curve25519_secret_key_t
client_auth_sk
;
curve25519_public_key_t
client_pk
;
curve25519_public_key_t
client_
auth_
pk
;
const
char
ephemeral_sk_b16
[]
=
"d023b674d993a5c8446bd2ca97e9961149b3c0e88c7dc14e8777744dd3468d6a"
;
const
char
descriptor_cookie_b16
[]
=
...
...
@@ -884,7 +884,7 @@ test_build_authorized_client(void *arg)
ret
=
curve25519_secret_key_generate
(
&
client_auth_sk
,
0
);
tt_int_op
(
ret
,
OP_EQ
,
0
);
curve25519_public_key_generate
(
&
client_pk
,
&
client_auth_sk
);
curve25519_public_key_generate
(
&
client_
auth_
pk
,
&
client_auth_sk
);
desc_client
=
tor_malloc_zero
(
sizeof
(
hs_desc_authorized_client_t
));
...
...
@@ -898,15 +898,15 @@ test_build_authorized_client(void *arg)
descriptor_cookie_b16
,
strlen
(
descriptor_cookie_b16
));
base16_decode
((
char
*
)
&
client_pk
,
sizeof
(
client_pk
),
base16_decode
((
char
*
)
&
client_
auth_
pk
,
sizeof
(
client_
auth_
pk
),
client_pubkey_b16
,
strlen
(
client_pubkey_b16
));
MOCK
(
crypto_strongest_rand
,
mock_crypto_strongest_rand
);
hs_desc_build_authorized_client
(
&
client_pk
,
&
auth_ephemeral_sk
,
descriptor_cookie
,
desc_client
);
hs_desc_build_authorized_client
(
&
client_
auth_
pk
,
&
auth_ephemeral_sk
,
descriptor_cookie
,
desc_client
);
test_memeq_hex
((
char
*
)
desc_client
->
client_id
,
"b514ef67192cad5f"
);
...
...
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