]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Extract internal-only parts of x509.h
authorNick Mathewson <nickm@torproject.org>
Sun, 12 Aug 2018 22:01:14 +0000 (18:01 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 21 Aug 2018 16:25:33 +0000 (12:25 -0400)
src/lib/tls/include.am
src/lib/tls/x509.c
src/lib/tls/x509.h
src/lib/tls/x509_internal.h [new file with mode: 0644]
src/lib/tls/x509_nss.c
src/lib/tls/x509_openssl.c
src/test/test_tortls.c
src/test/test_tortls_openssl.c

index 1731049032886ab792ecca16939a9bb68861a939..b25e2e16bfb55a91361feb29146f7c9255db0cb1 100644 (file)
@@ -34,4 +34,5 @@ noinst_HEADERS +=                             \
        src/lib/tls/tortls.h                    \
        src/lib/tls/tortls_internal.h           \
        src/lib/tls/tortls_st.h                 \
-       src/lib/tls/x509.h
+       src/lib/tls/x509.h                      \
+       src/lib/tls/x509_internal.h
index dbf1dd927c3626bb7856aa068abe91d26feb3c9e..fc6139aceb6485ddc31ab6d91d3aa8629de4f3dc 100644 (file)
@@ -11,6 +11,7 @@
 
 #define TOR_X509_PRIVATE
 #include "lib/tls/x509.h"
+#include "lib/tls/x509_internal.h"
 #include "lib/log/util_bug.h"
 #include "lib/crypt_ops/crypto_rand.h"
 
index f75d15d7e9c0fb57cabbe5425a682fd50358748e..ccaa92184e30406fb5d4db6bfa57b37107564f45 100644 (file)
@@ -40,15 +40,6 @@ void tor_tls_pick_certificate_lifetime(time_t now,
                                        time_t *start_time_out,
                                        time_t *end_time_out);
 
-MOCK_DECL(tor_x509_cert_impl_t *, tor_tls_create_certificate,
-                                                   (crypto_pk_t *rsa,
-                                                    crypto_pk_t *rsa_sign,
-                                                    const char *cname,
-                                                    const char *cname_sign,
-                                                  unsigned int cert_lifetime));
-MOCK_DECL(tor_x509_cert_t *, tor_x509_cert_new,
-          (tor_x509_cert_impl_t *x509_cert));
-
 #ifdef TOR_UNIT_TESTS
 tor_x509_cert_t *tor_x509_cert_replace_expiration(
                                                const tor_x509_cert_t *inp,
@@ -63,8 +54,6 @@ void tor_x509_cert_free_(tor_x509_cert_t *cert);
   FREE_AND_NULL(tor_x509_cert_t, tor_x509_cert_free_, (c))
 tor_x509_cert_t *tor_x509_cert_decode(const uint8_t *certificate,
                             size_t certificate_len);
-const tor_x509_cert_impl_t *tor_x509_cert_get_impl(
-                                           const tor_x509_cert_t *cert);
 void tor_x509_cert_get_der(const tor_x509_cert_t *cert,
                       const uint8_t **encoded_out, size_t *size_out);
 
diff --git a/src/lib/tls/x509_internal.h b/src/lib/tls/x509_internal.h
new file mode 100644 (file)
index 0000000..2cca393
--- /dev/null
@@ -0,0 +1,28 @@
+/* Copyright (c) 2003, Roger Dingledine
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2018, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+#ifndef TOR_X509_INTERNAL_H
+#define TOR_X509_INTERNAL_H
+
+/**
+ * \file x509.h
+ * \brief Internal headers for tortls.c
+ **/
+
+#include "lib/crypt_ops/crypto_rsa.h"
+#include "lib/testsupport/testsupport.h"
+
+MOCK_DECL(tor_x509_cert_impl_t *, tor_tls_create_certificate,
+                                                   (crypto_pk_t *rsa,
+                                                    crypto_pk_t *rsa_sign,
+                                                    const char *cname,
+                                                    const char *cname_sign,
+                                                  unsigned int cert_lifetime));
+MOCK_DECL(tor_x509_cert_t *, tor_x509_cert_new,
+          (tor_x509_cert_impl_t *x509_cert));
+const tor_x509_cert_impl_t *tor_x509_cert_get_impl(
+                                           const tor_x509_cert_t *cert);
+
+#endif
index e856c95187ae7713bd4f2538c8835017649a59f0..e0087eae6c03d453cf491dd88f88b4aeb558f429 100644 (file)
@@ -11,6 +11,7 @@
 
 #define TOR_X509_PRIVATE
 #include "lib/tls/x509.h"
+#include "lib/tls/x509_internal.h"
 #include "lib/tls/tortls.h"
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/crypt_ops/crypto_util.h"
index c003d4704bedd3343be397c36a7281a09949c977..43d33d781f1e880842501f2d230352b366ae477c 100644 (file)
@@ -11,6 +11,7 @@
 
 #define TOR_X509_PRIVATE
 #include "lib/tls/x509.h"
+#include "lib/tls/x509_internal.h"
 #include "lib/tls/tortls.h"
 #include "lib/crypt_ops/crypto_rand.h"
 #include "lib/crypt_ops/crypto_util.h"
index d20bc5fa6cef1e9f15a87e96e6425aca20890f6d..eedf0dd3c9511bcf77268ef33b447ad54c7d2095 100644 (file)
@@ -19,6 +19,7 @@
 #include "app/config/config.h"
 #include "lib/crypt_ops/compat_openssl.h"
 #include "lib/tls/x509.h"
+#include "lib/tls/x509_internal.h"
 #include "lib/tls/tortls.h"
 #include "lib/tls/tortls_st.h"
 #include "lib/tls/tortls_internal.h"
index a9336a6f1b72e4050a4972a8181e990bba07d231..12a05b3033df1f3ea69ffa03ef9bc8d16fdd9ef3 100644 (file)
@@ -36,6 +36,7 @@ ENABLE_GCC_WARNING(redundant-decls)
 #include "app/config/config.h"
 #include "lib/crypt_ops/compat_openssl.h"
 #include "lib/tls/x509.h"
+#include "lib/tls/x509_internal.h"
 #include "lib/tls/tortls.h"
 #include "lib/tls/tortls_st.h"
 #include "lib/tls/tortls_internal.h"