]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MEDIUM: jwe: Fix jwt.decrypt_alg_list to work correctly
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 7 May 2026 16:27:58 +0000 (18:27 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 7 May 2026 16:09:47 +0000 (18:09 +0200)
Function jwe_parse_global_alg_enc_list() handles both
jwt.decrypt_alg_list and jwd.decrypt_enc_list, but to know which array
to use, between the algorithms and encoding arrays to use, it was
checking the string to see if it matched jwe.supported_algorithms, so it
was always considering we were dealing with encodings, and
jwt.decrypt_alg_list could not possibly work.
Fix that by checking the right string.

src/jwe.c

index d192cfd4c1383e7c1baa947b138577e70ff09a3b..2b8eafe591b240493eade22e37e64432382d681b 100644 (file)
--- a/src/jwe.c
+++ b/src/jwe.c
@@ -2175,11 +2175,11 @@ static int jwe_parse_global_alg_enc_list(char **args, int section_type, struct p
        if (dup_alg_enc_arrays())
                goto end;
 
-       if (args[0][14] == 'a') {
-               /* "jwe.supported_algorithms" */
+       if (args[0][12] == 'a') {
+               /* "jwt.decrypt_alg_list" */
                arr = jwe_algs;
        } else {
-               /* "jwe.supported_encodings" */
+               /* "jwt.decrypt_enc_list" */
                arr = jwe_encodings;
        }