mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Fix up vote tests in test_dir_handle_get.
These tests used a hardcoded vote with a hardcoded digest. That vote didn't have any pr lines, and so it is now invalid. I've adjusted the testing code so that it mocks the signature-checking, so that we can more easily change the contents of the vote.
This commit is contained in:
@@ -139,13 +139,13 @@ signed_digest_equals, (const uint8_t *d1, const uint8_t *d2, size_t len))
|
||||
* the document when generating log messages. Return 0 on success, negative
|
||||
* on failure.
|
||||
*/
|
||||
int
|
||||
check_signature_token(const char *digest,
|
||||
MOCK_IMPL(int,
|
||||
check_signature_token,(const char *digest,
|
||||
ssize_t digest_len,
|
||||
directory_token_t *tok,
|
||||
crypto_pk_t *pkey,
|
||||
int flags,
|
||||
const char *doctype)
|
||||
const char *doctype))
|
||||
{
|
||||
char *signed_digest;
|
||||
size_t keysize;
|
||||
|
||||
@@ -20,12 +20,12 @@ int router_get_hash_impl(const char *s, size_t s_len, char *digest,
|
||||
|
||||
#define CST_NO_CHECK_OBJTYPE (1<<0)
|
||||
struct directory_token_t;
|
||||
int check_signature_token(const char *digest,
|
||||
ssize_t digest_len,
|
||||
struct directory_token_t *tok,
|
||||
crypto_pk_t *pkey,
|
||||
int flags,
|
||||
const char *doctype);
|
||||
MOCK_DECL(int, check_signature_token,(const char *digest,
|
||||
ssize_t digest_len,
|
||||
struct directory_token_t *tok,
|
||||
crypto_pk_t *pkey,
|
||||
int flags,
|
||||
const char *doctype));
|
||||
|
||||
int router_get_hash_impl_helper(const char *s, size_t s_len,
|
||||
const char *start_str,
|
||||
|
||||
Reference in New Issue
Block a user