BUG/MINOR: ssl/lua: use correctly cert_ext in CertCache.set()

Fix a typo that lead to using the wrong pointer when loading a
certificate, which lead to always using the pem loader for every
parameeter.

Use the cert_ext->load() ptr instead of cert_exts->load() which was the
first element of the cert_exts[] array.

Enhance the error message with the field name.

Should fix issue #1716
This commit is contained in:
William Lallemand 2022-05-26 11:20:13 +02:00
parent 8e5b9589b3
commit d8c195a326

View File

@ -11573,8 +11573,8 @@ __LJMP static int hlua_ckch_set(lua_State *L)
}
/* appply the change on the duplicate */
if (cert_exts->load(filename, payload, ckch, &err) != 0) {
memprintf(&err, "%sCan't load the payload\n", err ? err : "");
if (cert_ext->load(filename, payload, ckch, &err) != 0) {
memprintf(&err, "%sCan't load the payload for '%s'\n", err ? err : "", cert_ext->ext);
errcode |= ERR_ALERT | ERR_FATAL;
goto end;
}