From dec3d54ddd34bd4995261cce418076defb8eb1dc Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sat, 9 Apr 2022 20:29:13 +0200 Subject: [PATCH] Adding more SW codes. Signed-off-by: Pol Henarejos --- src/hsm/sc_hsm.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/hsm/sc_hsm.h b/src/hsm/sc_hsm.h index 061dc12..e45290b 100644 --- a/src/hsm/sc_hsm.h +++ b/src/hsm/sc_hsm.h @@ -26,29 +26,56 @@ extern const uint8_t sc_hsm_aid[]; #define SW_BYTES_REMAINING_00() set_res_sw (0x61, 0x00) #define SW_WARNING_STATE_UNCHANGED() set_res_sw (0x62, 0x00) +#define SW_WARNING_CORRUPTED() set_res_sw (0x62, 0x81) +#define SW_WARNING_EOF() set_res_sw (0x62, 0x82) +#define SW_WARNING_EF_DEACTIVATED() set_res_sw (0x62, 0x83) +#define SW_WARNING_WRONG_FCI() set_res_sw (0x62, 0x84) +#define SW_WARNING_EF_TERMINATED() set_res_sw (0x62, 0x85) + +#define SW_WARNING_NOINFO() set_res_sw (0x63, 0x00) +#define SW_WARNING_FILLUP() set_res_sw (0x63, 0x81) + #define SW_EXEC_ERROR() set_res_sw (0x64, 0x00) + #define SW_MEMORY_FAILURE() set_res_sw (0x65, 0x81) + #define SW_WRONG_LENGTH() set_res_sw (0x67, 0x00) #define SW_WRONG_DATA() set_res_sw (0x67, 0x00) + #define SW_LOGICAL_CHANNEL_NOT_SUPPORTED() set_res_sw (0x68, 0x81) #define SW_SECURE_MESSAGING_NOT_SUPPORTED() set_res_sw (0x68, 0x82) + +#define SW_COMMAND_INCOMPATIBLE() set_res_sw (0x69, 0x81) #define SW_SECURITY_STATUS_NOT_SATISFIED() set_res_sw (0x69, 0x82) #define SW_PIN_BLOCKED() set_res_sw (0x69, 0x83) #define SW_DATA_INVALID() set_res_sw (0x69, 0x84) #define SW_CONDITIONS_NOT_SATISFIED() set_res_sw (0x69, 0x85) #define SW_COMMAND_NOT_ALLOWED() set_res_sw (0x69, 0x86) +#define SW_SECURE_MESSAGING_MISSING_DO() set_res_sw (0x69, 0x87) +#define SW_SECURE_MESSAGING_INCORRECT_DO() set_res_sw (0x69, 0x88) #define SW_APPLET_SELECT_FAILED() set_res_sw (0x69, 0x99) + +#define SW_INCORRECT_PARAMS() set_res_sw (0x6A, 0x80) #define SW_FUNC_NOT_SUPPORTED() set_res_sw (0x6A, 0x81) #define SW_FILE_NOT_FOUND() set_res_sw (0x6A, 0x82) #define SW_RECORD_NOT_FOUND() set_res_sw (0x6A, 0x83) #define SW_FILE_FULL() set_res_sw (0x6A, 0x84) +#define SW_WRONG_NE() set_res_sw (0x6A, 0x85) #define SW_INCORRECT_P1P2() set_res_sw (0x6A, 0x86) +#define SW_WRONG_NC() set_res_sw (0x6A, 0x87) #define SW_REFERENCE_NOT_FOUND() set_res_sw (0x6A, 0x88) +#define SW_FILE_EXISTS() set_res_sw (0x6A, 0x89) + #define SW_WRONG_P1P2() set_res_sw (0x6B, 0x00) + #define SW_CORRECT_LENGTH_00() set_res_sw (0x6C, 0x00) + #define SW_INS_NOT_SUPPORTED() set_res_sw (0x6D, 0x00) + #define SW_CLA_NOT_SUPPORTED() set_res_sw (0x6E, 0x00) + #define SW_UNKNOWN() set_res_sw (0x6F, 0x00) + #define SW_OK() set_res_sw (0x90, 0x00) #define HSM_OK 0