writev over OpenSSL

Michael Wojcik Michael.Wojcik at microfocus.com
Mon Feb 3 15:00:00 UTC 2020


> From: openssl-users [mailto:openssl-users-bounces at openssl.org] On Behalf Of
> Viktor Dukhovni
> Sent: Sunday, February 02, 2020 11:10
>
> On Sun, Feb 02, 2020 at 05:28:19PM +0000, Salz, Rich via openssl-users wrote:
>
> > TLS/TLS will take your data and wrap it inside it’s own record
> > structure.  It has to, that’s the nature of the protocol.  Thinking
> > that a single writev() is “encrypt buffers and then do analogous
> > syscall” is wrong.
>
> Right, the encryption is not in place, the user's data is copied for
> encryption, by which point there's no incentive for a writev between
> OpenSSL and the socket.

True. There's still an argument to be made for a gather-write at the application level, though. That would let the application say "here are multiple buffers of application data which should be coalesced into as few TLS records as possible, then encrypted and transmitted". It saves either a temporary buffer and memory copy prior to calling SSL_write at the application level, or sending short TLS records.

Back in '01 I suggested it would also be useful for applications using the BIO abstraction for both TLS conversations and for plaintext stream sockets. Eighteen and a half years later, I suspect that's not a common use case.

But in any case, as I noted in my previous message, if this enhancement is sufficiently valuable to someone they can always implement it and submit a PR.

--
Michael Wojcik
Distinguished Engineer, Micro Focus





More information about the openssl-users mailing list