Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Benjamin J. Thompson
Tor
Commits
fa74af0c
Commit
fa74af0c
authored
13 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Also handle needless renegotiations in SSL_write()."
This reverts commit
e2b35271
.
parent
45c46129
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/common/tortls.c
+8
-24
8 additions, 24 deletions
src/common/tortls.c
with
8 additions
and
24 deletions
src/common/tortls.c
+
8
−
24
View file @
fa74af0c
...
...
@@ -1260,17 +1260,6 @@ tor_tls_context_new(crypto_pk_env_t *identity, unsigned int key_lifetime,
return
NULL
;
}
/** Return true if the <b>tls</b> object has completed more
* renegotiations than needed for the Tor protocol. */
static
INLINE
int
tor_tls_got_excess_renegotiations
(
tor_tls_t
*
tls
)
{
/** The Tor v2 server handshake needs a single renegotiation after
the initial SSL handshake. This means that if we ever see more
than 2 handshakes, we raise the flag. */
return
(
tls
->
server_handshake_count
>
2
)
?
1
:
0
;
}
#ifdef V2_HANDSHAKE_SERVER
/** Return true iff the cipher list suggested by the client for <b>ssl</b> is
* a list that indicates that the client knows how to do the v2 TLS connection
...
...
@@ -1648,12 +1637,6 @@ tor_tls_read(tor_tls_t *tls, char *cp, size_t len)
err
=
tor_tls_get_error
(
tls
,
r
,
CATCH_ZERO
,
"reading"
,
LOG_DEBUG
,
LD_NET
);
if
(
tor_tls_got_excess_renegotiations
(
tls
))
{
log_info
(
LD_NET
,
"Detected excess renegotiation from %s!"
,
ADDR
(
tls
));
return
TOR_TLS_ERROR_MISC
;
}
#ifdef V2_HANDSHAKE_SERVER
if
(
tls
->
got_renegotiate
)
{
tor_assert
(
tls
->
server_handshake_count
==
2
);
...
...
@@ -1666,6 +1649,14 @@ tor_tls_read(tor_tls_t *tls, char *cp, size_t len)
tls
->
got_renegotiate
=
0
;
return
r
;
}
else
if
(
tls
->
server_handshake_count
>
2
)
{
/* If we get more than 2 handshakes, it means that our peer is
trying to re-renegotiate. Return an error. */
tor_assert
(
tls
->
server_handshake_count
==
3
);
log_info
(
LD_NET
,
"Detected excess renegotiation from %s!"
,
ADDR
(
tls
));
return
TOR_TLS_ERROR_MISC
;
}
#endif
...
...
@@ -1705,13 +1696,6 @@ tor_tls_write(tor_tls_t *tls, const char *cp, size_t n)
}
r
=
SSL_write
(
tls
->
ssl
,
cp
,
(
int
)
n
);
err
=
tor_tls_get_error
(
tls
,
r
,
0
,
"writing"
,
LOG_INFO
,
LD_NET
);
if
(
tor_tls_got_excess_renegotiations
(
tls
))
{
log_info
(
LD_NET
,
"Detected excess renegotiation from %s!"
,
ADDR
(
tls
));
return
TOR_TLS_ERROR_MISC
;
}
if
(
err
==
TOR_TLS_DONE
)
{
return
r
;
}
...
...
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