diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-13 20:22:34 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-30 08:37:22 -0500 |
commit | e2aeaeb76c2fd04a8b5934b7682823d77dc6f064 (patch) | |
tree | 3317493ff9a96506017bf4122cf2aaf55f57b120 /src/common/crypto.c | |
parent | 60769e710f1099168f7508fe6834e458ce435ad9 (diff) | |
download | tor-e2aeaeb76c2fd04a8b5934b7682823d77dc6f064.tar.gz tor-e2aeaeb76c2fd04a8b5934b7682823d77dc6f064.zip |
Make a bunch of signature/digest-checking functions mockable
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 062179deda..7cb3330bde 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1107,10 +1107,10 @@ crypto_pk_private_decrypt(crypto_pk_t *env, char *to, * <b>tolen</b> is the number of writable bytes in <b>to</b>, and must be * at least the length of the modulus of <b>env</b>. */ -int -crypto_pk_public_checksig(const crypto_pk_t *env, char *to, - size_t tolen, - const char *from, size_t fromlen) +MOCK_IMPL(int, +crypto_pk_public_checksig,(const crypto_pk_t *env, char *to, + size_t tolen, + const char *from, size_t fromlen)) { int r; tor_assert(env); @@ -1134,9 +1134,10 @@ crypto_pk_public_checksig(const crypto_pk_t *env, char *to, * in <b>env</b>. Return 0 if <b>sig</b> is a correct signature for * SHA1(data). Else return -1. */ -int -crypto_pk_public_checksig_digest(crypto_pk_t *env, const char *data, - size_t datalen, const char *sig, size_t siglen) +MOCK_IMPL(int, +crypto_pk_public_checksig_digest,(crypto_pk_t *env, const char *data, + size_t datalen, const char *sig, + size_t siglen)) { char digest[DIGEST_LEN]; char *buf; |