Lines Matching refs:rv
94 CK_RV rv; in pkcs11_provider_finalize() local
103 (rv = p->function_list->C_CloseSession( in pkcs11_provider_finalize()
105 error("C_CloseSession failed: %lu", rv); in pkcs11_provider_finalize()
107 if ((rv = p->function_list->C_Finalize(NULL)) != CKR_OK) in pkcs11_provider_finalize()
108 error("C_Finalize failed: %lu", rv); in pkcs11_provider_finalize()
178 int rv = -1; in pkcs11_rsa_finish() local
182 rv = k11->orig_finish(rsa); in pkcs11_rsa_finish()
188 return (rv); in pkcs11_rsa_finish()
199 CK_RV rv; in pkcs11_find() local
204 if ((rv = f->C_FindObjectsInit(session, attr, nattr)) != CKR_OK) { in pkcs11_find()
205 error("C_FindObjectsInit failed (nattr %lu): %lu", nattr, rv); in pkcs11_find()
208 if ((rv = f->C_FindObjects(session, obj, 1, &nfound)) != CKR_OK || in pkcs11_find()
211 nfound, nattr, rv); in pkcs11_find()
214 if ((rv = f->C_FindObjectsFinal(session)) != CKR_OK) in pkcs11_find()
215 error("C_FindObjectsFinal failed: %lu", rv); in pkcs11_find()
229 CK_RV rv; in pkcs11_rsa_private_encrypt() local
272 rv = f->C_Login(si->session, CKU_USER, (u_char *)pin, in pkcs11_rsa_private_encrypt()
278 if (rv != CKR_OK && rv != CKR_USER_ALREADY_LOGGED_IN) { in pkcs11_rsa_private_encrypt()
279 error("C_Login failed: %lu", rv); in pkcs11_rsa_private_encrypt()
290 } else if ((rv = f->C_SignInit(si->session, &mech, obj)) != CKR_OK) { in pkcs11_rsa_private_encrypt()
291 error("C_SignInit failed: %lu", rv); in pkcs11_rsa_private_encrypt()
295 rv = f->C_Sign(si->session, (CK_BYTE *)from, flen, to, &tlen); in pkcs11_rsa_private_encrypt()
296 if (rv == CKR_OK) in pkcs11_rsa_private_encrypt()
299 error("C_Sign failed: %lu", rv); in pkcs11_rsa_private_encrypt()
360 CK_RV rv; in pkcs11_open_session() local
371 if ((rv = f->C_OpenSession(p->slotlist[slotidx], CKF_RW_SESSION| in pkcs11_open_session()
374 error("C_OpenSession failed: %lu", rv); in pkcs11_open_session()
378 rv = f->C_Login(session, CKU_USER, in pkcs11_open_session()
380 if (rv != CKR_OK && rv != CKR_USER_ALREADY_LOGGED_IN) { in pkcs11_open_session()
381 error("C_Login failed: %lu", rv); in pkcs11_open_session()
382 if ((rv = f->C_CloseSession(session)) != CKR_OK) in pkcs11_open_session()
383 error("C_CloseSession failed: %lu", rv); in pkcs11_open_session()
456 CK_RV rv; in pkcs11_fetch_keys_filter() local
465 if ((rv = f->C_FindObjectsInit(session, filter, 1)) != CKR_OK) { in pkcs11_fetch_keys_filter()
466 error("C_FindObjectsInit failed: %lu", rv); in pkcs11_fetch_keys_filter()
475 if ((rv = f->C_FindObjects(session, &obj, 1, &nfound)) != CKR_OK in pkcs11_fetch_keys_filter()
479 if ((rv = f->C_GetAttributeValue(session, obj, attribs, 3)) in pkcs11_fetch_keys_filter()
481 error("C_GetAttributeValue failed: %lu", rv); in pkcs11_fetch_keys_filter()
506 if ((rv = f->C_GetAttributeValue(session, obj, attribs, 3)) in pkcs11_fetch_keys_filter()
508 error("C_GetAttributeValue failed: %lu", rv); in pkcs11_fetch_keys_filter()
558 if ((rv = f->C_FindObjectsFinal(session)) != CKR_OK) in pkcs11_fetch_keys_filter()
559 error("C_FindObjectsFinal failed: %lu", rv); in pkcs11_fetch_keys_filter()
571 CK_RV rv; in pkcs11_add_provider() local
594 if ((rv = (*getfunctionlist)(&f)) != CKR_OK) { in pkcs11_add_provider()
595 error("C_GetFunctionList failed: %lu", rv); in pkcs11_add_provider()
599 if ((rv = f->C_Initialize(NULL)) != CKR_OK) { in pkcs11_add_provider()
600 error("C_Initialize failed: %lu", rv); in pkcs11_add_provider()
604 if ((rv = f->C_GetInfo(&p->info)) != CKR_OK) { in pkcs11_add_provider()
605 error("C_GetInfo failed: %lu", rv); in pkcs11_add_provider()
618 if ((rv = f->C_GetSlotList(CK_TRUE, NULL, &p->nslots)) != CKR_OK) { in pkcs11_add_provider()
619 error("C_GetSlotList failed: %lu", rv); in pkcs11_add_provider()
627 if ((rv = f->C_GetSlotList(CK_TRUE, p->slotlist, &p->nslots)) in pkcs11_add_provider()
629 error("C_GetSlotList failed: %lu", rv); in pkcs11_add_provider()
637 if ((rv = f->C_GetTokenInfo(p->slotlist[i], token)) in pkcs11_add_provider()
639 error("C_GetTokenInfo failed: %lu", rv); in pkcs11_add_provider()
667 if (need_finalize && (rv = f->C_Finalize(NULL)) != CKR_OK) in pkcs11_add_provider()
668 error("C_Finalize failed: %lu", rv); in pkcs11_add_provider()