summaryrefslogtreecommitdiff
path: root/src/or/hs_descriptor.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2016-03-15 14:18:03 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-11-04 10:29:28 -0400
commit473f99bf7bdb7d23b914cd1b590451333baaf7fe (patch)
tree18e1c2514a0677442752cc1eeadfa6e881934d71 /src/or/hs_descriptor.h
parentcff1fd63f16e83e4620afc9a8219f44e8b88b592 (diff)
downloadtor-473f99bf7bdb7d23b914cd1b590451333baaf7fe.tar.gz
tor-473f99bf7bdb7d23b914cd1b590451333baaf7fe.zip
test: Add prop224 descriptor unit tests
Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or/hs_descriptor.h')
-rw-r--r--src/or/hs_descriptor.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/or/hs_descriptor.h b/src/or/hs_descriptor.h
index 7ee686118e..9b48096d0e 100644
--- a/src/or/hs_descriptor.h
+++ b/src/or/hs_descriptor.h
@@ -207,4 +207,29 @@ int hs_desc_decode_plaintext(const char *encoded,
int hs_desc_decode_encrypted(const hs_descriptor_t *desc,
hs_desc_encrypted_data_t *desc_out);
+#ifdef HS_DESCRIPTOR_PRIVATE
+
+/* Encoding. */
+STATIC int encode_cert(const tor_cert_t *cert, char **cert_str_out);
+STATIC char *encode_link_specifiers(const smartlist_t *specs);
+STATIC size_t build_plaintext_padding(const char *plaintext,
+ size_t plaintext_len,
+ uint8_t **padded_out);
+/* Decoding. */
+STATIC smartlist_t *decode_link_specifiers(const char *encoded);
+STATIC hs_desc_intro_point_t *decode_introduction_point(
+ const hs_descriptor_t *desc,
+ const char *text);
+STATIC int decode_intro_points(const hs_descriptor_t *desc,
+ hs_desc_encrypted_data_t *desc_enc,
+ const char *data);
+STATIC int encrypted_data_length_is_valid(size_t len);
+STATIC int cert_is_valid(tor_cert_t *cert, uint8_t type,
+ const char *log_obj_type);
+STATIC int desc_sig_is_valid(const char *b64_sig,
+ const ed25519_keypair_t *signing_kp,
+ const char *encoded_desc, size_t encoded_len);
+
+#endif /* HS_DESCRIPTOR_PRIVATE */
+
#endif /* TOR_HS_DESCRIPTOR_H */