summaryrefslogtreecommitdiff
path: root/trust
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-03 10:38:19 +0200
committerStef Walter <stef@thewalter.net>2013-07-03 11:49:26 +0200
commit81431ffd8cbf55175b1b9a9ed130fc67d0d4000b (patch)
treeb6715f32115c537dd71a488048a9241a037024ad /trust
parent1c4522e5df79bd197feab8448008fc2bf6b4ea2e (diff)
path: Add p11_path_canon() function
Cleans up a filename with readable characters.
Diffstat (limited to 'trust')
-rw-r--r--trust/extract-info.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/trust/extract-info.c b/trust/extract-info.c
index ec25bc1..f125b8a 100644
--- a/trust/extract-info.c
+++ b/trust/extract-info.c
@@ -42,6 +42,7 @@
#include "dict.h"
#include "extract.h"
#include "message.h"
+#include "path.h"
#include "pkcs11.h"
#include "pkcs11x.h"
#include "x509.h"
@@ -442,23 +443,15 @@ extract_label (p11_extract_info *extract)
return strdup ("unknown");
}
-#define FILENAME_CHARS \
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_"
-
char *
p11_extract_info_filename (p11_extract_info *extract)
{
char *label;
- int i;
label = extract_label (extract);
return_val_if_fail (label != NULL, NULL);
- for (i = 0; label[i] != '\0'; i++) {
- if (strchr (FILENAME_CHARS, label[i]) == NULL)
- label[i] = '_';
- }
-
+ p11_path_canon (label);
return label;
}