From a5387c12e7894ece011ebdd864c2a471d14e2355 Mon Sep 17 00:00:00 2001 From: Alessio Di Mauro Date: Wed, 25 Nov 2015 15:44:11 +0100 Subject: [PATCH] YKCS11: Add more to session tests. --- ykcs11/tests/ykcs11_tests.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ykcs11/tests/ykcs11_tests.c b/ykcs11/tests/ykcs11_tests.c index 6aaafe0..a08ac72 100644 --- a/ykcs11/tests/ykcs11_tests.c +++ b/ykcs11/tests/ykcs11_tests.c @@ -172,6 +172,7 @@ static void test_mechanism_list_and_info() { static void test_session() { CK_SESSION_HANDLE session; + CK_SESSION_INFO info; asrt(funcs->C_Initialize(NULL), CKR_OK, "INITIALIZE"); @@ -179,6 +180,10 @@ static void test_session() { asrt(funcs->C_CloseSession(session), CKR_OK, "CloseSession"); asrt(funcs->C_OpenSession(0, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session), CKR_OK, "OpenSession2"); + asrt(funcs->C_GetSessionInfo(session, &info), CKR_OK, "GetSessionInfo"); + asrt(info.state, CKS_RW_PUBLIC_SESSION, "CHECK STATE"); + asrt(info.flags, CKF_SERIAL_SESSION | CKF_RW_SESSION, "CHECK FLAGS"); + asrt(info.ulDeviceError, 0, "CHECK DEVICE ERROR"); asrt(funcs->C_CloseSession(session), CKR_OK, "CloseSession"); asrt(funcs->C_OpenSession(0, CKF_SERIAL_SESSION, NULL, NULL, &session), CKR_OK, "OpenSession3");