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
2ad18ae7
Commit
2ad18ae7
authored
13 years ago
by
Robert Ransom
Committed by
Sebastian Hahn
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow rend_client_send_introduction to fail transiently
i.e. without closing the AP connection.
parent
440e48dd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changes/forget-rend-descs-on-newnym
+4
-0
4 additions, 0 deletions
changes/forget-rend-descs-on-newnym
src/or/circuituse.c
+12
-6
12 additions, 6 deletions
src/or/circuituse.c
src/or/rendclient.c
+10
-10
10 additions, 10 deletions
src/or/rendclient.c
with
26 additions
and
16 deletions
changes/forget-rend-descs-on-newnym
+
4
−
0
View file @
2ad18ae7
...
...
@@ -2,4 +2,8 @@
- Forget all hidden service descriptors cached as a client when
processing a SIGNAL NEWNYM command. Fixes bug 3000. Bugfix on
0.0.6.
o Code simplifications and refactoring:
- Allow rend_client_send_introduction to fail without closing the
AP connection permanently.
This diff is collapsed.
Click to expand it.
src/or/circuituse.c
+
12
−
6
View file @
2ad18ae7
...
...
@@ -1560,14 +1560,20 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
"introduction. (stream %d sec old)"
,
introcirc
->
_base
.
n_circ_id
,
rendcirc
->
_base
.
n_circ_id
,
conn_age
);
if
(
rend_client_send_introduction
(
introcirc
,
rendcirc
)
<
0
)
{
switch
(
rend_client_send_introduction
(
introcirc
,
rendcirc
))
{
case
0
:
/* success */
rendcirc
->
_base
.
timestamp_dirty
=
time
(
NULL
);
introcirc
->
_base
.
timestamp_dirty
=
time
(
NULL
);
assert_circuit_ok
(
TO_CIRCUIT
(
rendcirc
));
assert_circuit_ok
(
TO_CIRCUIT
(
introcirc
));
return
0
;
case
-
1
:
/* transient error */
return
0
;
case
-
2
:
/* permanent error */
return
-
1
;
default:
/* oops */
tor_fragile_assert
();
}
rendcirc
->
_base
.
timestamp_dirty
=
time
(
NULL
);
introcirc
->
_base
.
timestamp_dirty
=
time
(
NULL
);
assert_circuit_ok
(
TO_CIRCUIT
(
rendcirc
));
assert_circuit_ok
(
TO_CIRCUIT
(
introcirc
));
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/or/rendclient.c
+
10
−
10
View file @
2ad18ae7
...
...
@@ -77,7 +77,7 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
log_warn
(
LD_REND
,
"query %s didn't have valid rend desc in cache. Failing."
,
escaped_safe_str
(
introcirc
->
rend_data
->
onion_address
));
goto
err
;
goto
perm_
err
;
}
/* first 20 bytes of payload are the hash of Bob's pk */
...
...
@@ -115,13 +115,13 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
log_info
(
LD_REND
,
"Internal error: could not find intro key; we "
"only have a v2 rend desc with %d intro points."
,
num_intro_points
);
goto
err
;
goto
perm_
err
;
}
}
}
if
(
crypto_pk_get_digest
(
intro_key
,
payload
)
<
0
)
{
log_warn
(
LD_BUG
,
"Internal error: couldn't hash public key."
);
goto
err
;
goto
perm_
err
;
}
/* Initialize the pending_final_cpath and start the DH handshake. */
...
...
@@ -132,11 +132,11 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
cpath
->
magic
=
CRYPT_PATH_MAGIC
;
if
(
!
(
cpath
->
dh_handshake_state
=
crypto_dh_new
(
DH_TYPE_REND
)))
{
log_warn
(
LD_BUG
,
"Internal error: couldn't allocate DH."
);
goto
err
;
goto
perm_
err
;
}
if
(
crypto_dh_generate_public
(
cpath
->
dh_handshake_state
)
<
0
)
{
log_warn
(
LD_BUG
,
"Internal error: couldn't generate g^x."
);
goto
err
;
goto
perm_
err
;
}
}
...
...
@@ -186,7 +186,7 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
if
(
crypto_dh_get_public
(
cpath
->
dh_handshake_state
,
tmp
+
dh_offset
,
DH_KEY_LEN
)
<
0
)
{
log_warn
(
LD_BUG
,
"Internal error: couldn't extract g^x."
);
goto
err
;
goto
perm_
err
;
}
note_crypto_pk_op
(
REND_CLIENT
);
...
...
@@ -199,7 +199,7 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
PK_PKCS1_OAEP_PADDING
,
0
);
if
(
r
<
0
)
{
log_warn
(
LD_BUG
,
"Internal error: hybrid pk encrypt failed."
);
goto
err
;
goto
perm_
err
;
}
payload_len
=
DIGEST_LEN
+
r
;
...
...
@@ -212,17 +212,17 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
introcirc
->
cpath
->
prev
)
<
0
)
{
/* introcirc is already marked for close. leave rendcirc alone. */
log_warn
(
LD_BUG
,
"Couldn't send INTRODUCE1 cell"
);
return
-
1
;
return
-
2
;
}
/* Now, we wait for an ACK or NAK on this circuit. */
introcirc
->
_base
.
purpose
=
CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT
;
return
0
;
err:
perm_
err:
circuit_mark_for_close
(
TO_CIRCUIT
(
introcirc
),
END_CIRC_REASON_INTERNAL
);
circuit_mark_for_close
(
TO_CIRCUIT
(
rendcirc
),
END_CIRC_REASON_INTERNAL
);
return
-
1
;
return
-
2
;
}
/** Called when a rendezvous circuit is open; sends a establish
...
...
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