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
eb0a19c4
Commit
eb0a19c4
authored
20 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
change 0.0.8 extend cell format so it's compatible with 0.0.7
svn:r2094
parent
ca9604e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/circuitbuild.c
+7
-12
7 additions, 12 deletions
src/or/circuitbuild.c
with
7 additions
and
12 deletions
src/or/circuitbuild.c
+
7
−
12
View file @
eb0a19c4
...
...
@@ -401,15 +401,10 @@ int circuit_send_next_onion_skin(circuit_t *circ) {
*
(
uint32_t
*
)
payload
=
htonl
(
hop
->
addr
);
*
(
uint16_t
*
)(
payload
+
4
)
=
htons
(
hop
->
port
);
if
(
strncmp
(
router
->
platform
,
"Tor 0.0.7"
,
9
))
{
/* Before 0.0.8, we didn't support the long payload format. */
memcpy
(
payload
+
2
+
4
,
hop
->
identity_digest
,
DIGEST_LEN
);
onionskin
=
payload
+
2
+
4
+
DIGEST_LEN
;
payload_len
=
2
+
4
+
DIGEST_LEN
+
ONIONSKIN_CHALLENGE_LEN
;
}
else
{
onionskin
=
payload
+
2
+
4
;
payload_len
=
2
+
4
+
ONIONSKIN_CHALLENGE_LEN
;
}
onionskin
=
payload
+
2
+
4
;
memcpy
(
payload
+
2
+
4
+
ONIONSKIN_CHALLENGE_LEN
,
hop
->
identity_digest
,
DIGEST_LEN
);
payload_len
=
2
+
4
+
ONIONSKIN_CHALLENGE_LEN
+
DIGEST_LEN
;
if
(
onion_skin_create
(
router
->
onion_pkey
,
&
(
hop
->
handshake_state
),
onionskin
)
<
0
)
{
log_fn
(
LOG_WARN
,
"onion_skin_create failed."
);
...
...
@@ -450,7 +445,7 @@ int circuit_extend(cell_t *cell, circuit_t *circ) {
/* Once this format is no longer supported, nobody will use
* connection_*_get_by_addr_port. */
old_format
=
1
;
}
else
if
(
rh
.
length
==
4
+
2
+
DIGEST_LEN
+
ONIONSKIN_CHALLENGE_LEN
)
{
}
else
if
(
rh
.
length
==
4
+
2
+
ONIONSKIN_CHALLENGE_LEN
+
DIGEST_LEN
)
{
old_format
=
0
;
}
else
{
log_fn
(
LOG_WARN
,
"Wrong length on extend cell. Closing circuit."
);
...
...
@@ -464,9 +459,9 @@ int circuit_extend(cell_t *cell, circuit_t *circ) {
n_conn
=
connection_twin_get_by_addr_port
(
circ
->
n_addr
,
circ
->
n_port
);
onionskin
=
cell
->
payload
+
RELAY_HEADER_SIZE
+
4
+
2
;
}
else
{
id_digest
=
cell
->
payload
+
RELAY_HEADER_SIZE
+
4
+
2
;
onionskin
=
cell
->
payload
+
RELAY_HEADER_SIZE
+
4
+
2
;
id_digest
=
cell
->
payload
+
RELAY_HEADER_SIZE
+
4
+
2
+
ONIONSKIN_CHALLENGE_LEN
;
n_conn
=
connection_get_by_identity_digest
(
id_digest
,
CONN_TYPE_OR
);
onionskin
=
cell
->
payload
+
RELAY_HEADER_SIZE
+
4
+
2
+
DIGEST_LEN
;
}
if
(
!
n_conn
)
{
/* we should try to open a connection */
...
...
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