[libsoup/carlosgc/client-side-certs2: 2/4] ssl-test: Add test case for unhandled PKCS#11 PIN




commit 8897c2537015264c00bdf4cfcc1ac54f5e06858a
Author: Patrick Griffis <pgriffis igalia com>
Date:   Wed May 26 14:30:55 2021 -0500

    ssl-test: Add test case for unhandled PKCS#11 PIN

 tests/ssl-test.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/tests/ssl-test.c b/tests/ssl-test.c
index 345fc026..dde8f807 100644
--- a/tests/ssl-test.c
+++ b/tests/ssl-test.c
@@ -429,6 +429,18 @@ do_tls_interaction_msg_test (gconstpointer data)
                 g_bytes_unref (body);
                 g_object_unref (msg);
 
+                /* It should safely fail when the PIN is unhandled */
+                msg = soup_message_new_from_uri ("GET", uri);
+                soup_message_add_flags (msg, SOUP_MESSAGE_NEW_CONNECTION);
+                g_signal_connect (msg, "request-certificate",
+                                G_CALLBACK (request_certificate_cb),
+                                pkcs11_certificate);
+                body = soup_test_session_async_send (session, msg, NULL, &error);
+                g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED);
+                g_clear_error (&error);
+                g_bytes_unref (body);
+                g_object_unref (msg);
+
                 /* Handling the request-certificate-password signal asynchronously */
                 msg = soup_message_new_from_uri ("GET", uri);
                 soup_message_add_flags (msg, SOUP_MESSAGE_NEW_CONNECTION);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]