aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-16 09:07:50 -0400
committerNick Mathewson <nickm@torproject.org>2015-05-28 10:41:50 -0400
commit55bb7bbafd1272a1bc36a17d89bd2419d59b113a (patch)
tree98a870d6603b5ee394975395f7c40a02d882cedd /src/common
parentb75361c5ed717cde787c1b4f36e8fb51ccfddc2b (diff)
downloadtor-55bb7bbafd1272a1bc36a17d89bd2419d59b113a.tar.gz
tor-55bb7bbafd1272a1bc36a17d89bd2419d59b113a.zip
Tests for AUTHENTICATE cell functionality.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tortls.c8
-rw-r--r--src/common/tortls.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 62e32c5dae..e498b2ac23 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -2394,8 +2394,8 @@ tor_tls_peer_has_cert(tor_tls_t *tls)
}
/** Return the peer certificate, or NULL if there isn't one. */
-tor_x509_cert_t *
-tor_tls_get_peer_cert(tor_tls_t *tls)
+MOCK_IMPL(tor_x509_cert_t *,
+tor_tls_get_peer_cert,(tor_tls_t *tls))
{
X509 *cert;
cert = SSL_get_peer_certificate(tls->ssl);
@@ -2820,8 +2820,8 @@ tor_tls_server_got_renegotiate(tor_tls_t *tls)
* the v3 handshake to prove that the client knows the TLS secrets for the
* connection <b>tls</b>. Return 0 on success, -1 on failure.
*/
-int
-tor_tls_get_tlssecrets(tor_tls_t *tls, uint8_t *secrets_out)
+MOCK_IMPL(int,
+tor_tls_get_tlssecrets,(tor_tls_t *tls, uint8_t *secrets_out))
{
#define TLSSECRET_MAGIC "Tor V3 handshake TLS cross-certification"
char buf[128];
diff --git a/src/common/tortls.h b/src/common/tortls.h
index 11ef09fed4..1dc4b31b2a 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -72,7 +72,7 @@ void tor_tls_set_renegotiate_callback(tor_tls_t *tls,
int tor_tls_is_server(tor_tls_t *tls);
void tor_tls_free(tor_tls_t *tls);
int tor_tls_peer_has_cert(tor_tls_t *tls);
-tor_x509_cert_t *tor_tls_get_peer_cert(tor_tls_t *tls);
+MOCK_DECL(tor_x509_cert_t *,tor_tls_get_peer_cert,(tor_tls_t *tls));
int tor_tls_verify(int severity, tor_tls_t *tls, crypto_pk_t **identity);
int tor_tls_check_lifetime(int severity,
tor_tls_t *tls, int past_tolerance,
@@ -102,7 +102,7 @@ int tor_tls_used_v1_handshake(tor_tls_t *tls);
int tor_tls_received_v3_certificate(tor_tls_t *tls);
int tor_tls_get_num_server_handshakes(tor_tls_t *tls);
int tor_tls_server_got_renegotiate(tor_tls_t *tls);
-int tor_tls_get_tlssecrets(tor_tls_t *tls, uint8_t *secrets_out);
+MOCK_DECL(int,tor_tls_get_tlssecrets,(tor_tls_t *tls, uint8_t *secrets_out));
/* Log and abort if there are unhandled TLS errors in OpenSSL's error stack.
*/