diff options
author | Simon Busch <morphis@gravedo.de> | 2012-08-29 12:33:25 +0200 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2012-08-29 12:33:25 +0200 |
commit | 3baa91e5ca8b5c5e7d6fe52023d6bd7d98e1b672 (patch) | |
tree | da8b8ed7b63d9132bd29b02f8ed2567d6e456eb9 /include | |
parent | c2509569de22560f8bd5eabdbdebf40eba030a29 (diff) | |
download | external_libsamsung-ipc-3baa91e5ca8b5c5e7d6fe52023d6bd7d98e1b672.zip external_libsamsung-ipc-3baa91e5ca8b5c5e7d6fe52023d6bd7d98e1b672.tar.gz external_libsamsung-ipc-3baa91e5ca8b5c5e7d6fe52023d6bd7d98e1b672.tar.bz2 |
sec: refactor type naming to be clean and not misleading
Diffstat (limited to 'include')
-rw-r--r-- | include/sec.h | 129 |
1 files changed, 78 insertions, 51 deletions
diff --git a/include/sec.h b/include/sec.h index 5c7b90b..a85d563 100644 --- a/include/sec.h +++ b/include/sec.h @@ -24,53 +24,69 @@ struct ipc_message_info; -#define IPC_SEC_PIN_STATUS 0x0501 -#define IPC_SEC_PHONE_LOCK 0x0502 -#define IPC_SEC_CHANGE_LOCKING_PW 0x0503 -#define IPC_SEC_SIM_LANG 0x0504 -#define IPC_SEC_RSIM_ACCESS 0x0505 -#define IPC_SEC_GSIM_ACCESS 0x0506 -#define IPC_SEC_SIM_ICC_TYPE 0x0507 -#define IPC_SEC_LOCK_INFO 0x0508 -#define IPC_SEC_ISIM_AUTH 0x0509 - -#define IPC_SEC_PIN_SIM_INITIALIZING 0x00 -#define IPC_SEC_PIN_SIM_SIM_LOCK_REQUIRED 0x01 -#define IPC_SEC_PIN_SIM_INSIDE_PF_ERROR 0x02 -#define IPC_SEC_PIN_SIM_LOCK_SC 0x03 -#define IPC_SEC_PIN_SIM_LOCK_FD 0x04 -#define IPC_SEC_PIN_SIM_LOCK_PN 0x05 -#define IPC_SEC_PIN_SIM_LOCK_PU 0x06 -#define IPC_SEC_PIN_SIM_LOCK_PP 0x07 -#define IPC_SEC_PIN_SIM_LOCK_PC 0x08 -#define IPC_SEC_PIN_SIM_CARD_NOT_PRESENT 0x80 -#define IPC_SEC_PIN_SIM_CARD_ERROR 0x81 -#define IPC_SEC_PIN_SIM_INIT_COMPLETE 0x82 -#define IPC_SEC_PIN_SIM_PB_INIT_COMPLETE 0x83 - -/* Key types for the SIM card (SC) facility */ -#define IPC_SEC_PIN_SIM_LOCK_SC_PIN1_REQ 0x01 -#define IPC_SEC_PIN_SIM_LOCK_SC_PUK_REQ 0x02 -#define IPC_SEC_PIN_SIM_LOCK_SC_CARD_BLOCKED 0x05 - -#define IPC_SEC_PIN_TYPE_PIN1 0x03 -#define IPC_SEC_PIN_TYPE_PIN2 0x09 - -#define IPC_SEC_SIM_CARD_TYPE_UNKNOWN 0x00 -#define IPC_SEC_SIM_CARD_TYPE_SIM 0x01 -#define IPC_SEC_SIM_CARD_TYPE_USIM 0x02 - -#define IPC_SEC_RSIM_COMMAND_READ_BINARY 0xb0 -#define IPC_SEC_RSIM_COMMAND_READ_RECORD 0xc0 -#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xd6 -#define IPC_SEC_RSIM_COMMAND_STATUS 0xf2 +/* Possible SEC related IPC message types */ +#define IPC_SEC_PIN_STATUS 0x0501 +#define IPC_SEC_PHONE_LOCK 0x0502 +#define IPC_SEC_CHANGE_LOCKING_PW 0x0503 +#define IPC_SEC_SIM_LANG 0x0504 +#define IPC_SEC_RSIM_ACCESS 0x0505 +#define IPC_SEC_GSIM_ACCESS 0x0506 +#define IPC_SEC_SIM_ICC_TYPE 0x0507 +#define IPC_SEC_LOCK_INFO 0x0508 +#define IPC_SEC_ISIM_AUTH 0x0509 + +/* SIM status */ +#define IPC_SEC_SIM_STATUS_INITIALIZING 0x00 +#define IPC_SEC_SIM_STATUS_SIM_LOCK_REQUIRED 0x01 +#define IPC_SEC_SIM_STATUS_INSIDE_PF_ERROR 0x02 +#define IPC_SEC_SIM_STATUS_LOCK_SC 0x03 +#define IPC_SEC_SIM_STATUS_LOCK_FD 0x04 +#define IPC_SEC_SIM_STATUS_LOCK_PN 0x05 +#define IPC_SEC_SIM_STATUS_LOCK_PU 0x06 +#define IPC_SEC_SIM_STATUS_LOCK_PP 0x07 +#define IPC_SEC_SIM_STATUS_LOCK_PC 0x08 +#define IPC_SEC_SIM_STATUS_CARD_NOT_PRESENT 0x80 +#define IPC_SEC_SIM_STATUS_CARD_ERROR 0x81 +#define IPC_SEC_SIM_STATUS_INIT_COMPLETE 0x82 +#define IPC_SEC_SIM_STATUS_PB_INIT_COMPLETE 0x83 + +/* SIM/Network facility types */ +#define IPC_SEC_FACILITY_TYPE_SC 0x03 +#define IPC_SEC_FACILITY_TYPE_FD 0x04 +#define IPC_SEC_FACILITY_TYPE_PN 0x05 +#define IPC_SEC_FACILITY_TYPE_PU 0x06 +#define IPC_SEC_FACILITY_TYPE_PP 0x07 +#define IPC_SEC_FACILITY_TYPE_PC 0x08 + +/* SIM card (SC) facility lock types */ +#define IPC_SEC_FACILITY_LOCK_TYPE_SC_PIN1_REQ 0x01 +#define IPC_SEC_FACILITY_LOCK_TYPE_SC_PUK_REQ 0x02 +#define IPC_SEC_FACILITY_LOCK_TYPE_SC_CARD_BLOCKED 0x05 + +/* PIN type */ +#define IPC_SEC_PIN_TYPE_PIN1 0x03 +#define IPC_SEC_PIN_TYPE_PIN2 0x09 + +/* Type of the used SIM card */ +#define IPC_SEC_SIM_CARD_TYPE_UNKNOWN 0x00 +#define IPC_SEC_SIM_CARD_TYPE_SIM 0x01 +#define IPC_SEC_SIM_CARD_TYPE_USIM 0x02 + +/* Possible RSIM commads */ +#define IPC_SEC_RSIM_COMMAND_READ_BINARY 0xb0 +#define IPC_SEC_RSIM_COMMAND_READ_RECORD 0xc0 +#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xd6 +#define IPC_SEC_RSIM_COMMAND_STATUS 0xf2 struct ipc_sec_pin_status_response { - unsigned char type; - unsigned char key; + /* IPC_SEC_SIM_STATUS_... */ + unsigned char status; + /* IPC_SEC_FACILITY_LOCK_TYPE_... */ + unsigned char facility_lock; } __attribute__((__packed__)); struct ipc_sec_pin_status_set { + /* IPC_SEC_PIN_TYPE_... */ unsigned char type; unsigned char length1; unsigned char length2; @@ -79,30 +95,35 @@ struct ipc_sec_pin_status_set { } __attribute__((__packed__)); struct ipc_sec_phone_lock_set { - unsigned char type; // IPC_SEC_PIN_SIM_LOCK_... - unsigned char lock; + /* IPC_SEC_PIN_... */ + unsigned char type; + unsigned char lock; /* 1: lock, 0: unlock */ unsigned char length; unsigned char password[39]; } __attribute__((__packed__)); struct ipc_sec_phone_lock_get { - unsigned char type; // IPC_SEC_PIN_SIM_LOCK_... + /* IPC_SEC_FACILITY_TYPE_... */ + unsigned char facility; } __attribute__((__packed__)); struct ipc_sec_phone_lock_response { - unsigned char type; - unsigned char status; + /* IPC_SEC_FACILITY_TYPE_... */ + unsigned char facility; + unsigned char status; /* 1: active, 0: not active */ } __attribute__((__packed__)); struct ipc_sec_change_locking_pw { - unsigned char type; // IPC_SEC_PIN_SIM_LOCK_... + /* IPC_SEC_FACILITY_TYPE_... */ + unsigned char facility; unsigned char length_old; unsigned char length_new; unsigned char password_old[39]; unsigned char password_new[39]; } __attribute__((__packed__)); -struct ipc_sec_rsim_access_request { +struct ipc_sec_rsim_access_get { + /* IPC_SEC_RSIM_COMMAND_... */ unsigned char command; unsigned short fileid; unsigned char p1, p2, p3; @@ -113,25 +134,31 @@ struct ipc_sec_rsim_access_response { unsigned char len; } __attribute__((__packed__)); -struct ipc_sec_lock_info_request { - unsigned char unk0; +struct ipc_sec_lock_info_get { + unsigned char unk0; /* needs to be "1" */ + /* IPC_SEC_PIN_TYPE_... */ unsigned char pin_type; } __attribute__((__packed__)); struct ipc_sec_lock_info_response { unsigned char num; + /* IPC_SEC_PIN_TYPE_... */ unsigned char type; unsigned char key; unsigned char attempts; } __attribute__((__packed__)); struct ipc_sec_sim_icc_type { + /* unknown */ unsigned char type; } __attribute__((__packed__)); void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message, unsigned char pin_type, char *pin1, char *pin2); +void ipc_sec_lock_info_get_setup(struct ipc_sec_lock_info_get *message, + unsigned char pin_type); + char* ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response); #endif |