summaryrefslogtreecommitdiff
path: root/tools/p11-kit.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/p11-kit.c')
-rw-r--r--tools/p11-kit.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/tools/p11-kit.c b/tools/p11-kit.c
index 175b561..298c56d 100644
--- a/tools/p11-kit.c
+++ b/tools/p11-kit.c
@@ -41,7 +41,8 @@
#include <stdlib.h>
#include <unistd.h>
-#include "p11-kit.h"
+#include "p11-kit/p11-kit.h"
+#include "p11-kit/uri.h"
typedef int (*operation) (int argc, char *argv[]);
int verbose = 0;
@@ -54,6 +55,30 @@ usage (void)
exit (2);
}
+static void
+print_module_info (CK_FUNCTION_LIST_PTR module)
+{
+ CK_INFO info;
+ char *value;
+ CK_RV rv;
+
+ rv = (module->C_GetInfo) (&info);
+ if (rv != CKR_OK) {
+ warnx ("couldn't load module info: %s", p11_kit_strerror (rv));
+ return;
+ }
+
+ value = p11_kit_space_strdup (info.libraryDescription,
+ sizeof (info.libraryDescription));
+ printf ("\tlibrary-description: %s\n", value);
+ free (value);
+
+ value = p11_kit_space_strdup (info.manufacturerID,
+ sizeof (info.manufacturerID));
+ printf ("\tlibrary-manufacturer: %s\n", value);
+ free (value);
+}
+
static int
list_modules (int argc, char *argv[])
{
@@ -79,6 +104,7 @@ list_modules (int argc, char *argv[])
printf ("%s: %s\n",
name ? name : "(null)",
path ? path : "(null)");
+ print_module_info (module_list[i]);
free (name);
free (path);