Lines Matching defs:session

152 /* PKCS#11 session caches and their locks for all operation types */
164 * time in a given session. Therefore, C_Find{,Init,Final}Objects() should be
166 * ensured by the property of unique PKCS#11 session handle used for each
188 * Create all secret key objects in a global session so that they are available
266 int pk11_destroy_rsa_key_objects(PK11_SESSION *session);
271 int pk11_destroy_dsa_key_objects(PK11_SESSION *session);
276 int pk11_destroy_dh_key_objects(PK11_SESSION *session);
277 int pk11_destroy_dh_object(PK11_SESSION *session, CK_BBOOL uselock);
284 static int pk11_destroy_cipher_key_objects(PK11_SESSION *session);
346 retval = pk11_destroy_object(sp->session, obj_hdl, \
422 * session in multiple cipher_update calls
1069 /* invalidate the global session */
1291 * Termination function to clean up the session, the token, and the pk11
1323 /* Global session is not present when there are no slots. */
1412 pFuncList->C_SeedRandom(sp->session, (unsigned char *) buf, num);
1431 rv = pFuncList->C_GenerateRandom(sp->session, buf, num);
1535 * the session structure because we could get a newly allocated session
1560 * It is a new session so it will look like a cache miss to the
1580 * PK11_SESSION objects aside from the first session (sp) which
1637 * It is an inherited session from our parent so it needs
1646 if (pk11_token_relogin(sp->session) == 0)
1649 * We will keep the session in the cache list and let
1660 /* It is a new session and needs initialization. */
1688 * If this is a session from the parent it will be taken care of and
1690 * next time we will ask for a new session.
1750 * Destroy session structures from the linked list specified. Free as many
1783 if (sp->session != CK_INVALID_HANDLE && sp->pid == mypid)
1785 rv = pFuncList->C_CloseSession(sp->session);
1829 sp->session = CK_INVALID_HANDLE;
1832 NULL_PTR, NULL_PTR, &sp->session);
1837 * reinitialize of the session
1843 NULL_PTR, NULL_PTR, &sp->session);
1890 * We always initialize the session as containing a non-persistent
1924 /* Destroy RSA public key from single session. */
1942 /* Destroy RSA private key from single session. */
1961 * Destroy RSA key object wrapper. If session is NULL, try to destroy all
1965 pk11_destroy_rsa_key_objects(PK11_SESSION *session)
1972 if (session != NULL)
1973 local_free_session = session;
2004 if (session == NULL)
2012 /* Destroy DSA public key from single session. */
2034 /* Destroy DSA private key from single session. */
2057 * Destroy DSA key object wrapper. If session is NULL, try to destroy all
2061 pk11_destroy_dsa_key_objects(PK11_SESSION *session)
2068 if (session != NULL)
2069 local_free_session = session;
2100 if (session == NULL)
2108 /* Destroy DH key from single session. */
2133 * arg0: pointer to PKCS#11 engine session structure
2134 * if session is NULL, try to destroy all objects in the free list
2137 pk11_destroy_dh_key_objects(PK11_SESSION *session)
2144 if (session != NULL)
2145 local_free_session = session;
2167 if (session == NULL)
2175 pk11_destroy_object(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE oh,
2188 rv = pFuncList->C_DestroyObject(session, oh);
2280 rv = pFuncList->C_EncryptInit(sp->session, pmech,
2283 rv = pFuncList->C_DecryptInit(sp->session, pmech,
2402 * When reusing the same key in an encryption/decryption session for a
2403 * decryption/encryption session, we need to close the active session
2404 * and recreate a new one. Note that the key is in the global session so
2418 rv = pFuncList->C_CloseSession(sp->session);
2426 NULL_PTR, NULL_PTR, &sp->session);
2463 rv = pFuncList->C_EncryptUpdate(sp->session,
2475 rv = pFuncList->C_DecryptUpdate(sp->session,
2499 * Return the session to the pool. Calling C_EncryptFinal() and C_DecryptFinal()
2524 state->sp->session, buf, &len);
2527 state->sp->session, buf, &len);
2657 /* Create a secret key object in a PKCS#11 session */
2683 * mechanism. To get around this problem, we close the session and
2684 * then create a new session to use the same key object. When a session
2686 * objects in a global session, an individual session may be closed to
2689 CK_SESSION_HANDLE session = global_session;
2695 rv = pFuncList->C_CreateObject(session,
2705 * Save the key information used in this session.
2752 rv = pFuncList->C_DigestInit(sp->session, &mech);
2779 rv = pFuncList->C_DigestUpdate(state->sp->session, (CK_BYTE *) data,
2804 rv = pFuncList->C_DigestFinal(state->sp->session, md, &len);
2818 * Final is called and digest is returned, so return the session
2849 /* Get the size of the operation state of the copy-from session */
2850 rv = pFuncList->C_GetOperationState(state->sp->session, NULL,
2871 /* Get the operation state of the copy-from session */
2872 rv = pFuncList->C_GetOperationState(state->sp->session, pstate,
2882 /* Set the operation state of the copy-to session */
2883 rv = pFuncList->C_SetOperationState(state_to->sp->session, pstate,
2901 /* Return any pending session state to the pool */
2915 * will return the session to the cache.
2925 * Check if the new key is the same as the key object in the session. If the key
2945 static int pk11_destroy_cipher_key_objects(PK11_SESSION *session)
2951 if (session != NULL)
2952 local_free_session = session;
2978 if (session == NULL)