BUG/MEDIUM: jwt: Clear SSL error queue on error when checking the signature
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 26 Jul 2024 14:47:15 +0000 (16:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 29 Jul 2024 09:56:13 +0000 (11:56 +0200)
commit22ef1a993a16f22085353a5e585d259fd518ac4e
treead2306478db3fc8dd93aa62b1747321dd4305330
parent3b51c3db6f62e40b42ef537b6a3dabffad760d7c
BUG/MEDIUM: jwt: Clear SSL error queue on error when checking the signature

When the signature included in a JWT is verified, if an error occurred, one
or more SSL errors are queued and never cleared. These errors may be then
caught by the SSL stack and a fatal SSL error may be erroneously reported
during a SSL received or send.

So we must take care to clear the SSL error queue when the signature
verification failed.

This patch should fix issue #2643. It must be backported as far as 2.6.

(cherry picked from commit 46b1fec0e9a6afe2c12fd4dff7c8a0d788aa6dd4)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/jwt.c