Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jarl
tor
Commits
a23c581d
Commit
a23c581d
authored
8 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'teor/bug20864-029' into maint-0.2.9
parents
0d0c7a11
ebf243bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug20864
+4
-0
4 additions, 0 deletions
changes/bug20864
src/test/test_hs.c
+8
-5
8 additions, 5 deletions
src/test/test_hs.c
with
12 additions
and
5 deletions
changes/bug20864
0 → 100644
+
4
−
0
View file @
a23c581d
o Minor bugfixes (hidden services):
- Remove a double-free in the single onion service unit test. Stop
ignoring a return value. Make future changes less error-prone.
Fixes bug 20864; bugfix on 20638; not in any released version of tor.
This diff is collapsed.
Click to expand it.
src/test/test_hs.c
+
8
−
5
View file @
a23c581d
...
...
@@ -541,6 +541,7 @@ test_single_onion_poisoning(void *arg)
rend_service_t
*
service_2
=
tor_malloc_zero
(
sizeof
(
rend_service_t
));
char
*
dir2
=
tor_strdup
(
get_fname_rnd
(
"test_hs_dir2"
));
smartlist_t
*
services
=
smartlist_new
();
char
*
poison_path
=
NULL
;
/* No services, no service to verify, no problem! */
mock_options
->
HiddenServiceSingleHopMode
=
0
;
...
...
@@ -569,8 +570,8 @@ test_single_onion_poisoning(void *arg)
tt_assert
(
ret
==
0
);
}
service_1
->
directory
=
dir1
;
service_2
->
directory
=
dir2
;
service_1
->
directory
=
tor_strdup
(
dir1
)
;
service_2
->
directory
=
tor_strdup
(
dir2
)
;
/* The services own the directory pointers now */
dir1
=
dir2
=
NULL
;
/* Add port to service 1 */
...
...
@@ -687,6 +688,7 @@ test_single_onion_poisoning(void *arg)
/* Now add the second service: it has no key and no poison file */
ret
=
rend_service_check_dir_and_add
(
services
,
mock_options
,
service_2
,
0
);
tt_assert
(
ret
==
0
);
/* A new service, and an existing poisoned service. Not ok. */
mock_options
->
HiddenServiceSingleHopMode
=
0
;
...
...
@@ -706,9 +708,9 @@ test_single_onion_poisoning(void *arg)
/* Now remove the poisoning from the first service, and we have the opposite
* problem. */
char
*
poison_path
=
rend_service_sos_poison_path
(
service_1
);
poison_path
=
rend_service_sos_poison_path
(
service_1
);
tt_assert
(
poison_path
);
ret
=
unlink
(
poison_path
);
tor_free
(
poison_path
);
tt_assert
(
ret
==
0
);
/* Unpoisoned service directories with previous keys are ok, as are empty
...
...
@@ -765,9 +767,10 @@ test_single_onion_poisoning(void *arg)
tt_assert
(
ret
==
0
);
done:
/* The test harness deletes the directories at exit */
tor_free
(
poison_path
);
tor_free
(
dir1
);
tor_free
(
dir2
);
/* The test harness deletes the directories at exit */
smartlist_free
(
services
);
rend_service_free
(
service_1
);
rend_service_free
(
service_2
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment