summaryrefslogtreecommitdiff
path: root/trust
diff options
context:
space:
mode:
Diffstat (limited to 'trust')
-rw-r--r--trust/module.c5
-rw-r--r--trust/parser.c3
-rw-r--r--trust/tests/test-module.c10
-rw-r--r--trust/token.c3
4 files changed, 15 insertions, 6 deletions
diff --git a/trust/module.c b/trust/module.c
index 46ebeb6..e7eff62 100644
--- a/trust/module.c
+++ b/trust/module.c
@@ -45,6 +45,7 @@
#include "message.h"
#include "module.h"
#include "parser.h"
+#include "path.h"
#include "pkcs11.h"
#include "pkcs11x.h"
#include "session.h"
@@ -202,7 +203,7 @@ create_tokens_inlock (p11_array *tokens,
while (remaining) {
path = remaining;
- pos = strchr (remaining, ':');
+ pos = strchr (remaining, P11_PATH_SEP_C);
if (pos == NULL) {
remaining = NULL;
} else {
@@ -227,7 +228,7 @@ create_tokens_inlock (p11_array *tokens,
/* Didn't find a label above, then make one based on the path */
if (!label) {
- label = base = p11_basename (path);
+ label = base = p11_path_base (path);
return_val_if_fail (base != NULL, false);
}
diff --git a/trust/parser.c b/trust/parser.c
index 7eb18c9..b2555b1 100644
--- a/trust/parser.c
+++ b/trust/parser.c
@@ -45,6 +45,7 @@
#include "module.h"
#include "oid.h"
#include "parser.h"
+#include "path.h"
#include "pem.h"
#include "pkcs11x.h"
#include "persist.h"
@@ -741,7 +742,7 @@ p11_parse_memory (p11_parser *parser,
return_val_if_fail (parser != NULL, P11_PARSE_FAILURE);
- base = p11_basename (filename);
+ base = p11_path_base (filename);
parser->basename = base;
parser->flags = flags;
diff --git a/trust/tests/test-module.c b/trust/tests/test-module.c
index 525a68e..4facf3b 100644
--- a/trust/tests/test-module.c
+++ b/trust/tests/test-module.c
@@ -44,6 +44,7 @@
#include "attrs.h"
#include "hash.h"
#include "library.h"
+#include "path.h"
#include "pkcs11x.h"
#include "test-data.h"
#include "token.h"
@@ -81,7 +82,9 @@ setup (CuTest *cu)
CuAssertTrue (cu, rv == CKR_OK);
memset (&args, 0, sizeof (args));
- paths = SRCDIR "/input:" SRCDIR "/files/self-signed-with-ku.der:" SRCDIR "/files/thawte.pem";
+ paths = SRCDIR "/input" P11_PATH_SEP \
+ SRCDIR "/files/self-signed-with-ku.der" P11_PATH_SEP \
+ SRCDIR "/files/thawte.pem";
if (asprintf (&arguments, "paths='%s'", paths) < 0)
CuAssertTrue (cu, false && "not reached");
args.pReserved = arguments;
@@ -204,7 +207,10 @@ test_get_token_info (CuTest *cu)
CuAssertTrue (cu, rv == CKR_OK);
memset (&args, 0, sizeof (args));
- args.pReserved = "paths='" SYSCONFDIR "/input:" DATADIR "/files/blah:" "/some/other/path/the-basename'";
+ args.pReserved = "paths='" \
+ SYSCONFDIR "/input" P11_PATH_SEP \
+ DATADIR "/files/blah" P11_PATH_SEP \
+ "/some/other/path/the-basename'";
args.flags = CKF_OS_LOCKING_OK;
rv = module->C_Initialize (&args);
diff --git a/trust/token.c b/trust/token.c
index e7c91cd..f48f66b 100644
--- a/trust/token.c
+++ b/trust/token.c
@@ -44,6 +44,7 @@
#include "message.h"
#include "module.h"
#include "parser.h"
+#include "path.h"
#include "pkcs11.h"
#include "pkcs11x.h"
#include "token.h"
@@ -111,7 +112,7 @@ loader_load_directory (p11_token *token,
/* We're within a global mutex, so readdir is safe */
while ((dp = readdir (dir)) != NULL) {
- path = strconcat (directory, "/", dp->d_name, NULL);
+ path = p11_path_build (directory, dp->d_name, NULL);
return_val_if_fail (path != NULL, -1);
if (stat (path, &sb) < 0) {