Lines Matching defs:rc

760 	CK_RV rc;
764 rc = ber_encode_INTEGER(TRUE, NULL, &total, version, sizeof (version));
765 if (rc != CKR_OK) {
766 return (rc);
773 rc = ber_encode_OCTET_STRING(TRUE, NULL, &total,
776 if (rc != CKR_OK)
777 return (rc);
785 rc = ber_encode_SEQUENCE(TRUE, NULL, &total, NULL, len);
787 if (rc == CKR_OK)
789 return (rc);
797 rc = ber_encode_INTEGER(FALSE, &tmp, &total, version, sizeof (version));
798 if (rc != CKR_OK) {
808 rc = ber_encode_OCTET_STRING(FALSE, &tmp, &total,
810 if (rc != CKR_OK) {
820 rc = ber_encode_SEQUENCE(FALSE, data, data_len, buf, len);
824 return (rc);
838 CK_RV rc;
843 rc = ber_decode_SEQUENCE(data, &buf, &buf_len, &field_len);
844 if (rc != CKR_OK) {
845 return (rc);
848 rc = ber_decode_INTEGER(buf + offset, &ver, &len, &field_len);
849 if (rc != CKR_OK) {
850 return (rc);
854 rc = ber_decode_SEQUENCE(buf + offset, &alg, &len, &field_len);
855 if (rc != CKR_OK) {
856 return (rc);
861 rc = ber_decode_OCTET_STRING(alg + len, priv_key, &buf_len, &field_len);
862 return (rc);
895 CK_RV rc;
898 rc = 0;
900 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
903 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
906 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
909 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
912 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
915 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
918 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
921 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
924 rc |= ber_encode_INTEGER(TRUE, NULL, &len, NULL,
928 if (rc != CKR_OK) {
932 rc = ber_encode_SEQUENCE(TRUE, NULL, &len, NULL, offset);
933 if (rc != CKR_OK)
934 return (rc);
935 rc = ber_encode_PrivateKeyInfo(TRUE,
939 if (rc != CKR_OK)
940 return (rc);
941 return (rc);
949 rc = 0;
951 rc = ber_encode_INTEGER(FALSE, &buf2, &len, version, sizeof (version));
952 if (rc != CKR_OK) {
959 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
961 if (rc != CKR_OK) {
968 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
970 if (rc != CKR_OK) {
977 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
980 if (rc != CKR_OK) {
987 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
989 if (rc != CKR_OK) {
996 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
998 if (rc != CKR_OK) {
1005 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
1008 if (rc != CKR_OK) {
1015 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
1018 if (rc != CKR_OK) {
1025 rc = ber_encode_INTEGER(FALSE, &buf2, &len,
1027 if (rc != CKR_OK) {
1034 rc = ber_encode_SEQUENCE(FALSE, &buf2, &len, buf, offset);
1035 if (rc != CKR_OK) {
1038 rc = ber_encode_PrivateKeyInfo(FALSE,
1045 return (rc);
1074 CK_RV rc;
1076 rc = ber_decode_PrivateKeyInfo(data, data_len, &alg,
1078 if (rc != CKR_OK) {
1079 return (rc);
1084 rc = ber_decode_SEQUENCE(rsa_priv_key, &buf, &buf_len, &field_len);
1085 if (rc != CKR_OK)
1086 return (rc);
1089 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1090 if (rc != CKR_OK) {
1095 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1096 if (rc != CKR_OK) {
1101 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1102 if (rc != CKR_OK) {
1107 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1108 if (rc != CKR_OK) {
1113 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1114 if (rc != CKR_OK) {
1119 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1120 if (rc != CKR_OK) {
1125 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1126 if (rc != CKR_OK) {
1131 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1132 if (rc != CKR_OK) {
1137 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1138 if (rc != CKR_OK) {
1149 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1150 if (rc != CKR_OK) {
1155 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1156 if (rc != CKR_OK) {
1159 rc = build_attribute(CKA_MODULUS, tmp, len, &n_attr);
1160 if (rc != CKR_OK) {
1166 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1167 if (rc != CKR_OK) {
1170 rc = build_attribute(CKA_PUBLIC_EXPONENT, tmp, len, &e_attr);
1171 if (rc != CKR_OK) {
1177 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1178 if (rc != CKR_OK) {
1181 rc = build_attribute(CKA_PRIVATE_EXPONENT, tmp, len, &d_attr);
1182 if (rc != CKR_OK) {
1188 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1189 if (rc != CKR_OK) {
1192 rc = build_attribute(CKA_PRIME_1, tmp, len, &p_attr);
1193 if (rc != CKR_OK) {
1199 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1200 if (rc != CKR_OK) {
1203 rc = build_attribute(CKA_PRIME_2, tmp, len, &q_attr);
1204 if (rc != CKR_OK) {
1210 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1211 if (rc != CKR_OK) {
1214 rc = build_attribute(CKA_EXPONENT_1, tmp, len, &e1_attr);
1215 if (rc != CKR_OK) {
1221 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1222 if (rc != CKR_OK) {
1225 rc = build_attribute(CKA_EXPONENT_2, tmp, len, &e2_attr);
1226 if (rc != CKR_OK) {
1232 rc = ber_decode_INTEGER(buf + offset, &tmp, &len, &field_len);
1233 if (rc != CKR_OK) {
1236 rc = build_attribute(CKA_COEFFICIENT, tmp, len, &coeff_attr);
1237 if (rc != CKR_OK) {
1264 return (rc);