]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove util.h
authorNick Mathewson <nickm@torproject.org>
Thu, 5 Jul 2018 19:04:18 +0000 (15:04 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 5 Jul 2018 19:04:18 +0000 (15:04 -0400)
Inline its contents (which were all includes) into or.h, and some of
its contents into other places that didn't include or.h at all.

31 files changed:
src/common/include.am
src/common/util.h [deleted file]
src/or/config.c
src/or/dirauth/shared_random.c
src/or/ext_orport.c
src/or/hs_cell.c
src/or/keypin.c
src/or/onion_ntor.c
src/or/or.h
src/or/shared_random_client.c
src/or/torcert.c
src/or/transports.c
src/test/fuzz/fuzz_hsdescv3.c
src/test/test-memwipe.c
src/test/test-timers.c
src/test/test_bridges.c
src/test/test_bt_cl.c
src/test/test_checkdir.c
src/test/test_config.c
src/test/test_crypto.c
src/test/test_crypto_openssl.c
src/test/test_entrynodes.c
src/test/test_guardfraction.c
src/test/test_handles.c
src/test/test_hs_common.c
src/test/test_hs_ntor_cl.c
src/test/test_keypin.c
src/test/test_ntor_cl.c
src/test/test_pt.c
src/test/test_routerkeys.c
src/test/test_util_slow.c

index de4ecbaeeaf0c7936c3f414e86fdbdc955010245..0a58a39ae00444e91d1dd1b3585fdcee7d27e7ab 100644 (file)
@@ -52,7 +52,6 @@ COMMONHEADERS = \
   src/common/procmon.h                         \
   src/common/timers.h                          \
   src/common/token_bucket.h                    \
-  src/common/util.h                            \
   src/common/workqueue.h
 
 noinst_HEADERS+= $(COMMONHEADERS)
diff --git a/src/common/util.h b/src/common/util.h
deleted file mode 100644 (file)
index 55eec2b..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (c) 2003-2004, Roger Dingledine
- * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2018, The Tor Project, Inc. */
-/* See LICENSE for licensing information */
-
-/**
- * \file util.h
- * \brief Headers for util.c
- **/
-
-#ifndef TOR_UTIL_H
-#define TOR_UTIL_H
-
-#include "orconfig.h"
-#include "lib/arch/bytes.h"
-#include "lib/cc/compat_compiler.h"
-#include "lib/cc/torint.h"
-#include "lib/ctime/di_ops.h"
-#include "lib/encoding/cstring.h"
-#include "lib/encoding/time_fmt.h"
-#include "lib/err/torerr.h"
-#include "lib/fs/dir.h"
-#include "lib/fs/files.h"
-#include "lib/fs/mmap.h"
-#include "lib/fs/path.h"
-#include "lib/fs/userdb.h"
-#include "lib/intmath/addsub.h"
-#include "lib/intmath/bits.h"
-#include "lib/intmath/cmp.h"
-#include "lib/intmath/logic.h"
-#include "lib/intmath/muldiv.h"
-#include "lib/log/escape.h"
-#include "lib/log/ratelim.h"
-#include "lib/log/util_bug.h"
-#include "lib/malloc/util_malloc.h"
-#include "lib/net/ipv4.h"
-#include "lib/net/ipv6.h"
-#include "lib/net/resolve.h"
-#include "lib/net/socket.h"
-#include "lib/string/compat_ctype.h"
-#include "lib/string/compat_string.h"
-#include "lib/string/parse_int.h"
-#include "lib/string/printf.h"
-#include "lib/string/scanf.h"
-#include "lib/string/util_string.h"
-#include "lib/testsupport/testsupport.h"
-#include "lib/thread/threads.h"
-#include "lib/time/compat_time.h"
-#include "lib/wallclock/approx_time.h"
-#include "lib/wallclock/timeval.h"
-
-#endif /* !defined(TOR_UTIL_H) */
index 13002dd9633f1fd93dc80667fe0ddbae20c8a125..6dc2ad1d5b884134e2583d72736770e4957d6359 100644 (file)
@@ -99,7 +99,6 @@
 #include "or/rephist.h"
 #include "or/router.h"
 #include "lib/sandbox/sandbox.h"
-#include "common/util.h"
 #include "or/routerlist.h"
 #include "or/routerset.h"
 #include "or/scheduler.h"
index 8b53c1e7433ef243be907085eb67d96895f18a9c..d1226901296211b5ef3ec35f730329858a1eef33 100644 (file)
@@ -99,7 +99,6 @@
 #include "or/routerlist.h"
 #include "or/shared_random_client.h"
 #include "or/dirauth/shared_random_state.h"
-#include "common/util.h"
 #include "or/voting_schedule.h"
 
 #include "or/dirauth/dirvote.h"
index 701dc45288f3d60134f37f359583fa403ced42b2..7342a66e06191a1066f8dc3a14d7d0455407aed3 100644 (file)
@@ -27,7 +27,6 @@
 #include "or/ext_orport.h"
 #include "or/main.h"
 #include "or/proto_ext_or.h"
-#include "common/util.h"
 
 #include "or/or_connection_st.h"
 
index b50c87dfa39f9cb0309bec6f4dc872ee22ded19d..f8b76c513335e9bf3b90d3939022d584a3699e20 100644 (file)
@@ -11,7 +11,6 @@
 #include "lib/crypt_ops/crypto_util.h"
 #include "or/rendservice.h"
 #include "or/replaycache.h"
-#include "common/util.h"
 
 #include "or/hs_cell.h"
 #include "or/hs_ntor.h"
index 34cf64f5c47d643c49e93db244984577d8e2ee9b..a2f3654b826175349868dfb69dbd769cbf3996f8 100644 (file)
 #define KEYPIN_PRIVATE
 
 #include "orconfig.h"
+
+#include "lib/cc/torint.h"
 #include "lib/crypt_ops/crypto_digest.h"
 #include "lib/crypt_ops/crypto_format.h"
+#include "lib/crypt_ops/crypto_format.h"
+#include "lib/ctime/di_ops.h"
 #include "lib/ctime/di_ops.h"
+#include "lib/encoding/binascii.h"
+#include "lib/encoding/time_fmt.h"
+#include "lib/fdio/fdio.h"
+#include "lib/fs/files.h"
+#include "lib/fs/mmap.h"
+#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
+#include "lib/string/compat_ctype.h"
+#include "lib/string/printf.h"
+#include "lib/wallclock/approx_time.h"
+
 #include "ht.h"
 #include "or/keypin.h"
+
 #include "siphash.h"
-#include "lib/cc/torint.h"
-#include "lib/log/torlog.h"
-#include "lib/fdio/fdio.h"
-#include "common/util.h"
-#include "lib/encoding/binascii.h"
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #include <io.h>
 #endif
 
+#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+
 /**
  * @file keypin.c
  * @brief Key-pinning for RSA and Ed25519 identity keys at directory
index 34b1112020f54b6bfaac625e48e6d33fd0c1d892..59c923cb979c3a1b7489c147d96e8ce5403781cc 100644 (file)
 #include "orconfig.h"
 
 #define ONION_NTOR_PRIVATE
+
 #include "lib/crypt_ops/crypto.h"
-#include "lib/crypt_ops/crypto_hkdf.h"
 #include "lib/crypt_ops/crypto_digest.h"
+#include "lib/crypt_ops/crypto_hkdf.h"
 #include "lib/crypt_ops/crypto_util.h"
-#include "or/onion_ntor.h"
-#include "lib/log/torlog.h"
 #include "lib/ctime/di_ops.h"
-#include "common/util.h"
+#include "lib/log/torlog.h"
+#include "lib/log/util_bug.h"
+#include "or/onion_ntor.h"
+
+#include <string.h>
 
 /** Free storage held in an ntor handshake state. */
 void
index b0340ed1a0f4cf34a8d0e714320d5be50d8c2aae..826e81e468141519816d550f617c9be6cc5312e1 100644 (file)
 #include <time.h>
 #endif
 
-#include "common/util.h"
-
+#include "lib/arch/bytes.h"
+#include "lib/cc/compat_compiler.h"
+#include "lib/cc/torint.h"
 #include "lib/container/map.h"
 #include "lib/container/smartlist.h"
 #include "lib/crypt_ops/crypto.h"
+#include "lib/ctime/di_ops.h"
 #include "lib/defs/dh_sizes.h"
 #include "lib/encoding/binascii.h"
+#include "lib/encoding/cstring.h"
+#include "lib/encoding/time_fmt.h"
+#include "lib/err/torerr.h"
+#include "lib/fs/dir.h"
+#include "lib/fs/files.h"
+#include "lib/fs/mmap.h"
+#include "lib/fs/path.h"
+#include "lib/fs/userdb.h"
+#include "lib/intmath/addsub.h"
+#include "lib/intmath/bits.h"
+#include "lib/intmath/cmp.h"
+#include "lib/intmath/logic.h"
+#include "lib/intmath/muldiv.h"
+#include "lib/log/escape.h"
+#include "lib/log/ratelim.h"
+#include "lib/log/util_bug.h"
+#include "lib/malloc/util_malloc.h"
 #include "lib/net/address.h"
+#include "lib/net/ipv4.h"
+#include "lib/net/ipv6.h"
+#include "lib/net/resolve.h"
+#include "lib/net/socket.h"
+#include "lib/string/compat_ctype.h"
+#include "lib/string/compat_string.h"
+#include "lib/string/parse_int.h"
+#include "lib/string/printf.h"
+#include "lib/string/scanf.h"
+#include "lib/string/util_string.h"
+#include "lib/testsupport/testsupport.h"
+#include "lib/thread/threads.h"
+#include "lib/time/compat_time.h"
+#include "lib/wallclock/approx_time.h"
+#include "lib/wallclock/timeval.h"
 
 #include "ht.h"
 
index 9a6c0f6644293ea762d351c73f419637beaec535..42a5b42f60510f4da6f66bf76fce2d84d14a8df1 100644 (file)
@@ -14,7 +14,6 @@
 #include "or/config.h"
 #include "or/voting_schedule.h"
 #include "or/networkstatus.h"
-#include "common/util.h"
 #include "lib/encoding/binascii.h"
 
 #include "or/networkstatus_st.h"
index 269fa66ceafbbbe9a4384763d4ab41831720e28f..39c6605c6521d125becdecbb682ed1866d1e8103 100644 (file)
@@ -31,7 +31,6 @@
 #include "or/torcert.h"
 #include "trunnel/ed25519_cert.h"
 #include "lib/log/torlog.h"
-#include "common/util.h"
 #include "trunnel/link_handshake.h"
 #include "lib/tls/tortls.h"
 
index ff51ff00ebaea87acc52864bf70e5877a59f526f..1d3cb7b951a25b4a9b4a124ba940f845963ab4d9 100644 (file)
@@ -96,7 +96,6 @@
 #include "or/connection.h"
 #include "or/circuitbuild.h"
 #include "or/transports.h"
-#include "common/util.h"
 #include "or/router.h"
 #include "or/statefile.h"
 #include "or/connection_or.h"
index ada9fa6c2d180e90760dadbb5058137f205694e2..de574ac26d40f5d0e0805df41f352a34e8288833 100644 (file)
@@ -9,7 +9,6 @@
 #include "lib/crypt_ops/crypto_ed25519.h"
 #include "or/hs_descriptor.h"
 #include "or/routerparse.h"
-#include "common/util.h"
 
 #include "test/fuzz/fuzzing.h"
 
index 552cbbc551fe4ca9522635a580243f93fd647847..8a4610e9047e4fce3835982fc869c7afee98dc57 100644 (file)
@@ -2,14 +2,16 @@
 /* See LICENSE for licensing information */
 
 #include "orconfig.h"
+#include "lib/crypt_ops/crypto_util.h"
+
+#include "lib/intmath/cmp.h"
+#include "lib/malloc/util_malloc.h"
+
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
 
-#include "lib/crypt_ops/crypto_util.h"
-#include "common/util.h"
-
 static unsigned fill_a_buffer_memset(void) __attribute__((noinline));
 static unsigned fill_a_buffer_memwipe(void) __attribute__((noinline));
 static unsigned fill_a_buffer_nothing(void) __attribute__((noinline));
@@ -214,4 +216,3 @@ main(int argc, char **argv)
     return 0;
   }
 }
-
index aed150bda6e54f8e37d1e676a71c08ed7c8e232c..a2365a2e3815d61a2f8ef3d8a6d464e060bba539 100644 (file)
@@ -8,9 +8,11 @@
 #include <string.h>
 
 #include "common/compat_libevent.h"
-#include "lib/crypt_ops/crypto_rand.h"
 #include "common/timers.h"
-#include "common/util.h"
+#include "lib/crypt_ops/crypto_rand.h"
+#include "lib/log/util_bug.h"
+#include "lib/time/compat_time.h"
+#include "lib/wallclock/timeval.h"
 
 #define N_TIMERS 1000
 #define MAX_DURATION 30
@@ -138,4 +140,3 @@ main(int argc, char **argv)
   timers_shutdown();
   return ret;
 }
-
index 98e85cd6d8a70ae459c07067a1aafb47a6ab0419..685027c0e04464a35d345e3e47c25215bf3d6f0d 100644 (file)
@@ -16,7 +16,6 @@
 #include "or/bridges.h"
 #include "or/config.h"
 #include "or/transports.h"
-#include "common/util.h"
 
 /* Test suite stuff */
 #include "test/test.h"
index 8a8221f190d725e8c797489a0dea028a2f07ceff..3f7b0a203ad144dbca13b7d88d918b304f9a3760 100644 (file)
@@ -8,7 +8,6 @@
 /* To prevent 'assert' from going away. */
 #undef TOR_COVERAGE
 #include "or/or.h"
-#include "common/util.h"
 #include "lib/err/backtrace.h"
 #include "lib/log/torlog.h"
 
index 09688cf0a98a13dc6cbf0bc8ef610c51e4aa4c1d..a80c6ebd3af7140a08c31226e3efca14654f6b9f 100644 (file)
@@ -12,7 +12,6 @@
 
 #include "or/config.h"
 #include "test/test.h"
-#include "common/util.h"
 
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
index fb05645930dc76bdcd6b6a9f072ae3497404eb23..c7623d0c856b1d8837fed7eac417f66881c54804 100644 (file)
@@ -19,7 +19,6 @@
 #include "or/connection.h"
 #include "or/connection_edge.h"
 #include "test/test.h"
-#include "common/util.h"
 #include "or/connection_or.h"
 #include "or/control.h"
 #include "or/cpuworker.h"
index 341dbc9a4f1b6257d419701c1e56426c1abca61d..2e38dfc279820c2b267f3360726a87cfaaf26858 100644 (file)
@@ -9,7 +9,6 @@
 #include "or/or.h"
 #include "test/test.h"
 #include "lib/crypt_ops/aes.h"
-#include "common/util.h"
 #include "siphash.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "lib/crypt_ops/crypto_dh.h"
index d443ba6fd0a5fa4634917eef7454b484f1074eea..1d31ad027915caa5ea2dea35528eaa360101b75c 100644 (file)
@@ -7,14 +7,14 @@
 
 #define CRYPTO_RAND_PRIVATE
 
+#include "lib/crypt_ops/compat_openssl.h"
 #include "lib/crypt_ops/crypto_rand.h"
-#include "common/util.h"
 #include "lib/encoding/binascii.h"
 #include "test/test.h"
 
 #include <openssl/evp.h>
 #include <openssl/rand.h>
-#include "lib/crypt_ops/compat_openssl.h"
+#include <string.h>
 
 /* Test for rectifying openssl RAND engine. */
 static void
@@ -103,4 +103,3 @@ struct testcase_t crypto_openssl_tests[] = {
     TT_FORK, NULL, NULL },
   END_OF_TESTCASES
 };
-
index 262e2fa680581506d2e9f410aafb5535d9284e49..9c35cdaaf2f72332d23cb8a44247394a21a53be3 100644 (file)
@@ -28,7 +28,6 @@
 #include "or/routerparse.h"
 #include "or/routerset.h"
 #include "or/statefile.h"
-#include "common/util.h"
 
 #include "or/cpath_build_state_st.h"
 #include "or/crypt_path_st.h"
index b7737cafa8058794c2e53e3ac472e83a126c2761..3c293e378bad8228e367cdb752d46b045d62b11a 100644 (file)
@@ -10,7 +10,6 @@
 #include "or/config.h"
 #include "or/dirserv.h"
 #include "or/entrynodes.h"
-#include "common/util.h"
 #include "or/routerparse.h"
 #include "or/networkstatus.h"
 
index 26c68aa8a3c0c7baf8e7a54873112e45a2200541..2910d7e18f384e9ba068ee8d19379cc165af3973 100644 (file)
@@ -4,8 +4,10 @@
 #include "orconfig.h"
 #include "test/test.h"
 
-#include "common/util.h"
 #include "lib/container/handles.h"
+#include "lib/log/util_bug.h"
+
+#include <stdio.h>
 
 typedef struct demo_t {
   HANDLE_ENTRY(demo, demo_t);
@@ -94,4 +96,3 @@ struct testcase_t handle_tests[] = {
   HANDLE_TEST(basic, 0),
   END_OF_TESTCASES
 };
-
index 28c6316bd0cbe028351f53d87de8a5ed6cf759be..4c39570e306171c6c34eaaa2b24a0e787bd00670 100644 (file)
@@ -31,7 +31,6 @@
 #include "or/statefile.h"
 #include "or/circuitlist.h"
 #include "or/dirauth/shared_random.h"
-#include "common/util.h"
 #include "or/voting_schedule.h"
 
 #include "or/microdesc_st.h"
index 6bf11560b47c3225c71106d8164bf94f006be234..8643897db5e12025712eee9e7d0f6ccb2255debb 100644 (file)
@@ -14,7 +14,6 @@
 
 #define ONION_NTOR_PRIVATE
 #include "or/or.h"
-#include "common/util.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "lib/crypt_ops/crypto_ed25519.h"
index e7e7e629630cd4443cef43debe864454b1dbfee5..e7897a8473586720edd01cd06adda211b1bd24e9 100644 (file)
@@ -5,7 +5,6 @@
 #define KEYPIN_PRIVATE
 #include "or/or.h"
 #include "or/keypin.h"
-#include "common/util.h"
 
 #include "test/test.h"
 
index 75d5ccc126e033d1f487082b41caf41b6470dd62..5711a9116a5f7c86bacd1da9bf50ce2763252b78 100644 (file)
@@ -7,7 +7,6 @@
 
 #define ONION_NTOR_PRIVATE
 #include "or/or.h"
-#include "common/util.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/crypt_ops/crypto_curve25519.h"
 #include "or/onion_ntor.h"
index e685ab50deedd9578243feb711a1fb99e23c4d7d..189cb2584642a0d6493a5b12aaafb7e198f66c2b 100644 (file)
@@ -15,7 +15,6 @@
 #include "or/control.h"
 #include "or/transports.h"
 #include "or/circuitbuild.h"
-#include "common/util.h"
 #include "or/statefile.h"
 #include "test/test.h"
 #include "lib/process/subprocess.h"
index 8c2be30a8f6016c1ba533731d576cc6523d8e36d..2a761ad6e161e63883889333e08453c728a702c5 100644 (file)
@@ -9,7 +9,6 @@
 #include "or/config.h"
 #include "or/router.h"
 #include "or/routerkeys.h"
-#include "common/util.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/crypt_ops/crypto_format.h"
 #include "or/torcert.h"
index aeb0d422c1df798ef08e78ad28eef06fbb6baa40..5021e89dff7e1f64afe13f9ac0d907db59fb037a 100644 (file)
@@ -6,13 +6,17 @@
 #include "orconfig.h"
 #define UTIL_PRIVATE
 #define SUBPROCESS_PRIVATE
-#include "common/util.h"
-#include "lib/process/waitpid.h"
 #include "lib/crypt_ops/crypto.h"
 #include "lib/log/torlog.h"
 #include "lib/process/subprocess.h"
+#include "lib/process/waitpid.h"
+#include "lib/string/printf.h"
+#include "lib/time/compat_time.h"
 #include "test/test.h"
 
+#include <errno.h>
+#include <string.h>
+
 #ifndef BUILDDIR
 #define BUILDDIR "."
 #endif