6 #include "sw/device/lib/base/status.h"
7 #include "sw/device/lib/crypto/drivers/entropy.h"
8 #include "sw/device/lib/testing/test_framework/check.h"
10 #include "sw/device/lib/testing/test_framework/ujson_ottf.h"
11 #include "sw/device/lib/ujson/ujson.h"
14 #include "sw/device/tests/penetrationtests/json/commands.h"
15 #include "sw/device/tests/penetrationtests/json/crypto_fi_commands.h"
16 #include "sw/device/tests/penetrationtests/json/ibex_fi_commands.h"
17 #include "sw/device/tests/penetrationtests/json/lc_ctrl_fi_commands.h"
18 #include "sw/device/tests/penetrationtests/json/otp_fi_commands.h"
19 #include "sw/device/tests/penetrationtests/json/rng_fi_commands.h"
20 #include "sw/device/tests/penetrationtests/json/rom_fi_commands.h"
23 #include "fi/crypto_fi.h"
24 #include "fi/ibex_fi.h"
25 #include "fi/lc_ctrl_fi.h"
26 #include "fi/otp_fi.h"
27 #include "fi/rng_fi.h"
28 #include "fi/rom_fi.h"
29 #include "lib/extclk_sca_fi.h"
31 OTTF_DEFINE_TEST_CONFIG(.enable_uart_flow_control =
true);
35 penetrationtest_cmd_t cmd;
36 TRY(ujson_deserialize_penetrationtest_cmd_t(uj, &cmd));
38 case kPenetrationtestCommandCryptoFi:
39 RESP_ERR(uj, handle_crypto_fi(uj));
41 case kPenetrationtestCommandExtClkScaFi:
42 RESP_ERR(uj, handle_extclk_sca_fi(uj));
44 case kPenetrationtestCommandIbexFi:
45 RESP_ERR(uj, handle_ibex_fi(uj));
47 case kPenetrationtestCommandLCCtrlFi:
48 RESP_ERR(uj, handle_lc_ctrl_fi(uj));
50 case kPenetrationtestCommandOtpFi:
51 RESP_ERR(uj, handle_otp_fi(uj));
53 case kPenetrationtestCommandRngFi:
54 RESP_ERR(uj, handle_rng_fi(uj));
56 case kPenetrationtestCommandRomFi:
57 RESP_ERR(uj, handle_rom_fi(uj));
60 LOG_ERROR(
"Unrecognized command: %d", cmd);
61 RESP_ERR(uj, INVALID_ARGUMENT());
69 CHECK_STATUS_OK(entropy_complex_init());
70 ujson_t uj = ujson_ottf_console();
71 return status_ok(process_cmd(&uj));