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
266 rv = f->C_Login(si->session, CKU_USER, in pkcs11_rsa_private_encrypt()
268 if (rv != CKR_OK && rv != CKR_USER_ALREADY_LOGGED_IN) { in pkcs11_rsa_private_encrypt()
270 error("C_Login failed: %lu", rv); in pkcs11_rsa_private_encrypt()
282 } else if ((rv = f->C_SignInit(si->session, &mech, obj)) != CKR_OK) { in pkcs11_rsa_private_encrypt()
283 error("C_SignInit failed: %lu", rv); in pkcs11_rsa_private_encrypt()
287 rv = f->C_Sign(si->session, (CK_BYTE *)from, flen, to, &tlen); in pkcs11_rsa_private_encrypt()
288 if (rv == CKR_OK) in pkcs11_rsa_private_encrypt()
291 error("C_Sign failed: %lu", rv); in pkcs11_rsa_private_encrypt()
352 CK_RV rv; in pkcs11_open_session() local
363 if ((rv = f->C_OpenSession(p->slotlist[slotidx], CKF_RW_SESSION| in pkcs11_open_session()
366 error("C_OpenSession failed: %lu", rv); in pkcs11_open_session()
370 rv = f->C_Login(session, CKU_USER, in pkcs11_open_session()
372 if (rv != CKR_OK && rv != CKR_USER_ALREADY_LOGGED_IN) { in pkcs11_open_session()
373 error("C_Login failed: %lu", rv); in pkcs11_open_session()
374 if ((rv = f->C_CloseSession(session)) != CKR_OK) in pkcs11_open_session()
375 error("C_CloseSession failed: %lu", rv); in pkcs11_open_session()
448 CK_RV rv; in pkcs11_fetch_keys_filter() local
457 if ((rv = f->C_FindObjectsInit(session, filter, 1)) != CKR_OK) { in pkcs11_fetch_keys_filter()
458 error("C_FindObjectsInit failed: %lu", rv); in pkcs11_fetch_keys_filter()
467 if ((rv = f->C_FindObjects(session, &obj, 1, &nfound)) != CKR_OK in pkcs11_fetch_keys_filter()
471 if ((rv = f->C_GetAttributeValue(session, obj, attribs, 3)) in pkcs11_fetch_keys_filter()
473 error("C_GetAttributeValue failed: %lu", rv); in pkcs11_fetch_keys_filter()
490 if ((rv = f->C_GetAttributeValue(session, obj, attribs, 3)) in pkcs11_fetch_keys_filter()
492 error("C_GetAttributeValue failed: %lu", rv); in pkcs11_fetch_keys_filter()
542 if ((rv = f->C_FindObjectsFinal(session)) != CKR_OK) in pkcs11_fetch_keys_filter()
543 error("C_FindObjectsFinal failed: %lu", rv); in pkcs11_fetch_keys_filter()
555 CK_RV rv; in pkcs11_add_provider() local
578 if ((rv = (*getfunctionlist)(&f)) != CKR_OK) { in pkcs11_add_provider()
579 error("C_GetFunctionList failed: %lu", rv); in pkcs11_add_provider()
583 if ((rv = f->C_Initialize(NULL)) != CKR_OK) { in pkcs11_add_provider()
584 error("C_Initialize failed: %lu", rv); in pkcs11_add_provider()
588 if ((rv = f->C_GetInfo(&p->info)) != CKR_OK) { in pkcs11_add_provider()
589 error("C_GetInfo failed: %lu", rv); in pkcs11_add_provider()
602 if ((rv = f->C_GetSlotList(CK_TRUE, NULL, &p->nslots)) != CKR_OK) { in pkcs11_add_provider()
603 error("C_GetSlotList failed: %lu", rv); in pkcs11_add_provider()
611 if ((rv = f->C_GetSlotList(CK_TRUE, p->slotlist, &p->nslots)) in pkcs11_add_provider()
613 error("C_GetSlotList failed: %lu", rv); in pkcs11_add_provider()
621 if ((rv = f->C_GetTokenInfo(p->slotlist[i], token)) in pkcs11_add_provider()
623 error("C_GetTokenInfo failed: %lu", rv); in pkcs11_add_provider()
646 if (need_finalize && (rv = f->C_Finalize(NULL)) != CKR_OK) in pkcs11_add_provider()
647 error("C_Finalize failed: %lu", rv); in pkcs11_add_provider()