]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[tls] Split received records over multiple I/O buffers
authorMichael Brown <mcb30@ipxe.org>
Wed, 26 Sep 2012 20:42:23 +0000 (21:42 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 27 Sep 2012 00:56:01 +0000 (01:56 +0100)
commit72db14640c2a9eac0ba53baa955b180f1f4b9c2f
tree239f9dbbdfe5c889a9fd72110efae604ec80b14c
parent09d45ffd7991e6b64a76d86f338a2f0973527be6
[tls] Split received records over multiple I/O buffers

TLS servers are not obliged to implement the RFC3546 maximum fragment
length extension, and many common servers (including OpenSSL, as used
in Apache's mod_ssl) do not do so.  iPXE may therefore have to cope
with TLS records of up to 16kB.  Allocations for 16kB have a
non-negligible chance of failing, causing the TLS connection to abort.

Fix by maintaining the received record as a linked list of I/O
buffers, rather than a single contiguous buffer.  To reduce memory
pressure, we also decrypt in situ, and deliver the decrypted data via
xfer_deliver_iob() rather than xfer_deliver_raw().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/tls.h
src/net/tls.c