Lines Matching refs:state
46 * |state| The state we're called in, explained further at the
56 * The |state| tells the fixup_args function something about the caller and
63 * state, the fixup_args function is expected
78 * With the PRE_CTRL_TO_PARAMS state, the
82 * With the POST_CTRL_TO_PARAMS state, the
88 * with the POST_CTRL_TO_PARAMS state becomes
107 * With the PRE_CTRL_STR_TO_PARAMS state,
111 * With the POST_CTRL_STR_TO_PARAMS state,
132 * With the PRE_PARAMS_TO_CTRL state, the
136 * With the POST_PARAMS_TO_CTRL state, the
146 enum state {
155 typedef int fixup_args_fn(enum state state,
158 typedef int cleanup_args_fn(enum state state,
289 static int default_check(enum state state,
293 switch (state) {
384 static int default_fixup_args(enum state state,
390 if ((ret = default_check(state, translation, ctx)) <= 0)
393 switch (state) {
397 "[action:%d, state:%d]", ctx->action_type, state);
414 "[action:%d, state:%d]", ctx->action_type, state);
482 "[action:%d, state:%d] trying to get a "
484 ctx->action_type, state);
551 "[action:%d, state:%d] only setting allowed",
552 ctx->action_type, state);
581 "[action:%d, state:%d] name=%s, value=%s",
582 ctx->action_type, state,
615 if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET) {
616 /* For the PRE state, only setting needs some work to be done */
646 "[action:%d, state:%d] "
648 ctx->action_type, state,
652 } else if ((state == POST_PARAMS_TO_CTRL || state == PKEY)
654 /* For the POST state, only getting needs some work to be done */
658 if (state == PKEY)
692 "[action:%d, state:%d] "
694 ctx->action_type, state,
707 cleanup_translation_ctx(enum state state,
741 static int fix_cipher_md(enum state state,
750 if ((ret = default_check(state, translation, ctx)) <= 0)
753 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == GET) {
764 } else if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) {
774 } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET) {
779 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
782 if (state == POST_CTRL_TO_PARAMS && ctx->action_type == GET) {
785 * PRE_CTRL_TO_PARAMS state above.
790 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET) {
798 static int fix_cipher(enum state state,
802 return fix_cipher_md(state, translation, ctx,
806 static int fix_md(enum state state,
810 return fix_cipher_md(state, translation, ctx,
814 static int fix_distid_len(enum state state,
818 int ret = default_fixup_args(state, translation, ctx);
822 if ((state == POST_CTRL_TO_PARAMS
823 || state == POST_CTRL_STR_TO_PARAMS) && ctx->action_type == GET) {
836 static int fix_kdf_type(enum state state,
850 if ((ret = default_check(state, translation, ctx)) <= 0)
853 if (state == PRE_CTRL_TO_PARAMS) {
879 if ((ret = default_check(state, translation, ctx)) <= 0)
882 if ((state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET)
883 || (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET)) {
897 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
900 if ((state == POST_CTRL_TO_PARAMS && ctx->action_type == GET)
901 || (state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET)) {
912 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == GET) {
920 static int fix_dh_kdf_type(enum state state,
930 return fix_kdf_type(state, translation, ctx, kdf_type_map);
934 static int fix_ec_kdf_type(enum state state,
944 return fix_kdf_type(state, translation, ctx, kdf_type_map);
948 static int fix_oid(enum state state,
954 if ((ret = default_check(state, translation, ctx)) <= 0)
957 if ((state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET)
958 || (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET)) {
972 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
975 if ((state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET)
976 || (state == POST_CTRL_TO_PARAMS && ctx->action_type == GET)) {
991 static int fix_dh_nid(enum state state,
997 if ((ret = default_check(state, translation, ctx)) <= 0)
1004 if (state == PRE_CTRL_TO_PARAMS) {
1013 return default_fixup_args(state, translation, ctx);
1017 static int fix_dh_nid5114(enum state state,
1023 if ((ret = default_check(state, translation, ctx)) <= 0)
1030 switch (state) {
1057 return default_fixup_args(state, translation, ctx);
1061 static int fix_dh_paramgen_type(enum state state,
1067 if ((ret = default_check(state, translation, ctx)) <= 0)
1074 if (state == PRE_CTRL_STR_TO_PARAMS) {
1083 return default_fixup_args(state, translation, ctx);
1087 static int fix_ec_param_enc(enum state state,
1093 if ((ret = default_check(state, translation, ctx)) <= 0)
1100 if (state == PRE_CTRL_TO_PARAMS) {
1115 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
1118 if (state == PRE_PARAMS_TO_CTRL) {
1135 static int fix_ec_paramgen_curve_nid(enum state state,
1142 if ((ret = default_check(state, translation, ctx)) <= 0)
1149 if (state == PRE_CTRL_TO_PARAMS) {
1152 } else if (state == PRE_PARAMS_TO_CTRL) {
1166 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
1169 if (state == PRE_PARAMS_TO_CTRL) {
1178 static int fix_ecdh_cofactor(enum state state,
1191 if (state == PRE_CTRL_TO_PARAMS) {
1204 } else if (state == PRE_CTRL_STR_TO_PARAMS) {
1206 } else if (state == PRE_PARAMS_TO_CTRL) {
1212 if ((ret = default_check(state, translation, ctx)) <= 0)
1215 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) {
1222 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
1225 if (state == POST_CTRL_TO_PARAMS && ctx->action_type == GET) {
1233 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == GET) {
1241 static int fix_rsa_padding_mode(enum state state,
1257 if ((ret = default_check(state, translation, ctx)) <= 0)
1260 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == GET) {
1275 } else if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) {
1296 } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET) {
1320 "[action:%d, state:%d] padding number %d",
1321 ctx->action_type, state, ctx->p1);
1336 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
1339 if ((ctx->action_type == SET && state == PRE_PARAMS_TO_CTRL)
1340 || (ctx->action_type == GET && state == POST_CTRL_TO_PARAMS)) {
1350 "[action:%d, state:%d] padding name %s",
1351 ctx->action_type, state, ctx->p1);
1353 } else if (state == POST_CTRL_TO_PARAMS) {
1366 static int fix_rsa_pss_saltlen(enum state state,
1377 if ((ret = default_check(state, translation, ctx)) <= 0)
1380 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == GET) {
1396 } else if ((ctx->action_type == SET && state == PRE_CTRL_TO_PARAMS)
1397 || (ctx->action_type == GET && state == POST_PARAMS_TO_CTRL)) {
1415 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
1418 if ((ctx->action_type == SET && state == PRE_PARAMS_TO_CTRL)
1419 || (ctx->action_type == GET && state == POST_CTRL_TO_PARAMS)) {
1430 if (state == POST_CTRL_TO_PARAMS) {
1446 static int fix_hkdf_mode(enum state state,
1457 if ((ret = default_check(state, translation, ctx)) <= 0)
1460 if ((ctx->action_type == SET && state == PRE_CTRL_TO_PARAMS)
1461 || (ctx->action_type == GET && state == POST_PARAMS_TO_CTRL)) {
1474 if ((ret = default_fixup_args(state, translation, ctx)) <= 0)
1477 if ((ctx->action_type == SET && state == PRE_PARAMS_TO_CTRL)
1478 || (ctx->action_type == GET && state == POST_CTRL_TO_PARAMS)) {
1487 if (state == POST_CTRL_TO_PARAMS)
1507 static int get_payload_group_name(enum state state,
1557 return default_fixup_args(state, translation, ctx);
1560 static int get_payload_private_key(enum state state,
1594 return default_fixup_args(state, translation, ctx);
1597 static int get_payload_public_key(enum state state,
1655 ret = default_fixup_args(state, translation, ctx);
1660 static int get_payload_bn(enum state state,
1670 return default_fixup_args(state, translation, ctx);
1673 static int get_dh_dsa_payload_p(enum state state,
1695 return get_payload_bn(state, translation, ctx, bn);
1698 static int get_dh_dsa_payload_q(enum state state,
1717 return get_payload_bn(state, translation, ctx, bn);
1720 static int get_dh_dsa_payload_g(enum state state,
1739 return get_payload_bn(state, translation, ctx, bn);
1742 static int get_payload_int(enum state state,
1752 return default_fixup_args(state, translation, ctx);
1755 static int get_ec_decoded_from_explicit_params(enum state state,
1777 return get_payload_int(state, translation, ctx, val);
1780 static int get_rsa_payload_n(enum state state,
1790 return get_payload_bn(state, translation, ctx, bn);
1793 static int get_rsa_payload_e(enum state state,
1803 return get_payload_bn(state, translation, ctx, bn);
1806 static int get_rsa_payload_d(enum state state,
1816 return get_payload_bn(state, translation, ctx, bn);
1819 static int get_rsa_payload_factor(enum state state,
1846 return get_payload_bn(state, translation, ctx, bn);
1849 static int get_rsa_payload_exponent(enum state state,
1876 return get_payload_bn(state, translation, ctx, bn);
1879 static int get_rsa_payload_coefficient(enum state state,
1903 return get_payload_bn(state, translation, ctx, bn);
1908 get_rsa_payload_f##n(enum state state, \
1914 return get_rsa_payload_factor(state, translation, ctx, n - 1); \
1919 get_rsa_payload_e##n(enum state state, \
1925 return get_rsa_payload_exponent(state, translation, ctx, \
1931 get_rsa_payload_c##n(enum state state, \
1937 return get_rsa_payload_coefficient(state, translation, ctx, \
1971 static int fix_group_ecx(enum state state,
1977 switch (state) {