sec: RSIM access helper
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 26 Jul 2014 16:50:39 +0000 (18:50 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Sat, 26 Jul 2014 16:50:39 +0000 (18:50 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
include/sec.h
samsung-ipc/sec.c

index 236bc37..7a1d178 100644 (file)
@@ -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);
 
index 6ea645d..be5dccf 100644 (file)
@@ -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)
 {