In cli_parse_add_crtlist(), a store without any instance takes the conf
parsed from the line, even when it was declared in a crt-store section.
So adding such a certificate to a crt-list over the CLI silently drops
the settings of its "load" line: the file names are no longer reported
by "show ssl cert", and above all "ocsp-update on" is lost, so no OCSP
update is scheduled for it. A line with other keywords also replaces the
ones of the crt-store, while this is refused in a crt-list file.
Let's only replace the conf when the store doesn't come from a
crt-store, and compare the confs otherwise, as is done at boot. This
relies on the previous patch to work on an updated certificate. This was
introduced by commit
1bc6e990f ("MEDIUM: ssl/cli: handle crt-store
keywords in crt-list over the CLI") in 3.0-dev12, so this should be
backported to 3.0.
}
/* We can use a crt-store keyword when:
- * - no ckch_inst are linked OR
+ * - no ckch_inst are linked and the store is not from a crt-store OR
* - ckch_inst are linked but exact same ckch_conf is used.
*/
- if (LIST_ISEMPTY(&store->ckch_inst)) {
+ if (LIST_ISEMPTY(&store->ckch_inst) && store->conf.used != CKCH_CONF_SET_CRTSTORE) {
old_cc = store->conf;
store->conf = cc;