Lines Matching refs:state
146 enum state { enum
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, in default_check() argument
293 switch (state) { in default_check()
384 static int default_fixup_args(enum state state, in default_fixup_args() argument
390 if ((ret = default_check(state, translation, ctx)) <= 0) in default_fixup_args()
393 switch (state) { in default_fixup_args()
397 "[action:%d, state:%d]", ctx->action_type, state); in default_fixup_args()
414 "[action:%d, state:%d]", ctx->action_type, state); in default_fixup_args()
482 ctx->action_type, state); in default_fixup_args()
550 ctx->action_type, state); in default_fixup_args()
580 ctx->action_type, state, in default_fixup_args()
613 if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET) { in default_fixup_args()
646 ctx->action_type, state, in default_fixup_args()
650 } else if ((state == POST_PARAMS_TO_CTRL || state == PKEY) in default_fixup_args()
656 if (state == PKEY) in default_fixup_args()
692 ctx->action_type, state, in default_fixup_args()
696 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == GET) { in default_fixup_args()
708 cleanup_translation_ctx(enum state state, in cleanup_translation_ctx() argument
742 static int fix_cipher_md(enum state state, in fix_cipher_md() argument
751 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_cipher_md()
754 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == GET) { in fix_cipher_md()
765 } else if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) { in fix_cipher_md()
775 } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET) { in fix_cipher_md()
780 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_cipher_md()
783 if (state == POST_CTRL_TO_PARAMS && ctx->action_type == GET) { in fix_cipher_md()
791 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET) { in fix_cipher_md()
799 static int fix_cipher(enum state state, in fix_cipher() argument
803 return fix_cipher_md(state, translation, ctx, in fix_cipher()
807 static int fix_md(enum state state, in fix_md() argument
811 return fix_cipher_md(state, translation, ctx, in fix_md()
815 static int fix_distid_len(enum state state, in fix_distid_len() argument
819 int ret = default_fixup_args(state, translation, ctx); in fix_distid_len()
823 if ((state == POST_CTRL_TO_PARAMS in fix_distid_len()
824 || state == POST_CTRL_STR_TO_PARAMS) && ctx->action_type == GET) { in fix_distid_len()
837 static int fix_kdf_type(enum state state, in fix_kdf_type() argument
851 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_kdf_type()
854 if (state == PRE_CTRL_TO_PARAMS) { in fix_kdf_type()
880 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_kdf_type()
883 if ((state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) in fix_kdf_type()
884 || (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET)) { in fix_kdf_type()
898 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_kdf_type()
901 if ((state == POST_CTRL_TO_PARAMS && ctx->action_type == GET) in fix_kdf_type()
902 || (state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET)) { in fix_kdf_type()
913 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == GET) { in fix_kdf_type()
921 static int fix_dh_kdf_type(enum state state, in fix_dh_kdf_type() argument
931 return fix_kdf_type(state, translation, ctx, kdf_type_map); in fix_dh_kdf_type()
935 static int fix_ec_kdf_type(enum state state, in fix_ec_kdf_type() argument
945 return fix_kdf_type(state, translation, ctx, kdf_type_map); in fix_ec_kdf_type()
949 static int fix_oid(enum state state, in fix_oid() argument
955 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_oid()
958 if ((state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) in fix_oid()
959 || (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET)) { in fix_oid()
973 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_oid()
976 if ((state == PRE_PARAMS_TO_CTRL && ctx->action_type == SET) in fix_oid()
977 || (state == POST_CTRL_TO_PARAMS && ctx->action_type == GET)) { in fix_oid()
992 static int fix_dh_nid(enum state state, in fix_dh_nid() argument
998 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_dh_nid()
1005 if (state == PRE_CTRL_TO_PARAMS) { in fix_dh_nid()
1014 return default_fixup_args(state, translation, ctx); in fix_dh_nid()
1018 static int fix_dh_nid5114(enum state state, in fix_dh_nid5114() argument
1024 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_dh_nid5114()
1031 switch (state) { in fix_dh_nid5114()
1058 return default_fixup_args(state, translation, ctx); in fix_dh_nid5114()
1062 static int fix_dh_paramgen_type(enum state state, in fix_dh_paramgen_type() argument
1068 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_dh_paramgen_type()
1075 if (state == PRE_CTRL_STR_TO_PARAMS) { in fix_dh_paramgen_type()
1084 return default_fixup_args(state, translation, ctx); in fix_dh_paramgen_type()
1088 static int fix_ec_param_enc(enum state state, in fix_ec_param_enc() argument
1094 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_ec_param_enc()
1101 if (state == PRE_CTRL_TO_PARAMS) { in fix_ec_param_enc()
1116 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_ec_param_enc()
1119 if (state == PRE_PARAMS_TO_CTRL) { in fix_ec_param_enc()
1136 static int fix_ec_paramgen_curve_nid(enum state state, in fix_ec_paramgen_curve_nid() argument
1143 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_ec_paramgen_curve_nid()
1150 if (state == PRE_CTRL_TO_PARAMS) { in fix_ec_paramgen_curve_nid()
1153 } else if (state == PRE_PARAMS_TO_CTRL) { in fix_ec_paramgen_curve_nid()
1167 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_ec_paramgen_curve_nid()
1170 if (state == PRE_PARAMS_TO_CTRL) { in fix_ec_paramgen_curve_nid()
1179 static int fix_ecdh_cofactor(enum state state, in fix_ecdh_cofactor() argument
1192 if (state == PRE_CTRL_TO_PARAMS) { in fix_ecdh_cofactor()
1205 } else if (state == PRE_CTRL_STR_TO_PARAMS) { in fix_ecdh_cofactor()
1207 } else if (state == PRE_PARAMS_TO_CTRL) { in fix_ecdh_cofactor()
1211 } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == NONE) { in fix_ecdh_cofactor()
1215 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_ecdh_cofactor()
1218 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) { in fix_ecdh_cofactor()
1225 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_ecdh_cofactor()
1228 if (state == POST_CTRL_TO_PARAMS && ctx->action_type == GET) { in fix_ecdh_cofactor()
1236 } else if (state == PRE_PARAMS_TO_CTRL && ctx->action_type == GET) { in fix_ecdh_cofactor()
1238 } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET) { in fix_ecdh_cofactor()
1246 static int fix_rsa_padding_mode(enum state state, in fix_rsa_padding_mode() argument
1262 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_rsa_padding_mode()
1265 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == GET) { in fix_rsa_padding_mode()
1280 } else if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == SET) { in fix_rsa_padding_mode()
1301 } else if (state == POST_PARAMS_TO_CTRL && ctx->action_type == GET) { in fix_rsa_padding_mode()
1326 ctx->action_type, state, ctx->p1); in fix_rsa_padding_mode()
1341 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_rsa_padding_mode()
1344 if ((ctx->action_type == SET && state == PRE_PARAMS_TO_CTRL) in fix_rsa_padding_mode()
1345 || (ctx->action_type == GET && state == POST_CTRL_TO_PARAMS)) { in fix_rsa_padding_mode()
1356 ctx->action_type, state, ctx->p1); in fix_rsa_padding_mode()
1358 } else if (state == POST_CTRL_TO_PARAMS) { in fix_rsa_padding_mode()
1371 static int fix_rsa_pss_saltlen(enum state state, in fix_rsa_pss_saltlen() argument
1382 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_rsa_pss_saltlen()
1385 if (state == PRE_CTRL_TO_PARAMS && ctx->action_type == GET) { in fix_rsa_pss_saltlen()
1401 } else if ((ctx->action_type == SET && state == PRE_CTRL_TO_PARAMS) in fix_rsa_pss_saltlen()
1402 || (ctx->action_type == GET && state == POST_PARAMS_TO_CTRL)) { in fix_rsa_pss_saltlen()
1420 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_rsa_pss_saltlen()
1423 if ((ctx->action_type == SET && state == PRE_PARAMS_TO_CTRL) in fix_rsa_pss_saltlen()
1424 || (ctx->action_type == GET && state == POST_CTRL_TO_PARAMS)) { in fix_rsa_pss_saltlen()
1435 if (state == POST_CTRL_TO_PARAMS) { in fix_rsa_pss_saltlen()
1451 static int fix_hkdf_mode(enum state state, in fix_hkdf_mode() argument
1462 if ((ret = default_check(state, translation, ctx)) <= 0) in fix_hkdf_mode()
1465 if ((ctx->action_type == SET && state == PRE_CTRL_TO_PARAMS) in fix_hkdf_mode()
1466 || (ctx->action_type == GET && state == POST_PARAMS_TO_CTRL)) { in fix_hkdf_mode()
1479 if ((ret = default_fixup_args(state, translation, ctx)) <= 0) in fix_hkdf_mode()
1482 if ((ctx->action_type == SET && state == PRE_PARAMS_TO_CTRL) in fix_hkdf_mode()
1483 || (ctx->action_type == GET && state == POST_CTRL_TO_PARAMS)) { in fix_hkdf_mode()
1492 if (state == POST_CTRL_TO_PARAMS) in fix_hkdf_mode()
1512 static int get_payload_group_name(enum state state, in get_payload_group_name() argument
1562 return default_fixup_args(state, translation, ctx); in get_payload_group_name()
1565 static int get_payload_private_key(enum state state, in get_payload_private_key() argument
1599 return default_fixup_args(state, translation, ctx); in get_payload_private_key()
1602 static int get_payload_public_key(enum state state, in get_payload_public_key() argument
1660 ret = default_fixup_args(state, translation, ctx); in get_payload_public_key()
1665 static int get_payload_public_key_ec(enum state state, in get_payload_public_key_ec() argument
1713 ret = default_fixup_args(state, translation, ctx); in get_payload_public_key_ec()
1723 static int get_payload_bn(enum state state, in get_payload_bn() argument
1733 return default_fixup_args(state, translation, ctx); in get_payload_bn()
1736 static int get_dh_dsa_payload_p(enum state state, in get_dh_dsa_payload_p() argument
1758 return get_payload_bn(state, translation, ctx, bn); in get_dh_dsa_payload_p()
1761 static int get_dh_dsa_payload_q(enum state state, in get_dh_dsa_payload_q() argument
1780 return get_payload_bn(state, translation, ctx, bn); in get_dh_dsa_payload_q()
1783 static int get_dh_dsa_payload_g(enum state state, in get_dh_dsa_payload_g() argument
1802 return get_payload_bn(state, translation, ctx, bn); in get_dh_dsa_payload_g()
1805 static int get_payload_int(enum state state, in get_payload_int() argument
1815 return default_fixup_args(state, translation, ctx); in get_payload_int()
1818 static int get_ec_decoded_from_explicit_params(enum state state, in get_ec_decoded_from_explicit_params() argument
1840 return get_payload_int(state, translation, ctx, val); in get_ec_decoded_from_explicit_params()
1843 static int get_rsa_payload_n(enum state state, in get_rsa_payload_n() argument
1854 return get_payload_bn(state, translation, ctx, bn); in get_rsa_payload_n()
1857 static int get_rsa_payload_e(enum state state, in get_rsa_payload_e() argument
1868 return get_payload_bn(state, translation, ctx, bn); in get_rsa_payload_e()
1871 static int get_rsa_payload_d(enum state state, in get_rsa_payload_d() argument
1882 return get_payload_bn(state, translation, ctx, bn); in get_rsa_payload_d()
1885 static int get_rsa_payload_factor(enum state state, in get_rsa_payload_factor() argument
1912 return get_payload_bn(state, translation, ctx, bn); in get_rsa_payload_factor()
1915 static int get_rsa_payload_exponent(enum state state, in get_rsa_payload_exponent() argument
1942 return get_payload_bn(state, translation, ctx, bn); in get_rsa_payload_exponent()
1945 static int get_rsa_payload_coefficient(enum state state, in get_rsa_payload_coefficient() argument
1969 return get_payload_bn(state, translation, ctx, bn); in get_rsa_payload_coefficient()
1974 get_rsa_payload_f##n(enum state state, \
1981 return get_rsa_payload_factor(state, translation, ctx, n - 1); \
1986 get_rsa_payload_e##n(enum state state, \
1993 return get_rsa_payload_exponent(state, translation, ctx, \
1999 get_rsa_payload_c##n(enum state state, \
2006 return get_rsa_payload_coefficient(state, translation, ctx, \
2040 static int fix_group_ecx(enum state state, in fix_group_ecx() argument
2046 switch (state) { in fix_group_ecx()