mirror repository of the tor core protocol in case of issues
Go to file
David Goulet 3adabaf3e9 tls: Make buf_read_from_tls() read at most bytes
The buf_read_from_tls() function was designed to read up to a certain number
of bytes a TLS socket using read_to_chunk_tls() which boils down to SSL_read()
(with OpenSSL, common case).

However, at the end of the loop, the returned number of bytes from
read_to_chunk_tls() was treated like the syscall read() for which if less
bytes than the total asked are returned, it signals EOF.

But, with SSL_read(), it returns up to a TLS record which can be less than
what was asked. The assumption that it was EOF was wrong which made the while
loop exiting before it was able to consume all requested bytes (at_most
parameter).

The general use case that Tor sees is that it will ask the network layer to
give it at most 16KB (that is roughly 32 cells) but because of KIST scheduler,
the highest possible TLS record we currently observe is 4096 bytes (4KB or 8
cells). Thus the loop would at best always return 8 cells even though much
more could be on the TLS socket. See ticket #40006 for more details.

Fixes #40006

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-06-24 10:47:53 -04:00
changes tls: Make buf_read_from_tls() read at most bytes 2020-06-24 10:47:53 -04:00
contrib Bump version to 0.4.5.0-alpha-dev 2020-06-09 14:14:43 -04:00
doc Remove AssumeReachable from TestingTorNetwork. 2020-06-15 14:08:42 -04:00
m4 Print summary at the end of the configure script 2019-10-17 10:08:34 -04:00
scripts Merge branch 'maint-0.4.4' 2020-06-11 17:29:54 +03:00
src tls: Make buf_read_from_tls() read at most bytes 2020-06-24 10:47:53 -04:00
.appveyor.yml Merge branch 'maint-0.4.3' 2020-06-05 12:37:30 -04:00
.clang-format Add a dire warning about not reformatting the whole codebase yet. 2020-02-12 18:52:35 -05:00
.editorconfig Add .editorconfig to follow coding standards style 2018-06-17 19:24:40 -04:00
.gitignore Remove tor.sh from .gitignore 2020-06-05 10:28:29 +00:00
.gitlab-ci.yml gitlab-ci: purge old job for mirroring, its unused and obsolete 2019-10-29 22:55:13 +01:00
.gitmodules Update the .gitmodules to refer to project-level tor-rust-dependencies 2018-02-21 11:53:04 -05:00
.travis.yml Merge branch 'tor-github/pr/1913' 2020-06-12 12:55:34 -04:00
acinclude.m4 Bump copyright date to 2019 2019-01-16 12:33:22 -05:00
autogen.sh Cleanup shellcheck warnings in autogen.sh 2019-01-18 13:49:30 +02:00
ChangeLog forward-port the changelog for 0.4.4.1-alpha 2020-06-16 17:52:45 -04:00
CODE_OF_CONDUCT Add CODE_OF_CONDUCT file 2018-07-05 11:22:33 +03:00
config.rust.in Make the rust tests link. 2018-07-31 19:46:00 -04:00
configure.ac Bump version to 0.4.5.0-alpha-dev 2020-06-09 14:14:43 -04:00
CONTRIBUTING improve a URL 2018-05-11 18:00:30 -04:00
Doxyfile.in Doxyfile: skip CHECK_PRINTF() 2019-12-08 22:40:00 -06:00
INSTALL Remove old instructions from INSTALL 2018-07-03 16:34:52 +03:00
LICENSE clarify that tor's license is free software 2019-08-23 21:52:33 -04:00
Makefile.am Merge branch 'ticket33316_squashed' 2020-02-24 07:49:45 -05:00
Makefile.nmake Clean up the MVSC nmake files so they work again. 2014-09-09 10:27:05 -04:00
README Update README files with common style. 2020-03-22 13:50:58 +01:00
ReleaseNotes forward-port changelog and release-notes from 0.4.3.5 2020-06-15 16:43:09 -04:00
warning_flags.in Try @warning_flags to avoid bloating verbose make logs 2018-12-21 10:00:23 -05:00

Tor protects your privacy on the internet by hiding the connection
between your Internet address and the services you use. We believe Tor
is reasonably secure, but please ensure you read the instructions and
configure it properly.

To build Tor from source:
        ./configure && make && make install

To build Tor from a just-cloned git repository:
        sh autogen.sh && ./configure && make && make install

Home page:
        https://www.torproject.org/

Download new versions:
        https://www.torproject.org/download/download.html

Documentation, including links to installation and setup instructions:
        https://www.torproject.org/docs/documentation.html

Making applications work with Tor:
        https://wiki.torproject.org/projects/tor/wiki/doc/TorifyHOWTO

Frequently Asked Questions:
        https://www.torproject.org/docs/faq.html

Release timeline:
         https://trac.torproject.org/projects/tor/wiki/org/teams/NetworkTeam/CoreTorReleases

To get started working on Tor development:
        See the doc/HACKING directory.