aboutsummaryrefslogtreecommitdiff
path: root/src/core/crypto
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-04-29 12:11:57 -0400
committerDavid Goulet <dgoulet@torproject.org>2019-04-29 12:17:57 -0400
commit0f2ff267c5b509d697882989341d91b9fb4c249d (patch)
treefb4d3d2f44e5050703bd0fa15084080ece357e66 /src/core/crypto
parent0d8b9b56c5332b8f0205f460d0b23bb7f5620eff (diff)
downloadtor-0f2ff267c5b509d697882989341d91b9fb4c249d.tar.gz
tor-0f2ff267c5b509d697882989341d91b9fb4c249d.zip
sendme: Do not poke at crypto.sendme_digest directly
As per review from nickm, keep as much as we can the relay_crypto_t object opaque. Part of #26288 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/crypto')
-rw-r--r--src/core/crypto/relay_crypto.c8
-rw-r--r--src/core/crypto/relay_crypto.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/core/crypto/relay_crypto.c b/src/core/crypto/relay_crypto.c
index 5be45d6c7a..8931163161 100644
--- a/src/core/crypto/relay_crypto.c
+++ b/src/core/crypto/relay_crypto.c
@@ -91,6 +91,14 @@ relay_crypt_one_payload(crypto_cipher_t *cipher, uint8_t *in)
crypto_cipher_crypt_inplace(cipher, (char*) in, CELL_PAYLOAD_SIZE);
}
+/** Return the sendme_digest within the <b>crypto</b> object. */
+uint8_t *
+relay_crypto_get_sendme_digest(relay_crypto_t *crypto)
+{
+ tor_assert(crypto);
+ return crypto->sendme_digest;
+}
+
/** Record the b_digest from <b>crypto</b> and put it in the sendme_digest. */
void
relay_crypto_record_sendme_digest(relay_crypto_t *crypto)
diff --git a/src/core/crypto/relay_crypto.h b/src/core/crypto/relay_crypto.h
index 1009f1841b..bcc1531838 100644
--- a/src/core/crypto/relay_crypto.h
+++ b/src/core/crypto/relay_crypto.h
@@ -27,6 +27,7 @@ void relay_crypto_clear(relay_crypto_t *crypto);
void relay_crypto_assert_ok(const relay_crypto_t *crypto);
+uint8_t *relay_crypto_get_sendme_digest(relay_crypto_t *crypto);
void relay_crypto_record_sendme_digest(relay_crypto_t *crypto);
#endif /* !defined(TOR_RELAY_CRYPTO_H) */