diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-07-26 18:50:39 +0200 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-07-26 18:50:39 +0200 |
commit | 1c4d4f7e68ce1740b08b250292bab8361eca3402 (patch) | |
tree | 9d6c167df5d452d7287cf360df2fd9dd08e90576 | |
parent | 873093afb5e94d0e82524e0ad5f8689b2cee18cb (diff) | |
download | external_libsamsung-ipc-1c4d4f7e68ce1740b08b250292bab8361eca3402.zip external_libsamsung-ipc-1c4d4f7e68ce1740b08b250292bab8361eca3402.tar.gz external_libsamsung-ipc-1c4d4f7e68ce1740b08b250292bab8361eca3402.tar.bz2 |
sec: RSIM access helper
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r-- | include/sec.h | 2 | ||||
-rw-r--r-- | samsung-ipc/sec.c | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/include/sec.h b/include/sec.h index 236bc37..7a1d178 100644 --- a/include/sec.h +++ b/include/sec.h @@ -173,6 +173,8 @@ int ipc_sec_phone_lock_request_set_setup(struct ipc_sec_phone_lock_request_set_d int ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *data, unsigned char facility_type, const char *password_old, const char *password_new); +void *ipc_sec_rsim_access_setup(struct ipc_sec_rsim_access_request_header *header, + const void *sim_io_data, size_t sim_io_size); int ipc_sec_lock_infomation_setup(struct ipc_sec_lock_infomation_request_data *data, unsigned char type); diff --git a/samsung-ipc/sec.c b/samsung-ipc/sec.c index 6ea645d..be5dccf 100644 --- a/samsung-ipc/sec.c +++ b/samsung-ipc/sec.c @@ -120,6 +120,36 @@ int ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *data, return 0; } +void *ipc_sec_rsim_access_setup(struct ipc_sec_rsim_access_request_header *header, + const void *sim_io_data, size_t sim_io_size) +{ + void *data; + size_t size; + unsigned char *p; + + if (header == NULL) + return NULL; + + if (sim_io_data == NULL) + sim_io_size = 0; + + size = sizeof(struct ipc_sec_rsim_access_request_header) + sim_io_size; + + data = calloc(1, size); + + p = (unsigned char *) data; + + memcpy(p, header, sizeof(struct ipc_sec_rsim_access_request_header)); + p += sizeof(struct ipc_sec_rsim_access_request_header); + + if (sim_io_data != NULL && sim_io_size > 0) { + memcpy(p, sim_io_data, sim_io_size); + p += sim_io_size; + } + + return data; +} + int ipc_sec_lock_infomation_setup(struct ipc_sec_lock_infomation_request_data *data, unsigned char type) { |