]> git.ipfire.org Git - thirdparty/curl.git/commit
OpenSSL: clear error queue after SSL_shutdown
authorJohn Hawthorn <john@hawthorn.email>
Fri, 25 Aug 2023 18:06:28 +0000 (11:06 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 26 Aug 2023 17:36:40 +0000 (19:36 +0200)
commit6d44625305e96ec600bb4fe133295b342e79644e
tree22ac15314231fbf2b1759d123203dc69a92f1bd6
parentc2212c05aa99bb31e4b99b0b66fc1747b7d01be6
OpenSSL: clear error queue after SSL_shutdown

We've seen errors left in the OpenSSL error queue (specifically,
"shutdown while in init") by adding some logging it revealed that the
source was this file.

Since we call SSL_read and SSL_shutdown here, but don't check the return
code for an error, we should clear the OpenSSL error queue in case one
was raised.

This didn't affect curl because we call ERR_clear_error before every
write operation (a0dd9df9ab35528eb9eb669e741a5df4b1fb833c), but when
libcurl is used in a process with other OpenSSL users, they may detect
an OpenSSL error pushed by libcurl's SSL_shutdown as if it was their
own.

Co-authored-by: Satana de Sant'Ana <satana@skylittlesystem.org>
Closes #11736
lib/vtls/openssl.c