aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-26 12:03:16 -0400
committerNick Mathewson <nickm@torproject.org>2017-10-03 10:56:46 -0400
commit30d2e0b71e9c42ff93af5239f54268bb24ce1744 (patch)
tree161613bdd1bd6aa9399a45275c5b6f675a813de1 /src/or
parentc232b6b59cc136f7053922b3efc14afd5c34b6ec (diff)
downloadtor-30d2e0b71e9c42ff93af5239f54268bb24ce1744.tar.gz
tor-30d2e0b71e9c42ff93af5239f54268bb24ce1744.zip
test: Add an HS v3 descriptor fetch unit test
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or')
-rw-r--r--src/or/hs_client.c4
-rw-r--r--src/or/hs_client.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/or/hs_client.c b/src/or/hs_client.c
index 6f81ea09ed..93a913b34c 100644
--- a/src/or/hs_client.c
+++ b/src/or/hs_client.c
@@ -351,8 +351,8 @@ pick_hsdir_v3(const ed25519_public_key_t *onion_identity_pk)
*
* On success, HS_CLIENT_FETCH_LAUNCHED is returned. Otherwise, an error from
* hs_client_fetch_status_t is returned. */
-static hs_client_fetch_status_t
-fetch_v3_desc(const ed25519_public_key_t *onion_identity_pk)
+MOCK_IMPL(STATIC hs_client_fetch_status_t,
+fetch_v3_desc, (const ed25519_public_key_t *onion_identity_pk))
{
routerstatus_t *hsdir_rs =NULL;
diff --git a/src/or/hs_client.h b/src/or/hs_client.h
index 1d0201903b..164accc0e6 100644
--- a/src/or/hs_client.h
+++ b/src/or/hs_client.h
@@ -82,6 +82,9 @@ desc_intro_point_to_extend_info(const hs_desc_intro_point_t *ip);
STATIC int handle_rendezvous2(origin_circuit_t *circ, const uint8_t *payload,
size_t payload_len);
+MOCK_DECL(STATIC hs_client_fetch_status_t,
+ fetch_v3_desc, (const ed25519_public_key_t *onion_identity_pk));
+
#endif /* defined(HS_CLIENT_PRIVATE) */
#endif /* !defined(TOR_HS_CLIENT_H) */