1 /* Copyright (c) 2003, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2021, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
6 #ifndef TOR_X509_INTERNAL_H
7 #define TOR_X509_INTERNAL_H
11 * \brief Internal headers for tortls.c
14 #include "lib/crypt_ops/crypto_rsa.h"
15 #include "lib/testsupport/testsupport.h"
18 * How skewed do we allow our clock to be with respect to certificates that
19 * seem to be expired? (seconds)
21 #define TOR_X509_PAST_SLOP (2*24*60*60)
23 * How skewed do we allow our clock to be with respect to certificates that
24 * seem to come from the future? (seconds)
26 #define TOR_X509_FUTURE_SLOP (30*24*60*60)
28 MOCK_DECL(tor_x509_cert_impl_t
*, tor_tls_create_certificate
,
30 crypto_pk_t
*rsa_sign
,
32 const char *cname_sign
,
33 unsigned int cert_lifetime
));
34 MOCK_DECL(tor_x509_cert_t
*, tor_x509_cert_new
,
35 (tor_x509_cert_impl_t
*x509_cert
));
37 int tor_x509_check_cert_lifetime_internal(int severity
,
38 const tor_x509_cert_impl_t
*cert
,
41 int future_tolerance
);
43 void tor_x509_cert_impl_free_(tor_x509_cert_impl_t
*cert
);
44 #define tor_x509_cert_impl_free(cert) \
45 FREE_AND_NULL(tor_x509_cert_impl_t, tor_x509_cert_impl_free_, (cert))
46 tor_x509_cert_impl_t
*tor_x509_cert_impl_dup_(tor_x509_cert_impl_t
*cert
);
48 int tor_x509_cert_set_cached_der_encoding(tor_x509_cert_t
*cert
);
50 #define tor_x509_cert_set_cached_der_encoding(cert) (0)
53 #endif /* !defined(TOR_X509_INTERNAL_H) */