[gnutls-devel] GnuTLS | gnutls_aead_cipher_{en, de}cryptv2: write back cached data to buffers (!1085)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Thu Oct 3 17:13:56 CEST 2019

Simo Sorce commented:

I would add some more comments on the _sync function so a reader knows that
a) it is really only needed when we need to write back from an internal block that was needed because of a fragmented iovec not aligning on blocksized boundaries
b) that walking backwards is fine because we only ever sync a full block anyway.

Other than that the latest revision of _sync() is quite fine once you understand the assumptions, and th code looks correct.

I would also add a test vector that is more fragmented (with odd sized chunks)  in the middle where a block is split over at least 3 different vectors, to make sure all corner cases are always tested in case of future modification.

Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/1085#note_225660004
You're receiving this email because of your account on gitlab.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20191003/ae46ecb9/attachment.html>

More information about the Gnutls-devel mailing list