1 diff --color -urN pidgin-2.14.1.orig/libpurple/certificate.c pidgin-2.14.1/libpurple/certificate.c
2 --- pidgin-2.14.1.orig/libpurple/certificate.c 2020-06-10 04:41:32.000000000 +0200
3 +++ pidgin-2.14.1/libpurple/certificate.c 2020-10-22 17:55:33.752632736 +0200
5 GPatternSpec *pempat, *crtpat;
10 if (x509_ca_initialized) return TRUE;
14 /* Populate the certificates pool from the search path(s) */
15 for (iter = x509_ca_paths; iter; iter = iter->next) {
16 - certdir = g_dir_open(iter->data, 0, NULL);
18 - purple_debug_error("certificate/x509/ca", "Couldn't open location '%s'\n", (const char *)iter->data);
20 + is_ca_file = g_file_test(iter->data, G_FILE_TEST_IS_REGULAR);
22 + certdir = g_dir_open(iter->data, 0, NULL);
24 + purple_debug_error("certificate/x509/ca", "Couldn't open location '%s'\n", (const char *)iter->data);
29 - while ( (entry = g_dir_read_name(certdir)) ) {
30 + while ((is_ca_file && (entry = iter->data)) || (entry = g_dir_read_name(certdir)) ) {
32 PurpleCertificate *crt;
38 - fullpath = g_build_filename(iter->data, entry, NULL);
39 + fullpath = is_ca_file ? g_strdup(entry) : g_build_filename(iter->data, entry, NULL);
41 /* TODO: Respond to a failure in the following? */
42 crts = purple_certificates_import(x509, fullpath);
53 + g_dir_close(certdir);
55 - g_dir_close(certdir);
58 g_pattern_spec_free(pempat);
60 x509_ca_paths = g_list_append(NULL, g_build_filename(DATADIR,
63 + x509_ca_paths = g_list_append(x509_ca_paths, g_strdup("/etc/certs/ca-certificates.crt"));
64 # ifdef SSL_CERTIFICATES_DIR
65 - x509_ca_paths = g_list_append(NULL, g_strdup(SSL_CERTIFICATES_DIR));
66 + x509_ca_paths = g_list_append(x509_ca_paths, g_strdup(SSL_CERTIFICATES_DIR));
68 x509_ca_paths = g_list_append(x509_ca_paths,
69 g_build_filename(DATADIR, "purple", "ca-certs", NULL));