hannestschofenig / mbedtls

An open source, portable, easy to use, readable and flexible SSL library
https://tls.mbed.org
Apache License 2.0
15 stars 8 forks source link

MPS: Remove extended reader/writer from MPS, part 2 #325

Closed hanno-becker closed 3 years ago

hanno-becker commented 3 years ago

This PR removes all uses of extended reader/writer from MPS.

While reader/writer provide a layer of abstraction preventing buffer overflows and pointer arithmetic failures, extended reader/writers are primarily a means to track logical bounds, such as the bounds of a HS message spread over multiple physical buffers, or the bounds of substructures such as extensions in a ClientHello.

Bounds checks as performed by the extended reader/writer are necessary at some point in the stack. However, the previous design choice of incorporating them already at MPS Layer 3 caused significant technical difficulties.

For now, this PR removes extended reader/writers altogether, from both Layer 3 and Layer 4.

It will need to be reconsidered if/where we want to re-introduce extended readers/writers at a later point: Either at the handshake layer, or at the very boundary of MPS Layer 4 -- but not within MPS itself.