mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Revert "Fix issues pointed out by nickm."
This reverts commit e097bffaed
.
This commit is contained in:
parent
616b60cef3
commit
45c46129ed
@ -1323,21 +1323,17 @@ tor_tls_client_is_using_v2_ciphers(const SSL *ssl, const char *address)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** We got an SSL ClientHello message. This might mean that the
|
/** We sent the ServerHello part of an SSL handshake. This might mean
|
||||||
* client wants to initiate a renegotiation and appropriate actions
|
* that we completed a renegotiation and appropriate actions must be
|
||||||
* must be taken. */
|
* taken. */
|
||||||
static void
|
static void
|
||||||
tor_tls_got_client_hello(tor_tls_t *tls)
|
tor_tls_got_server_hello(tor_tls_t *tls)
|
||||||
{
|
{
|
||||||
if (tls->server_handshake_count < 3)
|
if (tls->server_handshake_count < 3)
|
||||||
++tls->server_handshake_count;
|
++tls->server_handshake_count;
|
||||||
|
|
||||||
if (tls->server_handshake_count == 2) {
|
if (tls->server_handshake_count == 2) {
|
||||||
if (!tls->negotiated_callback) {
|
tor_assert(tls->negotiated_callback);
|
||||||
log_warn(LD_BUG, "Got a renegotiation request but we don't"
|
|
||||||
" have a renegotiation callback set!");
|
|
||||||
}
|
|
||||||
|
|
||||||
tls->got_renegotiate = 1;
|
tls->got_renegotiate = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1380,8 +1376,8 @@ tor_tls_state_changed_callback(const SSL *ssl, int type, int val)
|
|||||||
if (type == SSL_CB_ACCEPT_LOOP &&
|
if (type == SSL_CB_ACCEPT_LOOP &&
|
||||||
ssl->state == SSL3_ST_SW_SRVR_HELLO_A) {
|
ssl->state == SSL3_ST_SW_SRVR_HELLO_A) {
|
||||||
|
|
||||||
/* Call tor_tls_got_client_hello() for every SSL ClientHello we
|
/* Call tor_tls_got_server_hello() for every SSL ServerHello we
|
||||||
receive. */
|
send. */
|
||||||
|
|
||||||
tor_tls_t *tls = tor_tls_get_by_ssl(ssl);
|
tor_tls_t *tls = tor_tls_get_by_ssl(ssl);
|
||||||
if (!tls) {
|
if (!tls) {
|
||||||
@ -1389,7 +1385,7 @@ tor_tls_state_changed_callback(const SSL *ssl, int type, int val)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tor_tls_got_client_hello(tls);
|
tor_tls_got_server_hello(tls);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1660,10 +1656,8 @@ tor_tls_read(tor_tls_t *tls, char *cp, size_t len)
|
|||||||
|
|
||||||
#ifdef V2_HANDSHAKE_SERVER
|
#ifdef V2_HANDSHAKE_SERVER
|
||||||
if (tls->got_renegotiate) {
|
if (tls->got_renegotiate) {
|
||||||
if (tls->server_handshake_count != 2) {
|
tor_assert(tls->server_handshake_count == 2);
|
||||||
log_warn(LD_BUG, "We did not notice renegotiation in a timely fashion (%u)!",
|
/* XXX tor_assert(err == TOR_TLS_WANTREAD); */
|
||||||
tls->server_handshake_count);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Renegotiation happened! */
|
/* Renegotiation happened! */
|
||||||
log_info(LD_NET, "Got a TLS renegotiation from %s", ADDR(tls));
|
log_info(LD_NET, "Got a TLS renegotiation from %s", ADDR(tls));
|
||||||
|
Loading…
Reference in New Issue
Block a user