Accept PKCS#12 file in either key or cert

This commit is contained in:
Stu Tomlinson
2022-06-22 10:41:26 +01:00
parent e90a6e9f71
commit 3d01915407
5 changed files with 33 additions and 17 deletions

View File

@@ -43,6 +43,9 @@ int main()
{0, NULL, "tests/cert.emptypass.pfx"},
{0, NULL, "tests/cert.nopass.pfx"},
{1, NULL, "tests/cert.pfx"},
{0, "tests/cert.emptypass.pfx", NULL},
{0, "tests/cert.nopass.pfx", NULL},
{1, "tests/cert.pfx", NULL},
};
const char *srcdir;
@@ -68,7 +71,10 @@ int main()
else
certfile = NULL;
snprintf(keyfile, MAXPATHLEN, "%s/%s", srcdir, client_cert[m].key);
if (client_cert[m].key)
snprintf(keyfile, MAXPATHLEN, "%s/%s", srcdir, client_cert[m].key);
else
keyfile = NULL;
if (client_cert[m].needs_callback)
xmpp_conn_set_password_callback(conn, password_callback, NULL);