Lines Matching defs:session

132 /* PKCS#11 session caches and their locks for all operation types */
144 * time in a given session. Therefore, C_Find{,Init,Final}Objects() should be
146 * ensured by the property of unique PKCS#11 session handle used for each
168 * Create all secret key objects in a global session so that they are available
248 int pk11_destroy_rsa_key_objects(PK11_SESSION *session);
253 int pk11_destroy_dsa_key_objects(PK11_SESSION *session);
258 int pk11_destroy_dh_key_objects(PK11_SESSION *session);
259 int pk11_destroy_dh_object(PK11_SESSION *session, CK_BBOOL uselock);
266 static int pk11_destroy_cipher_key_objects(PK11_SESSION *session);
329 retval = pk11_destroy_object((sp)->session, (obj_hdl), \
403 * session in multiple cipher_update calls
1064 /* invalidate the global session */
1277 * Termination function to clean up the session, the token, and the pk11
1312 /* Global session is not present when there are no slots. */
1399 pFuncList->C_SeedRandom(sp->session, (unsigned char *) buf, num);
1419 rv = pFuncList->C_GenerateRandom(sp->session, buf, num);
1515 * the session structure because we could get a newly allocated session
1538 * It is a new session so it will look like a cache miss to the
1557 * PK11_SESSION objects aside from the first session (sp) which
1609 * It is an inherited session from our parent so it needs
1617 if (pk11_token_relogin(sp->session) == 0) {
1619 * We will keep the session in the cache list and let
1629 /* It is a new session and needs initialization. */
1657 * If this is a session from the parent it will be taken care of and
1659 * next time we will ask for a new session.
1719 * Destroy session structures from the linked list specified. Free as many
1751 if (sp->session != CK_INVALID_HANDLE && sp->pid == mypid) {
1752 rv = pFuncList->C_CloseSession(sp->session);
1794 sp->session = CK_INVALID_HANDLE;
1797 NULL_PTR, NULL_PTR, &sp->session);
1801 * reinitialize of the session
1808 NULL_PTR, NULL_PTR, &sp->session);
1853 * We always initialize the session as containing a non-persistent
1884 /* Destroy RSA public key from single session. */
1901 /* Destroy RSA private key from single session. */
1919 * Destroy RSA key object wrapper. If session is NULL, try to destroy all
1923 pk11_destroy_rsa_key_objects(PK11_SESSION *session)
1930 if (session != NULL) {
1931 local_free_session = session;
1958 if (session == NULL) {
1967 /* Destroy DSA public key from single session. */
1987 /* Destroy DSA private key from single session. */
2008 * Destroy DSA key object wrapper. If session is NULL, try to destroy all
2012 pk11_destroy_dsa_key_objects(PK11_SESSION *session)
2019 if (session != NULL) {
2020 local_free_session = session;
2047 if (session == NULL) {
2056 /* Destroy DH key from single session. */
2079 * arg0: pointer to PKCS#11 engine session structure
2080 * if session is NULL, try to destroy all objects in the free list
2083 pk11_destroy_dh_key_objects(PK11_SESSION *session)
2090 if (session != NULL) {
2091 local_free_session = session;
2110 if (session == NULL) {
2119 pk11_destroy_object(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE oh,
2133 rv = pFuncList->C_DestroyObject(session, oh);
2224 rv = pFuncList->C_EncryptInit(sp->session, pmech,
2227 rv = pFuncList->C_DecryptInit(sp->session, pmech,
2346 * When reusing the same key in an encryption/decryption session for a
2347 * decryption/encryption session, we need to close the active session
2348 * and recreate a new one. Note that the key is in the global session so
2362 rv = pFuncList->C_CloseSession(sp->session);
2369 NULL_PTR, NULL_PTR, &sp->session);
2408 rv = pFuncList->C_EncryptUpdate(sp->session,
2416 rv = pFuncList->C_DecryptUpdate(sp->session,
2439 * Return the session to the pool. Calling C_EncryptFinal() and C_DecryptFinal()
2463 state->sp->session, buf, &len);
2466 state->sp->session, buf, &len);
2596 /* Create a secret key object in a PKCS#11 session */
2621 * mechanism. To get around this problem, we close the session and
2622 * then create a new session to use the same key object. When a session
2624 * objects in a global session, an individual session may be closed to
2627 CK_SESSION_HANDLE session = global_session;
2633 rv = pFuncList->C_CreateObject(session,
2642 * Save the key information used in this session.
2693 rv = pFuncList->C_DigestInit(sp->session, &mech);
2720 rv = pFuncList->C_DigestUpdate(state->sp->session, (CK_BYTE *) data,
2744 rv = pFuncList->C_DigestFinal(state->sp->session, md, &len);
2757 * Final is called and digest is returned, so return the session
2791 /* Get the size of the operation state of the copy-from session */
2792 rv = pFuncList->C_GetOperationState(state->sp->session, NULL,
2809 /* Get the operation state of the copy-from session */
2810 rv = pFuncList->C_GetOperationState(state->sp->session, pstate,
2818 /* Set the operation state of the copy-to session */
2819 rv = pFuncList->C_SetOperationState(state_to->sp->session, pstate,
2836 /* Return any pending session state to the pool */
2849 * will return the session to the cache.
2860 * Check if the new key is the same as the key object in the session. If the key
2881 pk11_destroy_cipher_key_objects(PK11_SESSION *session)
2887 if (session != NULL) {
2888 local_free_session = session;
2912 if (session == NULL) {