• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/crypto/heimdal/lib/hx509/

Lines Matching refs:ret

48     CK_RV ret;
57 ret = (*func->C_FindObjectsInit)(session, search_data, num_search_data);
58 if (ret != CKR_OK)
59 return ret;
61 ret = (*func->C_FindObjects)(session, object, 1, &object_count);
62 if (ret != CKR_OK)
63 return ret;
69 ret = (*func->C_FindObjectsFinal)(session);
70 if (ret != CKR_OK)
71 return ret;
86 CK_RV ret;
92 ret = C_GetFunctionList(&func);
93 if (ret != CKR_OK)
94 errx(1, "C_GetFunctionList failed: %d", (int)ret);
98 ret = (*func->C_GetSlotList)(FALSE, NULL, &num_slots);
99 if (ret != CKR_OK)
100 errx(1, "C_GetSlotList1 failed: %d", (int)ret);
108 ret = (*func->C_GetSlotList)(FALSE, slot_ids, &num_slots);
109 if (ret != CKR_OK)
110 errx(1, "C_GetSlotList2 failed: %d", (int)ret);
115 ret = (*func->C_GetSlotInfo)(slot, &slot_info);
116 if (ret)
117 errx(1, "C_GetSlotInfo failed: %d", (int)ret);
122 ret = (*func->C_OpenSession)(slot, CKF_SERIAL_SESSION,
124 if (ret != CKR_OK)
125 errx(1, "C_OpenSession failed: %d", (int)ret);
127 ret = (*func->C_GetTokenInfo)(slot, &token_info);
128 if (ret)
129 errx(1, "C_GetTokenInfo1 failed: %d", (int)ret);
132 ret = (*func->C_Login)(session, CKU_USER,
134 if (ret != CKR_OK)
135 errx(1, "C_Login failed: %d", (int)ret);
138 ret = (*func->C_GetTokenInfo)(slot, &token_info);
139 if (ret)
140 errx(1, "C_GetTokenInfo2 failed: %d", (int)ret);
145 ret = find_object(session, "cert", CKO_PUBLIC_KEY, &public);
146 if (ret != CKR_OK)
147 errx(1, "find cert failed: %d", (int)ret);
148 ret = find_object(session, "cert", CKO_PRIVATE_KEY, &private);
149 if (ret != CKR_OK)
150 errx(1, "find private key failed: %d", (int)ret);
159 ret = (*func->C_SignInit)(session, &mechanism, private);
160 if (ret != CKR_OK)
164 ret = (*func->C_Sign)(session, (CK_BYTE *)sighash, strlen(sighash),
166 if (ret != CKR_OK) {
167 printf("C_Sign failed with: %d\n", (int)ret);
171 ret = (*func->C_VerifyInit)(session, &mechanism, public);
172 if (ret != CKR_OK)
175 ret = (*func->C_Verify)(session, (CK_BYTE *)signature, ck_sigsize,
177 if (ret != CKR_OK) {
178 printf("message: %d\n", (int)ret);
192 ret = (*func->C_EncryptInit)(session, &mechanism, public);
193 if (ret != CKR_OK)
197 ret = (*func->C_Encrypt)(session, (CK_BYTE *)sighash, strlen(sighash),
199 if (ret != CKR_OK) {
200 printf("message: %d\n", (int)ret);
204 ret = (*func->C_DecryptInit)(session, &mechanism, private);
205 if (ret != CKR_OK)
209 ret = (*func->C_Decrypt)(session, (CK_BYTE *)signature, ck_sigsize,
211 if (ret != CKR_OK) {
212 printf("message: %d\n", (int)ret);
221 ret = (*func->C_CloseSession)(session);
222 if (ret != CKR_OK)