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
ec0f0004
Commit
ec0f0004
authored
4 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'maint-0.4.3' into maint-0.4.4
parents
b0e6ec62
0b2c64ef
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
changes/bug40080
+6
-0
6 additions, 0 deletions
changes/bug40080
src/core/or/channel.c
+1
-1
1 addition, 1 deletion
src/core/or/channel.c
src/core/or/channel.h
+3
-0
3 additions, 0 deletions
src/core/or/channel.h
src/core/or/circuitbuild.c
+20
-4
20 additions, 4 deletions
src/core/or/circuitbuild.c
with
30 additions
and
5 deletions
changes/bug40080
0 → 100644
+
6
−
0
View file @
ec0f0004
o Minor bugfixes (security):
- When completing a channel, relays now check more thoroughly to make
sure that it matches any pending circuits before attaching those
circuits. Previously, address correctness and Ed25519 identities were not
checked in this case, but only when extending circuits on an existing
channel. Fixes bug 40080; bugfix on 0.2.7.2-alpha.
This diff is collapsed.
Click to expand it.
src/core/or/channel.c
+
1
−
1
View file @
ec0f0004
...
@@ -670,7 +670,7 @@ channel_find_by_global_id(uint64_t global_identifier)
...
@@ -670,7 +670,7 @@ channel_find_by_global_id(uint64_t global_identifier)
/** Return true iff <b>chan</b> matches <b>rsa_id_digest</b> and <b>ed_id</b>.
/** Return true iff <b>chan</b> matches <b>rsa_id_digest</b> and <b>ed_id</b>.
* as its identity keys. If either is NULL, do not check for a match. */
* as its identity keys. If either is NULL, do not check for a match. */
static
int
int
channel_remote_identity_matches
(
const
channel_t
*
chan
,
channel_remote_identity_matches
(
const
channel_t
*
chan
,
const
char
*
rsa_id_digest
,
const
char
*
rsa_id_digest
,
const
ed25519_public_key_t
*
ed_id
)
const
ed25519_public_key_t
*
ed_id
)
...
...
This diff is collapsed.
Click to expand it.
src/core/or/channel.h
+
3
−
0
View file @
ec0f0004
...
@@ -735,6 +735,9 @@ int channel_is_outgoing(channel_t *chan);
...
@@ -735,6 +735,9 @@ int channel_is_outgoing(channel_t *chan);
void
channel_mark_client
(
channel_t
*
chan
);
void
channel_mark_client
(
channel_t
*
chan
);
void
channel_clear_client
(
channel_t
*
chan
);
void
channel_clear_client
(
channel_t
*
chan
);
int
channel_matches_extend_info
(
channel_t
*
chan
,
extend_info_t
*
extend_info
);
int
channel_matches_extend_info
(
channel_t
*
chan
,
extend_info_t
*
extend_info
);
int
channel_remote_identity_matches
(
const
channel_t
*
chan
,
const
char
*
rsa_id_digest
,
const
ed25519_public_key_t
*
ed_id
);
unsigned
int
channel_num_circuits
(
channel_t
*
chan
);
unsigned
int
channel_num_circuits
(
channel_t
*
chan
);
MOCK_DECL
(
void
,
channel_set_circid_type
,(
channel_t
*
chan
,
MOCK_DECL
(
void
,
channel_set_circid_type
,(
channel_t
*
chan
,
crypto_pk_t
*
identity_rcvd
,
crypto_pk_t
*
identity_rcvd
,
...
...
This diff is collapsed.
Click to expand it.
src/core/or/circuitbuild.c
+
20
−
4
View file @
ec0f0004
...
@@ -643,21 +643,37 @@ circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits)
...
@@ -643,21 +643,37 @@ circuit_n_chan_done(channel_t *chan, int status, int close_origin_circuits)
circ
->
state
!=
CIRCUIT_STATE_CHAN_WAIT
)
circ
->
state
!=
CIRCUIT_STATE_CHAN_WAIT
)
continue
;
continue
;
if
(
tor_digest_is_zero
(
circ
->
n_hop
->
identity_digest
))
{
const
char
*
rsa_ident
=
NULL
;
const
ed25519_public_key_t
*
ed_ident
=
NULL
;
if
(
!
tor_digest_is_zero
(
circ
->
n_hop
->
identity_digest
))
{
rsa_ident
=
circ
->
n_hop
->
identity_digest
;
}
if
(
!
ed25519_public_key_is_zero
(
&
circ
->
n_hop
->
ed_identity
))
{
ed_ident
=
&
circ
->
n_hop
->
ed_identity
;
}
if
(
rsa_ident
==
NULL
&&
ed_ident
==
NULL
)
{
/* Look at addr/port. This is an unkeyed connection. */
/* Look at addr/port. This is an unkeyed connection. */
if
(
!
channel_matches_extend_info
(
chan
,
circ
->
n_hop
))
if
(
!
channel_matches_extend_info
(
chan
,
circ
->
n_hop
))
continue
;
continue
;
}
else
{
}
else
{
/* We expected a key. See if it's the right one. */
/* We expected a key or keys. See if they matched. */
if
(
tor_memneq
(
chan
->
identity_digest
,
if
(
!
channel_remote_identity_matches
(
chan
,
rsa_ident
,
ed_ident
))
circ
->
n_hop
->
identity_digest
,
DIGEST_LEN
))
continue
;
continue
;
/* If the channel is canonical, great. If not, it needs to match
* the requested address exactly. */
if
(
!
chan
->
is_canonical
&&
!
channel_matches_extend_info
(
chan
,
circ
->
n_hop
))
{
continue
;
}
}
}
if
(
!
status
)
{
/* chan failed; close circ */
if
(
!
status
)
{
/* chan failed; close circ */
log_info
(
LD_CIRC
,
"Channel failed; closing circ."
);
log_info
(
LD_CIRC
,
"Channel failed; closing circ."
);
circuit_mark_for_close
(
circ
,
END_CIRC_REASON_CHANNEL_CLOSED
);
circuit_mark_for_close
(
circ
,
END_CIRC_REASON_CHANNEL_CLOSED
);
continue
;
continue
;
}
}
if
(
close_origin_circuits
&&
CIRCUIT_IS_ORIGIN
(
circ
))
{
if
(
close_origin_circuits
&&
CIRCUIT_IS_ORIGIN
(
circ
))
{
log_info
(
LD_CIRC
,
"Channel deprecated for origin circs; closing circ."
);
log_info
(
LD_CIRC
,
"Channel deprecated for origin circs; closing circ."
);
circuit_mark_for_close
(
circ
,
END_CIRC_REASON_CHANNEL_CLOSED
);
circuit_mark_for_close
(
circ
,
END_CIRC_REASON_CHANNEL_CLOSED
);
...
...
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