]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: jwt: Create jwt tree entry even for new empty certificates
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 26 Nov 2026 10:11:53 +0000 (11:11 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 26 Nov 2026 13:14:09 +0000 (14:14 +0100)
A new empty certificate created by calling "new ssl cert" directly
followed by "commit ssl cert" would not have a corresponding JWT tree
entry created since only the data-loading code paths were covered in the
previous jwt tree related commits.
With this patch we always have a corresponding jwt tree entry for every
ckch_store.

This patch can be backported to 3.4.

src/ssl_ckch.c

index 77528283d40ab9a337c8b330486e17bf30c96a07..f3faa056509f2e70ab52d2594c8f2bf4599fac13 100644 (file)
@@ -3490,6 +3490,14 @@ int ckch_store_create(char *path, char **err)
                goto error;
        }
 
+       /* Create empty entry into JWT-specific tree */
+       if (jwt_tree_create_entry_from_store(store, err)) {
+               memprintf(err,"%scould not create jwt tree entry for '%s'.", err && *err ? *err : "", store->path);
+               ckch_store_free(store);
+               store = NULL;
+               goto error;
+       }
+
        /* insert into the ckchs tree */
        ebst_insert(&ckchs_tree, &store->node);
        memprintf(err, "New empty certificate store '%s'!\n", path);