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
%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
%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
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;
}