From cf10ad5c11764ae83b00ac8c57fa4985045daadb Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 6 Oct 2025 16:18:07 +0200 Subject: jwt.c: Do not consider decoding errors as fatals The base64 string is considered untrusted input and, therefore, it might cause a decoding error. Therefore, this should not cause the server to close. --- jwt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jwt.c b/jwt.c index 2587b91..94f2f6e 100644 --- a/jwt.c +++ b/jwt.c @@ -137,7 +137,7 @@ int jwt_check(const char *const jwt, const void *const key, const size_t n) else if (!(dhmac = base64_decode(p + 1, &hmaclen))) { fprintf(stderr, "%s: base64_decode failed\n", __func__); - return -1; + return 1; } const int r = memcmp(dhmac, hmac, hmaclen); -- cgit v1.2.3