summaryrefslogtreecommitdiff
path: root/tools/extract.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-02-06 21:57:45 +0100
committerStef Walter <stefw@gnome.org>2013-05-21 10:47:51 +0200
commit5c19f0cf66495f00ccf69eba1d0915f862a88c8d (patch)
treee8ae733062507a0a4cc5c134d1fdd62cf055cddd /tools/extract.c
parentff853bd7902e271256cada4a1b20a3d46b519b69 (diff)
p11-kit: Managed PKCS#11 module loading
Support a new managed style module loading for PKCS#11 modules. This allows us to better coordinate between multiple callers of the same PKCS#11 modules and provide hooks into their behavior. This meant redoing the public facing API. The old methods are now deprecated, marked and documented as such.
Diffstat (limited to 'tools/extract.c')
-rw-r--r--tools/extract.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/extract.c b/tools/extract.c
index cd0f369..3d1fee7 100644
--- a/tools/extract.c
+++ b/tools/extract.c
@@ -231,7 +231,7 @@ limit_modules_if_necessary (CK_FUNCTION_LIST_PTR *modules,
/* TODO: This logic will move once we merge our p11-kit managed code */
for (i = 0, out = 0; modules[i] != NULL; i++) {
- string = p11_kit_registered_option (modules[i], "trust-policy");
+ string = p11_kit_config_option (modules[i], "trust-policy");
if (string && strcmp (string, "yes") == 0)
modules[out++] = modules[i];
else if (string && strcmp (string, "no") != 0)
@@ -305,7 +305,6 @@ p11_tool_extract (int argc,
CK_ATTRIBUTE *match;
P11KitUri *uri;
int opt = 0;
- CK_RV rv;
int ret;
enum {
@@ -435,13 +434,10 @@ p11_tool_extract (int argc,
if (uri && p11_kit_uri_any_unrecognized (uri))
p11_message ("uri contained unrecognized components, nothing will be extracted");
- rv = p11_kit_initialize_registered ();
- if (rv != CKR_OK) {
- p11_message ("couldn't initialize registered modules: %s", p11_kit_strerror (rv));
+ modules = p11_kit_modules_load_and_initialize (0);
+ if (!modules)
return 1;
- }
- modules = p11_kit_registered_modules ();
limit_modules_if_necessary (modules, ex.flags);
iter = p11_kit_iter_new (uri);
@@ -456,8 +452,9 @@ p11_tool_extract (int argc,
p11_extract_info_cleanup (&ex);
p11_kit_iter_free (iter);
p11_kit_uri_free (uri);
- free (modules);
- p11_kit_finalize_registered ();
+ p11_kit_modules_finalize (modules);
+ p11_kit_modules_release (modules);
+
return ret;
}