diff options
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/session.c b/src/session.c index 414a50e..a11fb50 100644 --- a/src/session.c +++ b/src/session.c @@ -3,6 +3,10 @@ #include "p11-tests.h" +#include <string.h> + +static const char *login_pin = NULL; + void session_info(CK_SESSION_HANDLE session, CK_SLOT_ID slot, CK_FLAGS flags, CK_STATE state) { @@ -51,11 +55,11 @@ session_main(CK_SLOT_ID slot) /** C_OpenSession */ /** - Invalid slot */ - rv = (p11t_module_funcs->C_OpenSession)((CK_SLOT_ID)-5, 0, NULL, NULL, &session_ro); + rv = (p11t_module_funcs->C_OpenSession)((CK_SLOT_ID)-5, CKF_SERIAL_SESSION, NULL, NULL, &session_ro); p11t_check_returns("C_OpenSession with invalid slot", rv, CKR_SLOT_ID_INVALID); /** - Null arguments */ - rv = (p11t_module_funcs->C_OpenSession)(slot, 0, NULL, NULL, NULL); + rv = (p11t_module_funcs->C_OpenSession)(slot, CKF_SERIAL_SESSION, NULL, NULL, NULL); p11t_check_returns("C_OpenSession with invalid slot", rv, CKR_ARGUMENTS_BAD); /** - No flags */ @@ -163,3 +167,10 @@ p11t_session_tests() session_main(slot); } } + +void +p11t_session_config(const char *name, const char *value) +{ + if(strcmp(name, "login-pin") == 0) + login_pin = value; +} |