diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-01-30 08:40:46 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-01-30 08:40:46 -0500 |
commit | 558c04f5b119b62f5a6ef00739468b31f65fcc19 (patch) | |
tree | 6e9b638f24d252a5bf2c5a8b779bc3707196e78a /src/common/crypto_ed25519.c | |
parent | 67eb6470d711b36d1b855e6423ce7bbb302af834 (diff) | |
parent | d71fc474385281453eaa93522479d32af85c94ef (diff) | |
download | tor-558c04f5b119b62f5a6ef00739468b31f65fcc19.tar.gz tor-558c04f5b119b62f5a6ef00739468b31f65fcc19.zip |
Merge branch 'combined-fuzzing-v4'
Diffstat (limited to 'src/common/crypto_ed25519.c')
-rw-r--r-- | src/common/crypto_ed25519.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c index 8977e7a325..525d25a3e0 100644 --- a/src/common/crypto_ed25519.c +++ b/src/common/crypto_ed25519.c @@ -15,6 +15,7 @@ * keys to and from the corresponding Curve25519 keys. */ +#define CRYPTO_ED25519_PRIVATE #include "orconfig.h" #ifdef HAVE_SYS_STAT_H #include <sys/stat.h> @@ -34,7 +35,6 @@ #include <openssl/sha.h> static void pick_ed25519_impl(void); -static int ed25519_impl_spot_check(void); /** An Ed25519 implementation, as a set of function pointers. */ typedef struct { @@ -308,10 +308,10 @@ ed25519_sign_prefixed,(ed25519_signature_t *signature_out, * * Return 0 if the signature is valid; -1 if it isn't. */ -int -ed25519_checksig(const ed25519_signature_t *signature, - const uint8_t *msg, size_t len, - const ed25519_public_key_t *pubkey) +MOCK_IMPL(int, +ed25519_checksig,(const ed25519_signature_t *signature, + const uint8_t *msg, size_t len, + const ed25519_public_key_t *pubkey)) { return get_ed_impl()->open(signature->sig, msg, len, pubkey->pubkey) < 0 ? -1 : 0; @@ -354,10 +354,10 @@ ed25519_checksig_prefixed(const ed25519_signature_t *signature, * was valid. Otherwise return -N, where N is the number of invalid * signatures. */ -int -ed25519_checksig_batch(int *okay_out, - const ed25519_checkable_t *checkable, - int n_checkable) +MOCK_IMPL(int, +ed25519_checksig_batch,(int *okay_out, + const ed25519_checkable_t *checkable, + int n_checkable)) { int i, res; const ed25519_impl_t *impl = get_ed_impl(); @@ -642,8 +642,8 @@ ed25519_pubkey_copy(ed25519_public_key_t *dest, /** Check whether the given Ed25519 implementation seems to be working. * If so, return 0; otherwise return -1. */ -static int -ed25519_impl_spot_check(void) +MOCK_IMPL(STATIC int, +ed25519_impl_spot_check,(void)) { static const uint8_t alicesk[32] = { 0xc5,0xaa,0x8d,0xf4,0x3f,0x9f,0x83,0x7b, |