aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuphanat Chunhapanya <haxx.pop@gmail.com>2017-08-13 16:15:40 +0700
committerSuphanat Chunhapanya <haxx.pop@gmail.com>2017-08-13 16:15:40 +0700
commitc860282fc0ca068b1e5c210130979823ee799636 (patch)
treea26e2e953d7637c7717c51c420f818981d4012f1
parentdc47d936d47ffc25dc0b5e59009435cda542d240 (diff)
downloadtor-c860282fc0ca068b1e5c210130979823ee799636.tar.gz
tor-c860282fc0ca068b1e5c210130979823ee799636.zip
Mock rsa_ed25519_crosscert_check
This commit just mocks the rsa_ed25519_crosscert_check to be used later in the fuzzer.
-rw-r--r--src/or/torcert.c12
-rw-r--r--src/or/torcert.h11
2 files changed, 12 insertions, 11 deletions
diff --git a/src/or/torcert.c b/src/or/torcert.c
index 658e620ca5..9ded3d585d 100644
--- a/src/or/torcert.c
+++ b/src/or/torcert.c
@@ -356,12 +356,12 @@ tor_make_rsa_ed25519_crosscert(const ed25519_public_key_t *ed_key,
*
* Return 0 on success, negative on failure.
*/
-int
-rsa_ed25519_crosscert_check(const uint8_t *crosscert,
- const size_t crosscert_len,
- const crypto_pk_t *rsa_id_key,
- const ed25519_public_key_t *master_key,
- const time_t reject_if_expired_before)
+MOCK_IMPL(int,
+rsa_ed25519_crosscert_check, (const uint8_t *crosscert,
+ const size_t crosscert_len,
+ const crypto_pk_t *rsa_id_key,
+ const ed25519_public_key_t *master_key,
+ const time_t reject_if_expired_before))
{
rsa_ed_crosscert_t *cc = NULL;
int rv;
diff --git a/src/or/torcert.h b/src/or/torcert.h
index 51f7665f1e..416ff7aa23 100644
--- a/src/or/torcert.h
+++ b/src/or/torcert.h
@@ -75,11 +75,12 @@ ssize_t tor_make_rsa_ed25519_crosscert(const ed25519_public_key_t *ed_key,
const crypto_pk_t *rsa_key,
time_t expires,
uint8_t **cert);
-int rsa_ed25519_crosscert_check(const uint8_t *crosscert,
- const size_t crosscert_len,
- const crypto_pk_t *rsa_id_key,
- const ed25519_public_key_t *master_key,
- const time_t reject_if_expired_before);
+MOCK_DECL(int,
+rsa_ed25519_crosscert_check, (const uint8_t *crosscert,
+ const size_t crosscert_len,
+ const crypto_pk_t *rsa_id_key,
+ const ed25519_public_key_t *master_key,
+ const time_t reject_if_expired_before));
or_handshake_certs_t *or_handshake_certs_new(void);
void or_handshake_certs_free(or_handshake_certs_t *certs);