/illumos-gate/usr/src/test/crypto-tests/tests/common/ |
H A D | cryptotest_pkcs.c | 48 cryptotest_error(char *name, CK_RV rv) in cryptotest_error() argument 51 name, rv, pkcs11_strerror(rv)); in cryptotest_error() 89 CK_RV rv; in cryptotest_close_session() local 90 rv = C_CloseSession(hsession); in cryptotest_close_session() 91 if (rv != CKR_OK) in cryptotest_close_session() 92 cryptotest_error("cryptotest_close_session", rv); in cryptotest_close_session() 94 return (rv); in cryptotest_close_session() 112 CK_RV rv; in get_mech_info() local 113 rv = pkcs11_str2mech(op->mechname, &op->mech); in get_mech_info() 114 if (rv != CKR_OK) { in get_mech_info() [all …]
|
/illumos-gate/usr/src/lib/pkcs11/libpkcs11/common/ |
H A D | pkcs11Object.c | 43 CK_RV rv; in C_CreateObject() local 57 HANDLE2SESSION(hSession, sessp, rv); in C_CreateObject() 59 if (rv != CKR_OK) { in C_CreateObject() 60 return (rv); in C_CreateObject() 64 rv = FUNCLIST(sessp->se_slotid)->C_CreateObject(sessp->se_handle, in C_CreateObject() 68 if (rv == CKR_FUNCTION_NOT_SUPPORTED) { in C_CreateObject() 72 return (rv); in C_CreateObject() 84 CK_RV rv; in C_CopyObject() local 98 HANDLE2SESSION(hSession, sessp, rv); in C_CopyObject() 100 if (rv != CKR_OK) { in C_CopyObject() [all …]
|
H A D | pkcs11Session.c | 45 CK_RV rv; in C_OpenSession() local 73 rv = meta_OpenSession(METASLOT_SLOTID, flags, in C_OpenSession() 82 rv = FUNCLIST(fw_st_id)->C_OpenSession(true_id, flags, in C_OpenSession() 87 if (rv == CKR_FUNCTION_NOT_SUPPORTED) { in C_OpenSession() 89 } else if (rv != CKR_OK) { in C_OpenSession() 91 return (rv); in C_OpenSession() 96 rv = pkcs11_session_add( in C_OpenSession() 100 rv = pkcs11_session_add(slottable->st_slots[fw_st_id], in C_OpenSession() 104 if (rv != CKR_OK) { in C_OpenSession() 108 return (rv); in C_OpenSession() [all …]
|
H A D | metaObject.c | 94 try_again(CK_RV rv) in try_again() argument 99 if (rv == stop_rv[i]) { in try_again() 115 CK_RV rv; in meta_CreateObject() local 127 rv = meta_handle2session(hSession, &session); in meta_CreateObject() 128 if (rv != CKR_OK) in meta_CreateObject() 129 return (rv); in meta_CreateObject() 131 rv = meta_object_alloc(session, &object); in meta_CreateObject() 132 if (rv != CKR_OK) in meta_CreateObject() 138 rv = meta_slot_object_alloc(&slot_object); in meta_CreateObject() 139 if (rv != CKR_OK) in meta_CreateObject() [all …]
|
H A D | metaSession.c | 54 CK_RV rv; in meta_OpenSession() local 78 rv = meta_session_alloc(&new_session); in meta_OpenSession() 79 if (rv != CKR_OK) in meta_OpenSession() 80 return (rv); in meta_OpenSession() 84 rv = meta_session_activate(new_session); in meta_OpenSession() 85 if (rv != CKR_OK) { in meta_OpenSession() 87 return (rv); in meta_OpenSession() 108 CK_RV rv; in meta_CloseSession() local 112 rv = meta_handle2session(hSession, &session); in meta_CloseSession() 113 if (rv != CKR_OK) in meta_CloseSession() [all …]
|
H A D | metaCrypt.c | 43 CK_RV rv; in meta_EncryptInit() local 50 rv = meta_handle2session(hSession, &session); in meta_EncryptInit() 51 if (rv != CKR_OK) in meta_EncryptInit() 52 return (rv); in meta_EncryptInit() 54 rv = meta_handle2object(hKey, &key); in meta_EncryptInit() 55 if (rv != CKR_OK) { in meta_EncryptInit() 57 return (rv); in meta_EncryptInit() 60 rv = meta_operation_init_defer(CKF_ENCRYPT, session, pMechanism, key); in meta_EncryptInit() 65 return (rv); in meta_EncryptInit() 78 CK_RV rv; in meta_Encrypt() local [all …]
|
H A D | pkcs11Crypt.c | 46 CK_RV rv; in C_EncryptInit() local 64 HANDLE2SESSION(hSession, sessp, rv); in C_EncryptInit() 66 if (rv != CKR_OK) { in C_EncryptInit() 67 return (rv); in C_EncryptInit() 78 rv = FUNCLIST(slotid)->C_EncryptInit(sessp->se_handle, in C_EncryptInit() 82 if (rv == CKR_FUNCTION_NOT_SUPPORTED) { in C_EncryptInit() 86 return (rv); in C_EncryptInit() 100 CK_RV rv; in C_Encrypt() local 114 HANDLE2SESSION(hSession, sessp, rv); in C_Encrypt() 116 if (rv != CKR_OK) { in C_Encrypt() [all …]
|
H A D | metaSign.c | 42 CK_RV rv; in meta_SignInit() local 49 rv = meta_handle2session(hSession, &session); in meta_SignInit() 50 if (rv != CKR_OK) in meta_SignInit() 51 return (rv); in meta_SignInit() 53 rv = meta_handle2object(hKey, &key); in meta_SignInit() 54 if (rv != CKR_OK) { in meta_SignInit() 56 return (rv); in meta_SignInit() 59 rv = meta_operation_init(CKF_SIGN, session, pMechanism, key); in meta_SignInit() 64 return (rv); in meta_SignInit() 77 CK_RV rv; in meta_Sign() local [all …]
|
H A D | metaKeys.c | 42 CK_RV rv; in meta_GenerateKey() local 49 rv = meta_handle2session(hSession, &session); in meta_GenerateKey() 50 if (rv != CKR_OK) in meta_GenerateKey() 51 return (rv); in meta_GenerateKey() 54 rv = meta_object_alloc(session, &key); in meta_GenerateKey() 55 if (rv != CKR_OK) in meta_GenerateKey() 58 rv = meta_generate_keys(session, pMechanism, pTemplate, ulCount, key, in meta_GenerateKey() 60 if (rv != CKR_OK) in meta_GenerateKey() 68 if (rv != CKR_OK) { in meta_GenerateKey() 75 return (rv); in meta_GenerateKey() [all …]
|
H A D | metaVerify.c | 42 CK_RV rv; in meta_VerifyInit() local 49 rv = meta_handle2session(hSession, &session); in meta_VerifyInit() 50 if (rv != CKR_OK) in meta_VerifyInit() 51 return (rv); in meta_VerifyInit() 53 rv = meta_handle2object(hKey, &key); in meta_VerifyInit() 54 if (rv != CKR_OK) { in meta_VerifyInit() 56 return (rv); in meta_VerifyInit() 59 rv = meta_operation_init(CKF_VERIFY, session, pMechanism, key); in meta_VerifyInit() 64 return (rv); in meta_VerifyInit() 76 CK_RV rv; in meta_Verify() local [all …]
|
H A D | pkcs11Sign.c | 45 CK_RV rv; in C_SignInit() local 63 HANDLE2SESSION(hSession, sessp, rv); in C_SignInit() 65 if (rv != CKR_OK) { in C_SignInit() 66 return (rv); in C_SignInit() 77 rv = FUNCLIST(slotid)->C_SignInit(sessp->se_handle, in C_SignInit() 81 if (rv == CKR_FUNCTION_NOT_SUPPORTED) { in C_SignInit() 85 return (rv); in C_SignInit() 99 CK_RV rv; in C_Sign() local 113 HANDLE2SESSION(hSession, sessp, rv); in C_Sign() 115 if (rv != CKR_OK) { in C_Sign() [all …]
|
H A D | pkcs11Verify.c | 44 CK_RV rv; in C_VerifyInit() local 62 HANDLE2SESSION(hSession, sessp, rv); in C_VerifyInit() 64 if (rv != CKR_OK) { in C_VerifyInit() 65 return (rv); in C_VerifyInit() 76 rv = FUNCLIST(slotid)->C_VerifyInit(sessp->se_handle, in C_VerifyInit() 80 if (rv == CKR_FUNCTION_NOT_SUPPORTED) { in C_VerifyInit() 84 return (rv); in C_VerifyInit() 96 CK_RV rv; in C_Verify() local 110 HANDLE2SESSION(hSession, sessp, rv); in C_Verify() 112 if (rv != CKR_OK) { in C_Verify() [all …]
|
/illumos-gate/usr/src/lib/libzfsbootenv/common/ |
H A D | lzbe_pair.c | 33 int rv = -1; in lzbe_nvlist_get() local 36 return (rv); in lzbe_nvlist_get() 39 return (rv); in lzbe_nvlist_get() 45 return (rv); in lzbe_nvlist_get() 48 rv = zpool_get_bootenv(zphdl, &nv); in lzbe_nvlist_get() 49 if (rv == 0) { in lzbe_nvlist_get() 53 rv = nvlist_lookup_nvlist(nv, key, &nvl); in lzbe_nvlist_get() 54 if (rv == 0) { in lzbe_nvlist_get() 55 rv = nvlist_dup(nvl, &dup, 0); in lzbe_nvlist_get() 57 if (rv == 0) in lzbe_nvlist_get() [all …]
|
/illumos-gate/usr/src/lib/pkcs11/pkcs11_softtoken/common/ |
H A D | softObject.c | 45 CK_RV rv; in C_CreateObject() local 56 rv = handle2session(hSession, &session_p); in C_CreateObject() 57 if (rv != CKR_OK) in C_CreateObject() 58 return (rv); in C_CreateObject() 62 rv = CKR_ARGUMENTS_BAD; in C_CreateObject() 67 rv = soft_add_object(pTemplate, ulCount, phObject, session_p); in C_CreateObject() 75 return (rv); in C_CreateObject() 84 CK_RV rv; in C_CopyObject() local 97 rv = handle2session(hSession, &session_p); in C_CopyObject() 98 if (rv != CKR_OK) in C_CopyObject() [all …]
|
H A D | softKeys.c | 38 CK_RV rv; in C_GenerateKey() local 46 rv = handle2session(hSession, &session_p); in C_GenerateKey() 47 if (rv != CKR_OK) in C_GenerateKey() 48 return (rv); in C_GenerateKey() 51 rv = CKR_ARGUMENTS_BAD; in C_GenerateKey() 56 rv = CKR_ARGUMENTS_BAD; in C_GenerateKey() 60 rv = soft_genkey(session_p, pMechanism, pTemplate, in C_GenerateKey() 65 return (rv); in C_GenerateKey() 77 CK_RV rv; in C_GenerateKeyPair() local 85 rv = handle2session(hSession, &session_p); in C_GenerateKeyPair() [all …]
|
H A D | softSign.c | 39 CK_RV rv; in C_SignInit() local 48 rv = handle2session(hSession, &session_p); in C_SignInit() 49 if (rv != CKR_OK) in C_SignInit() 50 return (rv); in C_SignInit() 53 rv = CKR_ARGUMENTS_BAD; in C_SignInit() 58 HANDLE2OBJECT(hKey, key_p, rv); in C_SignInit() 59 if (rv != CKR_OK) { in C_SignInit() 65 rv = CKR_KEY_FUNCTION_NOT_PERMITTED; in C_SignInit() 87 rv = soft_sign_init(session_p, pMechanism, key_p); in C_SignInit() 89 if (rv != CKR_OK) { in C_SignInit() [all …]
|
/illumos-gate/usr/src/lib/pkcs11/pkcs11_kernel/common/ |
H A D | kernelObject.c | 45 CK_RV rv; in C_CreateObject() local 61 rv = handle2session(hSession, &session_p); in C_CreateObject() 62 if (rv != CKR_OK) in C_CreateObject() 63 return (rv); in C_CreateObject() 66 rv = kernel_add_object(pTemplate, ulCount, phObject, session_p); in C_CreateObject() 74 return (rv); in C_CreateObject() 84 CK_RV rv; in C_CopyObject() local 108 rv = handle2session(hSession, &session_p); in C_CopyObject() 109 if (rv != CKR_OK) in C_CopyObject() 110 return (rv); in C_CopyObject() [all …]
|
H A D | kernelSign.c | 39 CK_RV rv; in C_SignInit() local 55 rv = kernel_mech(pMechanism->mechanism, &k_mech_type); in C_SignInit() 56 if (rv != CKR_OK) { in C_SignInit() 57 return (rv); in C_SignInit() 61 rv = handle2session(hSession, &session_p); in C_SignInit() 62 if (rv != CKR_OK) in C_SignInit() 63 return (rv); in C_SignInit() 66 HANDLE2OBJECT(hKey, key_p, rv); in C_SignInit() 67 if (rv != CKR_OK) { in C_SignInit() 69 return (rv); in C_SignInit() [all …]
|
/illumos-gate/usr/src/lib/smbsrv/libfksmbsrv/common/ |
H A D | fksmb_sign_pkcs.c | 38 CK_RV rv; in find_mech() local 40 rv = SUNW_C_GetMechSession(mid, &hdl); in find_mech() 41 if (rv != CKR_OK) { in find_mech() 74 CK_RV rv; in smb_md5_init() local 76 rv = SUNW_C_GetMechSession(mech->mechanism, ctxp); in smb_md5_init() 77 if (rv != CKR_OK) in smb_md5_init() 80 rv = C_DigestInit(*ctxp, mech); in smb_md5_init() 82 return (rv == CKR_OK ? 0 : -1); in smb_md5_init() 91 CK_RV rv; in smb_md5_update() local 93 rv = C_DigestUpdate(ctx, buf, len); in smb_md5_update() [all …]
|
/illumos-gate/usr/src/lib/smbclnt/libfknsmb/common/ |
H A D | fksmb_sign_pkcs.c | 44 CK_RV rv; in find_mech() local 46 rv = SUNW_C_GetMechSession(mid, &hdl); in find_mech() 47 if (rv != CKR_OK) { in find_mech() 80 CK_RV rv; in nsmb_md5_init() local 82 rv = SUNW_C_GetMechSession(mech->mechanism, ctxp); in nsmb_md5_init() 83 if (rv != CKR_OK) in nsmb_md5_init() 86 rv = C_DigestInit(*ctxp, mech); in nsmb_md5_init() 88 return (rv == CKR_OK ? 0 : -1); in nsmb_md5_init() 97 CK_RV rv; in nsmb_md5_update() local 99 rv = C_DigestUpdate(ctx, buf, len); in nsmb_md5_update() [all …]
|
/illumos-gate/usr/src/common/nvpair/ |
H A D | fnvpair.c | 99 nvlist_t *rv; in fnvlist_unpack() local 100 VERIFY0(nvlist_unpack(buf, buflen, &rv, KM_SLEEP)); in fnvlist_unpack() 101 return (rv); in fnvlist_unpack() 107 nvlist_t *rv; in fnvlist_dup() local 108 VERIFY0(nvlist_dup(nvl, &rv, KM_SLEEP)); in fnvlist_dup() 109 return (rv); in fnvlist_dup() 307 nvpair_t *rv; in fnvlist_lookup_nvpair() local 308 VERIFY0(nvlist_lookup_nvpair(nvl, name, &rv)); in fnvlist_lookup_nvpair() 309 return (rv); in fnvlist_lookup_nvpair() 322 boolean_t rv; in fnvlist_lookup_boolean_value() local [all …]
|
/illumos-gate/usr/src/lib/libdevice/ |
H A D | devctl.c | 484 int rv; in devctl_pm_raisepower() local 492 rv = dc_cmd(DEVCTL_PM_RAISE_PWR, 0, DCP(dcp), NULL, NULL); in devctl_pm_raisepower() 495 (void) printf("devctl_pm_raisepower: %d\n", rv); in devctl_pm_raisepower() 497 return (rv); in devctl_pm_raisepower() 506 int rv; in devctl_pm_changepowerhigh() local 514 rv = dc_cmd(DEVCTL_PM_CHANGE_PWR_HIGH, 0, DCP(dcp), NULL, NULL); in devctl_pm_changepowerhigh() 517 (void) printf("devctl_pm_changepowerhigh: %d\n", rv); in devctl_pm_changepowerhigh() 519 return (rv); in devctl_pm_changepowerhigh() 528 int rv; in devctl_pm_changepowerlow() local 536 rv = dc_cmd(DEVCTL_PM_CHANGE_PWR_LOW, 0, DCP(dcp), NULL, NULL); in devctl_pm_changepowerlow() [all …]
|
/illumos-gate/usr/src/lib/pkcs11/pkcs11_tpm/common/ |
H A D | api_interface.c | 396 CK_RV rv; in C_CloseAllSessions() local 429 rv = C_CloseSession((CK_SESSION_HANDLE)pCur); in C_CloseAllSessions() 430 if (rv == CKR_OK || in C_CloseAllSessions() 431 rv == CKR_SESSION_CLOSED || in C_CloseAllSessions() 432 rv == CKR_SESSION_HANDLE_INVALID) { in C_CloseAllSessions() 439 return (rv); in C_CloseAllSessions() 451 CK_RV rv; in C_CloseSession() local 465 rv = FuncList.ST_CloseSession(rSession); in C_CloseSession() 467 if (rv == CKR_OK) { in C_CloseSession() 472 rv = CKR_FUNCTION_NOT_SUPPORTED; in C_CloseSession() [all …]
|
/illumos-gate/usr/src/lib/libnisdb/ |
H A D | ldap_ruleval.c | 45 freeRuleValue(__nis_rule_value_t *rv, int count) { in freeRuleValue() argument 48 if (rv == 0) in freeRuleValue() 53 if (rv[n].colName != 0) { in freeRuleValue() 54 for (i = 0; i < rv[n].numColumns; i++) { in freeRuleValue() 55 sfree(rv[n].colName[i]); in freeRuleValue() 57 free(rv[n].colName); in freeRuleValue() 59 if (rv[n].colVal != 0) { in freeRuleValue() 60 for (i = 0; i < rv[n].numColumns; i++) { in freeRuleValue() 61 for (j = 0; j < rv[n].colVal[i].numVals; j++) { in freeRuleValue() 62 sfree(rv[n].colVal[i].val[j].value); in freeRuleValue() [all …]
|
/illumos-gate/usr/src/cmd/vntsd/ |
H A D | read.c | 87 int rv; in acquire_writer() local 111 rv = vntsd_que_rm(&(consp->clientpq), clientp); in acquire_writer() 112 assert(rv == VNTSD_SUCCESS); in acquire_writer() 120 rv = vntsd_que_insert_after(consp->clientpq, clientp, writerp); in acquire_writer() 126 if (rv != VNTSD_SUCCESS) { in acquire_writer() 127 return (rv); in acquire_writer() 132 if ((rv = vntsd_write_line(writerp, in acquire_writer() 135 return (rv); in acquire_writer() 163 int rv; in read_char() local 167 rv = vntsd_read_data(clientp, c); in read_char() [all …]
|