summaryrefslogtreecommitdiff
path: root/p11-kit/tests/test-mock.c
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-08-23 15:34:04 +0200
committerStef Walter <stef@thewalter.net>2014-07-08 08:57:30 +0200
commitc785ab66890ad7b73c556d6afdf2bb8a32dd50e2 (patch)
treeb871dc6edf5e0a094fa3736eccdb92ca2a7091a8 /p11-kit/tests/test-mock.c
parent469e75bb8184392cb47b3cb4897589caabe56e70 (diff)
rpc: Implement PKCS#11 messages/client/server code
* This enables passing around bytes which represent PKCS#11 RPC calls. * Caller is responsible for connecting/disconnecting and so on. * Client side caller gets a mixin from p11_rpc_client_init() to call into, which generates callbacks with byte arrays to be transported. * Server side calls p11_rpc_server_handle() with a CK_FUNCTION_LIST_PTR on which relevant methods get called. * Doesn't yet implement the actual daemon or clients etc... https://bugs.freedesktop.org/show_bug.cgi?id=54105
Diffstat (limited to 'p11-kit/tests/test-mock.c')
-rw-r--r--p11-kit/tests/test-mock.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/p11-kit/tests/test-mock.c b/p11-kit/tests/test-mock.c
index 5fba7ec..079ff0d 100644
--- a/p11-kit/tests/test-mock.c
+++ b/p11-kit/tests/test-mock.c
@@ -55,8 +55,14 @@ test_get_info (void)
module = setup_mock_module (NULL);
rv = (module->C_GetInfo) (&info);
- assert (rv == CKR_OK);
- assert (memcmp (&info, &MOCK_INFO, sizeof (CK_INFO)) == 0);
+ assert_num_eq (rv, CKR_OK);
+ assert_num_eq (MOCK_INFO.cryptokiVersion.major, info.cryptokiVersion.major);
+ assert_num_eq (MOCK_INFO.cryptokiVersion.minor, info.cryptokiVersion.minor);
+ assert (memcmp (MOCK_INFO.manufacturerID, info.manufacturerID, sizeof (info.manufacturerID)) == 0);
+ assert_num_eq (MOCK_INFO.flags, info.flags);
+ assert (memcmp (MOCK_INFO.libraryDescription, info.libraryDescription, sizeof (info.libraryDescription)) == 0);
+ assert_num_eq (MOCK_INFO.libraryVersion.major, info.libraryVersion.major);
+ assert_num_eq (MOCK_INFO.libraryVersion.minor, info.libraryVersion.minor);
teardown_mock_module (module);
}