summaryrefslogtreecommitdiff
path: root/client/gtk.c
diff options
context:
space:
mode:
authorMarcus Carlson <marcus@mejlamej.nu>2010-04-12 22:39:49 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-04-12 23:26:09 +0200
commitd7ce4d993f15a79b30d7b8ac2a607723c2ac8eec (patch)
tree8d1e80731eeba398a8a54816fd4e757a39fcc9af /client/gtk.c
parent420bae5f3d6b660b1a9bcde74230c5f72f126b71 (diff)
downloadfribid-d7ce4d993f15a79b30d7b8ac2a607723c2ac8eec.tar.gz
fribid-d7ce4d993f15a79b30d7b8ac2a607723c2ac8eec.tar.bz2
fribid-d7ce4d993f15a79b30d7b8ac2a607723c2ac8eec.zip
Allow p12 files in ~/.cbt
Diffstat (limited to 'client/gtk.c')
-rw-r--r--client/gtk.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/client/gtk.c b/client/gtk.c
index 193786c..a668b3e 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -178,6 +178,8 @@ static void selectDefaultSignature() {
void platform_startSign(const char *url, const char *hostname, const char *ip,
const char *subjectFilter, unsigned long parentWindowId) {
+ char** paths;
+ int len;
currentSubjectFilter = (subjectFilter != NULL ?
strdup(subjectFilter) : NULL);
@@ -206,15 +208,19 @@ void platform_startSign(const char *url, const char *hostname, const char *ip,
GtkListStore *signatures = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING);
GtkTreeIter iter = { .stamp = 0 };
- // Look for P12s in ~/cbt
- PlatformDirIter *dir = platform_openKeysDir();
- if (dir) {
- while (platform_iterateDir(dir)) {
- char *filename = platform_currentPath(dir);
- addSignatureFile(signatures, filename, &iter);
- free(filename);
+ // Look for P12s in ~/cbt and ~/.cbt
+ platform_keyDirs(&paths, &len);
+ for (int i = 0; i <= len; i++) {
+ PlatformDirIter *dir = platform_openKeysDir(paths[i]);
+ if (dir) {
+ while (platform_iterateDir(dir)) {
+ char *filename = platform_currentPath(dir);
+ addSignatureFile(signatures, filename, &iter);
+ free(filename);
+ }
+ platform_closeDir(dir);
}
- platform_closeDir(dir);
+ free (paths[i]);
}
signaturesCombo = GTK_COMBO_BOX(gtk_builder_get_object(builder, "signature_combo"));