summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-05-12 13:30:07 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-07-01 14:01:41 -0400
commitd43646e191dec6f800f63acb6a6861190b77d86f (patch)
tree60d1e2797fff1d890c488c6ecabb302232144f2a /src/or
parentcd858d78a7d04fa64b9af3d602c435154acd284f (diff)
downloadtor-d43646e191dec6f800f63acb6a6861190b77d86f.tar.gz
tor-d43646e191dec6f800f63acb6a6861190b77d86f.zip
prop250: Fix unit tests about the RSA fingerprint check
Code has been changed so every RSA fingerprint for a commit in our state is validated before being used. This fixes the unit tests by mocking one of the key function and updating the hardcoded state string. Also, fix a time parsing overflow on platforms with 32bit time_t Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerlist.c4
-rw-r--r--src/or/routerlist.h3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index bdb3d490c7..4d55b2e44f 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1494,8 +1494,8 @@ router_digest_is_fallback_dir(const char *digest)
* v3 identity key hashes to <b>digest</b>, or NULL if no such authority
* is known.
*/
-dir_server_t *
-trusteddirserver_get_by_v3_auth_digest(const char *digest)
+MOCK_IMPL(dir_server_t *,
+trusteddirserver_get_by_v3_auth_digest, (const char *digest))
{
if (!trusted_dir_servers)
return NULL;
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index be242d6e87..17adade5d3 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -52,7 +52,8 @@ dir_server_t *router_get_trusteddirserver_by_digest(const char *d);
dir_server_t *router_get_fallback_dirserver_by_digest(
const char *digest);
int router_digest_is_fallback_dir(const char *digest);
-dir_server_t *trusteddirserver_get_by_v3_auth_digest(const char *d);
+MOCK_DECL(dir_server_t *, trusteddirserver_get_by_v3_auth_digest,
+ (const char *d));
const routerstatus_t *router_pick_trusteddirserver(dirinfo_type_t type,
int flags);
const routerstatus_t *router_pick_fallback_dirserver(dirinfo_type_t type,