summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-07 11:17:53 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-07 11:17:53 -0400
commitc387cc5022f84ebb452278747f36f1c7d8b32187 (patch)
treeec53450a1b17bca3e679552c9475c5464c4e57f9 /src/common
parentaa792fd20a2a26c5bd4bb4a2d62ab89bcc55f2c5 (diff)
parent6a64563b1d608dbc09f38b50cc47d0ae2de7836d (diff)
downloadtor-c387cc5022f84ebb452278747f36f1c7d8b32187.tar.gz
tor-c387cc5022f84ebb452278747f36f1c7d8b32187.zip
Merge branch 'ticket21859_032_01_squashed'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/crypto.c12
-rw-r--r--src/common/crypto.h5
2 files changed, 17 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 0fc8474832..875b4eeb56 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -1854,6 +1854,18 @@ struct crypto_digest_t {
} d;
};
+#ifdef TOR_UNIT_TESTS
+
+digest_algorithm_t
+crypto_digest_get_algorithm(crypto_digest_t *digest)
+{
+ tor_assert(digest);
+
+ return digest->algorithm;
+}
+
+#endif
+
/**
* Return the number of bytes we need to malloc in order to get a
* crypto_digest_t for <b>alg</b>, or the number of bytes we need to wipe
diff --git a/src/common/crypto.h b/src/common/crypto.h
index c70d91c262..5951321c05 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -20,6 +20,9 @@
#include "testsupport.h"
#include "compat.h"
+#include <openssl/engine.h>
+#include "keccak-tiny/keccak-tiny.h"
+
/*
Macro to create an arbitrary OpenSSL version number as used by
OPENSSL_VERSION_NUMBER or SSLeay(), since the actual numbers are a bit hard
@@ -335,6 +338,7 @@ struct dh_st *crypto_dh_get_dh_(crypto_dh_t *dh);
void crypto_add_spaces_to_fp(char *out, size_t outlen, const char *in);
#ifdef CRYPTO_PRIVATE
+
STATIC int crypto_force_rand_ssleay(void);
STATIC int crypto_strongest_rand_raw(uint8_t *out, size_t out_len);
@@ -346,6 +350,7 @@ extern int break_strongest_rng_fallback;
#ifdef TOR_UNIT_TESTS
void crypto_pk_assign_(crypto_pk_t *dest, const crypto_pk_t *src);
+digest_algorithm_t crypto_digest_get_algorithm(crypto_digest_t *digest);
#endif
#endif