Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
The Tor Project
Core
Tor
Commits
1bbea670
Commit
1bbea670
authored
21 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Remove the last vestige of code that claims to know the inner structure of an onion on the network
svn:r239
parent
05b52ad8
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
src/or/circuit.c
+3
-2
3 additions, 2 deletions
src/or/circuit.c
src/or/onion.c
+6
-4
6 additions, 4 deletions
src/or/onion.c
with
9 additions
and
6 deletions
src/or/circuit.c
+
3
−
2
View file @
1bbea670
...
...
@@ -144,7 +144,7 @@ int circuit_init(circuit_t *circ, int aci_type, onion_layer_t *layer) {
unsigned
char
digest1
[
20
];
unsigned
char
digest2
[
20
];
struct
timeval
start
,
end
;
int
time_passed
;
int
time_passed
;
assert
(
circ
&&
circ
->
onion
);
...
...
@@ -166,7 +166,8 @@ int circuit_init(circuit_t *circ, int aci_type, onion_layer_t *layer) {
my_gettimeofday
(
&
end
);
if
(
tv_udiff
(
&
start
,
&
end
)
>
1000
)
{
/* more than 1ms */
time_passed
=
tv_udiff
(
&
start
,
&
end
);
if
(
time_passed
>
1000
)
{
/* more than 1ms */
log
(
LOG_NOTICE
,
"circuit_init(): get_unique_aci just took %d us!"
,
time_passed
);
}
...
...
This diff is collapsed.
Click to expand it.
src/or/onion.c
+
6
−
4
View file @
1bbea670
...
...
@@ -9,7 +9,8 @@ extern or_options_t options; /* command-line and config-file options */
static
int
onion_process
(
circuit_t
*
circ
);
static
int
onion_deliver_to_conn
(
aci_t
aci
,
unsigned
char
*
onion
,
uint32_t
onionlen
,
connection_t
*
conn
);
static
int
count_acceptable_routers
(
routerinfo_t
**
rarray
,
int
rarray_len
);
static
int
find_tracked_onion
(
unsigned
char
*
onion
,
uint32_t
onionlen
);
static
int
find_tracked_onion
(
unsigned
char
*
onion
,
uint32_t
onionlen
,
int
expire
);
int
decide_aci_type
(
uint32_t
local_addr
,
uint16_t
local_port
,
uint32_t
remote_addr
,
uint16_t
remote_port
)
{
...
...
@@ -245,7 +246,7 @@ static int onion_process(circuit_t *circ) {
}
/* check for replay. at the same time, add it to the pile of tracked onions. */
if
(
find_tracked_onion
(
circ
->
onion
,
circ
->
onionlen
))
{
if
(
find_tracked_onion
(
circ
->
onion
,
circ
->
onionlen
,
layer
.
expire
))
{
log
(
LOG_NOTICE
,
"process_onion(): I have just received a replayed onion. This could be a replay attack."
);
return
-
1
;
}
...
...
@@ -756,7 +757,8 @@ void init_tracked_tree(void) {
/* see if this onion has been seen before. if so, return 1, else
* return 0 and add the sha1 of this onion to the tree.
*/
static
int
find_tracked_onion
(
unsigned
char
*
onion
,
uint32_t
onionlen
)
{
static
int
find_tracked_onion
(
unsigned
char
*
onion
,
uint32_t
onionlen
,
int
expire
)
{
static
struct
tracked_onion
*
head_tracked_onions
=
NULL
;
/* linked list of tracked onions */
static
struct
tracked_onion
*
tail_tracked_onions
=
NULL
;
...
...
@@ -791,7 +793,7 @@ static int find_tracked_onion(unsigned char *onion, uint32_t onionlen) {
/* this is a new onion. add it to the list. */
to
->
expire
=
ntohl
(
*
(
uint32_t
*
)(
onion
+
7
))
;
/* set the expiration date */
to
->
expire
=
expire
;
/* set the expiration date */
to
->
next
=
NULL
;
if
(
!
head_tracked_onions
)
{
...
...
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