[glib-networking/wip/tingping/pkcs11-spy] tests: Add more verbose PKCS11 logging with pkcs11-spy
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/wip/tingping/pkcs11-spy] tests: Add more verbose PKCS11 logging with pkcs11-spy
- Date: Wed, 20 Nov 2019 22:16:52 +0000 (UTC)
commit fc003be8a84aaa4d072ec35f39410fdf0913193a
Author: Patrick Griffis <tingping tingping se>
Date: Wed Nov 20 14:16:27 2019 -0800
tests: Add more verbose PKCS11 logging with pkcs11-spy
tls/tests/connection.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/tls/tests/connection.c b/tls/tests/connection.c
index 5c02932..c0943a8 100644
--- a/tls/tests/connection.c
+++ b/tls/tests/connection.c
@@ -2532,6 +2532,7 @@ main (int argc,
int ret;
#ifdef BACKEND_IS_GNUTLS
char *module_path;
+ const char *spy_path;
#endif
g_test_init (&argc, &argv, NULL);
@@ -2544,6 +2545,20 @@ main (int argc,
#ifdef BACKEND_IS_GNUTLS
module_path = g_build_filename (g_getenv ("G_TEST_BUILDDIR"), "mock-pkcs11.so", NULL);
+
+ /* This just adds extra logging which is useful for debugging */
+ spy_path = g_getenv ("PKCS11SPY_PATH");
+ if (!spy_path)
+ spy_path = "/usr/lib64/pkcs11-spy.so"; /* Fedora's path */
+
+ if (g_file_test (spy_path, G_FILE_TEST_EXISTS))
+ {
+ g_debug ("Using PKCS #11 Spy");
+ g_setenv ("PKCS11SPY", module_path, TRUE);
+ g_free (module_path);
+ module_path = g_strdup (spy_path);
+ }
+
ret = gnutls_pkcs11_init (GNUTLS_PKCS11_FLAG_MANUAL, NULL);
g_assert_cmpint (ret, ==, GNUTLS_E_SUCCESS);
ret = gnutls_pkcs11_add_provider (module_path, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]