aboutsummaryrefslogtreecommitdiff
path: root/src/lib/tls
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/tls')
-rw-r--r--src/lib/tls/.may_include10
-rw-r--r--src/lib/tls/buffers_tls.c4
-rw-r--r--src/lib/tls/tortls.c17
-rw-r--r--src/lib/tls/tortls.h2
4 files changed, 23 insertions, 10 deletions
diff --git a/src/lib/tls/.may_include b/src/lib/tls/.may_include
index a2d84165f0..0b47bdf08e 100644
--- a/src/lib/tls/.may_include
+++ b/src/lib/tls/.may_include
@@ -1,13 +1,19 @@
orconfig.h
+lib/arch/*.h
lib/cc/*.h
+lib/ctime/*.h
lib/container/*.h
lib/crypt_ops/*.h
+lib/intmath/*.h
+lib/encoding/*.h
lib/err/*.h
+lib/net/*.h
+lib/string/*.h
lib/testsupport/testsupport.h
lib/tls/*.h
lib/log/*.h
ciphers.inc
-# XXX I'd like to remove this.
-common/*.h
+# this shouldn't be in common
+common/buffers.h
diff --git a/src/lib/tls/buffers_tls.c b/src/lib/tls/buffers_tls.c
index ac78b6501b..0f9dd7a4d2 100644
--- a/src/lib/tls/buffers_tls.c
+++ b/src/lib/tls/buffers_tls.c
@@ -9,11 +9,11 @@
#include <stddef.h>
#include "common/buffers.h"
#include "lib/tls/buffers_tls.h"
-#include "common/compat.h"
-#include "common/util.h"
#include "lib/cc/torint.h"
#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
#include "lib/tls/tortls.h"
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
diff --git a/src/lib/tls/tortls.c b/src/lib/tls/tortls.c
index 6fa0611f1d..3eee41bd16 100644
--- a/src/lib/tls/tortls.c
+++ b/src/lib/tls/tortls.c
@@ -28,7 +28,6 @@
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/crypt_ops/crypto_dh.h"
#include "lib/crypt_ops/crypto_util.h"
-#include "common/compat.h"
/* Some versions of OpenSSL declare SSL_get_selected_srtp_profile twice in
* srtp.h. Suppress the GCC warning so we can build with -Wredundant-decl. */
@@ -53,11 +52,21 @@ ENABLE_GCC_WARNING(redundant-decls)
#define TORTLS_PRIVATE
#include "lib/tls/tortls.h"
-#include "common/util.h"
#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
#include "lib/container/smartlist.h"
+#include "lib/string/compat_string.h"
+#include "lib/string/printf.h"
+#include "lib/net/socket.h"
+#include "lib/intmath/cmp.h"
+#include "lib/ctime/di_ops.h"
+#include "lib/encoding/time_fmt.h"
+
+#include <stdlib.h>
#include <string.h>
+#include "lib/arch/bytes.h"
+
#ifdef OPENSSL_1_1_API
#define X509_get_notBefore_const(cert) \
X509_get0_notBefore(cert)
@@ -1392,7 +1401,7 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
{
unsigned char cipherid[3];
tor_assert(ssl);
- set_uint16(cipherid, htons(cipher));
+ set_uint16(cipherid, tor_htons(cipher));
cipherid[2] = 0; /* If ssl23_get_cipher_by_char finds no cipher starting
* with a two-byte 'cipherid', it may look for a v2
* cipher with the appropriate 3 bytes. */
@@ -1406,7 +1415,7 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher)
# if defined(HAVE_STRUCT_SSL_METHOD_ST_GET_CIPHER_BY_CHAR)
if (m && m->get_cipher_by_char) {
unsigned char cipherid[3];
- set_uint16(cipherid, htons(cipher));
+ set_uint16(cipherid, tor_htons(cipher));
cipherid[2] = 0; /* If ssl23_get_cipher_by_char finds no cipher starting
* with a two-byte 'cipherid', it may look for a v2
* cipher with the appropriate 3 bytes. */
diff --git a/src/lib/tls/tortls.h b/src/lib/tls/tortls.h
index c46b46d2fa..fe192b2abc 100644
--- a/src/lib/tls/tortls.h
+++ b/src/lib/tls/tortls.h
@@ -13,7 +13,6 @@
#include "lib/crypt_ops/crypto_rsa.h"
#include "lib/crypt_ops/compat_openssl.h"
-#include "common/compat.h"
#include "lib/testsupport/testsupport.h"
/* Opaque structure to hold a TLS connection. */
@@ -292,4 +291,3 @@ const char *tor_tls_get_ciphersuite_name(tor_tls_t *tls);
int evaluate_ecgroup_for_tls(const char *ecgroup);
#endif /* !defined(TOR_TORTLS_H) */
-