All TAs should be loaded from sytem TA store. Licence fixes. Client library fixes. 51/156851/4 accepted/tizen/unified/20171020.160207 submit/tizen/20171020.123639 submit/tizen_4.0/20171020.123601
authorTomasz Swierczek <t.swierczek@samsung.com>
Fri, 20 Oct 2017 07:16:01 +0000 (09:16 +0200)
committerr.tyminski <r.tyminski@partner.samsung.com>
Fri, 20 Oct 2017 12:07:11 +0000 (14:07 +0200)
Change-Id: Ic106b3c21b22e72f3eaf622cb3d5da6aeb7d827f

packaging/tef-simulator.spec
simulatordaemon/src/SecurityContext.cpp
ssflib/CMakeLists.txt
systemd/tef-simulator.service.in

index 1f34aef..99f1571 100644 (file)
@@ -3,7 +3,7 @@ Summary:    TEF TrustZone simulator and it's utilities
 Version:    0.0.1
 Release:    1
 Group:      Security
-License:    Apache-2.0 and BSD-3-Clause
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 ExcludeArch: armv6l armv7hl armv7l aarch64
 BuildRequires: cmake
@@ -95,16 +95,12 @@ make install
 
 %post
 ln -sf %{tastore_dir} %{link_tastore_dir}
-systemctl enable tef-simulator
-
-%post -n %{name}-client
 tef-update.sh simulator
+systemctl enable tef-simulator
 
 %preun
 
 %postun
-
-%postun -n %{name}-client
 if [ $1 = 0 ] ; then
     tef-update.sh
 fi
@@ -115,9 +111,8 @@ fi
 %attr(770,root,security_fw) %{tastore_dir}
 %attr(444,security_fw,security_fw) %{_unitdir}/tef-simulator.service
 %attr(444,security_fw,security_fw) %{_unitdir}/tef-simulator.socket
+%attr(755,security_fw,security_fw) %{lib_dir}/tef/simulator/libteec.so
 
-%files -n %{name}-client
-%attr(111,security_fw,security_fw) %{lib_dir}/tef/simulator/libteec.so
 
 %files -n %{name}-devkit
 %{bin_dir}/TA_PackageBuilder.sh
index 5b29ce8..c7d8946 100644 (file)
@@ -111,51 +111,17 @@ std::string SecurityContext::getCaFullPathFromPkgId(char* pkgid) {
 
 
 bool SecurityContext::findRequestedTa(const std::string &ta_name, std::string &allowed_path) {
-       int ret;
-       char* pkg_id_ca;
-
-       LOGD(SIM_DAEMON, "Entry");
-       ret = security_manager_identify_app_from_socket(connFd, &pkg_id_ca, NULL);
-
-       if (ret == SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT) {
-               LOGD(SIM_DAEMON, "Owner of socket has no pkgid");
-
-               std::string ta_full_path;
-
-               /* Check if any of system ta directories contains our ta */
-               for (const std::string& path : sysTaPaths) {
-                       ta_full_path = path + ta_name;
-
-                       if (fs::exists(ta_full_path)){
-                               allowed_path = path;
-                               return true;
-                       }
+        LOGD(SIM_DAEMON, "Entry");
+       std::string ta_full_path;
+       /* Check if any of system ta directories contains our ta */
+       for (const std::string& path : sysTaPaths) {
+               ta_full_path = path + ta_name;
+               if (fs::exists(ta_full_path)){
+                       allowed_path = path;
+                       return true;
                }
-
-               return false;
-       }
-
-       if (ret != SECURITY_MANAGER_SUCCESS) {
-               LOGE(SIM_DAEMON, "security_manager_identify_app_from_socket failed with CA");
-               return false;
-       }
-
-       /* We can free it only if security_manager_identify_app_from_socket return success */
-       p_char p_pkg_id_ca(pkg_id_ca, &free);
-
-       std::string ca_pkg_path = getCaFullPathFromPkgId(pkg_id_ca);
-       if (!fs::exists(ca_pkg_path)) {
-               LOGE(SIM_DAEMON, "Error while loading client's path");
-               return false;
        }
-
-       if (!fs::exists(ca_pkg_path + "/" + ta_name)) {
-               LOGE(SIM_DAEMON, "TA %s not found in res/tee/", ta_name.c_str());
-               return false;
-       }
-
-       allowed_path = ca_pkg_path + "/";
-       return true;
+       return false;
 }
 
 
index 3d456a7..9812d99 100644 (file)
@@ -20,6 +20,7 @@
 PKG_CHECK_MODULES(SSFLIB_DEPS REQUIRED
                   openssl
                   tef-libteec
+                  dlog
                   )
 
 SET(SSFLIB_CRYPTOCORE_SOURCES
index 85a3efa..a9b767c 100644 (file)
@@ -6,6 +6,7 @@ BindsTo=tef-simulator.socket
 [Service]
 User=security_fw
 Group=security_fw
+SupplementaryGroups=users
 CapabilityBoundingSet=
 SmackProcessLabel=@SMACK_DOMAIN_NAME@
 ExecStart=@SYSTEMD_CFG_BIN_DIR@/tef-simulator-daemon