Lines Matching defs:sp
89 static isc_result_t setup_session(pk11_session_t *sp,
93 static isc_result_t token_login(pk11_session_t *sp);
344 pk11_session_t *sp;
424 sp = ISC_LIST_HEAD(*freelist);
425 if (sp != NULL) {
426 ISC_LIST_UNLINK(*freelist, sp, link);
427 ISC_LIST_APPEND(actives, sp, link);
430 ret = token_login(sp);
431 ctx->handle = sp;
432 ctx->session = sp->session;
437 sp = pk11_mem_get(sizeof(*sp));
438 if (sp == NULL)
440 sp->magic = SES_MAGIC;
441 sp->token = token;
442 sp->session = CK_INVALID_HANDLE;
443 ISC_LINK_INIT(sp, link);
444 ret = setup_session(sp, token, rw);
446 ret = token_login(sp);
448 ISC_LIST_APPEND(actives, sp, link);
450 ctx->handle = sp;
451 ctx->session = sp->session;
461 pk11_session_t *sp = (pk11_session_t *) ctx->handle;
463 if (sp == NULL)
469 ISC_LIST_UNLINK(actives, sp, link);
471 if (sp->session == CK_INVALID_HANDLE) {
472 pk11_mem_put(sp, sizeof(*sp));
477 ISC_LIST_APPEND(sp->token->sessions, sp, link);
505 pk11_session_t *sp;
512 sp = ISC_LIST_HEAD(*slist);
514 if (sp->session != CK_INVALID_HANDLE) {
515 rv = pkcs_C_CloseSession(sp->session);
520 ISC_LIST_UNLINK(*slist, sp, link);
521 pk11_mem_put(sp, sizeof(*sp));
529 setup_session(pk11_session_t *sp, pk11_token_t *token,
539 NULL_PTR, &sp->session);
546 token_login(pk11_session_t *sp) {
548 pk11_token_t *token = sp->token;
553 rv = pkcs_C_Login(sp->session, CKU_USER,