Lines Matching defs:rc

466 	CK_ULONG publ_exp, rc = 1;
477 rc = memcmp(pubexp_bytes, publ_exp_attr->pValue, 3);
482 rc = 0;
488 return (rc);
505 stlogit("Tspi_GetAttribData failed: rc=0x%0x - %s\n",
513 stlogit("Trspi_UnloadBlob_PUBKEY failed: rc=0x%0x - %s\n",
534 stlogit("Tspi_SetAttribData failed: rc=0x%0x - %s\n",
606 TSS_RESULT rc;
610 if ((rc = Tspi_Context_GetTpmObject(hContext, &hTPM))) {
612 rc, Trspi_Error_String(rc));
616 if ((rc = Tspi_TPM_GetRandom(hTPM, bytes, &random_bytes))) {
618 rc, Trspi_Error_String(rc));
771 CK_RV rc = CKR_OK;
781 if ((rc = object_mgr_find_in_map1(hContext, ckObject, &obj))) {
782 return (rc);
825 if ((rc = util_check_public_exponent(obj->template))) {
842 if ((rc = token_wrap_sw_key(hContext,
847 return (rc);
910 if ((rc = build_attribute(CKA_IBM_OPAQUE, rgbBlob, ulBlobLen,
913 return (rc);
923 rc = save_token_object(hContext, obj);
926 return (rc);
978 CK_RV rc;
985 if ((rc = token_wrap_key_object(hContext, ckKey,
987 return (rc);
1262 CK_RV rc = CKR_FUNCTION_FAILED;
1290 return (rc);
1315 rc = CKR_OK;
1319 return (rc);
1335 CK_RV rc = CKR_FUNCTION_FAILED;
1345 rc = token_rng(hContext, rgbData, sizeof (rgbData));
1346 if (rc)
1360 rc = CKR_PIN_INCORRECT;
1367 rc = CKR_FUNCTION_FAILED;
1372 rc = CKR_PIN_INCORRECT;
1374 rc = CKR_OK;
1380 return (rc);
1386 CK_RV rc;
1409 rc = CKR_FUNCTION_FAILED;
1422 rc = CKR_FUNCTION_FAILED;
1432 rc = CKR_FUNCTION_FAILED;
1445 rc = CKR_FUNCTION_FAILED;
1451 if ((rc = token_generate_leaf_key(hContext,
1479 rc = CKR_FUNCTION_FAILED;
1484 return (rc);
1490 CK_RV rc;
1513 rc = CKR_FUNCTION_FAILED;
1526 rc = CKR_FUNCTION_FAILED;
1535 rc = CKR_FUNCTION_FAILED;
1546 rc = CKR_FUNCTION_FAILED;
1551 if ((rc = token_generate_leaf_key(hContext, TPMTOK_PUBLIC_LEAF_KEY,
1553 rc = CKR_FUNCTION_FAILED;
1578 rc = CKR_FUNCTION_FAILED;
1584 return (rc);
1594 CK_RV rc;
1599 if ((rc = compute_sha(pPin, ulPinLen, hash_sha)))
1616 rc = CKR_USER_PIN_NOT_INITIALIZED;
1634 rc = CKR_OK;
1638 if ((rc = verify_user_pin(hContext, hash_sha)))
1644 rc = load_private_token_objects(hContext);
1645 if (rc == CKR_OK) {
1666 rc = CKR_OK;
1676 rc = CKR_FUNCTION_FAILED;
1689 rc = CKR_FUNCTION_FAILED;
1694 if ((rc = token_verify_pin(hContext, hPublicLeafKey)))
1703 return (rc);
1780 CK_RV rc;
1807 rc = CKR_FUNCTION_FAILED;
1820 rc = CKR_FUNCTION_FAILED;
1829 rc = token_verify_pin(hContext, hPrivateLeafKey);
1833 return (rc);
1844 CK_RV rc;
1851 if ((rc = compute_sha(pOldPin, ulOldPinLen, oldpin_hash))) {
1854 if ((rc = compute_sha(pNewPin, ulNewPinLen, newpin_hash))) {
1876 if ((rc = check_pin_properties(CKU_USER, newpin_hash,
1878 return (rc);
1881 if ((rc = token_create_private_tree(sess->hContext,
1906 if ((rc = verify_user_pin(sess->hContext,
1908 return (rc);
1912 if ((rc = check_pin_properties(CKU_USER, newpin_hash,
1914 return (rc);
1929 if ((rc = check_pin_properties(CKU_SO,
1931 return (rc);
1933 if ((rc = token_create_public_tree(sess->hContext,
1947 if ((rc = check_pin_properties(CKU_SO, newpin_hash,
1949 return (rc);
1959 rc = CKR_SESSION_READ_ONLY;
1962 return (rc);
1971 CK_RV rc;
1975 if ((rc = compute_sha(pPin, ulPinLen, hash_sha))) {
1978 if ((rc = token_load_srk(hContext, &hSRK))) {
2008 if ((rc = load_mrk(hContext, hSRK, &hMRK)))
2013 rc = CKR_FUNCTION_FAILED;
2019 rc = CKR_FUNCTION_FAILED;
2026 rc = CKR_FUNCTION_FAILED;
2033 rc = CKR_FUNCTION_FAILED;
2039 rc = CKR_FUNCTION_FAILED;
2044 rc = token_verify_pin(hContext, hPublicLeafKey);
2050 return (rc);
2084 CK_RV rc;
2124 if ((rc = build_attribute(CKA_ENC_AUTHDATA, blob, blob_size,
2126 return (rc);
2130 if ((rc = build_attribute(CKA_ENC_AUTHDATA, blob,
2132 return (rc);
2136 return (rc);
2189 CK_RV rc;
2236 if ((rc = token_rng(hContext, authHash, SHA1_DIGEST_LENGTH))) {
2248 if ((rc = token_rng(hContext, authHash, SHA1_DIGEST_LENGTH))) {
2268 if ((rc = build_attribute(CKA_IBM_OPAQUE, rgbBlob,
2271 return (rc);
2274 if ((rc = build_attribute(CKA_IBM_OPAQUE, rgbBlob,
2277 return (rc);
2292 if ((rc = build_attribute(CKA_MODULUS, rgbBlob, ulBlobLen, &attr))) {
2294 return (rc);
2299 if ((rc = build_attribute(CKA_MODULUS, rgbBlob, ulBlobLen, &attr))) {
2301 return (rc);
2308 rc = token_wrap_auth_data(hContext, authData, publ_tmpl,
2312 return (rc);
2326 CK_RV rc;
2346 rc = template_attribute_find(key_obj->template,
2354 if (class == CKO_PUBLIC_KEY || rc == FALSE) {
2355 rc = object_mgr_find_in_map2(hContext, key_obj, &handle);
2356 if (rc != CKR_OK)
2359 if ((rc = token_load_key(hContext,
2361 return (rc);
2380 if ((rc = template_attribute_find(key_obj->template,
2382 return (rc);
2551 CK_RV rc;
2554 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2555 return (rc);
2558 rc = tpm_decrypt_data(hContext, hKey, in_data, in_data_len,
2561 return (rc);
2576 CK_RV rc;
2578 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2579 return (rc);
2607 rc = CKR_SIGNATURE_INVALID;
2609 rc = CKR_OK;
2612 return (rc);
2629 CK_RV rc;
2631 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2632 return (rc);
2791 CK_RV rc;
2793 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2794 return (rc);
2797 rc = tpm_encrypt_data(hContext, hKey, in_data, in_data_len,
2800 return (rc);
2823 CK_RV rc;
2833 if ((rc = token_rsa_load_key(hContext, key_obj, &hKey))) {
2834 return (rc);
2845 rc = CKR_SIGNATURE_LEN_RANGE;
2851 rc = CKR_HOST_MEMORY;
2858 rc = CKR_HOST_MEMORY;
2868 rc = CKR_FUNCTION_FAILED;
2884 rc = CKR_FUNCTION_FAILED;
2889 rc = CKR_BUFFER_TOO_SMALL;
2902 return (rc);