aboutsummaryrefslogtreecommitdiff
path: root/src/common/tortls.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-08-10 20:02:03 -0400
committerNick Mathewson <nickm@torproject.org>2016-11-03 08:37:22 -0400
commit0b4221f98dbb93c9322e7a778f04bcbcfcc79738 (patch)
tree7bae3403a060841faa121ecab87aff4b9cf86e52 /src/common/tortls.h
parente3c825372180be00aff9c8e5cde60ea36d141f8c (diff)
downloadtor-0b4221f98dbb93c9322e7a778f04bcbcfcc79738.tar.gz
tor-0b4221f98dbb93c9322e7a778f04bcbcfcc79738.zip
Make the current time an argument to x509 cert-checking functions
This makes the code a bit cleaner by having more of the functions be pure functions that don't depend on the current time.
Diffstat (limited to 'src/common/tortls.h')
-rw-r--r--src/common/tortls.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/tortls.h b/src/common/tortls.h
index fe5898ef5c..3adb1b2f6e 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -200,7 +200,8 @@ int tor_tls_peer_has_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,
+ tor_tls_t *tls, time_t now,
+ int past_tolerance,
int future_tolerance);
MOCK_DECL(int, tor_tls_read, (tor_tls_t *tls, char *cp, size_t len));
int tor_tls_write(tor_tls_t *tls, const char *cp, size_t n);
@@ -259,6 +260,7 @@ MOCK_DECL(int,tor_tls_cert_matches_key,(const tor_tls_t *tls,
int tor_tls_cert_is_valid(int severity,
const tor_x509_cert_t *cert,
const tor_x509_cert_t *signing_cert,
+ time_t now,
int check_rsa_1024);
const char *tor_tls_get_ciphersuite_name(tor_tls_t *tls);