Skip to content
Snippets Groups Projects
Commit 873564ea authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Some versions of openssl have an SSL_pending function that erroneously

returns bytes when there is a non-application record pending.

I have no idea when/why this would even happen, but let's catch it and
make sure tor_tls_get_pending_bytes stays correct.


svn:r1727
parent 06624df6
No related branches found
No related tags found
No related merge requests found
......@@ -603,7 +603,14 @@ int
tor_tls_get_pending_bytes(tor_tls *tls)
{
tor_assert(tls);
#if OPENSSL_VERSION_NUMBER < 0x0090700fl
if (tls->ssl->rstate == SSL_ST_READ_BODY)
return 0;
if (tls->ssl->s3->rrec.type != SSL3_RT_APPLICATION_DATA)
return 0;
#endif
return SSL_pending(tls->ssl);
}
/* Return the number of bytes read across the underlying socket. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment