Change TA store to /usr/lib, add helloworld 13/139613/3
authorLukasz Kostyra <l.kostyra@samsung.com>
Wed, 19 Jul 2017 12:45:14 +0000 (14:45 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Mon, 11 Sep 2017 14:35:18 +0000 (16:35 +0200)
TA store directory was changed from /tmp/tastore, which was
not the best place to keep TA images - rebooting the device
would remove our TAs.

Change-Id: I684b2b2f166755a0243663ebe2c9e6d21defdbca

14 files changed:
CMakeLists.txt
TEEStub/teestubmain.cpp
helloworld/CMakeLists.txt [new file with mode: 0644]
helloworld/host/main.c [new file with mode: 0644]
helloworld/ta/hello_world.c [new file with mode: 0644]
helloworld/ta/hello_world.h [new file with mode: 0644]
helloworld/ta/hello_world.xml [new file with mode: 0644]
include/include/config.h
packaging/tef-simulator.spec
simulatordaemon/src/TABinaryManager/Config.h
simulatordaemon/src/TABinaryManager/TABinaryManager.cpp
simulatordaemon/src/TAFactory.cpp
simulatordaemon/src/TAInstance.cpp
simulatordaemon/src/scripts/update_uuid_list.sh

index f1aa4d9..38e1910 100644 (file)
@@ -63,6 +63,10 @@ SET(TARGET_TEF_SIMULATOR_LOG ${TARGET_TEF_SIMULATOR}-log)
 SET(TARGET_TEF_SIMULATOR_OSAL ${TARGET_TEF_SIMULATOR}-osal)
 SET(TARGET_TEF_SIMULATOR_DAEMON ${TARGET_TEF_SIMULATOR}-daemon)
 SET(TARGET_TEF_SIMULATOR_SSFLIB ${TARGET_TEF_SIMULATOR}-ssflib)
+SET(TARGET_TEF_SIMULATOR_HELLO_WORLD_CA ${TARGET_TEF_SIMULATOR}-helloworld)
+
+# helloworld TA needs to be named after its UUID
+SET(TARGET_TEF_SIMULATOR_HELLO_WORLD_TA 00000000-0000-0000-0000-112233445566)
 
 # below targets need different names due to linking with CAs and TAs (libteec for client)
 SET(TARGET_TEF_SIMULATOR_TEEC_LIB teec)
@@ -97,6 +101,11 @@ SET(TEEC_LIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEECLib)
 # TEEStub
 SET(TEE_STUB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEEStub)
 
+# helloworld
+SET(HELLO_WORLD_PATH ${TEF_SIMULATOR_ROOT_PATH}/helloworld)
+SET(HELLO_WORLD_TA_PATH ${HELLO_WORLD_PATH}/ta)
+SET(HELLO_WORLD_CA_PATH ${HELLO_WORLD_PATH}/host)
+
 
 ############################# subdirectories ##################################
 
@@ -106,3 +115,4 @@ ADD_SUBDIRECTORY(simulatordaemon)
 ADD_SUBDIRECTORY(ssflib)
 ADD_SUBDIRECTORY(TEECLib)
 ADD_SUBDIRECTORY(TEEStub)
+ADD_SUBDIRECTORY(helloworld)
index c87be23..103e391 100644 (file)
@@ -78,7 +78,8 @@ int main(int argc, char* argv[]) {
        TEE_Result initStatus;
        char uuid[100];
        int uuidlen = strlen(argv[0]);
-       printf("argv[0]: %s\n", argv[0]);
+       printf("TEESTUB argv[0]: %s\n", argv[0]);
+       printf("TEESTUB argv[1]: %s\n", argv[1]);
        // fetch uuid from argv[0]
        int i, j;
        for (i = uuidlen - 38, j = 0; i < uuidlen - 6; j++, i++) {
diff --git a/helloworld/CMakeLists.txt b/helloworld/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5e59ea0
--- /dev/null
@@ -0,0 +1,70 @@
+# Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+# @file
+# @author  Lukasz Kostyra (l.kostyra@samsung.com)
+# @brief   CMakeLists for tef-simulator CA and TA
+#
+
+############# TA #############
+
+SET(HELLO_WORLD_TA_SOURCES
+    ${HELLO_WORLD_TA_PATH}/hello_world.c
+    )
+
+ADD_EXECUTABLE(${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
+    ${HELLO_WORLD_TA_SOURCES}
+    )
+
+ADD_DEPENDENCIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
+    ${TARGET_TEF_SIMULATOR_TEE_STUB}
+    )
+
+INCLUDE_DIRECTORIES(
+    ${TEF_SIMULATOR_INCLUDE_PATH}/include
+    )
+
+TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
+    ${TARGET_TEF_SIMULATOR_TEE_STUB}
+    )
+
+# TODO directory for TAs
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA} DESTINATION ${TASTORE_DIR})
+
+
+############# CA #############
+
+SET(HELLO_WORLD_CA_SOURCES
+    ${HELLO_WORLD_CA_PATH}/main.c
+    )
+
+ADD_EXECUTABLE(${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA}
+    ${HELLO_WORLD_CA_SOURCES}
+    )
+
+ADD_DEPENDENCIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA}
+    ${TARGET_TEF_SIMULATOR_TEEC_LIB}
+    ${TARGET_TEF_SIMULATOR_HELLO_WORLD_TA}
+    )
+
+INCLUDE_DIRECTORIES(
+    ${TEF_SIMULATOR_INCLUDE_PATH}/include
+    ${HELLO_WORLD_TA_PATH}
+    )
+
+TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA}
+    ${TARGET_TEF_SIMULATOR_TEEC_LIB}
+    )
+
+INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_HELLO_WORLD_CA} DESTINATION ${BIN_DIR})
diff --git a/helloworld/host/main.c b/helloworld/host/main.c
new file mode 100644 (file)
index 0000000..86f9e13
--- /dev/null
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+/**
+ * @file
+ * @author  Lukasz Kostyra (l.kostyra@samsung.com)
+ * @brief   Example Hello World CA for TEF Simulator
+ */
+
+
+#include <err.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <tee_client_api.h>
+#include <hello_world.h>
+
+int main(int argc, char *argv[])
+{
+       TEEC_Result result;
+       TEEC_Context ctx;
+       TEEC_Session sess;
+       TEEC_Operation op;
+       TEEC_UUID uuid = HELLO_WORLD_UUID;
+       uint32_t error;
+
+       result = TEEC_InitializeContext(NULL, &ctx);
+       if (result != TEEC_SUCCESS) {
+               printf("TEEC_InitializeContext failed with result %x\n", result);
+               return -1;
+       }
+
+       result = TEEC_OpenSession(&ctx, &sess, &uuid, TEEC_LOGIN_PUBLIC, NULL, NULL, &error);
+       if (result != TEEC_SUCCESS) {
+               printf("TEEC_OpenSession failed with result %x\n", result);
+               return -2;
+       }
+
+       memset(&op, 0, sizeof(op));
+       op.paramTypes = TEEC_PARAM_TYPES(TEEC_VALUE_INOUT, TEEC_NONE, TEEC_NONE, TEEC_NONE);
+       op.params[0].value.a = 1;
+
+       printf("Incrementing %d via TA\n", op.params[0].value.a);
+       result = TEEC_InvokeCommand(&sess, HELLO_WORLD_CMD_INC, &op, &error);
+       if (result != TEEC_SUCCESS) {
+               printf("TEEC_InvokeCommand failed with result %x, error %x\n", result, error);
+               return -3;
+       }
+
+       printf("TA incremented value to %d\n", op.params[0].value.a);
+       TEEC_CloseSession(&sess);
+       TEEC_FinalizeContext(&ctx);
+
+       return 0;
+}
diff --git a/helloworld/ta/hello_world.c b/helloworld/ta/hello_world.c
new file mode 100644 (file)
index 0000000..2a6cfe2
--- /dev/null
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+/**
+ * @file
+ * @author  Lukasz Kostyra (l.kostyra@samsung.com)
+ * @brief   Example Hello World TA for TEF Simulator
+ */
+
+#include <tee_internal_api.h>
+
+#include "hello_world.h"
+#include <stdio.h>
+
+#define LOG_FUNC() printf("%s has been called\n", __func__)
+
+
+TEE_Result TA_CreateEntryPoint(void)
+{
+       LOG_FUNC();
+       return TEE_SUCCESS;
+}
+
+void TA_DestroyEntryPoint(void)
+{
+       LOG_FUNC();
+}
+
+TEE_Result TA_OpenSessionEntryPoint(uint32_t param_types,
+                                                                       TEE_Param params[4],
+                                                                       void **sess_ctx)
+{
+       (void)&params;
+       (void)&sess_ctx;
+
+       LOG_FUNC();
+
+       uint32_t expectedParams = TEE_PARAM_TYPES(TEE_PARAM_TYPE_NONE,
+                                                                                               TEE_PARAM_TYPE_NONE,
+                                                                                               TEE_PARAM_TYPE_NONE,
+                                                                                               TEE_PARAM_TYPE_NONE);
+       if (param_types != expectedParams)
+               return TEE_ERROR_BAD_PARAMETERS;
+
+       printf("Hello world!\n");
+
+       return TEE_SUCCESS;
+}
+
+void TA_CloseSessionEntryPoint(const void *sess_ctx)
+{
+       (void)&sess_ctx;
+       LOG_FUNC();
+}
+
+static TEE_Result inc_value(uint32_t param_types,
+                                                       TEE_Param params[4])
+{
+       uint32_t exp_param_types = TEE_PARAM_TYPES(TEE_PARAM_TYPE_VALUE_INOUT,
+                                                                                       TEE_PARAM_TYPE_NONE,
+                                                                                       TEE_PARAM_TYPE_NONE,
+                                                                                       TEE_PARAM_TYPE_NONE);
+
+       LOG_FUNC();
+       if (param_types != exp_param_types)
+               return TEE_ERROR_BAD_PARAMETERS;
+
+       printf("Got value %u\n", params[0].value.a);
+       params[0].value.a++;
+       printf("Increased value to %u\n", params[0].value.a);
+       return TEE_SUCCESS;
+}
+
+TEE_Result TA_InvokeCommandEntryPoint(const void *sess_ctx,
+                                                                       uint32_t cmd_id,
+                                                                       uint32_t param_types,
+                                                                       TEE_Param params[4])
+{
+       (void)&sess_ctx;
+
+       LOG_FUNC();
+
+       switch (cmd_id) {
+       case HELLO_WORLD_CMD_INC:
+               return inc_value(param_types, params);
+       default:
+               return TEE_ERROR_BAD_PARAMETERS;
+       }
+}
diff --git a/helloworld/ta/hello_world.h b/helloworld/ta/hello_world.h
new file mode 100644 (file)
index 0000000..2191ff9
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    Licensed under the Apache License, Version 2.0 (the "License");
+ *    you may not use this file except in compliance with the License.
+ *    You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing, software
+ *    distributed under the License is distributed on an "AS IS" BASIS,
+ *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *    See the License for the specific language governing permissions and
+ *    limitations under the License.
+ */
+
+/**
+ * @file
+ * @author  Lukasz Kostyra (l.kostyra@samsung.com)
+ * @brief   Example Hello World TA for TEF Simulator
+ */
+
+#ifndef HELLO_WORLD_H
+#define HELLO_WORLD_H
+
+#define HELLO_WORLD_UUID { 0x00000000, 0x0000, 0x0000, \
+               { 0x00, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66} }
+
+enum HelloWorldCmds {
+       HELLO_WORLD_CMD_INC = 0
+};
+
+#endif // HELLO_WORLD_H
diff --git a/helloworld/ta/hello_world.xml b/helloworld/ta/hello_world.xml
new file mode 100644 (file)
index 0000000..b29c7df
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://www.samsungdforum.com/ns/packages" >
+    <properties>
+        <!-- Trusted Application Configuration Properties GPD TEE Internal API Specification v1.0 -->
+        <general
+            appID="00000000000000000000112233445566"
+            singleInstance="true"
+            multiSession="true"
+            instanceKeepAlive="false"
+            stackSize="4096"
+            dataSize="4096" />
+
+        <!-- Extended TEE specific -->
+        <extension
+            appName="tef-simulator-helloworld"
+            appVersion="1"
+            type="application"
+            zone="internal"
+            sdkVersion="2.0"
+            launchMode="debug" />
+    </properties>
+    <!-- Access Control Policy -->
+    <policy>
+        <privilege name = "tef-simulator-helloworld" />
+        <protectionDomain>
+            <createDomain name = "testtefsimulator" />
+            <allowedDomain name = "testtefsimulator" />
+        </protectionDomain>
+
+        <permission>
+            <uses-permission name="system.permission.storage" />
+        </permission>
+    </policy>
+
+    <taEncryption>
+        <model>
+            <modelName value="Debug"/>
+            <plainkeydata value="Y2FlZTI3MGJlN2IwZjMyNTM3OWRlZDU0OGQxMGMwZmZiZmJhYTc5NTY5MzY3Y2Q5ZTIzZWNjMmZiY2ExOGViZg0K" />
+        </model>
+    </taEncryption>
+
+    <information>
+        <description> "Sample Hello World application." </description>
+        <author> "Samsung Electronics" </author>
+        <terms> "This sample Application is provided as is. All rights reserved." </terms>
+        <copyright> "Copyright (c) 2017 Samsung Electronics" </copyright>
+    </information>
+
+</manifest>
index b4428d7..f327479 100644 (file)
@@ -10,6 +10,6 @@
 
 #define TEE_PROP_FILE "/usr/bin/GPD_TEE_PROP"
 #define TA_ROOT "/tmp/"
-#define TEE_TASTORE_ROOT "/tmp/tastore/"
+#define TEE_TASTORE_ROOT "/usr/lib/tastore/"
 
 #endif /* INCLUDE_CONFIG_H_ */
index 7eaea97..cf33c83 100644 (file)
@@ -16,6 +16,8 @@ BuildRequires: pkgconfig(security-manager)
 
 %global bin_dir %{?TZ_SYS_BIN:%TZ_SYS_BIN}%{!?TZ_SYS_BIN:%_bindir}
 %global sbin_dir %{?TZ_SYS_SBIN:%TZ_SYS_SBIN}%{!?TZ_SYS_SBIN:%_sbindir}
+%global lib_dir %{?TZ_SYS_LIB:%TZ_SYS_LIB}%{!?TZ_SYS_LIB:%_libdir}
+%global tastore_dir %{lib_dir}/tastore
 
 %description
 TEF Simulator provides a TrustZone simulated environment
@@ -29,7 +31,8 @@ environment natively (ex. on an emulator).
 %cmake . \
         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
         -DBIN_DIR=%{bin_dir} \
-        -DSBIN_DIR=%{sbin_dir}
+        -DSBIN_DIR=%{sbin_dir} \
+        -DTASTORE_DIR=%{tastore_dir}
 make %{?silent:--silent} %{?jobs:-j%jobs}
 
 %install
@@ -45,8 +48,10 @@ make %{?silent:--silent} %{?jobs:-j%jobs}
 
 %files -n tef-simulator
 %{bin_dir}/tef-simulator-daemon
+%{bin_dir}/tef-simulator-helloworld
 %{_libdir}/libtef-simulator-log.so
 %{_libdir}/libtef-simulator-osal.so
 %{_libdir}/libtef-simulator-ssflib.so
 %{_libdir}/libteec.so
+%{tastore_dir}/00000000-0000-0000-0000-112233445566
 %{sbin_dir}/tef-simulator-update-uuid-list.sh
index 110e0bd..a14e98e 100644 (file)
@@ -22,7 +22,7 @@
 /*-----------------------------------------------------------------------------
  *  MACROS
  *-----------------------------------------------------------------------------*/
-#define TA_STORE_PATH "/tmp/tastore/"
-#define TA_UUID_LIST_PATH "/tmp/tastore/uuidlist.list"
+#define TA_STORE_PATH "/usr/lib/tastore/"
+#define TA_UUID_LIST_PATH "/usr/lib/tastore/uuidlist.list"
 
 #endif /* CONFIG_H_ */
index 20056f5..b035dd9 100644 (file)
@@ -184,6 +184,8 @@ bool TABinaryManager::readUUIDList() {
        if(uuidFileStream) {
                getline(uuidFileStream, str);
                line = line + str;
+       } else {
+               LOGD(SIM_DAEMON, "Failed to open uuid file");
        }
 
        /*
@@ -201,6 +203,7 @@ bool TABinaryManager::readUUIDList() {
                char* uuid_data;
                strncpy(data, line.c_str(), (strlen(line.c_str()) + 1) * sizeof(char));
                uuid_data = strtok(data, ",");
+
                const string uuid(data);
                if (uuid_data != NULL) {
                        char* port_data;
@@ -210,21 +213,23 @@ bool TABinaryManager::readUUIDList() {
                                info.port = port;
                        } else info.port = "";
                }
-               //cout << "UUID: " << uuid << endl;
-               //cout << "port: " << info.port << endl;
+
                // Open file
-               FILE *fpTA=fopen((string(TA_STORE_PATH) + "ta.tmp").c_str(),"r+");
+               FILE *fpTA=fopen((string(TA_STORE_PATH) + uuid).c_str(),"r+");
                if (flock(fileno(fpTA),LOCK_EX) != 0) { // do an exclusive lock
                    LOGE(SIM_DAEMON, "Failed to lock the file");
                }
+
                pthread_mutex_lock(&taLock);
                if (unpackBinary(uuid, info)) {
                        binaryMap[uuid] = info;
                }
                pthread_mutex_unlock(&taLock);
+
                if (flock(fileno(fpTA),LOCK_UN) != 0) {
                    LOGE(SIM_DAEMON, "Failed to unlock the file");
                }
+
                fclose(fpTA);
                OsaFree(data);
 
@@ -307,8 +312,9 @@ void TABinaryManager::decryptImage(StructBinaryInfo& info) {
 bool TABinaryManager::unpackBinary(const string &uuid, StructBinaryInfo& info) {
        TAUnpack* unpacker = TAUnpack::getInstance();
        bool ret = false;
-       LOGE(SIM_DAEMON, "");
+       LOGE(SIM_DAEMON, "Unpacking TA");
        if (0 == unpacker->unpackTA(string(TA_STORE_PATH), uuid)) {
+               LOGE(SIM_DAEMON, "Unpacked, filling info");
                // 1. Set binary info
                info.path = string(TA_STORE_PATH) + uuid;
                info.extractpath = string(TA_STORE_PATH) + uuid + "-ext/";
@@ -316,6 +322,8 @@ bool TABinaryManager::unpackBinary(const string &uuid, StructBinaryInfo& info) {
                info.manifestPath = info.extractpath + uuid + ".manifest";
                // 2. Parse manifest and store results
                info.manifest.processXML(info.manifestPath);
+
+               LOGE(SIM_DAEMON, "Decrypting");
                // 3. Decrypt image using secret value in manifest
                if (info.manifest.properties.extension.launchMode == "debug")
                  decryptImage(info);
index 57c863a..6379144 100644 (file)
@@ -362,6 +362,7 @@ bool TAFactory::launchTA(string TAUUID, std::stringstream& str, bool debug,
        // Get TABinaryManager instance
        TABinaryManager *TABin = TABinaryManager::getInstance();
        // Get TA Image path for launching
+       LOGD(SIM_DAEMON, TAUUID.c_str());
        string argvPath = TABin->getImagePath(TAUUID);
        if ("" == argvPath) {
                LOGE(SIM_DAEMON, "Trusted Application does not exist");
index 2b1650f..5eec96c 100644 (file)
@@ -173,7 +173,7 @@ TEEC_Result TAInstance::connecttoTA(std::stringstream& str) {
                boost::system::error_code error = boost::asio::error::host_not_found;
                stream_protocol::endpoint ep(string("/tmp/") + str.str());
 
-               LOGD(SIM_DAEMON, "Connect to TEEStub");
+               LOGD(SIM_DAEMON, "Connect to TEEStub %s", str.str().c_str());
                // Try to connect to TA RETRY_COUNT number of times
                while (error && (retry_count < RETRY_COUNT)) {
 #if 0
index 590b3aa..2dc7815 100755 (executable)
@@ -4,12 +4,12 @@
 # UUID pattern is: ....-....-....-............
 # This script should be executed once all the TA packages are transferred to /tmp/tastore
 
-# Author: Krishna Devale 
+# Author: Krishna Devale
 # Samsung R & D Institute, Bangalore
 # 7 May 2015
 
 #uuidfile="./tastore/uuidlist.list";
-uuidfile="/tmp/tastore/uuidlist.list";
+uuidfile="/usr/lib/tastore/uuidlist.list";
 
 retval=""
 file="/tmp/fileLock"
@@ -1183,7 +1183,7 @@ echo $retval
 #uuidfile="/tmp/tastore/uuidlist.list";
 #rm -f $uuidfile;
 
-#for filename in $(find /tmp/tastore/ -maxdepth 1 -regex ".*/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]" ! -name "*ext"); do 
+#for filename in $(find /tmp/tastore/ -maxdepth 1 -regex ".*/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]-[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]" ! -name "*ext"); do
 #strip off the complete path, retain only the file names
-#(echo "${filename:13}" >> $uuidfile); 
+#(echo "${filename:13}" >> $uuidfile);
 #done