Lines Matching refs:rv

104         CK_RV rv;  in pkcs11_get_slot_list_malloc()  local
114 rv = m->C_GetSlotList(0, NULL, &n_slotids); in pkcs11_get_slot_list_malloc()
115 if (rv != CKR_OK) in pkcs11_get_slot_list_malloc()
116 return rv; in pkcs11_get_slot_list_malloc()
127 rv = m->C_GetSlotList(0, slotids, &n_slotids); in pkcs11_get_slot_list_malloc()
128 if (rv == CKR_OK) { in pkcs11_get_slot_list_malloc()
134 if (rv != CKR_BUFFER_TOO_SMALL) in pkcs11_get_slot_list_malloc()
135 return rv; in pkcs11_get_slot_list_malloc()
186 CK_RV rv; in pkcs11_token_login_by_pin() local
192 rv = m->C_Login(session, CKU_USER, NULL, 0); in pkcs11_token_login_by_pin()
193 if (rv != CKR_OK) in pkcs11_token_login_by_pin()
195 … "Failed to log into security token '%s': %s", token_label, p11_kit_strerror(rv)); in pkcs11_token_login_by_pin()
209 rv = m->C_Login(session, CKU_USER, (CK_UTF8CHAR*) pin, pin_size); in pkcs11_token_login_by_pin()
210 if (rv == CKR_OK) { in pkcs11_token_login_by_pin()
215 if (rv == CKR_PIN_LOCKED) in pkcs11_token_login_by_pin()
218 if (!IN_SET(rv, CKR_PIN_INCORRECT, CKR_PIN_LEN_RANGE)) in pkcs11_token_login_by_pin()
220 … "Failed to log into security token '%s': %s", token_label, p11_kit_strerror(rv)); in pkcs11_token_login_by_pin()
244 CK_RV rv; in pkcs11_token_login() local
334 rv = m->C_GetTokenInfo(slotid, &updated_token_info); in pkcs11_token_login()
335 if (rv != CKR_OK) in pkcs11_token_login()
338 slotid, p11_kit_strerror(rv)); in pkcs11_token_login()
358 CK_RV rv, rv2; in pkcs11_token_find_x509_certificate() local
434 rv = m->C_FindObjectsInit(session, attributes, n_attributes); in pkcs11_token_find_x509_certificate()
435 if (rv != CKR_OK) in pkcs11_token_find_x509_certificate()
437 … "Failed to initialize object find call: %s", p11_kit_strerror(rv)); in pkcs11_token_find_x509_certificate()
439 rv = m->C_FindObjects(session, objects, ELEMENTSOF(objects), &n_objects); in pkcs11_token_find_x509_certificate()
441 if (rv != CKR_OK) in pkcs11_token_find_x509_certificate()
443 "Failed to find objects: %s", p11_kit_strerror(rv)); in pkcs11_token_find_x509_certificate()
446 … "Failed to finalize object find call: %s", p11_kit_strerror(rv)); in pkcs11_token_find_x509_certificate()
470 CK_RV rv; in pkcs11_token_read_x509_certificate() local
475 rv = m->C_GetAttributeValue(session, object, &attribute, 1); in pkcs11_token_read_x509_certificate()
476 if (rv != CKR_OK) in pkcs11_token_read_x509_certificate()
478 … "Failed to read X.509 certificate size off token: %s", p11_kit_strerror(rv)); in pkcs11_token_read_x509_certificate()
486 rv = m->C_GetAttributeValue(session, object, &attribute, 1); in pkcs11_token_read_x509_certificate()
487 if (rv != CKR_OK) in pkcs11_token_read_x509_certificate()
489 … "Failed to read X.509 certificate data off token: %s", p11_kit_strerror(rv)); in pkcs11_token_read_x509_certificate()
522 CK_RV rv, rv2; in pkcs11_token_find_private_key() local
624 rv = m->C_FindObjectsInit(session, attributes, n_attributes); in pkcs11_token_find_private_key()
625 if (rv != CKR_OK) in pkcs11_token_find_private_key()
627 … "Failed to initialize object find call: %s", p11_kit_strerror(rv)); in pkcs11_token_find_private_key()
629 rv = m->C_FindObjects(session, objects, ELEMENTSOF(objects), &n_objects); in pkcs11_token_find_private_key()
631 if (rv != CKR_OK) in pkcs11_token_find_private_key()
633 "Failed to find objects: %s", p11_kit_strerror(rv)); in pkcs11_token_find_private_key()
636 … "Failed to finalize object find call: %s", p11_kit_strerror(rv)); in pkcs11_token_find_private_key()
662 CK_RV rv; in pkcs11_token_decrypt_data() local
670 rv = m->C_DecryptInit(session, (CK_MECHANISM*) &mechanism, object); in pkcs11_token_decrypt_data()
671 if (rv != CKR_OK) in pkcs11_token_decrypt_data()
673 … "Failed to initialize decryption on security token: %s", p11_kit_strerror(rv)); in pkcs11_token_decrypt_data()
680rv = m->C_Decrypt(session, (CK_BYTE*) encrypted_data, encrypted_data_size, dbuffer, &dbuffer_size); in pkcs11_token_decrypt_data()
681 if (rv == CKR_BUFFER_TOO_SMALL) { in pkcs11_token_decrypt_data()
688rv = m->C_Decrypt(session, (CK_BYTE*) encrypted_data, encrypted_data_size, dbuffer, &dbuffer_size); in pkcs11_token_decrypt_data()
690 if (rv != CKR_OK) in pkcs11_token_decrypt_data()
692 … "Failed to decrypt key on security token: %s", p11_kit_strerror(rv)); in pkcs11_token_decrypt_data()
707 CK_RV rv; in pkcs11_token_acquire_rng() local
725 rv = m->C_GenerateRandom(session, buffer, rps); in pkcs11_token_acquire_rng()
726 if (rv != CKR_OK) in pkcs11_token_acquire_rng()
728 … "Failed to generate RNG data on security token: %s", p11_kit_strerror(rv)); in pkcs11_token_acquire_rng()
750 CK_RV rv; in token_process() local
761 rv = m->C_OpenSession(slotid, CKF_SERIAL_SESSION, NULL, NULL, &session); in token_process()
762 if (rv != CKR_OK) in token_process()
764 … "Failed to create session for security token '%s': %s", token_label, p11_kit_strerror(rv)); in token_process()
771 rv = m->C_CloseSession(session); in token_process()
772 if (rv != CKR_OK) in token_process()
773 … log_warning("Failed to close session on PKCS#11 token, ignoring: %s", p11_kit_strerror(rv)); in token_process()
790 CK_RV rv; in slot_process() local
797 rv = m->C_GetSlotInfo(slotid, &slot_info); in slot_process()
798 if (rv != CKR_OK) { in slot_process()
799 …rning("Failed to acquire slot info for slot %lu, ignoring slot: %s", slotid, p11_kit_strerror(rv)); in slot_process()
819 rv = m->C_GetTokenInfo(slotid, &token_info); in slot_process()
820 if (rv == CKR_TOKEN_NOT_PRESENT) { in slot_process()
823 } else if (rv != CKR_OK) { in slot_process()
824 …ning("Failed to acquire token info for slot %lu, ignoring slot: %s", slotid, p11_kit_strerror(rv)); in slot_process()
868 CK_RV rv; in module_process() local
883 rv = m->C_GetInfo(&info); in module_process()
884 if (rv != CKR_OK) { in module_process()
885 … log_warning("Failed to get info on PKCS#11 module, ignoring module: %s", p11_kit_strerror(rv)); in module_process()
901 rv = pkcs11_get_slot_list_malloc(m, &slotids, &n_slotids); in module_process()
902 if (rv != CKR_OK) { in module_process()
903 log_warning("Failed to get slot list, ignoring module: %s", p11_kit_strerror(rv)); in module_process()