summaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorSuphanat Chunhapanya <haxx.pop@gmail.com>2018-04-22 20:51:21 +0700
committerDavid Goulet <dgoulet@torproject.org>2018-09-07 14:02:43 -0400
commit53dd1699baf5cb09086644eaca239596aedbde15 (patch)
tree82ae25fcad8165ee109be50aa878101789ea81af /src/feature
parent69fb25b0f6f3c2e7397b3f5e49213025ab1e8173 (diff)
downloadtor-53dd1699baf5cb09086644eaca239596aedbde15.tar.gz
tor-53dd1699baf5cb09086644eaca239596aedbde15.zip
hs-v3: Re-enable the decoding in the encoding function
Previously, the validation by decoding a created descriptor was disabled because the interface had to be entirely changed and not implemented at the time. This commit re-enabled it because it is now implemented. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/hs/hs_descriptor.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/feature/hs/hs_descriptor.c b/src/feature/hs/hs_descriptor.c
index 3f9b505cbd..52b0802714 100644
--- a/src/feature/hs/hs_descriptor.c
+++ b/src/feature/hs/hs_descriptor.c
@@ -2705,14 +2705,16 @@ hs_desc_encode_descriptor,(const hs_descriptor_t *desc,
goto err;
}
- /* Try to decode what we just encoded. Symmetry is nice! */
- /* XXX: I need to disable this assertation for now to make the test pass.
- * I will enable it again when I finish writing the decoding */
- /* ret = hs_desc_decode_descriptor(*encoded_out, */
- /* desc->subcredential, NULL); */
- /* if (BUG(ret < 0)) { */
- /* goto err; */
- /* } */
+ /* Try to decode what we just encoded. Symmetry is nice!, but it is
+ * symmetric only if the client auth is disabled. That is, the descriptor
+ * cookie will be NULL. */
+ if (!descriptor_cookie) {
+ ret = hs_desc_decode_descriptor(*encoded_out, desc->subcredential,
+ NULL, NULL);
+ if (BUG(ret < 0)) {
+ goto err;
+ }
+ }
return 0;