test_hs_cache.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. /* Copyright (c) 2016-2018, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file test_hs_cache.c
  5. * \brief Test hidden service caches.
  6. */
  7. #define CONNECTION_PRIVATE
  8. #define DIRCACHE_PRIVATE
  9. #define DIRCLIENT_PRIVATE
  10. #define HS_CACHE_PRIVATE
  11. #include "trunnel/ed25519_cert.h"
  12. #include "feature/hs/hs_cache.h"
  13. #include "feature/rend/rendcache.h"
  14. #include "feature/dircache/dircache.h"
  15. #include "feature/dirclient/dirclient.h"
  16. #include "feature/nodelist/networkstatus.h"
  17. #include "core/mainloop/connection.h"
  18. #include "core/proto/proto_http.h"
  19. #include "lib/crypt_ops/crypto_format.h"
  20. #include "feature/dircommon/dir_connection_st.h"
  21. #include "feature/nodelist/networkstatus_st.h"
  22. #include "test/hs_test_helpers.h"
  23. #include "test/test_helpers.h"
  24. #include "test/test.h"
  25. /* Static variable used to encoded the HSDir query. */
  26. static char query_b64[256];
  27. /* Build an HSDir query using a ed25519 public key. */
  28. static const char *
  29. helper_get_hsdir_query(const hs_descriptor_t *desc)
  30. {
  31. ed25519_public_to_base64(query_b64, &desc->plaintext_data.blinded_pubkey);
  32. return query_b64;
  33. }
  34. static void
  35. init_test(void)
  36. {
  37. /* Always needed. Initialize the subsystem. */
  38. hs_cache_init();
  39. /* We need the v2 cache since our OOM and cache cleanup does poke at it. */
  40. rend_cache_init();
  41. }
  42. static void
  43. test_directory(void *arg)
  44. {
  45. int ret;
  46. size_t oom_size;
  47. char *desc1_str = NULL;
  48. const char *desc_out;
  49. ed25519_keypair_t signing_kp1;
  50. hs_descriptor_t *desc1 = NULL;
  51. (void) arg;
  52. init_test();
  53. /* Generate a valid descriptor with normal values. */
  54. ret = ed25519_keypair_generate(&signing_kp1, 0);
  55. tt_int_op(ret, OP_EQ, 0);
  56. desc1 = hs_helper_build_hs_desc_with_ip(&signing_kp1);
  57. tt_assert(desc1);
  58. ret = hs_desc_encode_descriptor(desc1, &signing_kp1, NULL, &desc1_str);
  59. tt_int_op(ret, OP_EQ, 0);
  60. /* Very first basic test, should be able to be stored, survive a
  61. * clean, found with a lookup and then cleaned by our OOM. */
  62. {
  63. ret = hs_cache_store_as_dir(desc1_str);
  64. tt_int_op(ret, OP_EQ, 0);
  65. /* Re-add, it should fail since we already have it. */
  66. ret = hs_cache_store_as_dir(desc1_str);
  67. tt_int_op(ret, OP_EQ, -1);
  68. /* Try to clean now which should be fine, there is at worst few seconds
  69. * between the store and this call. */
  70. hs_cache_clean_as_dir(time(NULL));
  71. /* We should find it in our cache. */
  72. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  73. tt_int_op(ret, OP_EQ, 1);
  74. tt_str_op(desc_out, OP_EQ, desc1_str);
  75. /* Tell our OOM to run and to at least remove a byte which will result in
  76. * removing the descriptor from our cache. */
  77. oom_size = hs_cache_handle_oom(time(NULL), 1);
  78. tt_int_op(oom_size, OP_GE, 1);
  79. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  80. tt_int_op(ret, OP_EQ, 0);
  81. }
  82. /* Store two descriptors and remove the expiring one only. */
  83. {
  84. ed25519_keypair_t signing_kp_zero;
  85. ret = ed25519_keypair_generate(&signing_kp_zero, 0);
  86. tt_int_op(ret, OP_EQ, 0);
  87. hs_descriptor_t *desc_zero_lifetime;
  88. desc_zero_lifetime = hs_helper_build_hs_desc_with_ip(&signing_kp_zero);
  89. tt_assert(desc_zero_lifetime);
  90. desc_zero_lifetime->plaintext_data.revision_counter = 1;
  91. desc_zero_lifetime->plaintext_data.lifetime_sec = 0;
  92. char *desc_zero_lifetime_str;
  93. ret = hs_desc_encode_descriptor(desc_zero_lifetime, &signing_kp_zero,
  94. NULL, &desc_zero_lifetime_str);
  95. tt_int_op(ret, OP_EQ, 0);
  96. ret = hs_cache_store_as_dir(desc1_str);
  97. tt_int_op(ret, OP_EQ, 0);
  98. ret = hs_cache_store_as_dir(desc_zero_lifetime_str);
  99. tt_int_op(ret, OP_EQ, 0);
  100. /* This one should clear out our zero lifetime desc. */
  101. hs_cache_clean_as_dir(time(NULL));
  102. /* We should find desc1 in our cache. */
  103. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  104. tt_int_op(ret, OP_EQ, 1);
  105. tt_str_op(desc_out, OP_EQ, desc1_str);
  106. /* We should NOT find our zero lifetime desc in our cache. */
  107. ret = hs_cache_lookup_as_dir(3,
  108. helper_get_hsdir_query(desc_zero_lifetime),
  109. NULL);
  110. tt_int_op(ret, OP_EQ, 0);
  111. /* Cleanup our entire cache. */
  112. oom_size = hs_cache_handle_oom(time(NULL), 1);
  113. tt_int_op(oom_size, OP_GE, 1);
  114. hs_descriptor_free(desc_zero_lifetime);
  115. tor_free(desc_zero_lifetime_str);
  116. }
  117. /* Throw junk at it. */
  118. {
  119. ret = hs_cache_store_as_dir("blah");
  120. tt_int_op(ret, OP_EQ, -1);
  121. /* Poor attempt at tricking the decoding. */
  122. ret = hs_cache_store_as_dir("hs-descriptor 3\nJUNK");
  123. tt_int_op(ret, OP_EQ, -1);
  124. /* Undecodable base64 query. */
  125. ret = hs_cache_lookup_as_dir(3, "blah", NULL);
  126. tt_int_op(ret, OP_EQ, -1);
  127. /* Decodable base64 query but wrong ed25519 size. */
  128. ret = hs_cache_lookup_as_dir(3, "dW5pY29ybg==", NULL);
  129. tt_int_op(ret, OP_EQ, -1);
  130. }
  131. /* Test descriptor replacement with revision counter. */
  132. {
  133. char *new_desc_str;
  134. /* Add a descriptor. */
  135. ret = hs_cache_store_as_dir(desc1_str);
  136. tt_int_op(ret, OP_EQ, 0);
  137. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  138. tt_int_op(ret, OP_EQ, 1);
  139. /* Bump revision counter. */
  140. desc1->plaintext_data.revision_counter++;
  141. ret = hs_desc_encode_descriptor(desc1, &signing_kp1, NULL, &new_desc_str);
  142. tt_int_op(ret, OP_EQ, 0);
  143. ret = hs_cache_store_as_dir(new_desc_str);
  144. tt_int_op(ret, OP_EQ, 0);
  145. /* Look it up, it should have been replaced. */
  146. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  147. tt_int_op(ret, OP_EQ, 1);
  148. tt_str_op(desc_out, OP_EQ, new_desc_str);
  149. tor_free(new_desc_str);
  150. }
  151. done:
  152. hs_descriptor_free(desc1);
  153. tor_free(desc1_str);
  154. }
  155. static void
  156. test_clean_as_dir(void *arg)
  157. {
  158. size_t ret;
  159. char *desc1_str = NULL;
  160. time_t now = time(NULL);
  161. hs_descriptor_t *desc1 = NULL;
  162. ed25519_keypair_t signing_kp1;
  163. (void) arg;
  164. init_test();
  165. /* Generate a valid descriptor with values. */
  166. ret = ed25519_keypair_generate(&signing_kp1, 0);
  167. tt_int_op(ret, OP_EQ, 0);
  168. desc1 = hs_helper_build_hs_desc_with_ip(&signing_kp1);
  169. tt_assert(desc1);
  170. ret = hs_desc_encode_descriptor(desc1, &signing_kp1, NULL, &desc1_str);
  171. tt_int_op(ret, OP_EQ, 0);
  172. ret = hs_cache_store_as_dir(desc1_str);
  173. tt_int_op(ret, OP_EQ, 0);
  174. /* With the lifetime being 3 hours, a cleanup shouldn't remove it. */
  175. ret = cache_clean_v3_as_dir(now, 0);
  176. tt_int_op(ret, OP_EQ, 0);
  177. /* Should be present after clean up. */
  178. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  179. tt_int_op(ret, OP_EQ, 1);
  180. /* Set a cutoff 100 seconds in the past. It should not remove the entry
  181. * since the entry is still recent enough. */
  182. ret = cache_clean_v3_as_dir(now, now - 100);
  183. tt_int_op(ret, OP_EQ, 0);
  184. /* Should be present after clean up. */
  185. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  186. tt_int_op(ret, OP_EQ, 1);
  187. /* Set a cutoff of 100 seconds in the future. It should remove the entry
  188. * that we've just added since it's not too old for the cutoff. */
  189. ret = cache_clean_v3_as_dir(now, now + 100);
  190. tt_int_op(ret, OP_GT, 0);
  191. /* Shouldn't be present after clean up. */
  192. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  193. tt_int_op(ret, OP_EQ, 0);
  194. done:
  195. hs_descriptor_free(desc1);
  196. tor_free(desc1_str);
  197. }
  198. /* Test helper: Fetch an HS descriptor from an HSDir (for the hidden service
  199. with <b>blinded_key</b>. Return the received descriptor string. */
  200. static char *
  201. helper_fetch_desc_from_hsdir(const ed25519_public_key_t *blinded_key)
  202. {
  203. int retval;
  204. char *received_desc = NULL;
  205. char *hsdir_query_str = NULL;
  206. /* The dir conn we are going to simulate */
  207. dir_connection_t *conn = NULL;
  208. /* First extract the blinded public key that we are going to use in our
  209. query, and then build the actual query string. */
  210. {
  211. char hsdir_cache_key[ED25519_BASE64_LEN+1];
  212. retval = ed25519_public_to_base64(hsdir_cache_key,
  213. blinded_key);
  214. tt_int_op(retval, OP_EQ, 0);
  215. tor_asprintf(&hsdir_query_str, GET("/tor/hs/3/%s"), hsdir_cache_key);
  216. }
  217. /* Simulate an HTTP GET request to the HSDir */
  218. conn = dir_connection_new(AF_INET);
  219. tor_addr_from_ipv4h(&conn->base_.addr, 0x7f000001);
  220. TO_CONN(conn)->linked = 1;/* Pretend the conn is encrypted :) */
  221. retval = directory_handle_command_get(conn, hsdir_query_str,
  222. NULL, 0);
  223. tt_int_op(retval, OP_EQ, 0);
  224. /* Read the descriptor that the HSDir just served us */
  225. {
  226. char *headers = NULL;
  227. size_t body_used = 0;
  228. fetch_from_buf_http(TO_CONN(conn)->outbuf, &headers, MAX_HEADERS_SIZE,
  229. &received_desc, &body_used, HS_DESC_MAX_LEN, 0);
  230. tor_free(headers);
  231. }
  232. done:
  233. tor_free(hsdir_query_str);
  234. if (conn)
  235. connection_free_minimal(TO_CONN(conn));
  236. return received_desc;
  237. }
  238. /* Publish a descriptor to the HSDir, then fetch it. Check that the received
  239. descriptor matches the published one. */
  240. static void
  241. test_upload_and_download_hs_desc(void *arg)
  242. {
  243. int retval;
  244. hs_descriptor_t *published_desc = NULL;
  245. char *published_desc_str = NULL;
  246. char *received_desc_str = NULL;
  247. (void) arg;
  248. /* Initialize HSDir cache subsystem */
  249. init_test();
  250. /* Test a descriptor not found in the directory cache. */
  251. {
  252. ed25519_public_key_t blinded_key;
  253. memset(&blinded_key.pubkey, 'A', sizeof(blinded_key.pubkey));
  254. received_desc_str = helper_fetch_desc_from_hsdir(&blinded_key);
  255. tt_int_op(strlen(received_desc_str), OP_EQ, 0);
  256. tor_free(received_desc_str);
  257. }
  258. /* Generate a valid descriptor with normal values. */
  259. {
  260. ed25519_keypair_t signing_kp;
  261. retval = ed25519_keypair_generate(&signing_kp, 0);
  262. tt_int_op(retval, OP_EQ, 0);
  263. published_desc = hs_helper_build_hs_desc_with_ip(&signing_kp);
  264. tt_assert(published_desc);
  265. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  266. NULL, &published_desc_str);
  267. tt_int_op(retval, OP_EQ, 0);
  268. }
  269. /* Publish descriptor to the HSDir */
  270. {
  271. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  272. tt_int_op(retval, OP_EQ, 200);
  273. }
  274. /* Simulate a fetch of the previously published descriptor */
  275. {
  276. const ed25519_public_key_t *blinded_key;
  277. blinded_key = &published_desc->plaintext_data.blinded_pubkey;
  278. received_desc_str = helper_fetch_desc_from_hsdir(blinded_key);
  279. }
  280. /* Verify we received the exact same descriptor we published earlier */
  281. tt_str_op(received_desc_str, OP_EQ, published_desc_str);
  282. tor_free(received_desc_str);
  283. /* With a valid descriptor in the directory cache, try again an invalid. */
  284. {
  285. ed25519_public_key_t blinded_key;
  286. memset(&blinded_key.pubkey, 'A', sizeof(blinded_key.pubkey));
  287. received_desc_str = helper_fetch_desc_from_hsdir(&blinded_key);
  288. tt_int_op(strlen(received_desc_str), OP_EQ, 0);
  289. }
  290. done:
  291. tor_free(received_desc_str);
  292. tor_free(published_desc_str);
  293. hs_descriptor_free(published_desc);
  294. }
  295. /* Test that HSDirs reject outdated descriptors based on their revision
  296. * counter. Also test that HSDirs correctly replace old descriptors with newer
  297. * descriptors. */
  298. static void
  299. test_hsdir_revision_counter_check(void *arg)
  300. {
  301. int retval;
  302. ed25519_keypair_t signing_kp;
  303. hs_descriptor_t *published_desc = NULL;
  304. char *published_desc_str = NULL;
  305. uint8_t subcredential[DIGEST256_LEN];
  306. char *received_desc_str = NULL;
  307. hs_descriptor_t *received_desc = NULL;
  308. (void) arg;
  309. /* Initialize HSDir cache subsystem */
  310. init_test();
  311. /* Generate a valid descriptor with normal values. */
  312. {
  313. retval = ed25519_keypair_generate(&signing_kp, 0);
  314. tt_int_op(retval, OP_EQ, 0);
  315. published_desc = hs_helper_build_hs_desc_with_ip(&signing_kp);
  316. tt_assert(published_desc);
  317. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  318. NULL, &published_desc_str);
  319. tt_int_op(retval, OP_EQ, 0);
  320. }
  321. /* Publish descriptor to the HSDir */
  322. {
  323. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  324. tt_int_op(retval, OP_EQ, 200);
  325. }
  326. /* Try publishing again with the same revision counter: Should fail. */
  327. {
  328. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  329. tt_int_op(retval, OP_EQ, 400);
  330. }
  331. /* Fetch the published descriptor and validate the revision counter. */
  332. {
  333. const ed25519_public_key_t *blinded_key;
  334. blinded_key = &published_desc->plaintext_data.blinded_pubkey;
  335. hs_get_subcredential(&signing_kp.pubkey, blinded_key, subcredential);
  336. received_desc_str = helper_fetch_desc_from_hsdir(blinded_key);
  337. retval = hs_desc_decode_descriptor(received_desc_str,
  338. subcredential, NULL, &received_desc);
  339. tt_int_op(retval, OP_EQ, 0);
  340. tt_assert(received_desc);
  341. /* Check that the revision counter is correct */
  342. tt_u64_op(received_desc->plaintext_data.revision_counter, OP_EQ, 42);
  343. hs_descriptor_free(received_desc);
  344. received_desc = NULL;
  345. tor_free(received_desc_str);
  346. }
  347. /* Increment the revision counter and try again. Should work. */
  348. {
  349. published_desc->plaintext_data.revision_counter = 1313;
  350. tor_free(published_desc_str);
  351. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  352. NULL, &published_desc_str);
  353. tt_int_op(retval, OP_EQ, 0);
  354. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  355. tt_int_op(retval, OP_EQ, 200);
  356. }
  357. /* Again, fetch the published descriptor and perform the revision counter
  358. validation. The revision counter must have changed. */
  359. {
  360. const ed25519_public_key_t *blinded_key;
  361. blinded_key = &published_desc->plaintext_data.blinded_pubkey;
  362. received_desc_str = helper_fetch_desc_from_hsdir(blinded_key);
  363. retval = hs_desc_decode_descriptor(received_desc_str,
  364. subcredential, NULL, &received_desc);
  365. tt_int_op(retval, OP_EQ, 0);
  366. tt_assert(received_desc);
  367. /* Check that the revision counter is the latest */
  368. tt_u64_op(received_desc->plaintext_data.revision_counter, OP_EQ, 1313);
  369. }
  370. done:
  371. hs_descriptor_free(published_desc);
  372. hs_descriptor_free(received_desc);
  373. tor_free(received_desc_str);
  374. tor_free(published_desc_str);
  375. }
  376. static networkstatus_t mock_ns;
  377. static networkstatus_t *
  378. mock_networkstatus_get_live_consensus(time_t now)
  379. {
  380. (void) now;
  381. return &mock_ns;
  382. }
  383. /** Test that we can store HS descriptors in the client HS cache. */
  384. static void
  385. test_client_cache(void *arg)
  386. {
  387. int retval;
  388. ed25519_keypair_t signing_kp;
  389. hs_descriptor_t *published_desc = NULL;
  390. char *published_desc_str = NULL;
  391. uint8_t wanted_subcredential[DIGEST256_LEN];
  392. response_handler_args_t *args = NULL;
  393. dir_connection_t *conn = NULL;
  394. (void) arg;
  395. /* Initialize HSDir cache subsystem */
  396. init_test();
  397. MOCK(networkstatus_get_live_consensus,
  398. mock_networkstatus_get_live_consensus);
  399. /* Set consensus time */
  400. parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
  401. &mock_ns.valid_after);
  402. parse_rfc1123_time("Sat, 26 Oct 1985 14:00:00 UTC",
  403. &mock_ns.fresh_until);
  404. parse_rfc1123_time("Sat, 26 Oct 1985 16:00:00 UTC",
  405. &mock_ns.valid_until);
  406. /* Generate a valid descriptor with normal values. */
  407. {
  408. retval = ed25519_keypair_generate(&signing_kp, 0);
  409. tt_int_op(retval, OP_EQ, 0);
  410. published_desc = hs_helper_build_hs_desc_with_ip(&signing_kp);
  411. tt_assert(published_desc);
  412. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  413. NULL, &published_desc_str);
  414. tt_int_op(retval, OP_EQ, 0);
  415. memcpy(wanted_subcredential, published_desc->subcredential, DIGEST256_LEN);
  416. tt_assert(!tor_mem_is_zero((char*)wanted_subcredential, DIGEST256_LEN));
  417. }
  418. /* Test handle_response_fetch_hsdesc_v3() */
  419. {
  420. args = tor_malloc_zero(sizeof(response_handler_args_t));
  421. args->status_code = 200;
  422. args->reason = NULL;
  423. args->body = published_desc_str;
  424. args->body_len = strlen(published_desc_str);
  425. conn = tor_malloc_zero(sizeof(dir_connection_t));
  426. conn->hs_ident = tor_malloc_zero(sizeof(hs_ident_dir_conn_t));
  427. ed25519_pubkey_copy(&conn->hs_ident->identity_pk, &signing_kp.pubkey);
  428. }
  429. /* store the descriptor! */
  430. retval = handle_response_fetch_hsdesc_v3(conn, args);
  431. tt_int_op(retval, == , 0);
  432. /* Progress time a bit and attempt to clean cache: our desc should not be
  433. * cleaned since we still in the same TP. */
  434. {
  435. parse_rfc1123_time("Sat, 27 Oct 1985 02:00:00 UTC",
  436. &mock_ns.valid_after);
  437. parse_rfc1123_time("Sat, 27 Oct 1985 03:00:00 UTC",
  438. &mock_ns.fresh_until);
  439. parse_rfc1123_time("Sat, 27 Oct 1985 05:00:00 UTC",
  440. &mock_ns.valid_until);
  441. /* fetch the descriptor and make sure it's there */
  442. const hs_descriptor_t *cached_desc = NULL;
  443. cached_desc = hs_cache_lookup_as_client(&signing_kp.pubkey);
  444. tt_assert(cached_desc);
  445. tt_mem_op(cached_desc->subcredential, OP_EQ, wanted_subcredential,
  446. DIGEST256_LEN);
  447. }
  448. /* Progress time to next TP and check that desc was cleaned */
  449. {
  450. parse_rfc1123_time("Sat, 27 Oct 1985 12:00:00 UTC",
  451. &mock_ns.valid_after);
  452. parse_rfc1123_time("Sat, 27 Oct 1985 13:00:00 UTC",
  453. &mock_ns.fresh_until);
  454. parse_rfc1123_time("Sat, 27 Oct 1985 15:00:00 UTC",
  455. &mock_ns.valid_until);
  456. const hs_descriptor_t *cached_desc = NULL;
  457. cached_desc = hs_cache_lookup_as_client(&signing_kp.pubkey);
  458. tt_assert(!cached_desc);
  459. }
  460. done:
  461. tor_free(args);
  462. hs_descriptor_free(published_desc);
  463. tor_free(published_desc_str);
  464. if (conn) {
  465. tor_free(conn->hs_ident);
  466. tor_free(conn);
  467. }
  468. }
  469. struct testcase_t hs_cache[] = {
  470. /* Encoding tests. */
  471. { "directory", test_directory, TT_FORK,
  472. NULL, NULL },
  473. { "clean_as_dir", test_clean_as_dir, TT_FORK,
  474. NULL, NULL },
  475. { "hsdir_revision_counter_check", test_hsdir_revision_counter_check, TT_FORK,
  476. NULL, NULL },
  477. { "upload_and_download_hs_desc", test_upload_and_download_hs_desc, TT_FORK,
  478. NULL, NULL },
  479. { "client_cache", test_client_cache, TT_FORK,
  480. NULL, NULL },
  481. END_OF_TESTCASES
  482. };