]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[tls] Tidy up error handling flow in tls_send_plaintext()
authorMichael Brown <mcb30@ipxe.org>
Wed, 31 Jan 2024 13:49:35 +0000 (13:49 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 31 Jan 2024 13:49:35 +0000 (13:49 +0000)
commit0cc0f47443ef9711775a748c2b0fb40e38643733
tree09559533495ff0869428374f0feb5292d27eb257
parent65d69d33da445afc7ff56857af1881cf73666be4
[tls] Tidy up error handling flow in tls_send_plaintext()

Coverity reported that tls_send_plaintext() failed to check the return
status from tls_generate_random(), which could potentially result in
uninitialised random data being used as the block initialisation
vector (instead of intentionally random data).

Add the missing return status check, and separate out the error
handling code paths (since on the successful exit code path there will
be no need to free either the plaintext or the ciphertext anyway).

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