]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Split crypto and tls libraries into directories
authorNick Mathewson <nickm@torproject.org>
Thu, 21 Jun 2018 16:46:11 +0000 (12:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 Jun 2018 17:14:14 +0000 (13:14 -0400)
I am calling the crypto library "crypt_ops", since I want
higher-level crypto things to be separated from lower-level ones.
This library will hold only the low-level ones, once we have it
refactored.

41 files changed:
.gitignore
Makefile.am
src/common/include.am
src/include.am
src/lib/crypt_ops/aes.c [moved from src/common/aes.c with 100% similarity]
src/lib/crypt_ops/aes.h [moved from src/common/aes.h with 100% similarity]
src/lib/crypt_ops/compat_openssl.h [moved from src/common/compat_openssl.h with 100% similarity]
src/lib/crypt_ops/crypto.c [moved from src/common/crypto.c with 100% similarity]
src/lib/crypt_ops/crypto.h [moved from src/common/crypto.h with 100% similarity]
src/lib/crypt_ops/crypto_curve25519.c [moved from src/common/crypto_curve25519.c with 100% similarity]
src/lib/crypt_ops/crypto_curve25519.h [moved from src/common/crypto_curve25519.h with 100% similarity]
src/lib/crypt_ops/crypto_dh.c [moved from src/common/crypto_dh.c with 100% similarity]
src/lib/crypt_ops/crypto_dh.h [moved from src/common/crypto_dh.h with 100% similarity]
src/lib/crypt_ops/crypto_digest.c [moved from src/common/crypto_digest.c with 100% similarity]
src/lib/crypt_ops/crypto_digest.h [moved from src/common/crypto_digest.h with 100% similarity]
src/lib/crypt_ops/crypto_ed25519.c [moved from src/common/crypto_ed25519.c with 100% similarity]
src/lib/crypt_ops/crypto_ed25519.h [moved from src/common/crypto_ed25519.h with 100% similarity]
src/lib/crypt_ops/crypto_format.c [moved from src/common/crypto_format.c with 100% similarity]
src/lib/crypt_ops/crypto_format.h [moved from src/common/crypto_format.h with 100% similarity]
src/lib/crypt_ops/crypto_hkdf.c [moved from src/common/crypto_hkdf.c with 100% similarity]
src/lib/crypt_ops/crypto_hkdf.h [moved from src/common/crypto_hkdf.h with 100% similarity]
src/lib/crypt_ops/crypto_openssl_mgt.c [moved from src/common/crypto_openssl_mgt.c with 100% similarity]
src/lib/crypt_ops/crypto_openssl_mgt.h [moved from src/common/crypto_openssl_mgt.h with 100% similarity]
src/lib/crypt_ops/crypto_pwbox.c [moved from src/common/crypto_pwbox.c with 100% similarity]
src/lib/crypt_ops/crypto_pwbox.h [moved from src/common/crypto_pwbox.h with 100% similarity]
src/lib/crypt_ops/crypto_rand.c [moved from src/common/crypto_rand.c with 100% similarity]
src/lib/crypt_ops/crypto_rand.h [moved from src/common/crypto_rand.h with 100% similarity]
src/lib/crypt_ops/crypto_rsa.c [moved from src/common/crypto_rsa.c with 100% similarity]
src/lib/crypt_ops/crypto_rsa.h [moved from src/common/crypto_rsa.h with 100% similarity]
src/lib/crypt_ops/crypto_s2k.c [moved from src/common/crypto_s2k.c with 100% similarity]
src/lib/crypt_ops/crypto_s2k.h [moved from src/common/crypto_s2k.h with 100% similarity]
src/lib/crypt_ops/crypto_util.c [moved from src/common/crypto_util.c with 100% similarity]
src/lib/crypt_ops/crypto_util.h [moved from src/common/crypto_util.h with 100% similarity]
src/lib/crypt_ops/include.am [new file with mode: 0644]
src/lib/tls/buffers_tls.c [moved from src/common/buffers_tls.c with 100% similarity]
src/lib/tls/buffers_tls.h [moved from src/common/buffers_tls.h with 100% similarity]
src/lib/tls/ciphers.inc [moved from src/common/ciphers.inc with 100% similarity]
src/lib/tls/include.am [new file with mode: 0644]
src/lib/tls/tortls.c [moved from src/common/tortls.c with 100% similarity]
src/lib/tls/tortls.h [moved from src/common/tortls.h with 100% similarity]
src/rust/build.rs

index 2716bac8310c3a23b6172e68914e327e5a6e25c3..d797f4f53d99e7ea7d14916134506ab1e64e4f7f 100644 (file)
@@ -141,9 +141,6 @@ uptime-*.json
 /src/common/libor-ctime.a
 /src/common/libor-ctime-testing.a
 /src/common/libor-ctime.lib
-/src/common/libor-crypto.a
-/src/common/libor-crypto-testing.a
-/src/common/libor-crypto.lib
 /src/common/libor-event.a
 /src/common/libor-event-testing.a
 /src/common/libor-event.lib
@@ -169,10 +166,14 @@ uptime-*.json
 # /src/lib
 /src/lib/libtor-compress.a
 /src/lib/libtor-compress-testing.a
+/src/lib/libtor-crypt-ops.a
+/src/lib/libtor-crypt-ops-testing.a
 /src/lib/libtor-ctime.a
 /src/lib/libtor-ctime-testing.a
 /src/lib/libtor-err.a
 /src/lib/libtor-err-testing.a
+/src/lib/libtor-tls.a
+/src/lib/libtor-tls-testing.a
 /src/lib/libtor-trace.a
 
 # /src/or/
index 62c0e2a4a1a05fb5e78d7002f74b7b141c10131c..4ccee670e621a108d2f1583f0ad10e30ba29eda3 100644 (file)
@@ -52,14 +52,16 @@ TOR_UTIL_TESTING_LIBS = \
 
 # Internal crypto libraries used in Tor
 TOR_CRYPTO_LIBS = \
-       src/common/libor-crypto.a \
+       src/lib/libtor-tls.a \
+       src/lib/libtor-crypt-ops.a \
        $(LIBKECCAK_TINY) \
        $(LIBDONNA)
 
 # Variants of the above for linking the testing variant of tor (for coverage
 # and tests)
 TOR_CRYPTO_TESTING_LIBS = \
-       src/common/libor-crypto-testing.a \
+       src/lib/libtor-tls-testing.a \
+       src/lib/libtor-crypt-ops-testing.a \
        $(LIBKECCAK_TINY) \
        $(LIBDONNA)
 
index 2869c2ac9ddc4d52613c2d92e4ad5ba9f2deefb7..fb5472f3b91f21211bd13db9095545fe049b037f 100644 (file)
@@ -1,13 +1,11 @@
 
 noinst_LIBRARIES += \
        src/common/libor.a \
-       src/common/libor-crypto.a \
        src/common/libor-event.a
 
 if UNITTESTS_ENABLED
 noinst_LIBRARIES += \
        src/common/libor-testing.a \
-       src/common/libor-crypto-testing.a \
        src/common/libor-event-testing.a
 endif
 
@@ -83,24 +81,6 @@ LIBOR_A_SRC = \
 src/common/src_common_libor_testing_a-log.$(OBJEXT) \
   src/common/log.$(OBJEXT): micro-revision.i
 
-LIBOR_CRYPTO_A_SRC = \
-  src/common/aes.c             \
-  src/common/buffers_tls.c     \
-  src/common/crypto.c          \
-  src/common/crypto_dh.c       \
-  src/common/crypto_digest.c     \
-  src/common/crypto_format.c   \
-  src/common/crypto_hkdf.c      \
-  src/common/crypto_openssl_mgt.c    \
-  src/common/crypto_pwbox.c     \
-  src/common/crypto_rand.c     \
-  src/common/crypto_rsa.c     \
-  src/common/crypto_s2k.c      \
-  src/common/crypto_util.c     \
-  src/common/tortls.c          \
-  src/common/crypto_curve25519.c \
-  src/common/crypto_ed25519.c
-
 LIBOR_EVENT_A_SRC = \
        src/common/compat_libevent.c \
        src/common/procmon.c         \
@@ -108,53 +88,31 @@ LIBOR_EVENT_A_SRC = \
        src/ext/timeouts/timeout.c
 
 src_common_libor_a_SOURCES = $(LIBOR_A_SRC)
-src_common_libor_crypto_a_SOURCES = $(LIBOR_CRYPTO_A_SRC)
 src_common_libor_event_a_SOURCES = $(LIBOR_EVENT_A_SRC)
 
 if UNITTESTS_ENABLED
 src_common_libor_testing_a_SOURCES = $(LIBOR_A_SRC)
-src_common_libor_crypto_testing_a_SOURCES = $(LIBOR_CRYPTO_A_SRC)
 src_common_libor_event_testing_a_SOURCES = $(LIBOR_EVENT_A_SRC)
 else
 src_common_libor_testing_a_SOURCES =
-src_common_libor_crypto_testing_a_SOURCES =
 src_common_libor_event_testing_a_SOURCES =
 endif
 
 src_common_libor_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
-src_common_libor_crypto_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
 src_common_libor_event_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
 src_common_libor_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
-src_common_libor_crypto_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
 src_common_libor_event_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
 
 COMMONHEADERS = \
   src/common/address.h                         \
   src/common/address_set.h                     \
   src/common/buffers.h                         \
-  src/common/buffers_tls.h                     \
-  src/common/aes.h                             \
-  src/common/ciphers.inc                       \
   src/common/compat.h                          \
   src/common/compat_libevent.h                 \
-  src/common/compat_openssl.h                  \
   src/common/compat_threads.h                  \
   src/common/compat_time.h                     \
   src/common/confline.h                                \
   src/common/container.h                       \
-  src/common/crypto.h                          \
-  src/common/crypto_dh.h            \
-  src/common/crypto_digest.h            \
-  src/common/crypto_curve25519.h               \
-  src/common/crypto_ed25519.h                  \
-  src/common/crypto_format.h                   \
-  src/common/crypto_hkdf.h              \
-  src/common/crypto_openssl_mgt.h         \
-  src/common/crypto_pwbox.h                    \
-  src/common/crypto_rand.h          \
-  src/common/crypto_rsa.h           \
-  src/common/crypto_s2k.h                      \
-  src/common/crypto_util.h                     \
   src/common/handles.h                         \
   src/common/memarea.h                         \
   src/common/linux_syscalls.inc                        \
@@ -165,7 +123,6 @@ COMMONHEADERS = \
   src/common/timers.h                          \
   src/common/token_bucket.h                    \
   src/common/torlog.h                          \
-  src/common/tortls.h                          \
   src/common/util.h                            \
   src/common/util_bug.h                                \
   src/common/util_format.h                     \
index d4b348b4ef2cbfb3516b72b840389493e4b6e137..e82943f733edd8b993b72e7a1997898569bf6628 100644 (file)
@@ -3,6 +3,8 @@ include src/lib/err/include.am
 include src/lib/cc/include.am
 include src/lib/ctime/include.am
 include src/lib/compress/include.am
+include src/lib/crypt_ops/include.am
+include src/lib/tls/include.am
 include src/lib/trace/include.am
 include src/common/include.am
 include src/trunnel/include.am
similarity index 100%
rename from src/common/aes.c
rename to src/lib/crypt_ops/aes.c
similarity index 100%
rename from src/common/aes.h
rename to src/lib/crypt_ops/aes.h
diff --git a/src/lib/crypt_ops/include.am b/src/lib/crypt_ops/include.am
new file mode 100644 (file)
index 0000000..b881c68
--- /dev/null
@@ -0,0 +1,44 @@
+
+noinst_LIBRARIES += src/lib/libtor-crypt-ops.a
+
+if UNITTESTS_ENABLED
+noinst_LIBRARIES += src/lib/libtor-crypt-ops-testing.a
+endif
+
+src_lib_libtor_crypt_ops_a_SOURCES =                   \
+       src/lib/crypt_ops/aes.c                         \
+       src/lib/crypt_ops/crypto.c                      \
+       src/lib/crypt_ops/crypto_curve25519.c           \
+       src/lib/crypt_ops/crypto_dh.c                   \
+       src/lib/crypt_ops/crypto_digest.c               \
+       src/lib/crypt_ops/crypto_ed25519.c              \
+       src/lib/crypt_ops/crypto_format.c               \
+       src/lib/crypt_ops/crypto_hkdf.c                 \
+       src/lib/crypt_ops/crypto_openssl_mgt.c          \
+       src/lib/crypt_ops/crypto_pwbox.c                \
+       src/lib/crypt_ops/crypto_rand.c                 \
+       src/lib/crypt_ops/crypto_rsa.c                  \
+       src/lib/crypt_ops/crypto_s2k.c                  \
+       src/lib/crypt_ops/crypto_util.c
+
+src_lib_libtor_crypt_ops_testing_a_SOURCES = \
+       $(src_lib_libtor_crypt_ops_a_SOURCES)
+src_lib_libtor_crypt_ops_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
+src_lib_libtor_crypt_ops_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
+
+noinst_HEADERS +=                                      \
+       src/lib/crypt_ops/aes.h                         \
+       src/lib/crypt_ops/compat_openssl.h              \
+       src/lib/crypt_ops/crypto_curve25519.h           \
+       src/lib/crypt_ops/crypto_dh.h                   \
+       src/lib/crypt_ops/crypto_digest.h               \
+       src/lib/crypt_ops/crypto_ed25519.h              \
+       src/lib/crypt_ops/crypto_format.h               \
+       src/lib/crypt_ops/crypto.h                      \
+       src/lib/crypt_ops/crypto_hkdf.h                 \
+       src/lib/crypt_ops/crypto_openssl_mgt.h          \
+       src/lib/crypt_ops/crypto_pwbox.h                \
+       src/lib/crypt_ops/crypto_rand.h                 \
+       src/lib/crypt_ops/crypto_rsa.h                  \
+       src/lib/crypt_ops/crypto_s2k.h                  \
+       src/lib/crypt_ops/crypto_util.h
diff --git a/src/lib/tls/include.am b/src/lib/tls/include.am
new file mode 100644 (file)
index 0000000..b3b013f
--- /dev/null
@@ -0,0 +1,20 @@
+
+noinst_LIBRARIES += src/lib/libtor-tls.a
+
+if UNITTESTS_ENABLED
+noinst_LIBRARIES += src/lib/libtor-tls-testing.a
+endif
+
+src_lib_libtor_tls_a_SOURCES =                 \
+       src/lib/tls/buffers_tls.c               \
+       src/lib/tls/tortls.c
+
+src_lib_libtor_tls_testing_a_SOURCES = \
+       $(src_lib_libtor_tls_a_SOURCES)
+src_lib_libtor_tls_testing_a_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_CPPFLAGS)
+src_lib_libtor_tls_testing_a_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
+
+noinst_HEADERS +=                              \
+       src/lib/tls/ciphers.inc                 \
+       src/lib/tls/buffers_tls.h               \
+       src/lib/tls/tortls.h
similarity index 100%
rename from src/common/tortls.c
rename to src/lib/tls/tortls.c
similarity index 100%
rename from src/common/tortls.h
rename to src/lib/tls/tortls.h
index f9b40689fcabe741254192f0dc8342b172ba9bdc..8b0ea8ed650d43e2ac4907c46b891a4ede8320ed 100644 (file)
@@ -149,7 +149,7 @@ pub fn main() {
             // will have dependencies on all the other rust packages that
             // tor uses.  We must be careful with factoring and dependencies
             // moving forward!
-            cfg.component("or-crypto-testing");
+            cfg.component("tor-crypt-ops-testing");
             cfg.component("or-testing");
             cfg.component("tor-err-testing");
             cfg.component("or-event-testing");