]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: jwt: jwt_verify returns negative values in case of error
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 18 Oct 2021 13:14:49 +0000 (15:14 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 18 Oct 2021 14:02:29 +0000 (16:02 +0200)
commit1c891bcc90346aa84f8b16bc6fe00fa6c104a4cb
tree33c5f1ac6d8f98322bae637d8e2b0479d899bf6b
parent0b24d2fa4543dbbdf6f32c35e3313906065e84b3
MINOR: jwt: jwt_verify returns negative values in case of error

In order for all the error return values to be distributed on the same
side (instead of surrounding the success error code), the return values
for errors other than a simple verification failure are switched to
negative values. This way the result of the jwt_verify converter can be
compared strictly to 1 as well relative to 0 (any <= 0 return value is
an error).
The documentation was also modified to discourage conversion of the
return value into a boolean (which would definitely not work).
doc/configuration.txt
include/haproxy/jwt-t.h
reg-tests/jwt/jws_verify.vtc