From 98d9a06f7cdae0bf23614127006eb73de0126b1e Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Thu, 4 May 2017 13:24:29 +0200 Subject: [PATCH 01/16] Add gitignore Change-Id: I110cb0b5ac72f053435a773292a5636b4c916a2d --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a75f2a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.d +*.o +*.out -- 2.7.4 From 5d273524394f61eaad261d3a7ea67053ff9b8ffb Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Thu, 4 May 2017 13:39:15 +0200 Subject: [PATCH 02/16] Delete useless toolchain variable from makefile Change-Id: I573a2720eaddc811befc0535e7b4b1966e7239b8 --- build/TEECLib/makefile | 1 - build/TEEStub/makefile | 1 - build/log/makefile | 1 - build/osal/makefile | 1 - build/simulatordaemon/makefile | 1 - build/ssflib/makefile | 1 - 6 files changed, 6 deletions(-) diff --git a/build/TEECLib/makefile b/build/TEECLib/makefile index 7c44a62..75048f7 100755 --- a/build/TEECLib/makefile +++ b/build/TEECLib/makefile @@ -2,7 +2,6 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ diff --git a/build/TEEStub/makefile b/build/TEEStub/makefile index e21018c..4ec32ee 100755 --- a/build/TEEStub/makefile +++ b/build/TEEStub/makefile @@ -2,7 +2,6 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr diff --git a/build/log/makefile b/build/log/makefile index c351a93..2466dac 100755 --- a/build/log/makefile +++ b/build/log/makefile @@ -2,7 +2,6 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ LOG_SOURCE = ../../log diff --git a/build/osal/makefile b/build/osal/makefile index af05f50..3a815f0 100755 --- a/build/osal/makefile +++ b/build/osal/makefile @@ -2,7 +2,6 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ OSAL_SOURCE = ../../osal diff --git a/build/simulatordaemon/makefile b/build/simulatordaemon/makefile index 7e56eaa..d3ab23c 100755 --- a/build/simulatordaemon/makefile +++ b/build/simulatordaemon/makefile @@ -2,7 +2,6 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ diff --git a/build/ssflib/makefile b/build/ssflib/makefile index d979fa5..0b25637 100755 --- a/build/ssflib/makefile +++ b/build/ssflib/makefile @@ -2,7 +2,6 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ -- 2.7.4 From c86ffdae0a3565f2c3522b4d4e513a2a22268808 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Thu, 4 May 2017 15:07:52 +0200 Subject: [PATCH 03/16] Fix platform dependent types casts. Change-Id: I50ac18635a3cb0adfc9852a1d69f22f40be381e3 --- osal/OsaIpc.c | 31 +++++++++++++++++++++----- osal/OsaSem.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 85 insertions(+), 16 deletions(-) diff --git a/osal/OsaIpc.c b/osal/OsaIpc.c index 57bb384..6f2824e 100755 --- a/osal/OsaIpc.c +++ b/osal/OsaIpc.c @@ -131,6 +131,27 @@ typedef struct { #define MAX_NAMEDSEM_MGR 256 +static UlOsaSem_t* sem[MAX_NAMEDSEM_MGR]={0}; + + +unsigned int addptr(UlOsaSem_t*s) { + for (int i=0; i < MAX_NAMEDSEM_MGR; ++i) { + if (sem[i]==NULL) {sem[i]=s; return i;} + } + return -1; +} + + +UlOsaSem_t* getptr(unsigned int id) { + return sem[id]; +} + + +void rmid(unsigned int id) { + sem[id]=NULL; +} + + static int UlOsaNamedSemCreate(const char pcName[10], int iCount, int iAttribute, unsigned int* puiSmid) { int iRetVal = OSAL_OK; @@ -175,7 +196,7 @@ static int UlOsaNamedSemCreate(const char pcName[10], int iCount, memcpy((void*)sem->bName, (const void*)pcName, (size_t)10); sem->bName[10] = '\0'; - *puiSmid = (unsigned int)sem; + *puiSmid = addptr(sem); return iRetVal; } @@ -207,7 +228,7 @@ static int UlOsaNamedSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { struct timeval tv; int ret; - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); if (!sem) { return OSAL_ERROR; @@ -267,7 +288,7 @@ static int UlOsaNamedSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { } static int UlOsaNamedSemRelease(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); struct sembuf semBuf; if (!sem) { @@ -288,7 +309,7 @@ static int UlOsaNamedSemRelease(unsigned int uiSmid) { } static int UlOsaNamedSemReset(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); union semun semUnion; if (!sem) { @@ -306,7 +327,7 @@ static int UlOsaNamedSemReset(unsigned int uiSmid) { } static int UlOsaNamedSemGetval(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); int n; if (!sem) { diff --git a/osal/OsaSem.c b/osal/OsaSem.c index eaef3e1..c2865ec 100755 --- a/osal/OsaSem.c +++ b/osal/OsaSem.c @@ -37,6 +37,30 @@ typedef struct _UlOsaSem { *-----------------------------------------------------------------------------*/ /* TODO: apply iAttribute */ // COMMON_071008_1 + +#define MAX_NAMEDSEM_MGR 256 +static UlOsaSem_t* sem[MAX_NAMEDSEM_MGR]={0}; + + +unsigned int addptr(UlOsaSem_t*s) { + for (int i=0; i < MAX_NAMEDSEM_MGR; ++i) { + if (sem[i]==NULL) {sem[i]=s; return i;} + } + return -1; +} + + +UlOsaSem_t* getptr(unsigned int id) { + return sem[id]; +} + + +void rmid(unsigned int id) { + sem[id]=NULL; +} + + + static int UlOsaSemCreate(const char bName[10], int iCount, int iAttribute, unsigned int* puiSmid) { UlOsaSem_t* sem; @@ -59,13 +83,13 @@ static int UlOsaSemCreate(const char bName[10], int iCount, int iAttribute, memcpy((void*)sem->bName, (const void*)bName, (size_t)10); sem->bName[10] = '\0'; - *puiSmid = (unsigned int)sem; + *puiSmid = addptr(sem); return OSAL_OK; } static int UlOsaSemDelete(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); if (!sem) { return OSAL_ERROR; @@ -73,13 +97,14 @@ static int UlOsaSemDelete(unsigned int uiSmid) { sem_destroy(&sem->sem); free(sem); + rmid(uiSmid); return OSAL_OK; } static int UlOsaSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { int ret; - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); if (!sem) { return OSAL_ERROR; @@ -148,7 +173,7 @@ static int UlOsaSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { } static int UlOsaSemRelease(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); if (!sem) { return OSAL_ERROR; } @@ -163,7 +188,7 @@ static int UlOsaSemRelease(unsigned int uiSmid) { } static int UlOsaSemReset(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); if (!sem) { return OSAL_ERROR; } @@ -183,7 +208,7 @@ static int UlOsaSemReset(unsigned int uiSmid) { } static int UlOsaSemGetval(unsigned int uiSmid) { - UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; + UlOsaSem_t *sem = getptr(uiSmid); int n; if (!sem) { return OSAL_ERROR; @@ -301,6 +326,28 @@ int OsaSemReset(unsigned int uiSmid) { //------------------------------------------------------------------------------ // $$$ */ + + +pthread_mutex_t* mutexes[MAX_NAMEDSEM_MGR] = {0}; + +unsigned int add_mutex(pthread_mutex_t* s) { + for (int i=0; i < MAX_NAMEDSEM_MGR; ++i) { + if (mutexes[i]==NULL) {mutexes[i]=s; return i;} + } + return -1; +} + + +pthread_mutex_t* get_mutex(unsigned int id) { + return mutexes[id]; +} + + +void rmid_mutex(unsigned int id) { + mutexes[id]=NULL; +} + + int OsaMutCreate(const char bName[10], int iAttributes, unsigned int* puiMutid) { pthread_mutexattr_t attr_t; pthread_mutex_t* pmutex_t; @@ -328,7 +375,7 @@ int OsaMutCreate(const char bName[10], int iAttributes, unsigned int* puiMutid) break; } - (*puiMutid) = (unsigned int)pmutex_t; + (*puiMutid) = add_mutex(pmutex_t); pthread_mutexattr_destroy(&attr_t); } else { @@ -358,7 +405,7 @@ int OsaMutCreate(const char bName[10], int iAttributes, unsigned int* puiMutid) int OsaMutDelete(unsigned int uiMutid) { int iRet; - pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; + pthread_mutex_t* pmutex_t = get_mutex(uiMutid); if (pmutex_t == NULL) { return OSAL_OK; } @@ -371,6 +418,7 @@ int OsaMutDelete(unsigned int uiMutid) { } free(pmutex_t); + rmid_mutex(uiMutid); return OSAL_OK; } @@ -390,7 +438,7 @@ int OsaMutDelete(unsigned int uiMutid) { int OsaMutRelease(unsigned int uiMutid) { int iRet; - pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; + pthread_mutex_t* pmutex_t = get_mutex(uiMutid); iRet = pthread_mutex_unlock(pmutex_t); if (iRet < 0) { perror("In OsaMutRelease() : failed "); @@ -414,7 +462,7 @@ int OsaMutRelease(unsigned int uiMutid) { */ int OsaMutGet(unsigned int uiMutid, int iFlags, int iTimeout) { int iRet; - pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; + pthread_mutex_t* pmutex_t = get_mutex(uiMutid); iRet = pthread_mutex_lock(pmutex_t); if (iRet < 0) { perror("In OsaMutGet() : failed "); @@ -438,7 +486,7 @@ int OsaMutGet(unsigned int uiMutid, int iFlags, int iTimeout) { int OsaMutTryGet(unsigned int uiMutid, int iFlags, int iTimeout) { int iRet; - pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; + pthread_mutex_t* pmutex_t = get_mutex(uiMutid); iRet = pthread_mutex_trylock(pmutex_t); if (iRet) { return ((int)iRet); -- 2.7.4 From 8990b499a063c290c42450f24e7bf4c3f2dcfa65 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Thu, 4 May 2017 15:22:00 +0200 Subject: [PATCH 04/16] Add fPIC option to so compilation. Change-Id: Ibe88c4bc2625b76c3449c574d35dc93cf2c4aa2c --- build/TEECLib/src/subdir.mk | 3 ++- build/log/subdir.mk | 4 +++- build/osal/subdir.mk | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build/TEECLib/src/subdir.mk b/build/TEECLib/src/subdir.mk index 1af650e..5bdd5c9 100755 --- a/build/TEECLib/src/subdir.mk +++ b/build/TEECLib/src/subdir.mk @@ -11,12 +11,13 @@ C_DEPS += \ ./src/teec_api.d \ ./src/teec_connection.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes src/%.o: $(TEECLIB_SOURCE)/src/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/log/subdir.mk b/build/log/subdir.mk index 354843c..42ea68f 100755 --- a/build/log/subdir.mk +++ b/build/log/subdir.mk @@ -8,11 +8,13 @@ OBJS += \ C_DEPS += \ ./log.d +C_FLAGS += -fPIC + # Each subdirectory must supply rules for building sources it contributes %.o: $(LOG_SOURCE)/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/osal/subdir.mk b/build/osal/subdir.mk index 4f05c36..f508fed 100755 --- a/build/osal/subdir.mk +++ b/build/osal/subdir.mk @@ -23,12 +23,13 @@ C_DEPS += \ ./OsaSignal.d \ ./OsaTask.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes %.o: $(OSAL_SOURCE)/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' -- 2.7.4 From 0f5ec7e68e779ff5df82efca8c2eb94bcdfbaa28 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Thu, 4 May 2017 17:21:47 +0200 Subject: [PATCH 05/16] Fix type casting. Change-Id: I7e2cf5cabaf0c9793fcf12bd4b74c72ffb17eba0 --- TEEStub/PropertyAccess/PropertyApi.cpp | 4 +-- build/build.sh | 15 ++++++++--- build/ssflib/dep/cryptocore/source/base/subdir.mk | 3 ++- .../ssflib/dep/cryptocore/source/middle/subdir.mk | 3 ++- build/ssflib/dep/cryptocore/source/subdir.mk | 4 ++- build/ssflib/dep/swdss/source/subdir.mk | 3 ++- build/ssflib/dep/time/subdir.mk | 3 ++- build/ssflib/dep/uci/source/subdir.mk | 3 ++- build/ssflib/src/subdir.mk | 4 ++- ssflib/dep/cryptocore/include/CC_Type.h | 11 ++++---- ssflib/dep/swdss/include/ss_types.h | 2 +- ssflib/dep/uci/include/uci_aes_xcbc_mac.h | 2 +- ssflib/dep/uci/include/uci_api.h | 16 +++++------ ssflib/dep/uci/include/uci_cryptocore.h | 10 +++---- ssflib/dep/uci/include/uci_type.h | 2 +- ssflib/dep/uci/source/uci_aes_xcbc_mac.c | 2 +- ssflib/dep/uci/source/uci_api.c | 31 ++++++++++++---------- ssflib/dep/uci/source/uci_cryptocore.c | 28 +++++++++++++------ ssflib/src/ssf_crypto.c | 25 ++++++++--------- 19 files changed, 102 insertions(+), 69 deletions(-) diff --git a/TEEStub/PropertyAccess/PropertyApi.cpp b/TEEStub/PropertyAccess/PropertyApi.cpp index 7cc2e15..161d18c 100755 --- a/TEEStub/PropertyAccess/PropertyApi.cpp +++ b/TEEStub/PropertyAccess/PropertyApi.cpp @@ -296,7 +296,7 @@ void TEE_FreePropertyEnumerator(TEE_PropSetHandle enumerator) { void TEE_StartPropertyEnumerator(TEE_PropSetHandle enumerator, TEE_PropSetHandle propSet) { PropertyEnumHandle *newEnumHandle = (PropertyEnumHandle*)enumerator; - switch ((uint32_t)propSet) { + switch ((intptr_t)propSet) { case TEE_PROPSET_CURRENT_TA: { newEnumHandle->property = new TAProperty( string(TEE_TASTORE_ROOT) + thisTAUUIDGlobal + "-ext/" @@ -375,7 +375,7 @@ TEE_Result TEE_GetNextProperty(TEE_PropSetHandle enumerator) { Property* _GetTargetProperty(TEE_PropSetHandle propsetOrEnumerator) { Property *targetProperty = NULL; - switch ((uint32_t)propsetOrEnumerator) { + switch ((intptr_t)propsetOrEnumerator) { case TEE_PROPSET_TEE_IMPLEMENTATION: { targetProperty = teeProperty; break; diff --git a/build/build.sh b/build/build.sh index 204083d..c0bc759 100755 --- a/build/build.sh +++ b/build/build.sh @@ -25,6 +25,9 @@ SIMDAEMON_PATH=$DIR/simulatordaemon Package=$2 TOOLCHAIN=$3 +CA_SIMULATOR_LIB=$Package/CA/simulator/usr/lib/ +TA_SIMULATOR_LIB=$Package/TA/simulator/usr/lib/ + #check error case check_make_error() { @@ -88,7 +91,8 @@ check_make_error make TOOLCHAIN=$TOOLCHAIN check_make_error echo "Copying libteec.so in Package" -cp libteec2.so $Package/CA/simulator/usr/lib/ +mkdir -p $CA_SIMULATOR_LIB +cp libteec2.so $CA_SIMULATOR_LIB check_make_error cd $DIR } @@ -101,7 +105,8 @@ check_make_error make TOOLCHAIN=$TOOLCHAIN check_make_error echo "Copying libssflib.so in Package" -cp libssflib.so $Package/TA/simulator/usr/lib/ +mkdir -p $TA_SIMULATOR_LIB +cp libssflib.so $TA_SIMULATOR_LIB check_make_error cd $DIR } @@ -114,7 +119,8 @@ check_make_error make TOOLCHAIN=$TOOLCHAIN check_make_error echo "Copying libTEEStub.a in Package" -cp libTEEStub.a $Package/TA/simulator/usr/lib/ +mkdir -p $TA_SIMULATOR_LIB +cp libTEEStub.a $TA_SIMULATOR_LIB check_make_error cd $DIR } @@ -127,7 +133,8 @@ check_make_error make TOOLCHAIN=$TOOLCHAIN check_make_error echo "Copying SimulatorDaemon in Package" -cp SimulatorDaemon $Package/CA/simulator/usr/lib/ +mkdir -p $CA_SIMULATOR_LIB +cp SimulatorDaemon $CA_SIMULATOR_LIB check_make_error cd $DIR } diff --git a/build/ssflib/dep/cryptocore/source/base/subdir.mk b/build/ssflib/dep/cryptocore/source/base/subdir.mk index 5f01c31..c6fdf8b 100755 --- a/build/ssflib/dep/cryptocore/source/base/subdir.mk +++ b/build/ssflib/dep/cryptocore/source/base/subdir.mk @@ -47,12 +47,13 @@ C_DEPS += \ ./dep/cryptocore/source/base/cc_sha2.d \ ./dep/cryptocore/source/base/cc_snow2.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/cryptocore/source/base/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/base/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/cryptocore/source/middle/subdir.mk b/build/ssflib/dep/cryptocore/source/middle/subdir.mk index 73d96ca..f709eb5 100755 --- a/build/ssflib/dep/cryptocore/source/middle/subdir.mk +++ b/build/ssflib/dep/cryptocore/source/middle/subdir.mk @@ -35,12 +35,13 @@ C_DEPS += \ ./dep/cryptocore/source/middle/cc_symmetric.d \ ./dep/cryptocore/source/middle/cc_tdes.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/cryptocore/source/middle/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/middle/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/cryptocore/source/subdir.mk b/build/ssflib/dep/cryptocore/source/subdir.mk index 0b82019..23e59c8 100755 --- a/build/ssflib/dep/cryptocore/source/subdir.mk +++ b/build/ssflib/dep/cryptocore/source/subdir.mk @@ -8,12 +8,14 @@ OBJS += \ C_DEPS += \ ./dep/cryptocore/source/CC_API.d +C_FLAGS += -fPIC + # Each subdirectory must supply rules for building sources it contributes dep/cryptocore/source/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/swdss/source/subdir.mk b/build/ssflib/dep/swdss/source/subdir.mk index fd93294..93190bd 100755 --- a/build/ssflib/dep/swdss/source/subdir.mk +++ b/build/ssflib/dep/swdss/source/subdir.mk @@ -23,12 +23,13 @@ CPP_DEPS += \ ./dep/swdss/source/ss_misc.d \ ./dep/swdss/source/ss_temp_store.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/swdss/source/%.o: $(SSFLIB_SOURCE)/dep/swdss/source/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/time/subdir.mk b/build/ssflib/dep/time/subdir.mk index 58955f9..12cc093 100755 --- a/build/ssflib/dep/time/subdir.mk +++ b/build/ssflib/dep/time/subdir.mk @@ -8,12 +8,13 @@ OBJS += \ CPP_DEPS += \ ./dep/time/ssf_time.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/time/%.o: $(SSFLIB_SOURCE)/dep/time/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/uci/source/subdir.mk b/build/ssflib/dep/uci/source/subdir.mk index e103ce3..5823e7a 100755 --- a/build/ssflib/dep/uci/source/subdir.mk +++ b/build/ssflib/dep/uci/source/subdir.mk @@ -17,12 +17,13 @@ C_DEPS += \ ./dep/uci/source/uci_cryptocore.d \ ./dep/uci/source/uci_hwcrypto.d +C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/uci/source/%.o: $(SSFLIB_SOURCE)/dep/uci/source/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/src/subdir.mk b/build/ssflib/src/subdir.mk index 6a5a5b6..f1ddb62 100755 --- a/build/ssflib/src/subdir.mk +++ b/build/ssflib/src/subdir.mk @@ -32,12 +32,14 @@ C_DEPS += \ ./src/ssf_taentrypoint.d \ ./src/app_debug.d +C_FLAGS += -fPIC + # Each subdirectory must supply rules for building sources it contributes src/%.o: $(SSFLIB_SOURCE)/src/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/ssflib/dep/cryptocore/include/CC_Type.h b/ssflib/dep/cryptocore/include/CC_Type.h index 1de5240..94afd90 100755 --- a/ssflib/dep/cryptocore/include/CC_Type.h +++ b/ssflib/dep/cryptocore/include/CC_Type.h @@ -12,15 +12,16 @@ #ifndef _CC_TYPE_H_ #define _CC_TYPE_H_ +#include /*! @brief 1-byte data type */ -typedef unsigned char cc_u8; +typedef uint8_t cc_u8; /*! @brief 2-byte data type */ -typedef unsigned short cc_u16; +typedef uint16_t cc_u16; /*! @brief 4-byte data type */ -typedef unsigned int cc_u32; +typedef uint32_t cc_u32; #ifndef _OP64_NOTSUPPORTED @@ -28,11 +29,11 @@ typedef unsigned int cc_u32; #ifdef _WIN32 typedef unsigned __int64 cc_u64; #else - typedef unsigned long long cc_u64; + typedef uint64_t cc_u64; #endif //_WIN32 #endif //_OP64_NOTSUPPORTED #endif //_CC_TYPE_H_ -/***************************** End of File *****************************/ \ No newline at end of file +/***************************** End of File *****************************/ diff --git a/ssflib/dep/swdss/include/ss_types.h b/ssflib/dep/swdss/include/ss_types.h index 02f1791..82f9663 100755 --- a/ssflib/dep/swdss/include/ss_types.h +++ b/ssflib/dep/swdss/include/ss_types.h @@ -86,7 +86,7 @@ typedef struct credential { typedef unsigned char uint8_t; typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; +typedef unsigned long uint64_t; typedef uint8_t CBT_OCTET; typedef uint8_t* CBT_OCTET_PTR; typedef uint32_t CBT_UINT32; diff --git a/ssflib/dep/uci/include/uci_aes_xcbc_mac.h b/ssflib/dep/uci/include/uci_aes_xcbc_mac.h index 47ff5f0..176a150 100755 --- a/ssflib/dep/uci/include/uci_aes_xcbc_mac.h +++ b/ssflib/dep/uci/include/uci_aes_xcbc_mac.h @@ -43,7 +43,7 @@ typedef struct { int xcbc_init(aes_xcbc_state *xcbc, unsigned char *key, unsigned int keylen); int xcbc_process(aes_xcbc_state *xcbc, unsigned char *in, unsigned int inlen); -int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, unsigned int *outlen); +int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, size_t *outlen); #ifdef __cplusplus } diff --git a/ssflib/dep/uci/include/uci_api.h b/ssflib/dep/uci/include/uci_api.h index 0acb7e4..4ce1e25 100755 --- a/ssflib/dep/uci/include/uci_api.h +++ b/ssflib/dep/uci/include/uci_api.h @@ -132,7 +132,7 @@ int uci_mac_update(UCI_HANDLE oh, unsigned char *msg, unsigned int msg_len); * @retval UCI_ERROR if output is NULL. */ int uci_mac_final(UCI_HANDLE oh, unsigned char *output, - unsigned int *output_len); + size_t *output_len); /** * @brief generate c-mac code @@ -298,7 +298,7 @@ int uci_ae_set_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, * @retval UCI_ERROR input or output is NULL.. */ int uci_ae_encrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, - unsigned char * output, unsigned int* output_len); + unsigned char * output, size_t* output_len); /** * @brief RSA Decryption @@ -313,7 +313,7 @@ int uci_ae_encrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, * @retval UCI_ERROR input or output is NULL. */ int uci_ae_decrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, - unsigned char * output, unsigned int* output_len); + unsigned char * output, size_t* output_len); /** * @brief RSA Decryption using CRT @@ -371,7 +371,7 @@ int uci_wbae_decrypt(UCI_HANDLE oh, unsigned char * input, * @retval UCI_ERROR if hash or signature is NULL. */ int uci_ds_sign(UCI_HANDLE oh, unsigned char * hash, unsigned int hash_len, - unsigned char * signature, unsigned int* sign_len); + unsigned char * signature, size_t* sign_len); /** * @brief generate signature for given value @@ -442,13 +442,13 @@ int uci_authcrypt_init(UCI_HANDLE oh, unsigned int mode, unsigned char *nonce, int uci_authcrypt_update_aad(UCI_HANDLE oh, unsigned char *aad, unsigned int aad_len); int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, unsigned int *dest_len); + unsigned int src_len, unsigned char *dest, size_t *dest_len); int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, unsigned int *dest_len, - unsigned char *tag, unsigned int *tag_len); + unsigned int src_len, unsigned char *dest, size_t *dest_len, + unsigned char *tag, size_t *tag_len); int uci_authcrypt_decryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, unsigned int *dest_len, + unsigned int src_len, unsigned char *dest, size_t *dest_len, unsigned char *tag, unsigned int tag_len); /** diff --git a/ssflib/dep/uci/include/uci_cryptocore.h b/ssflib/dep/uci/include/uci_cryptocore.h index ab40685..1e83215 100755 --- a/ssflib/dep/uci/include/uci_cryptocore.h +++ b/ssflib/dep/uci/include/uci_cryptocore.h @@ -126,7 +126,7 @@ int cryptocore_mac_update(UCI_HANDLE oh, unsigned char *msg, */ int cryptocore_mac_final(UCI_HANDLE oh, unsigned char *output, - unsigned int *output_len); + size_t *output_len); /** * @brief generate c-mac code @@ -267,7 +267,7 @@ int cryptocore_ae_set_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, */ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, unsigned int* output_len); + unsigned int input_len, unsigned char * output, size_t* output_len); /** * @brief RSA Decryption @@ -281,7 +281,7 @@ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char * input, * @retval UCI_ERROR other error occured. */ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, unsigned int* output_len); + unsigned int input_len, unsigned char * output, size_t* output_len); /** * @brief RSA Decryption using CRT @@ -295,7 +295,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char * input, * @retvla UCI_ERROR other error occured. */ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, unsigned int* output_len); + unsigned int input_len, unsigned char * output, size_t* output_len); /** * @brief generate signature for given value @@ -309,7 +309,7 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input, * @retval UCI_ERROR other error occured. */ int cryptocore_ds_sign(UCI_HANDLE oh, unsigned char * hash, - unsigned int hash_len, unsigned char * signature, unsigned int* sign_len); + unsigned int hash_len, unsigned char * signature, size_t* sign_len); /** * @brief generate signature for given value diff --git a/ssflib/dep/uci/include/uci_type.h b/ssflib/dep/uci/include/uci_type.h index f3c8843..f123fa8 100755 --- a/ssflib/dep/uci/include/uci_type.h +++ b/ssflib/dep/uci/include/uci_type.h @@ -35,7 +35,7 @@ * @brief UCI handle. * */ -typedef int UCI_HANDLE; +typedef intptr_t UCI_HANDLE; /** * @brief UCI return error type. * diff --git a/ssflib/dep/uci/source/uci_aes_xcbc_mac.c b/ssflib/dep/uci/source/uci_aes_xcbc_mac.c index ae3f3b0..e20585f 100755 --- a/ssflib/dep/uci/source/uci_aes_xcbc_mac.c +++ b/ssflib/dep/uci/source/uci_aes_xcbc_mac.c @@ -94,7 +94,7 @@ int xcbc_process(aes_xcbc_state *xcbc, unsigned char *in, unsigned int inlen) { } return 1; } -int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, unsigned int *outlen) { +int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, size_t *outlen) { unsigned int x; if (xcbc == NULL || out == NULL) { return 0; diff --git a/ssflib/dep/uci/source/uci_api.c b/ssflib/dep/uci/source/uci_api.c index 15cb5fc..59928ae 100755 --- a/ssflib/dep/uci/source/uci_api.c +++ b/ssflib/dep/uci/source/uci_api.c @@ -83,7 +83,7 @@ UCI_HANDLE uci_context_alloc(unsigned int algorithm, uci_engine_config_e config) ctx = (uci_context_s*)OsaMalloc(sizeof(uci_context_s)); ctx->imp = (aes_xcbc_state *)OsaMalloc(sizeof(aes_xcbc_state)); ctx->alg = ID_UCI_XCBCMAC; - return (int)ctx; + return (UCI_HANDLE)ctx; } if (conf == UCI_SW_CRYPTOCORE) { return cryptocore_context_alloc(algorithm); @@ -172,7 +172,7 @@ int uci_mac_update(UCI_HANDLE oh, unsigned char *msg, unsigned int msg_len) { } int uci_mac_final(UCI_HANDLE oh, unsigned char *output, - unsigned int *output_len) { + size_t *output_len) { int ret = 0; uci_context_s *pctx = (uci_context_s*)oh; if (pctx->alg == ID_UCI_XCBCMAC) { @@ -189,8 +189,8 @@ int uci_mac_final(UCI_HANDLE oh, unsigned char *output, int uci_mac_get_mac(UCI_HANDLE oh, unsigned char *key, unsigned int key_len, unsigned char *msg, unsigned int msg_len, unsigned char *output, - unsigned int *output_len) { - //int ret = 0; + size_t *output_len) { + int ret = 0; uci_context_s *pctx = (uci_context_s*)oh; if (pctx->alg == ID_UCI_XCBCMAC) { if (xcbc_init((aes_xcbc_state *)(pctx->imp), key, key_len) != 1) { @@ -207,8 +207,11 @@ int uci_mac_get_mac(UCI_HANDLE oh, unsigned char *key, unsigned int key_len, return UCI_SUCCESS; } - return cryptocore_mac_getmac(oh, key, key_len, msg, msg_len, output, - output_len); + unsigned int uioutput_len = (unsigned int)(*output_len); + ret = cryptocore_mac_getmac(oh, key, key_len, msg, msg_len, output, + &uioutput_len); + *output_len = (size_t)uioutput_len; + return ret; } int uci_se_init(UCI_HANDLE oh, unsigned int mode, unsigned padding, @@ -315,17 +318,17 @@ int uci_ae_set_keypair(UCI_HANDLE oh, uci_key_s *keymaterial, } int uci_ae_encrypt(UCI_HANDLE oh, unsigned char *input, unsigned int input_len, - unsigned char *output, unsigned int *output_len) { + unsigned char *output, size_t *output_len) { return cryptocore_ae_encrypt(oh, input, input_len, output, output_len); } int uci_ae_decrypt(UCI_HANDLE oh, unsigned char *input, unsigned int input_len, - unsigned char *output, unsigned int *output_len) { + unsigned char *output, size_t *output_len) { return cryptocore_ae_decrypt(oh, input, input_len, output, output_len); } int uci_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, unsigned int *output_len) { + unsigned int input_len, unsigned char *output, size_t *output_len) { return cryptocore_ae_decryptbycrt(oh, input, input_len, output, output_len); } @@ -340,7 +343,7 @@ int uci_wbae_decrypt(UCI_HANDLE oh, unsigned char *input, } int uci_ds_sign(UCI_HANDLE oh, unsigned char *hash, unsigned int hash_len, - unsigned char *signature, unsigned int *sign_len) { + unsigned char *signature, size_t *sign_len) { return cryptocore_ds_sign(oh, hash, hash_len, signature, sign_len); } @@ -443,7 +446,7 @@ int uci_authcrypt_update_aad(UCI_HANDLE oh, unsigned char *aad, return UCI_ERROR; } int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, unsigned int *dest_len) { + unsigned int src_len, unsigned char *dest, size_t *dest_len) { #if 0 uci_context_s *pctx = (uci_context_s*)oh; gcm_context *gctx; @@ -477,8 +480,8 @@ int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, return UCI_ERROR; } int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, unsigned int *dest_len, - unsigned char *tag, unsigned int *tag_len) { + unsigned int src_len, unsigned char *dest, size_t *dest_len, + unsigned char *tag, size_t *tag_len) { #if 0 uci_context_s *pctx = (uci_context_s*)oh; gcm_context *gctx = NULL; @@ -525,7 +528,7 @@ int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, return UCI_ERROR; } int uci_authcrypt_decryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, unsigned int *dest_len, + unsigned int src_len, unsigned char *dest, size_t *dest_len, unsigned char *tag, unsigned int tag_len) { #if 0 uci_context_s *pctx = (uci_context_s*)oh; diff --git a/ssflib/dep/uci/source/uci_cryptocore.c b/ssflib/dep/uci/source/uci_cryptocore.c index db15895..f695180 100755 --- a/ssflib/dep/uci/source/uci_cryptocore.c +++ b/ssflib/dep/uci/source/uci_cryptocore.c @@ -182,7 +182,7 @@ int cryptocore_mac_update(UCI_HANDLE oh, unsigned char *msg, } int cryptocore_mac_final(UCI_HANDLE oh, unsigned char *output, - unsigned int *output_len) { + size_t *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; if (pctx == NULL) { @@ -193,8 +193,11 @@ int cryptocore_mac_final(UCI_HANDLE oh, unsigned char *output, return UCI_INVALID_HANDLE; } + cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->MAC_final( - (CryptoCoreContainer*)(pctx->imp), output, output_len); + (CryptoCoreContainer*)(pctx->imp), output, &output_len32); + *output_len = (size_t)output_len32; + if (ret != CRYPTO_SUCCESS) { return UCI_ERROR; } @@ -709,7 +712,7 @@ int cryptocore_ae_set_keypair(UCI_HANDLE oh, uci_key_s *keymaterial, } int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, unsigned int *output_len) { + unsigned int input_len, unsigned char *output, size_t *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -724,8 +727,11 @@ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char *input, if (pctx->alg < ID_UCI_RSA || pctx->alg > ID_UCI_RSA512) { return UCI_INVALID_HANDLE; } + + cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->AE_encrypt( - ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len); + ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32); + *output_len = (size_t)output_len32; if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } @@ -736,7 +742,7 @@ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char *input, } int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, unsigned int *output_len) { + unsigned int input_len, unsigned char *output, size_t *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -752,8 +758,12 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input, if (pctx->alg < ID_UCI_RSA || pctx->alg > ID_UCI_RSA512) { return UCI_INVALID_HANDLE; } + + cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->AE_decrypt( - ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len); + ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32); + *output_len = (size_t)output_len32; + if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } @@ -791,7 +801,7 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, } int cryptocore_ds_sign(UCI_HANDLE oh, unsigned char *hash, - unsigned int hash_len, unsigned char *signature, unsigned int *sign_len) { + unsigned int hash_len, unsigned char *signature, size_t *sign_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -804,8 +814,10 @@ int cryptocore_ds_sign(UCI_HANDLE oh, unsigned char *hash, return UCI_INVALID_HANDLE; } + cc_u32 sign_len32 = (cc_u32)(*sign_len); ret = ((CryptoCoreContainer *)pctx->imp)->DS_sign( - ((CryptoCoreContainer*)pctx->imp), hash, hash_len, signature, sign_len); + ((CryptoCoreContainer*)pctx->imp), hash, hash_len, signature, &sign_len32); + *sign_len = (size_t)sign_len32; if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } diff --git a/ssflib/src/ssf_crypto.c b/ssflib/src/ssf_crypto.c index 655eabd..fc14963 100755 --- a/ssflib/src/ssf_crypto.c +++ b/ssflib/src/ssf_crypto.c @@ -1339,9 +1339,9 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, unsigned char pub[384]; unsigned char priv[384]; unsigned char module[384]; - unsigned int pubLen = 384; - unsigned int privLen = 384; - unsigned int moduleLen = 384; + size_t pubLen = 384; + size_t privLen = 384; + size_t moduleLen = 384; unsigned int alg; memset(&ucikey, 0, sizeof(uci_key_s)); memset(&uciparam, 0, sizeof(uci_param_s)); @@ -1425,6 +1425,7 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, uciparam.ucip_rsa_padding = ID_UCI_NO_PADDING; break; } + size_t obj_size = (size_t)(key->info.objectSize); switch (key->info.objectType) { case TEE_TYPE_RSA_PUBLIC_KEY: case TEE_TYPE_RSA_KEYPAIR: @@ -1524,7 +1525,7 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, uciparam.ucip_dsa_g_len = key->info.objectSize; uciparam.ucip_dsa_q_len = key->info.objectSize; rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_PRIME, - uciparam.ucip_dsa_p, &uciparam.ucip_dsa_p_len); + uciparam.ucip_dsa_p, &obj_size); if (rc != TEE_SUCCESS) { OsaFree(uciparam.ucip_dsa_p); OsaFree(uciparam.ucip_dsa_q); @@ -1534,7 +1535,7 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, return rc; } rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_BASE, - uciparam.ucip_dsa_g, &uciparam.ucip_dsa_g_len); + uciparam.ucip_dsa_g, &obj_size); if (rc != TEE_SUCCESS) { OsaFree(uciparam.ucip_dsa_p); OsaFree(uciparam.ucip_dsa_q); @@ -1544,7 +1545,7 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, return rc; } rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_SUBPRIME, - uciparam.ucip_dsa_q, &uciparam.ucip_dsa_q_len); + uciparam.ucip_dsa_q, &obj_size); if (rc != TEE_SUCCESS) { OsaFree(uciparam.ucip_dsa_p); OsaFree(uciparam.ucip_dsa_q); @@ -1571,7 +1572,7 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, key->info.objectSize); uciparam.ucip_dh_len = key->info.objectSize; rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DH_PRIME, - uciparam.ucip_dh_prime, &uciparam.ucip_dh_len); + uciparam.ucip_dh_prime, &obj_size); if (rc != TEE_SUCCESS) { OsaFree(uciparam.ucip_dh_prime); OsaFree(uciparam.ucip_dh_generator); @@ -1580,7 +1581,7 @@ TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, return rc; } rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DH_BASE, - uciparam.ucip_dh_generator, &uciparam.ucip_dh_len); + uciparam.ucip_dh_generator, &obj_size); if (rc != TEE_SUCCESS) { OsaFree(uciparam.ucip_dh_prime); OsaFree(uciparam.ucip_dh_generator); @@ -1728,9 +1729,9 @@ void TEE_CipherInit(TEE_OperationHandle operation, const void* IV, size_t IVLen) unsigned int mode; unsigned char key1[32] = {0x0, }; //unsigned char key2[32] = {0x0, }; - unsigned int key_len1 = sizeof(key1); + size_t key_len1 = sizeof(key1); //unsigned int key_len2 = sizeof(key2); - unsigned int uci_alg; + size_t uci_alg; TEE_Result rc; struct TEE_Operation * op = (struct TEE_Operation*)operation; @@ -2521,8 +2522,8 @@ void TEE_DeriveKey(TEE_OperationHandle operation, const TEE_Attribute* params, unsigned char authkey[512]; unsigned char privkey[512]; unsigned char *pubkey = NULL; - unsigned int pubkey_len = 0; - unsigned int privkey_len = sizeof(privkey); + size_t pubkey_len = 0; + size_t privkey_len = sizeof(privkey); TEE_Attribute attrs[1]; TEE_Result rc; struct TEE_Operation * op = (struct TEE_Operation*)operation; -- 2.7.4 From 8775489320b04cf5b067f1e8018b4a12dec57a07 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Fri, 5 May 2017 11:03:07 +0200 Subject: [PATCH 06/16] Remove redefinitions of stdint types Change-Id: I36b61f17082e0dc14d4e4f17149b419002ef4365 --- ssflib/dep/swdss/include/ss_types.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ssflib/dep/swdss/include/ss_types.h b/ssflib/dep/swdss/include/ss_types.h index 82f9663..89ec412 100755 --- a/ssflib/dep/swdss/include/ss_types.h +++ b/ssflib/dep/swdss/include/ss_types.h @@ -17,6 +17,8 @@ #ifndef _SWD_SS_COMMON_H_ #define _SWD_SS_COMMON_H_ +#include + #define SS_MAX_UUID_LEN 64 #define SS_MAX_MODULE_NAME_LEN 32 #define SS_MAX_DATA_NAME_LEN 128 @@ -84,16 +86,12 @@ typedef struct credential { } ss_credential_s; -typedef unsigned char uint8_t; -typedef unsigned int uint32_t; -typedef unsigned long uint64_t; typedef uint8_t CBT_OCTET; typedef uint8_t* CBT_OCTET_PTR; typedef uint32_t CBT_UINT32; typedef uint32_t* CBT_UINT32_PTR; typedef void* CBT_DATA_PTR; typedef CBT_UINT32 CBT_BOOL; -typedef unsigned short uint16_t; #endif -- 2.7.4 From 276456e5d3006962822207591fbf2144fb8aa01d Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Thu, 18 May 2017 16:06:56 +0200 Subject: [PATCH 07/16] Fetch cryptocore_ae_decrypt body to header. Change-Id: If5bbc0b8937074acf3d7057e96c832e3139d829a --- .cproject | 10 ++++++++-- build/TEEStub/subdir.mk | 2 +- simulatordaemon/src/TAInstance.cpp | 2 +- ssflib/dep/uci/include/uci_cryptocore.h | 2 +- ssflib/dep/uci/source/uci_cryptocore.c | 6 ++++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.cproject b/.cproject index 2e304b4..2814223 100644 --- a/.cproject +++ b/.cproject @@ -14,11 +14,11 @@ - + - + @@ -46,4 +46,10 @@ + + + + + + diff --git a/build/TEEStub/subdir.mk b/build/TEEStub/subdir.mk index 0502a59..ff324bd 100755 --- a/build/TEEStub/subdir.mk +++ b/build/TEEStub/subdir.mk @@ -13,7 +13,7 @@ CPP_DEPS += \ %.o: $(TEESTUB_SOURCE)/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" -g @echo 'Finished building: $<' @echo ' ' diff --git a/simulatordaemon/src/TAInstance.cpp b/simulatordaemon/src/TAInstance.cpp index f8733a7..d11ebb7 100755 --- a/simulatordaemon/src/TAInstance.cpp +++ b/simulatordaemon/src/TAInstance.cpp @@ -176,7 +176,7 @@ TEEC_Result TAInstance::connecttoTA(std::stringstream& str) { LOGD(SIM_DAEMON, "Connect to TEEStub"); // Try to connect to TA RETRY_COUNT number of times while (error && (retry_count < RETRY_COUNT)) { -#if 0 +#if 0 LOGD(SIM_DAEMON, "Trying to connect to TEEStub"); LOGE(SIM_DAEMON, "Response returned with error code %d", error.value()); LOGE(SIM_DAEMON, "Response returned with error code %s", diff --git a/ssflib/dep/uci/include/uci_cryptocore.h b/ssflib/dep/uci/include/uci_cryptocore.h index 1e83215..3323971 100755 --- a/ssflib/dep/uci/include/uci_cryptocore.h +++ b/ssflib/dep/uci/include/uci_cryptocore.h @@ -295,7 +295,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char * input, * @retvla UCI_ERROR other error occured. */ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, size_t* output_len); + unsigned int input_len, unsigned char * output, size_t * output_len); /** * @brief generate signature for given value diff --git a/ssflib/dep/uci/source/uci_cryptocore.c b/ssflib/dep/uci/source/uci_cryptocore.c index f695180..a0e1a1b 100755 --- a/ssflib/dep/uci/source/uci_cryptocore.c +++ b/ssflib/dep/uci/source/uci_cryptocore.c @@ -774,7 +774,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input, } int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, unsigned int *output_len) { + unsigned int input_len, unsigned char *output, size_t *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -789,8 +789,10 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, // ctr=(CryptoCoreContainer *)(pctx->imp); // ctr->MD_update(ctr,msg,msg_len); + cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->AE_decryptByCRT( - ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len); + ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32); + *output_len = (size_t)output_len32; if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } -- 2.7.4 From 34f1002ba1cdb5693119c64cde504515d279d53c Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Fri, 23 Jun 2017 11:13:39 +0200 Subject: [PATCH 08/16] Add security checking. Change-Id: I09aacf1d31af84da2c6fb37e0aad3ed908504e8d --- build/simulatordaemon/src/subdir.mk | 12 +- simulatordaemon/inc/SecurityChecker.h | 47 ++++++ simulatordaemon/inc/TEEContext.h | 7 +- simulatordaemon/inc/security.h | 53 +++++++ simulatordaemon/src/SecurityChecker.cpp | 48 ++++++ simulatordaemon/src/Session.cpp | 5 + simulatordaemon/src/SimulatorDaemonServer.cpp | 9 ++ simulatordaemon/src/TEEContext.cpp | 4 +- simulatordaemon/src/security.c | 215 ++++++++++++++++++++++++++ 9 files changed, 395 insertions(+), 5 deletions(-) create mode 100644 simulatordaemon/inc/SecurityChecker.h create mode 100644 simulatordaemon/inc/security.h create mode 100644 simulatordaemon/src/SecurityChecker.cpp create mode 100644 simulatordaemon/src/security.c diff --git a/build/simulatordaemon/src/subdir.mk b/build/simulatordaemon/src/subdir.mk index f2c0e3c..a34517c 100755 --- a/build/simulatordaemon/src/subdir.mk +++ b/build/simulatordaemon/src/subdir.mk @@ -2,12 +2,14 @@ CPP_SRCS += \ $(SIMDAEMON_SOURCE)/src/ConnectionSession.cpp \ $(SIMDAEMON_SOURCE)/src/Session.cpp \ +$(SIMDAEMON_SOURCE)/src/SecurityChecker.cpp \ $(SIMDAEMON_SOURCE)/src/SimulatorDaemon.cpp \ $(SIMDAEMON_SOURCE)/src/SimulatorDaemonServer.cpp \ $(SIMDAEMON_SOURCE)/src/TAFactory.cpp \ $(SIMDAEMON_SOURCE)/src/TAInstance.cpp \ $(SIMDAEMON_SOURCE)/src/TEEContext.cpp \ -$(SIMDAEMON_SOURCE)/src/ioService.cpp +$(SIMDAEMON_SOURCE)/src/ioService.cpp \ +$(SIMDAEMON_SOURCE)/src/security.c OBJS += \ ./src/ConnectionSession.o \ @@ -17,7 +19,9 @@ OBJS += \ ./src/TAFactory.o \ ./src/TAInstance.o \ ./src/TEEContext.o \ -./src/ioService.o +./src/ioService.o \ +./src/SecurityChecker.o \ +./src/security.o CPP_DEPS += \ ./src/ConnectionSession.d \ @@ -27,7 +31,9 @@ CPP_DEPS += \ ./src/TAFactory.d \ ./src/TAInstance.d \ ./src/TEEContext.d \ -./src/ioService.d +./src/ioService.d \ +./src/SecurityChecker.d \ +./src/security.d # Each subdirectory must supply rules for building sources it contributes diff --git a/simulatordaemon/inc/SecurityChecker.h b/simulatordaemon/inc/SecurityChecker.h new file mode 100644 index 0000000..e040afa --- /dev/null +++ b/simulatordaemon/inc/SecurityChecker.h @@ -0,0 +1,47 @@ +/* + * ===================================================================================== + * + * Filename: SecurityChecker.h + * + * Description: Class to check if client application has access to TEE + * + * Version: 1.0 + * Created: 19 June 2017 14:00:03 IST + * Revision: Original + * Compiler: gcc + * + * Author: Uladzislau Harbuz, u.harbuz@samsung.com + * Organization: Samsung Electronics + * + * ===================================================================================== + */ + +#ifndef SECURITYCHECKER_H +#define SECURITYCHECKER_H + +#include +#include "ConnectionSession.h" +#include "log.h" +#include "security.h" + + +using std::string; + +class SecurityChecker{ +private: + ConnectionSession* mConnSess; + +public: + + SecurityChecker(ConnectionSession* ses); + + static bool clientHasAccessToTa(ConnectionSession *ses, string taName); + static bool clientHasCynaraPermission(ConnectionSession *ses, string privelege); + + bool clientHasAccessToTa(string taName); + bool clientHasCynaraPermission(string privelege); + + ~SecurityChecker(); + +}; +#endif /* SECURITYCHECKER_H */ diff --git a/simulatordaemon/inc/TEEContext.h b/simulatordaemon/inc/TEEContext.h index ac0669f..5c70da7 100755 --- a/simulatordaemon/inc/TEEContext.h +++ b/simulatordaemon/inc/TEEContext.h @@ -31,6 +31,8 @@ #include "Session.h" #include "tee_command.h" #include "IConnectionSession.h" +#include "ConnectionSession.h" +#include "SecurityChecker.h" using namespace std; /*----------------------------------------------------------------------------- @@ -53,11 +55,14 @@ public: IConnectionSession* mConnSess; // ContextID assigned to the instance uint32_t mContextID; + /* Security checker wich can tell us if client has different Tizen's policy permissions*/ + SecurityChecker mConnSecChecker; + /* For TA internal APIs support, dummy Context is created and for recognizing * the context as dummy isInternal member variable is used */ bool isInternal; - TEEContext(uint32_t contextID, IConnectionSession* connSession); + TEEContext(uint32_t contextID, ConnectionSession* connSession); TEEC_Result initContext(InitContextData* data); void finContext(FinalizeContextData data); TEEC_Result openSession(OpenSessionData data); diff --git a/simulatordaemon/inc/security.h b/simulatordaemon/inc/security.h new file mode 100644 index 0000000..b8153ca --- /dev/null +++ b/simulatordaemon/inc/security.h @@ -0,0 +1,53 @@ +/* + * security.h + * + * Copyright (C) 2017 Samsung Electronics + * Uladzislau Harbuz + * + * 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. + */ + + +#ifndef SECURITY_H +#define SECURITY_H + +#include +#include +#include +#include +#include + +#define MAX_PATH_LENGTH 100 +#define MAX_TA_NAME_LENGTH 36 + +#define FILE_WAS_FOUND 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* TODO: */ +const char* system_ta_paths[]= { + "/usr/lib/optee_armtz/", +} +#define N_SYS_TA_PATHS 1 + +bool ca_has_access_to_ta(int ca_fd, const char* ta_name); +bool client_has_cynara_permission(int ca_fd, const char* privelege); + +#ifdef __cplusplus +} +#endif + + +#endif /* SECURITY_H */ diff --git a/simulatordaemon/src/SecurityChecker.cpp b/simulatordaemon/src/SecurityChecker.cpp new file mode 100644 index 0000000..7b629a6 --- /dev/null +++ b/simulatordaemon/src/SecurityChecker.cpp @@ -0,0 +1,48 @@ +/* + * ===================================================================================== + * + * Filename: SecurityChecker.cpp + * + * Description: Class to check if client application has access to TEE + * + * Version: 1.0 + * Created: 19 June 2017 14:37:03 IST + * Revision: Original + * Compiler: gcc + * + * Author: Uladzislau Harbuz, u.harbuz@samsung.com + * Organization: Samsung Electronics + * + * ===================================================================================== + */ + +#include "SecurityChecker.h" + + +SecurityChecker(ConnectionSession* ses){ + mConnSess = ses; +} + + +bool SecurityChecker::clientHasAccessToTa(ConnectionSession *ses, string taName){ + return ca_has_access_to_ta(ses->socket().native(), taName.c_str()); +} + + +bool SecurityChecker::clientHasCynaraPermission(ConnectionSession *ses, string privelege){ + return client_has_cynara_permission(ses->socket().native(), privelege.c_str()); +} + + +bool SecurityChecker::clientHasCynaraPermission(string privelege){ + return SecurityChecker::clientHasCynaraPermission(mConnSess, privelege); +} + + +bool SecurityChecker::clientHasAccessToTa(string taName){ + return SecurityChecker::clientHasAccessToTa(mConnSess, taName); +} + + +~SecurityChecker(){ +} diff --git a/simulatordaemon/src/Session.cpp b/simulatordaemon/src/Session.cpp index 0739089..e6340e1 100755 --- a/simulatordaemon/src/Session.cpp +++ b/simulatordaemon/src/Session.cpp @@ -102,6 +102,11 @@ TEEC_Result Session::createSession(OpenSessionData data) { string TAUUID = TABin->getUUIDAsString(data.uuid); string argvPort = TABin->getPort(TAUUID); + if(!mContext->nConnSecChecker.clientHasAccessToTa(TAUUID)){ + LOGE(SIM_DAEMON, "Client has no permission for access TA: %s ", TAUUID.c_str()); + return TEEC_ERROR_ACCESS_DENIED; + } + if (argvPort != "") { pthread_rwlock_wrlock(&TAFact->mTAInstanceMapLock); multimap::iterator itr; diff --git a/simulatordaemon/src/SimulatorDaemonServer.cpp b/simulatordaemon/src/SimulatorDaemonServer.cpp index 7d06878..42a3da5 100755 --- a/simulatordaemon/src/SimulatorDaemonServer.cpp +++ b/simulatordaemon/src/SimulatorDaemonServer.cpp @@ -20,6 +20,7 @@ * Include files *-----------------------------------------------------------------------------*/ #include "SimulatorDaemonServer.h" +#include "SecurityChecker.h" /*----------------------------------------------------------------------------- * Member functions @@ -45,6 +46,7 @@ void SimulatorDaemonServer::startAccept() { ConnectionSession::session_ptr new_session = ConnectionSession::create( acceptor.get_io_service()); + acceptor.async_accept(new_session->socket(), boost::bind(&SimulatorDaemonServer::handleAccept, this, new_session, boost::asio::placeholders::error)); @@ -58,7 +60,14 @@ void SimulatorDaemonServer::startAccept() { void SimulatorDaemonServer::handleAccept( ConnectionSession::session_ptr new_session, const boost::system::error_code& error) { + + const string privelege("http://tizen.org/privilege/account.read"); LOGD(SIM_DAEMON, "Entry"); + if (!SecurityChecker::clientHasCynaraPermission(new_session.get(), privelege)){ + LOGE("Client has no permission to use TEE"); + return; + } + if (!error) { new_session->start(); } diff --git a/simulatordaemon/src/TEEContext.cpp b/simulatordaemon/src/TEEContext.cpp index 3e352f7..f2cbea4 100755 --- a/simulatordaemon/src/TEEContext.cpp +++ b/simulatordaemon/src/TEEContext.cpp @@ -36,7 +36,9 @@ uint32_t sessID = 51; * @param contextID ID for Context reference * @param connSession ConnectionSession instance associated with the context */ -TEEContext::TEEContext(uint32_t contextID, IConnectionSession* connSession) { +TEEContext::TEEContext(uint32_t contextID, ConnectionSession* connSession) + :mConnSecChecker(connSession) +{ LOGD(SIM_DAEMON, "ContextID: %d", contextID); diff --git a/simulatordaemon/src/security.c b/simulatordaemon/src/security.c new file mode 100644 index 0000000..ae73646 --- /dev/null +++ b/simulatordaemon/src/security.c @@ -0,0 +1,215 @@ +/* + * security.c + * + * Copyright (C) 2017 Samsung Electronics + * Uladzislau Harbuz + * + * 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. + */ + +#include +#include +#include +#include +#include +#include "security.h" + +/* This variable is for nftw searching of ta */ +static const char* g_ta_name = NULL; + + +static bool file_exists(const char* fname){ + struct stat st; + return stat(fname, &st) == 0; +} + + +static bool get_ca_full_path_from_socket(int fd, char* path){ + /* How to get full path from pkgid? */ + pid_t ca_pid = -1; + cynara *cynara = NULL; + int ret = -1; + + ret = cynara_initialize(&cynara, NULL); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Cynara initialization failed with error code %d", ret); + return false; + } + + ret = cynara_creds_socket_get_pid(ca_fd, &ca_pid); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Couldn't get pid of the client. Error code: %d", ret); + cynara_finish(cynara); + return false; + } + + char ca_path[MAX_PATH_LENGTH] = {0}; + snprintf(ca_path, MAX_PATH_LENGTH, "/proc/%d/exe", ca_pid); + ret = readlink(ca_path, path, MAX_PATH_LENGTH); + + if(ret == -1){ + EMSG("readlink() failed"); + cynara_finish(cynara); + return false; + } + + cynara_finish(cynara); + + return true; +} + + +static int cmp_ta_name(const char *fpath, const struct stat *sb, + int tflag, struct FTW *ftwbuf) +{ + if(tflag == FTW_D){ + char ta_full_path[MAX_PATH_LENGTH] = {0}; + snprintf(ta_full_name, MAX_PATH_LENGTH, "%s/%s", fpath, g_ta_name); + + if(file_exists(ta_full_path)){ + return FILE_WAS_FOUND; + } + } + + return 0; +} + + +bool ca_has_access_to_ta(int ca_fd, const char* ta_name){ + int ret; + g_ta_name = ta_name; + + char *pkg_id_ca; + + ret = security_manager_identify_app_from_socket(ca_fd, &pkg_id_ca, NULL); + if(ret == SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT){ + DMSG("Owner of socket has no pkgid"); + + char ta_full_path[MAX_PATH_LENGTH] = {0}; + + /* Check if any of system ta directories contains our ta */ + for(int i = 0; i < N_SYS_TA_PATHS; ++i){ + strcpy(ta_full_path, system_ta_paths[i]); + strcat(ta_full_path, ta_name); + + if(file_exists(ta_full_name)){ + return true; + } + + memset(ta_full_path, 0, MAX_PATH_LENGTH); + } + + return false; + } + + if(ret != SECURITY_MANAGER_SUCCESS){ + EMSG("security_manager_identify_app_from_cynara_client() failed with CA"); + return false; + } + + char ca_pkg_path[MAX_PATH_LENGTH]; + if(!get_full_ca_path_from_socket(ca_fd, ca_pkg_path)){ + EMSG("Error while loading client's path"); + free(pkg_id_ca); + return false; + } + + ret = nftw(ca_pkg_path, cmp_ta_name, MAX_OPENED_FD, 0); + if(ret == FILE_WAS_FOUND){ + free(pkg_id_ca); + return true; + } + + free(pkg_id_ca); + return false; +} + + +bool client_has_cynara_permission(int ca_fd, const char *privelege){ + cynara *cynara = NULL; + int ret = -1; + char *user; + char *session = NULL; + char *label; + pid_t ca_pid = -1; + + ret = cynara_initialize(&cynara, NULL); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Cynara initialization failed with error code %d", ret); + return false; + } + + ret = cynara_creds_socket_get_client(ca_fd, CLIENT_METHOD_SMACK, &label); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Couldn't get smack label of the client. Error code: %d", ret); + goto exit_error3; + } + + ret = cynara_creds_socket_get_pid(ca_fd, &ca_pid); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Couldn't get pid of the client. Error code: %d", ret); + goto exit_error2; + } + + session = cynara_session_from_pid(ca_pid); + if(!session){ + EMSG("Couldn't get client's cynara session."); + goto exit_error2; + } + + ret = cynara_creds_socket_get_user(ca_fd, CLIENT_METHOD_SMACK, &user); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Couldn't get user. Error code: %d", ret); + goto exit_error1; + } + + ret = cynara_check(cynara, label, session, user, privelege); + if(ret == CYNARA_API_ACCESS_DENIED){ + EMSG("Cynara access denied."); + goto exit_error0; + } + else if(ret != CYNARA_API_ACCESS_ALLOWED){ + EMSG("Error during cynara_check(). Error code: %d", ret); + goto exit_error0; + } + + + ret = cynara_finish(cynara); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Cynara finish failed with error code %d", ret); + } + + free(session); + free(label); + free(user); + + return true; + + +exit_error0: + free(user); + +exit_error1: + free(session); + +exit_error2: + free(label); + +exit_error3: + ret = cynara_finish(cynara); + if(ret != CYNARA_API_SUCCESS){ + EMSG("Cynara finish failed with error code %d", ret); + } + + return false; +} -- 2.7.4 From f630802a7a5d24e6fd6b940339e7811e4af53f79 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Fri, 23 Jun 2017 11:40:50 +0200 Subject: [PATCH 09/16] Fix TA name passed to check. Change-Id: I02b928d40a64bbb7a77c36b4195055c324597453 --- simulatordaemon/inc/Session.h | 1 + simulatordaemon/src/Session.cpp | 4 +++- simulatordaemon/src/security.c | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/simulatordaemon/inc/Session.h b/simulatordaemon/inc/Session.h index 8569059..da37b37 100755 --- a/simulatordaemon/inc/Session.h +++ b/simulatordaemon/inc/Session.h @@ -24,6 +24,7 @@ *-----------------------------------------------------------------------------*/ #include #include +#include #include "ISession.h" /*----------------------------------------------------------------------------- diff --git a/simulatordaemon/src/Session.cpp b/simulatordaemon/src/Session.cpp index e6340e1..1500539 100755 --- a/simulatordaemon/src/Session.cpp +++ b/simulatordaemon/src/Session.cpp @@ -102,8 +102,10 @@ TEEC_Result Session::createSession(OpenSessionData data) { string TAUUID = TABin->getUUIDAsString(data.uuid); string argvPort = TABin->getPort(TAUUID); + string TAName(TAUUID); + std::transform(TAName.begin(), TAName.end(), TAName.begin(), ::toupper); if(!mContext->nConnSecChecker.clientHasAccessToTa(TAUUID)){ - LOGE(SIM_DAEMON, "Client has no permission for access TA: %s ", TAUUID.c_str()); + LOGE(SIM_DAEMON, "Client has no permission for access TA: %s ", TAName.c_str()); return TEEC_ERROR_ACCESS_DENIED; } diff --git a/simulatordaemon/src/security.c b/simulatordaemon/src/security.c index ae73646..7ae3958 100644 --- a/simulatordaemon/src/security.c +++ b/simulatordaemon/src/security.c @@ -99,8 +99,7 @@ bool ca_has_access_to_ta(int ca_fd, const char* ta_name){ /* Check if any of system ta directories contains our ta */ for(int i = 0; i < N_SYS_TA_PATHS; ++i){ - strcpy(ta_full_path, system_ta_paths[i]); - strcat(ta_full_path, ta_name); + snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", system_ta_paths[i], ta_name); if(file_exists(ta_full_name)){ return true; -- 2.7.4 From 16a64b9bea976b6c0fe5d9d1b083f0cb365408ae Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Fri, 23 Jun 2017 12:12:05 +0200 Subject: [PATCH 10/16] Fix compilation errors of security.c Change-Id: I22da6c5a9cd564dd81ee70cba1da2ee56e663cb2 --- simulatordaemon/inc/security.h | 5 +---- simulatordaemon/src/security.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/simulatordaemon/inc/security.h b/simulatordaemon/inc/security.h index b8153ca..8481bf0 100644 --- a/simulatordaemon/inc/security.h +++ b/simulatordaemon/inc/security.h @@ -29,6 +29,7 @@ #define MAX_PATH_LENGTH 100 #define MAX_TA_NAME_LENGTH 36 +#define MAX_OPENED_FD 20 #define FILE_WAS_FOUND 1 @@ -36,10 +37,6 @@ extern "C" { #endif -/* TODO: */ -const char* system_ta_paths[]= { - "/usr/lib/optee_armtz/", -} #define N_SYS_TA_PATHS 1 bool ca_has_access_to_ta(int ca_fd, const char* ta_name); diff --git a/simulatordaemon/src/security.c b/simulatordaemon/src/security.c index 7ae3958..ea225ac 100644 --- a/simulatordaemon/src/security.c +++ b/simulatordaemon/src/security.c @@ -27,6 +27,10 @@ /* This variable is for nftw searching of ta */ static const char* g_ta_name = NULL; +static const char* system_ta_paths[N_SYS_TA_PATHS]= { + "/usr/lib/optee_armtz/", +}; + static bool file_exists(const char* fname){ struct stat st; @@ -46,7 +50,7 @@ static bool get_ca_full_path_from_socket(int fd, char* path){ return false; } - ret = cynara_creds_socket_get_pid(ca_fd, &ca_pid); + ret = cynara_creds_socket_get_pid(fd, &ca_pid); if(ret != CYNARA_API_SUCCESS){ EMSG("Couldn't get pid of the client. Error code: %d", ret); cynara_finish(cynara); @@ -74,7 +78,7 @@ static int cmp_ta_name(const char *fpath, const struct stat *sb, { if(tflag == FTW_D){ char ta_full_path[MAX_PATH_LENGTH] = {0}; - snprintf(ta_full_name, MAX_PATH_LENGTH, "%s/%s", fpath, g_ta_name); + snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", fpath, g_ta_name); if(file_exists(ta_full_path)){ return FILE_WAS_FOUND; @@ -101,7 +105,7 @@ bool ca_has_access_to_ta(int ca_fd, const char* ta_name){ for(int i = 0; i < N_SYS_TA_PATHS; ++i){ snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", system_ta_paths[i], ta_name); - if(file_exists(ta_full_name)){ + if(file_exists(ta_full_path)){ return true; } @@ -117,7 +121,7 @@ bool ca_has_access_to_ta(int ca_fd, const char* ta_name){ } char ca_pkg_path[MAX_PATH_LENGTH]; - if(!get_full_ca_path_from_socket(ca_fd, ca_pkg_path)){ + if(!get_ca_full_path_from_socket(ca_fd, ca_pkg_path)){ EMSG("Error while loading client's path"); free(pkg_id_ca); return false; -- 2.7.4 From 9a80eb4394dcef3f30c066a9ae50a9f518cac3d9 Mon Sep 17 00:00:00 2001 From: Lukasz Kostyra Date: Mon, 3 Jul 2017 11:17:41 +0200 Subject: [PATCH 11/16] Remove unneeded Eclipse project files Change-Id: Id3837bd0fe99a2caddf0f1366147608040a4c118 --- .cproject | 55 ------- .gitignore | 1 + .project | 27 ---- TEECLib/.cproject | 130 --------------- TEECLib/.project | 28 ---- TEECLib/.settings/language.settings.xml | 36 ----- TEECLib/.settings/org.eclipse.cdt.core.prefs | 13 -- TEEStub/.cproject | 174 -------------------- TEEStub/.project | 84 ---------- TEEStub/.settings/org.eclipse.cdt.core.prefs | 16 -- TEEStub/.settings/org.eclipse.cdt.ui.prefs | 2 - .../org.eclipse.ltk.core.refactoring.prefs | 2 - include/.cproject | 107 ------------- include/.project | 26 --- include/.settings/language.settings.xml | 25 --- include/.settings/org.eclipse.cdt.core.prefs | 6 - log/.cproject | 105 ------------ log/.project | 26 --- log/.settings/language.settings.xml | 36 ----- log/.settings/org.eclipse.cdt.core.prefs | 13 -- osal/.cproject | 129 --------------- osal/.project | 26 --- osal/.settings/org.eclipse.cdt.core.prefs | 11 -- .../org.eclipse.cdt.managedbuilder.core.prefs | 7 - simulatordaemon/.cproject | 151 ------------------ simulatordaemon/.project | 29 ---- simulatordaemon/.settings/language.settings.xml | 22 --- .../.settings/org.eclipse.cdt.core.prefs | 11 -- .../src/RemoteSystemsTempFiles/.project | 12 -- simulatordaemon/src/TABinaryManager/.cproject | 123 -------------- simulatordaemon/src/TABinaryManager/.project | 64 -------- ssflib/.cproject | 177 --------------------- ssflib/.project | 27 ---- ssflib/.settings/org.eclipse.cdt.core.prefs | 31 ---- 34 files changed, 1 insertion(+), 1731 deletions(-) delete mode 100644 .cproject delete mode 100644 .project delete mode 100755 TEECLib/.cproject delete mode 100755 TEECLib/.project delete mode 100755 TEECLib/.settings/language.settings.xml delete mode 100755 TEECLib/.settings/org.eclipse.cdt.core.prefs delete mode 100755 TEEStub/.cproject delete mode 100755 TEEStub/.project delete mode 100755 TEEStub/.settings/org.eclipse.cdt.core.prefs delete mode 100755 TEEStub/.settings/org.eclipse.cdt.ui.prefs delete mode 100755 TEEStub/.settings/org.eclipse.ltk.core.refactoring.prefs delete mode 100755 include/.cproject delete mode 100755 include/.project delete mode 100755 include/.settings/language.settings.xml delete mode 100755 include/.settings/org.eclipse.cdt.core.prefs delete mode 100755 log/.cproject delete mode 100755 log/.project delete mode 100755 log/.settings/language.settings.xml delete mode 100755 log/.settings/org.eclipse.cdt.core.prefs delete mode 100755 osal/.cproject delete mode 100755 osal/.project delete mode 100755 osal/.settings/org.eclipse.cdt.core.prefs delete mode 100755 osal/.settings/org.eclipse.cdt.managedbuilder.core.prefs delete mode 100755 simulatordaemon/.cproject delete mode 100755 simulatordaemon/.project delete mode 100755 simulatordaemon/.settings/language.settings.xml delete mode 100755 simulatordaemon/.settings/org.eclipse.cdt.core.prefs delete mode 100755 simulatordaemon/src/RemoteSystemsTempFiles/.project delete mode 100755 simulatordaemon/src/TABinaryManager/.cproject delete mode 100755 simulatordaemon/src/TABinaryManager/.project delete mode 100755 ssflib/.cproject delete mode 100755 ssflib/.project delete mode 100755 ssflib/.settings/org.eclipse.cdt.core.prefs diff --git a/.cproject b/.cproject deleted file mode 100644 index 2814223..0000000 --- a/.cproject +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index 8a75f2a..915e9a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.d *.o *.out +*.a diff --git a/.project b/.project deleted file mode 100644 index bc6a330..0000000 --- a/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - simulator - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/TEECLib/.cproject b/TEECLib/.cproject deleted file mode 100755 index 9a99562..0000000 --- a/TEECLib/.cproject +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TEECLib/.project b/TEECLib/.project deleted file mode 100755 index 6b5f6d3..0000000 --- a/TEECLib/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - TEECLib - - - log - osal - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/TEECLib/.settings/language.settings.xml b/TEECLib/.settings/language.settings.xml deleted file mode 100755 index a85d310..0000000 --- a/TEECLib/.settings/language.settings.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TEECLib/.settings/org.eclipse.cdt.core.prefs b/TEECLib/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index 40a6ba6..0000000 --- a/TEECLib/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.1187618160/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.1187618160/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.295131884/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.295131884/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.295131884/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\Program Files (x86)\\Java\\jre1.8.0_45\\bin;C\:\\Program Files\\eclipse;C\:/Program Files/Java/jre1.8.0_31/bin/server;C\:/Program Files/Java/jre1.8.0_31/bin;C\:/Program Files/Java/jre1.8.0_31/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\csvn\\bin\\;C\:\\csvn\\Python25\\;C\:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files\\Diskeeper Corporation\\ExpressCache\\;C\:\\Program Files (x86)\\Windows Live\\Shared;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files (x86)\\WinSCP\\;C\:\\Program Files (x86)\\PuTTY;C\:\\Program Files\\Microsoft\\Web Platform Installer\\;C\:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C\:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C\:\\Program Files (x86)\\doxygen\\bin;C\:\\Program Files (x86)\\sfk168;C\:\\Program Files (x86)\\vlc-2.1.0;C\:\\Python27\\Scripts;C\:\\Program Files (x86)\\GnuWin32\\bin;C\:\\Python27;C\:\\Program Files (x86)\\Subversion\\bin;c\:\\Program Files\\Synergy;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\MinGW\\lib\\gcc\\mingw32\\4.8.1;C\:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C\:\\Program Files (x86)\\GitExtensions\\;C\:\\Program Files\\Perforce;c\:\\Program Files\\Java\\jre1.8.0_31\\bin\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;D\:\\samsung-tv-sdk\\ide;${Path};D\:\\samsung-tv-sdk\\tools\\i386-linux-gnueabi-gcc-4.6\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.295131884/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838.295131884/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files (x86)\\GitExtensions\\;D\:\\Tizen\\tizen-sdk\\tools;D\:\\Android\\android-sdk\\platform-tools;D\:\\Android\\android-ndk-r10c;C\:\\Program Files\\Perforce;D\:\\eclipse\\eclipse-rcp-luna-SR1-win32-x86_64;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\bin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\mingbin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1008004838/appendContributed=true diff --git a/TEEStub/.cproject b/TEEStub/.cproject deleted file mode 100755 index 9ed7e56..0000000 --- a/TEEStub/.cproject +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/TEEStub/.project b/TEEStub/.project deleted file mode 100755 index dae54e6..0000000 --- a/TEEStub/.project +++ /dev/null @@ -1,84 +0,0 @@ - - - TEEStub - - - ssflib - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - ?name? - - - - org.eclipse.cdt.make.core.append_environment - true - - - org.eclipse.cdt.make.core.autoBuildTarget - all - - - org.eclipse.cdt.make.core.buildArguments - - - - org.eclipse.cdt.make.core.buildCommand - make - - - org.eclipse.cdt.make.core.buildLocation - ${workspace_loc:/TEEStub/Debug} - - - org.eclipse.cdt.make.core.cleanBuildTarget - clean - - - org.eclipse.cdt.make.core.contents - org.eclipse.cdt.make.core.activeConfigSettings - - - org.eclipse.cdt.make.core.enableAutoBuild - false - - - org.eclipse.cdt.make.core.enableCleanBuild - true - - - org.eclipse.cdt.make.core.enableFullBuild - true - - - org.eclipse.cdt.make.core.fullBuildTarget - all - - - org.eclipse.cdt.make.core.stopOnError - true - - - org.eclipse.cdt.make.core.useDefaultBuildCmd - true - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/TEEStub/.settings/org.eclipse.cdt.core.prefs b/TEEStub/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index 935792c..0000000 --- a/TEEStub/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,16 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152.533145061/PATH/delimiter=\: -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152.533145061/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152.533145061/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\Program Files (x86)\\Java\\jre1.8.0_45\\bin;C\:\\Program Files\\eclipse;C\:/Program Files/Java/jre1.8.0_31/bin/server;C\:/Program Files/Java/jre1.8.0_31/bin;C\:/Program Files/Java/jre1.8.0_31/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\csvn\\bin\\;C\:\\csvn\\Python25\\;C\:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files\\Diskeeper Corporation\\ExpressCache\\;C\:\\Program Files (x86)\\Windows Live\\Shared;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files (x86)\\WinSCP\\;C\:\\Program Files (x86)\\PuTTY;C\:\\Program Files\\Microsoft\\Web Platform Installer\\;C\:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C\:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C\:\\Program Files (x86)\\doxygen\\bin;C\:\\Program Files (x86)\\sfk168;C\:\\Program Files (x86)\\vlc-2.1.0;C\:\\Python27\\Scripts;C\:\\Program Files (x86)\\GnuWin32\\bin;C\:\\Python27;C\:\\Program Files (x86)\\Subversion\\bin;c\:\\Program Files\\Synergy;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\MinGW\\lib\\gcc\\mingw32\\4.8.1;C\:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C\:\\Program Files (x86)\\GitExtensions\\;C\:\\Program Files\\Perforce;c\:\\Program Files\\Java\\jre1.8.0_31\\bin\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;D\:\\tizen-sdk\\ide;D\:\\samsung-tv-sdk\\tasdk_ide\\tasdk_tools\\i386-linux-gnueabi-gcc-4.6\\bin;D\:\\samsung-tv-sdk\\tasdk_ide\\tasdk_tools\\mingw\\bin;D\:\\samsung-tv-sdk\\tasdk_ide\\tasdk_tools\\mingw\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152.533145061/append=true -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152.533145061/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152/PATH/delimiter=\: -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152/PATH/value=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/usr/games\:/usr/local/games\:/usr/local/lib\:usr/lib;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\bin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\mingbin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152/append=true -environment/project/cdt.managedbuild.config.gnu.exe.debug.1955467152/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.exe.release.1350514530/PATH/delimiter=\: -environment/project/cdt.managedbuild.config.gnu.exe.release.1350514530/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.exe.release.1350514530/PATH/value=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/usr/games\:/usr/local/games -environment/project/cdt.managedbuild.config.gnu.exe.release.1350514530/append=true -environment/project/cdt.managedbuild.config.gnu.exe.release.1350514530/appendContributed=true diff --git a/TEEStub/.settings/org.eclipse.cdt.ui.prefs b/TEEStub/.settings/org.eclipse.cdt.ui.prefs deleted file mode 100755 index 4ee12a4..0000000 --- a/TEEStub/.settings/org.eclipse.cdt.ui.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -formatter_settings_version=1 diff --git a/TEEStub/.settings/org.eclipse.ltk.core.refactoring.prefs b/TEEStub/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100755 index b196c64..0000000 --- a/TEEStub/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,2 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/include/.cproject b/include/.cproject deleted file mode 100755 index abef4a7..0000000 --- a/include/.cproject +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/.project b/include/.project deleted file mode 100755 index 5b839e7..0000000 --- a/include/.project +++ /dev/null @@ -1,26 +0,0 @@ - - - include - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/include/.settings/language.settings.xml b/include/.settings/language.settings.xml deleted file mode 100755 index 1408bef..0000000 --- a/include/.settings/language.settings.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/include/.settings/org.eclipse.cdt.core.prefs b/include/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index ecae8d3..0000000 --- a/include/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,6 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.624722712/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.624722712/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.624722712/PATH/value=D\:\\eclipse\\eclipse-rcp-luna-SR1-win32-x86_64;C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files (x86)\\GitExtensions\\;D\:\\Tizen\\tizen-sdk\\tools;D\:\\Android\\android-sdk\\platform-tools;D\:\\Android\\android-ndk-r10c;C\:\\Program Files\\Perforce; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.624722712/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.624722712/appendContributed=true diff --git a/log/.cproject b/log/.cproject deleted file mode 100755 index a63706f..0000000 --- a/log/.cproject +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/log/.project b/log/.project deleted file mode 100755 index d1a8b53..0000000 --- a/log/.project +++ /dev/null @@ -1,26 +0,0 @@ - - - log - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/log/.settings/language.settings.xml b/log/.settings/language.settings.xml deleted file mode 100755 index 6b3365f..0000000 --- a/log/.settings/language.settings.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/log/.settings/org.eclipse.cdt.core.prefs b/log/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index a945b31..0000000 --- a/log/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.1318202039/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.1318202039/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.1318202039/PATH/value=C\:/Program Files/Java/jre1.8.0_40/bin/server;C/Program Files/Java/jre1.8.0_40/bin;C\:/Program Files/Java/jre1.8.0_40/lib/amd64;C\:\\Program Files (x86)\\Black Duck Software\\protexIP\\bin;C\:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;C\:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files (x86)\\QuickTime\\QTSystem\\;C\:\\Program Files (x86)\\Java\\jre7\\bin; C\:\\cygwin64\\bin;C\:\\Program Files\\doxygen\\bin;D\:\\eclipse;C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\Program Files (x86)\\Java\\jre1.8.0_45\\bin;C\:\\Program Files\\eclipse;C\:/Program Files/Java/jre1.8.0_31/bin/server;C\:/Program Files/Java/jre1.8.0_31/bin;C\:/Program Files/Java/jre1.8.0_31/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\csvn\\bin\\;C\:\\csvn\\Python25\\;C\:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files\\Diskeeper Corporation\\ExpressCache\\;C\:\\Program Files (x86)\\Windows Live\\Shared;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files (x86)\\WinSCP\\;C\:\\Program Files (x86)\\PuTTY;C\:\\Program Files\\Microsoft\\Web Platform Installer\\;C\:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C\:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C\:\\Program Files (x86)\\doxygen\\bin;C\:\\Program Files (x86)\\sfk168;C\:\\Program Files (x86)\\vlc-2.1.0;C\:\\Python27\\Scripts;C\:\\Program Files (x86)\\GnuWin32\\bin;C\:\\Python27;C\:\\Program Files (x86)\\Subversion\\bin;c\:\\Program Files\\Synergy;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\MinGW\\lib\\gcc\\mingw32\\4.8.1;C\:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C\:\\Program Files (x86)\\GitExtensions\\;C\:\\Program Files\\Perforce;c\:\\Program Files\\Java\\jre1.8.0_31\\bin\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\tizen-sdk\\ide;${Path};D\:\\samsung-tv-sdk\\tools\\i386-linux-gnueabi-gcc-4.6\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.1318202039/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.1318202039/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.695503171/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592.695503171/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files (x86)\\GitExtensions\\;D\:\\Tizen\\tizen-sdk\\tools;D\:\\Android\\android-sdk\\platform-tools;D\:\\Android\\android-ndk-r10c;C\:\\Program Files\\Perforce;D\:\\eclipse\\eclipse-rcp-luna-SR1-win32-x86_64;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\bin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\mingbin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.22061592/appendContributed=true diff --git a/osal/.cproject b/osal/.cproject deleted file mode 100755 index afa393f..0000000 --- a/osal/.cproject +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/osal/.project b/osal/.project deleted file mode 100755 index 1d29a11..0000000 --- a/osal/.project +++ /dev/null @@ -1,26 +0,0 @@ - - - osal - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/osal/.settings/org.eclipse.cdt.core.prefs b/osal/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index bb01593..0000000 --- a/osal/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461.1612701246/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461.1612701246/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461.1612701246/PATH/value=C\:/Program Files/Java/jre1.8.0_40/bin/server;C\:/Program Files/Java/jre1.8.0_40/bin;C\:/Program Files/Java/jre1.8.0_40/lib/amd64;C\:\\Program Files (x86)\\Black Duck Software\\protexIP\\bin;C\:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;C\:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files (x86)\\QuickTime\\QTSystem\\;C\:\\Program Files (x86)\\Java\\jre7\\bin; C\:\\cygwin64\\bin;C\:\\Program Files\\doxygen\\bin;D\:\\eclipse;C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\Program Files (x86)\\Java\\jre1.8.0_45\\bin;C\:\\Program Files\\eclipse;C\:/Program Files/Java/jre1.8.0_31/bin/server;C\:/Program Files/Java/jre1.8.0_31/bin;C\:/Program Files/Java/jre1.8.0_31/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\csvn\\bin\\;C\:\\csvn\\Python25\\;C\:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files\\Diskeeper Corporation\\ExpressCache\\;C\:\\Program Files (x86)\\Windows Live\\Shared;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files (x86)\\WinSCP\\;C\:\\Program Files (x86)\\PuTTY;C\:\\Program Files\\Microsoft\\Web Platform Installer\\;C\:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C\:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C\:\\Program Files (x86)\\doxygen\\bin;C\:\\Program Files (x86)\\sfk168;C\:\\Program Files (x86)\\vlc-2.1.0;C\:\\Python27\\Scripts;C\:\\Program Files (x86)\\GnuWin32\\bin;C\:\\Python27;C\:\\Program Files (x86)\\Subversion\\bin;c\:\\Program Files\\Synergy;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\MinGW\\lib\\gcc\\mingw32\\4.8.1;C\:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C\:\\Program Files (x86)\\GitExtensions\\;C\:\\Program Files\\Perforce;c\:\\Program Files\\Java\\jre1.8.0_31\\bin\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\tizen-sdk\\ide;${Path};D\:\\samsung-tv-sdk\\tools\\i386-linux-gnueabi-gcc-4.6\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461.1612701246/append=true -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461.1612701246/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files (x86)\\GitExtensions\\;D\:\\Tizen\\tizen-sdk\\tools;D\:\\Android\\android-sdk\\platform-tools;D\:\\Android\\android-ndk-r10c;C\:\\Program Files\\Perforce;D\:\\eclipse\\eclipse-rcp-luna-SR1-win32-x86_64;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\bin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\mingbin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/append=true -environment/project/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/appendContributed=true diff --git a/osal/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/osal/.settings/org.eclipse.cdt.managedbuilder.core.prefs deleted file mode 100755 index 16b7426..0000000 --- a/osal/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/CPATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/CPATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/C_INCLUDE_PATH/delimiter=; -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/C_INCLUDE_PATH/operation=remove -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/append=true -environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.1210907461/appendContributed=true diff --git a/simulatordaemon/.cproject b/simulatordaemon/.cproject deleted file mode 100755 index 8fc762f..0000000 --- a/simulatordaemon/.cproject +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/simulatordaemon/.project b/simulatordaemon/.project deleted file mode 100755 index d1ea21c..0000000 --- a/simulatordaemon/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - SimulatorDaemon - - - TEECLib - TEEStub - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/simulatordaemon/.settings/language.settings.xml b/simulatordaemon/.settings/language.settings.xml deleted file mode 100755 index 53ab1a6..0000000 --- a/simulatordaemon/.settings/language.settings.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/simulatordaemon/.settings/org.eclipse.cdt.core.prefs b/simulatordaemon/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index 71eacce..0000000 --- a/simulatordaemon/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356.743154132/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356.743154132/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356.743154132/PATH/value=C\:/Program Files/Java/jre1.8.0_40/bin/server;C\:/Program Files/Java/jre1.8.0_40/bin;C\:/Program Files/Java/jre1.8.0_40/lib/amd64;C\:\\Program Files (x86)\\Black Duck Software\\protexIP\\bin;C\:\\Program Files\\Common Files\\Microsoft Shared\\Windows Live;C\:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Windows Live;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files (x86)\\QuickTime\\QTSystem\\;C\:\\Program Files (x86)\\Java\\jre7\\bin; C\:\\cygwin64\\bin;C\:\\Program Files\\doxygen\\bin;D\:\\eclipse;C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\Program Files (x86)\\Java\\jre1.8.0_45\\bin;C\:\\Program Files\\eclipse;C\:/Program Files/Java/jre1.8.0_31/bin/server;C\:/Program Files/Java/jre1.8.0_31/bin;C\:/Program Files/Java/jre1.8.0_31/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\csvn\\bin\\;C\:\\csvn\\Python25\\;C\:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files\\Diskeeper Corporation\\ExpressCache\\;C\:\\Program Files (x86)\\Windows Live\\Shared;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files (x86)\\WinSCP\\;C\:\\Program Files (x86)\\PuTTY;C\:\\Program Files\\Microsoft\\Web Platform Installer\\;C\:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C\:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C\:\\Program Files (x86)\\doxygen\\bin;C\:\\Program Files (x86)\\sfk168;C\:\\Program Files (x86)\\vlc-2.1.0;C\:\\Python27\\Scripts;C\:\\Program Files (x86)\\GnuWin32\\bin;C\:\\Python27;C\:\\Program Files (x86)\\Subversion\\bin;c\:\\Program Files\\Synergy;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\MinGW\\lib\\gcc\\mingw32\\4.8.1;C\:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C\:\\Program Files (x86)\\GitExtensions\\;C\:\\Program Files\\Perforce;c\:\\Program Files\\Java\\jre1.8.0_31\\bin\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;D\:\\samsung-tv-sdk\\ide;${Path};D\:\\samsung-tv-sdk\\tools\\i386-linux-gnueabi-gcc-4.6\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\bin;D\:\\samsung-tv-sdk\\tools\\mingw\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356.743154132/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356.743154132/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files (x86)\\GitExtensions\\;D\:\\Tizen\\tizen-sdk\\tools;D\:\\Android\\android-sdk\\platform-tools;D\:\\Android\\android-ndk-r10c;C\:\\Program Files\\Perforce;D\:\\eclipse\\eclipse-rcp-luna-SR1-win32-x86_64;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\bin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\mingbin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356/append=true -environment/project/cdt.managedbuild.config.gnu.cross.exe.debug.1895221356/appendContributed=true diff --git a/simulatordaemon/src/RemoteSystemsTempFiles/.project b/simulatordaemon/src/RemoteSystemsTempFiles/.project deleted file mode 100755 index 5447a64..0000000 --- a/simulatordaemon/src/RemoteSystemsTempFiles/.project +++ /dev/null @@ -1,12 +0,0 @@ - - - RemoteSystemsTempFiles - - - - - - - org.eclipse.rse.ui.remoteSystemsTempNature - - diff --git a/simulatordaemon/src/TABinaryManager/.cproject b/simulatordaemon/src/TABinaryManager/.cproject deleted file mode 100755 index 552414a..0000000 --- a/simulatordaemon/src/TABinaryManager/.cproject +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/simulatordaemon/src/TABinaryManager/.project b/simulatordaemon/src/TABinaryManager/.project deleted file mode 100755 index 51cfe9c..0000000 --- a/simulatordaemon/src/TABinaryManager/.project +++ /dev/null @@ -1,64 +0,0 @@ - - - TABinaryManager - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - - - include - 2 - virtual:/virtual - - - include/tee_command.h - 1 - PARENT-2-PROJECT_LOC/include/tee_command.h - - - include/tee_internal_api.h - 1 - PARENT-2-PROJECT_LOC/include/tee_internal_api.h - - - include/tee_sim_command.h - 1 - PARENT-2-PROJECT_LOC/include/tee_sim_command.h - - - include/tee_client_api.h - 1 - PARENT-2-PROJECT_LOC/include/tee_client_api.h - - - include/teec_data.h - 1 - PARENT-2-PROJECT_LOC/include/teec_data.h - - - include/teestub_command_data.h - 1 - PARENT-2-PROJECT_LOC/include/teestub_command_data.h - - - diff --git a/ssflib/.cproject b/ssflib/.cproject deleted file mode 100755 index 61f06db..0000000 --- a/ssflib/.cproject +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ssflib/.project b/ssflib/.project deleted file mode 100755 index ae8262f..0000000 --- a/ssflib/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - ssflib - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/ssflib/.settings/org.eclipse.cdt.core.prefs b/ssflib/.settings/org.eclipse.cdt.core.prefs deleted file mode 100755 index 5f794a6..0000000 --- a/ssflib/.settings/org.eclipse.cdt.core.prefs +++ /dev/null @@ -1,31 +0,0 @@ -eclipse.preferences.version=1 -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/CWD/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/CWD/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/CWD/value=${ProjDirPath}/Debug_Windows -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\Program Files (x86)\\Java\\jre1.8.0_45\\bin;C\:\\Program Files\\eclipse;C\:/Program Files/Java/jre1.8.0_31/bin/server;C\:/Program Files/Java/jre1.8.0_31/bin;C\:/Program Files/Java/jre1.8.0_31/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\csvn\\bin\\;C\:\\csvn\\Python25\\;C\:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files\\Diskeeper Corporation\\ExpressCache\\;C\:\\Program Files (x86)\\Windows Live\\Shared;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\3.0\\bin\\x64;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files (x86)\\WinSCP\\;C\:\\Program Files (x86)\\PuTTY;C\:\\Program Files\\Microsoft\\Web Platform Installer\\;C\:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C\:\\Program Files (x86)\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\Tools\\Binn\\;C\:\\Program Files\\Microsoft SQL Server\\100\\DTS\\Binn\\;C\:\\Program Files (x86)\\doxygen\\bin;C\:\\Program Files (x86)\\sfk168;C\:\\Program Files (x86)\\vlc-2.1.0;C\:\\Python27\\Scripts;C\:\\Program Files (x86)\\GnuWin32\\bin;C\:\\Python27;C\:\\Program Files (x86)\\Subversion\\bin;c\:\\Program Files\\Synergy;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\MinGW\\lib\\gcc\\mingw32\\4.8.1;C\:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C\:\\Program Files (x86)\\GitExtensions\\;C\:\\Program Files\\Perforce;c\:\\Program Files\\Java\\jre1.8.0_31\\bin\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;D\:\\samsung-tv-sdk\\ide;D\:\\samsung-tv-sdk\\tasdk_ide\\tasdk_tools\\i386-linux-gnueabi-gcc-4.6\\bin;D\:\\samsung-tv-sdk\\tasdk_ide\\tasdk_tools\\mingw\\bin;D\:\\samsung-tv-sdk\\tasdk_ide\\tasdk_tools\\mingw\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/PWD/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/PWD/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/PWD/value=${ProjDirPath}/Debug_Windows -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/append=true -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484.12338249/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/CWD/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/CWD/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/CWD/value=${ProjDirPath}/Debug_Windows -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/PATH/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/PATH/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/PATH/value=C\:/Program Files/Java/jre1.8.0_45/bin/server;C\:/Program Files/Java/jre1.8.0_45/bin;C\:/Program Files/Java/jre1.8.0_45/lib/amd64;C\:\\ProgramData\\Oracle\\Java\\javapath;C\:\\Program Files (x86)\\AMD APP\\bin\\x86_64;C\:\\Program Files (x86)\\AMD APP\\bin\\x86;C\:\\Program Files (x86)\\Intel\\iCLS Client\\;C\:\\Program Files\\Intel\\iCLS Client\\;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C\:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x86;C\:\\Program Files (x86)\\Intel\\OpenCL SDK\\2.0\\bin\\x64;C\:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C\:\\Program Files\\Intel\\WiFi\\bin\\;C\:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C\:\\Program Files\\TortoiseSVN\\bin;C\:\\Program Files (x86)\\GitExtensions\\;D\:\\Tizen\\tizen-sdk\\tools;D\:\\Android\\android-sdk\\platform-tools;D\:\\Android\\android-ndk-r10c;C\:\\Program Files\\Perforce;D\:\\eclipse\\eclipse-rcp-luna-SR1-win32-x86_64;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\bin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\mingbin;${PWD}\\..\\..\\..\\toolchain\\windows\\i386-linux-gnueabi-gcc-4.6\\msys\\1.0\\bin -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/PWD/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/PWD/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/PWD/value=${ProjDirPath}/Debug_Windows -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/append=true -environment/project/cdt.managedbuild.config.gnu.so.debug.345774484/appendContributed=true -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/CWD/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/CWD/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/CWD/value=${ProjDirPath}/Release_Windows -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/PWD/delimiter=; -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/PWD/operation=replace -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/PWD/value=${ProjDirPath}/Release_Windows -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/append=true -environment/project/cdt.managedbuild.config.gnu.so.release.1065319080/appendContributed=true -- 2.7.4 From 9ad59002e78be6115fe341daa46c206bfa52a6c1 Mon Sep 17 00:00:00 2001 From: "u.harbuz" Date: Tue, 4 Jul 2017 09:48:50 +0200 Subject: [PATCH 12/16] Refactor code style to current project-like. Change-Id: I42434a9d754604413c41bdc88dd8480b7dbe08a7 --- simulatordaemon/inc/security.h | 11 +- simulatordaemon/src/SecurityChecker.cpp | 8 +- simulatordaemon/src/security.c | 318 +++++++++++++++++--------------- 3 files changed, 171 insertions(+), 166 deletions(-) diff --git a/simulatordaemon/inc/security.h b/simulatordaemon/inc/security.h index 8481bf0..695cc7c 100644 --- a/simulatordaemon/inc/security.h +++ b/simulatordaemon/inc/security.h @@ -22,23 +22,14 @@ #define SECURITY_H #include -#include -#include -#include -#include #define MAX_PATH_LENGTH 100 -#define MAX_TA_NAME_LENGTH 36 -#define MAX_OPENED_FD 20 - -#define FILE_WAS_FOUND 1 +#define MAX_OPENED_FD 5 #ifdef __cplusplus extern "C" { #endif -#define N_SYS_TA_PATHS 1 - bool ca_has_access_to_ta(int ca_fd, const char* ta_name); bool client_has_cynara_permission(int ca_fd, const char* privelege); diff --git a/simulatordaemon/src/SecurityChecker.cpp b/simulatordaemon/src/SecurityChecker.cpp index 7b629a6..c9b6b12 100644 --- a/simulatordaemon/src/SecurityChecker.cpp +++ b/simulatordaemon/src/SecurityChecker.cpp @@ -24,22 +24,22 @@ SecurityChecker(ConnectionSession* ses){ } -bool SecurityChecker::clientHasAccessToTa(ConnectionSession *ses, string taName){ +bool SecurityChecker::clientHasAccessToTa(ConnectionSession *ses, string taName) { return ca_has_access_to_ta(ses->socket().native(), taName.c_str()); } -bool SecurityChecker::clientHasCynaraPermission(ConnectionSession *ses, string privelege){ +bool SecurityChecker::clientHasCynaraPermission(ConnectionSession *ses, string privelege) { return client_has_cynara_permission(ses->socket().native(), privelege.c_str()); } -bool SecurityChecker::clientHasCynaraPermission(string privelege){ +bool SecurityChecker::clientHasCynaraPermission(string privelege) { return SecurityChecker::clientHasCynaraPermission(mConnSess, privelege); } -bool SecurityChecker::clientHasAccessToTa(string taName){ +bool SecurityChecker::clientHasAccessToTa(string taName) { return SecurityChecker::clientHasAccessToTa(mConnSess, taName); } diff --git a/simulatordaemon/src/security.c b/simulatordaemon/src/security.c index ea225ac..02e764b 100644 --- a/simulatordaemon/src/security.c +++ b/simulatordaemon/src/security.c @@ -1,6 +1,6 @@ /* * security.c - * + * * Copyright (C) 2017 Samsung Electronics * Uladzislau Harbuz * @@ -8,7 +8,7 @@ * 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 + * 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, @@ -22,197 +22,211 @@ #include #include #include +#include +#include +#include +#include #include "security.h" /* This variable is for nftw searching of ta */ static const char* g_ta_name = NULL; -static const char* system_ta_paths[N_SYS_TA_PATHS]= { - "/usr/lib/optee_armtz/", +#define FILE_WAS_FOUND 1 + +#define N_SYS_TA_PATHS 1 +static const char* system_ta_paths[N_SYS_TA_PATHS]={ + "/usr/lib/optee_armtz/", }; -static bool file_exists(const char* fname){ - struct stat st; - return stat(fname, &st) == 0; +static bool file_exists(const char* fname) { + struct stat st; + return stat(fname, &st) == 0; } -static bool get_ca_full_path_from_socket(int fd, char* path){ - /* How to get full path from pkgid? */ - pid_t ca_pid = -1; - cynara *cynara = NULL; - int ret = -1; - - ret = cynara_initialize(&cynara, NULL); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Cynara initialization failed with error code %d", ret); - return false; - } - - ret = cynara_creds_socket_get_pid(fd, &ca_pid); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Couldn't get pid of the client. Error code: %d", ret); - cynara_finish(cynara); - return false; - } - - char ca_path[MAX_PATH_LENGTH] = {0}; - snprintf(ca_path, MAX_PATH_LENGTH, "/proc/%d/exe", ca_pid); - ret = readlink(ca_path, path, MAX_PATH_LENGTH); - - if(ret == -1){ - EMSG("readlink() failed"); - cynara_finish(cynara); - return false; - } - - cynara_finish(cynara); - - return true; +/* TODO: need we get path of CA from its pkgid or we need traverse some + * predefined directories with CA which contain its TA, or will installator of + * it store some paired CA-TA pathces? Now it is not good mechanism for searcing + * CA path from pid. + */ +static bool get_ca_full_path_from_socket(int fd, char* path) { + + pid_t ca_pid = -1; + cynara *cynara = NULL; + int ret = -1; + + ret = cynara_initialize(&cynara, NULL); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Cynara initialization failed with error code %d", ret); + return false; + } + + ret = cynara_creds_socket_get_pid(fd, &ca_pid); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Couldn't get pid of the client. Error code: %d", ret); + cynara_finish(cynara); + return false; + } + + char ca_path[MAX_PATH_LENGTH] = {0}; + snprintf(ca_path, MAX_PATH_LENGTH, "/proc/%d/exe", ca_pid); + ret = readlink(ca_path, path, MAX_PATH_LENGTH); + + if(ret == -1) { + EMSG("readlink() failed"); + cynara_finish(cynara); + return false; + } + + cynara_finish(cynara); + + return true; } -static int cmp_ta_name(const char *fpath, const struct stat *sb, - int tflag, struct FTW *ftwbuf) -{ - if(tflag == FTW_D){ - char ta_full_path[MAX_PATH_LENGTH] = {0}; - snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", fpath, g_ta_name); +static int cmp_ta_name(const char *fpath, const struct stat *sb, + int tflag, struct FTW *ftwbuf) { + if(tflag == FTW_D) { + char ta_full_path[MAX_PATH_LENGTH] = {0}; + snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", fpath, g_ta_name); - if(file_exists(ta_full_path)){ - return FILE_WAS_FOUND; - } - } + if(file_exists(ta_full_path)) { + return FILE_WAS_FOUND; + } + } - return 0; + return 0; } -bool ca_has_access_to_ta(int ca_fd, const char* ta_name){ - int ret; - g_ta_name = ta_name; +bool ca_has_access_to_ta(int ca_fd, const char* ta_name) { + int ret; + g_ta_name = ta_name; - char *pkg_id_ca; + char *pkg_id_ca; - ret = security_manager_identify_app_from_socket(ca_fd, &pkg_id_ca, NULL); - if(ret == SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT){ - DMSG("Owner of socket has no pkgid"); + ret = security_manager_identify_app_from_socket(ca_fd, &pkg_id_ca, NULL); + if(ret == SECURITY_MANAGER_ERROR_NO_SUCH_OBJECT) { + DMSG("Owner of socket has no pkgid"); - char ta_full_path[MAX_PATH_LENGTH] = {0}; + char ta_full_path[MAX_PATH_LENGTH] = {0}; - /* Check if any of system ta directories contains our ta */ - for(int i = 0; i < N_SYS_TA_PATHS; ++i){ - snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", system_ta_paths[i], ta_name); + /* Check if any of system ta directories contains our ta */ + for(int i = 0; i < N_SYS_TA_PATHS; ++i){ + snprintf(ta_full_path, MAX_PATH_LENGTH, "%s/%s", system_ta_paths[i], ta_name); - if(file_exists(ta_full_path)){ - return true; - } + if(file_exists(ta_full_path)){ + return true; + } - memset(ta_full_path, 0, MAX_PATH_LENGTH); - } + memset(ta_full_path, 0, MAX_PATH_LENGTH); + } - return false; - } + return false; + } - if(ret != SECURITY_MANAGER_SUCCESS){ - EMSG("security_manager_identify_app_from_cynara_client() failed with CA"); - return false; - } + if(ret != SECURITY_MANAGER_SUCCESS) { + EMSG("security_manager_identify_app_from_cynara_client() failed with CA"); + return false; + } - char ca_pkg_path[MAX_PATH_LENGTH]; - if(!get_ca_full_path_from_socket(ca_fd, ca_pkg_path)){ - EMSG("Error while loading client's path"); - free(pkg_id_ca); - return false; - } + char ca_pkg_path[MAX_PATH_LENGTH]; + if(!get_ca_full_path_from_socket(ca_fd, ca_pkg_path)) { + EMSG("Error while loading client's path"); + free(pkg_id_ca); + return false; + } - ret = nftw(ca_pkg_path, cmp_ta_name, MAX_OPENED_FD, 0); - if(ret == FILE_WAS_FOUND){ - free(pkg_id_ca); - return true; - } +/* Now it searches TA of client recursively in subdirectories of it. Maybe + * in future we will know koncrete predefined subdirectories or even + * map Client <-> allowed directories for it*/ + ret = nftw(ca_pkg_path, cmp_ta_name, MAX_OPENED_FD, 0); + if(ret == FILE_WAS_FOUND) { + free(pkg_id_ca); + return true; + } - free(pkg_id_ca); - return false; + free(pkg_id_ca); + return false; } -bool client_has_cynara_permission(int ca_fd, const char *privelege){ - cynara *cynara = NULL; - int ret = -1; - char *user; - char *session = NULL; - char *label; - pid_t ca_pid = -1; - - ret = cynara_initialize(&cynara, NULL); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Cynara initialization failed with error code %d", ret); - return false; - } - - ret = cynara_creds_socket_get_client(ca_fd, CLIENT_METHOD_SMACK, &label); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Couldn't get smack label of the client. Error code: %d", ret); - goto exit_error3; - } - - ret = cynara_creds_socket_get_pid(ca_fd, &ca_pid); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Couldn't get pid of the client. Error code: %d", ret); - goto exit_error2; - } - - session = cynara_session_from_pid(ca_pid); - if(!session){ - EMSG("Couldn't get client's cynara session."); - goto exit_error2; - } - - ret = cynara_creds_socket_get_user(ca_fd, CLIENT_METHOD_SMACK, &user); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Couldn't get user. Error code: %d", ret); - goto exit_error1; - } - - ret = cynara_check(cynara, label, session, user, privelege); - if(ret == CYNARA_API_ACCESS_DENIED){ - EMSG("Cynara access denied."); - goto exit_error0; - } - else if(ret != CYNARA_API_ACCESS_ALLOWED){ - EMSG("Error during cynara_check(). Error code: %d", ret); - goto exit_error0; - } - - - ret = cynara_finish(cynara); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Cynara finish failed with error code %d", ret); - } - - free(session); - free(label); - free(user); - - return true; +bool client_has_cynara_permission(int ca_fd, const char *privelege) { + cynara *cynara = NULL; + int ret = -1; + char *user; + char *session = NULL; + char *label; + pid_t ca_pid = -1; + + ret = cynara_initialize(&cynara, NULL); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Cynara initialization failed with error code %d", ret); + return false; + } + + ret = cynara_creds_socket_get_client(ca_fd, CLIENT_METHOD_SMACK, &label); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Couldn't get smack label of the client. Error code: %d", ret); + goto exit_error3; + } + + ret = cynara_creds_socket_get_pid(ca_fd, &ca_pid); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Couldn't get pid of the client. Error code: %d", ret); + goto exit_error2; + } + + session = cynara_session_from_pid(ca_pid); + if(!session) { + EMSG("Couldn't get client's cynara session."); + goto exit_error2; + } + + ret = cynara_creds_socket_get_user(ca_fd, CLIENT_METHOD_SMACK, &user); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Couldn't get user. Error code: %d", ret); + goto exit_error1; + } + + ret = cynara_check(cynara, label, session, user, privelege); + if(ret == CYNARA_API_ACCESS_DENIED) { + EMSG("Cynara access denied."); + goto exit_error0; + } + else if(ret != CYNARA_API_ACCESS_ALLOWED) { + EMSG("Error during cynara_check(). Error code: %d", ret); + goto exit_error0; + } + + + ret = cynara_finish(cynara); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Cynara finish failed with error code %d", ret); + } + + free(session); + free(label); + free(user); + + return true; exit_error0: - free(user); + free(user); exit_error1: - free(session); + free(session); exit_error2: - free(label); + free(label); exit_error3: - ret = cynara_finish(cynara); - if(ret != CYNARA_API_SUCCESS){ - EMSG("Cynara finish failed with error code %d", ret); - } + ret = cynara_finish(cynara); + if(ret != CYNARA_API_SUCCESS) { + EMSG("Cynara finish failed with error code %d", ret); + } - return false; + return false; } -- 2.7.4 From 30aa65940a34ff3f11239305a1677491d1f131e0 Mon Sep 17 00:00:00 2001 From: Lukasz Kostyra Date: Tue, 4 Jul 2017 10:05:10 +0200 Subject: [PATCH 13/16] Fix source file permissions in the project Most files had unnecessary execute permission, which is now removed Change-Id: Ic7a97b95c2a0167ecffc8be7077729b41ac43c4e --- TEECLib/inc/teec_connection.h | 0 TEECLib/src/teec_api.c | 0 TEECLib/src/teec_connection.c | 0 TEEStub/DeveloperReadme.txt | 0 TEEStub/PropertyAccess/ClientProperty.cpp | 0 TEEStub/PropertyAccess/ClientProperty.h | 0 TEEStub/PropertyAccess/Property.h | 0 TEEStub/PropertyAccess/PropertyApi.cpp | 0 TEEStub/PropertyAccess/PropertyApi.h | 0 TEEStub/PropertyAccess/PropertyUtility.cpp | 0 TEEStub/PropertyAccess/PropertyUtility.h | 0 TEEStub/PropertyAccess/TAProperty.cpp | 0 TEEStub/PropertyAccess/TAProperty.h | 0 TEEStub/PropertyAccess/TEEProperty.cpp | 0 TEEStub/PropertyAccess/TEEProperty.h | 0 TEEStub/PropertyAccess/rapidxml/rapidxml.hpp | 0 TEEStub/PropertyAccess/rapidxml/rapidxml_iterators.hpp | 0 TEEStub/PropertyAccess/rapidxml/rapidxml_print.hpp | 0 TEEStub/PropertyAccess/rapidxml/rapidxml_utils.hpp | 0 TEEStub/TACommands/CommandBase.cpp | 0 TEEStub/TACommands/CommandBase.h | 0 TEEStub/TACommands/CommandCloseSession.cpp | 0 TEEStub/TACommands/CommandCloseSession.h | 0 TEEStub/TACommands/CommandCreateEntryPoint.cpp | 0 TEEStub/TACommands/CommandCreateEntryPoint.h | 0 TEEStub/TACommands/CommandDestroyEntryPoint.cpp | 0 TEEStub/TACommands/CommandDestroyEntryPoint.h | 0 TEEStub/TACommands/CommandInvoke.cpp | 0 TEEStub/TACommands/CommandInvoke.h | 0 TEEStub/TACommands/CommandOpenSession.cpp | 0 TEEStub/TACommands/CommandOpenSession.h | 0 TEEStub/TACommands/CommandRequestCancel.cpp | 0 TEEStub/TACommands/CommandRequestCancel.h | 0 TEEStub/TACommands/MakeCommand.cpp | 0 TEEStub/TACommands/MakeCommand.h | 0 TEEStub/TACommands/SharedMemoryMap.cpp | 0 TEEStub/TACommands/SharedMemoryMap.h | 0 TEEStub/TEEStubServer/ConnectionSession.cpp | 0 TEEStub/TEEStubServer/ConnectionSession.h | 0 TEEStub/TEEStubServer/TAProperty.cpp | 0 TEEStub/TEEStubServer/TAProperty.h | 0 TEEStub/TEEStubServer/TEEStubServer.cpp | 0 TEEStub/TEEStubServer/TEEStubServer.h | 0 TEEStub/TaskStrategy/SessionState.cpp | 0 TEEStub/TaskStrategy/SessionState.h | 0 TEEStub/TaskStrategy/TaskQueuedStrategy.cpp | 0 TEEStub/TaskStrategy/TaskQueuedStrategy.h | 0 TEEStub/TaskStrategy/TaskStrategy.cpp | 0 TEEStub/TaskStrategy/TaskStrategy.h | 0 TEEStub/teestubmain.cpp | 0 build/TEECLib/objects.mk | 0 build/TEECLib/sources.mk | 0 build/TEECLib/src/subdir.mk | 0 build/TEEStub/PropertyAccess/subdir.mk | 0 build/TEEStub/TACommands/subdir.mk | 0 build/TEEStub/TEEStubServer/subdir.mk | 0 build/TEEStub/TaskStrategy/subdir.mk | 0 build/TEEStub/objects.mk | 0 build/TEEStub/sources.mk | 0 build/TEEStub/subdir.mk | 0 build/log/objects.mk | 0 build/log/sources.mk | 0 build/log/subdir.mk | 0 build/osal/objects.mk | 0 build/osal/sources.mk | 0 build/osal/subdir.mk | 0 build/simulatordaemon/objects.mk | 0 build/simulatordaemon/sources.mk | 0 build/simulatordaemon/src/ClientCommands/subdir.mk | 0 build/simulatordaemon/src/ResponseCommands/subdir.mk | 0 build/simulatordaemon/src/TABinaryManager/subdir.mk | 0 build/simulatordaemon/src/subdir.mk | 0 build/ssflib/dep/cryptocore/source/base/subdir.mk | 0 build/ssflib/dep/cryptocore/source/middle/subdir.mk | 0 build/ssflib/dep/cryptocore/source/subdir.mk | 0 build/ssflib/dep/swdss/source/subdir.mk | 0 build/ssflib/dep/time/subdir.mk | 0 build/ssflib/dep/uci/source/subdir.mk | 0 build/ssflib/objects.mk | 0 build/ssflib/sources.mk | 0 build/ssflib/src/subdir.mk | 0 include/include/config.h | 0 include/include/tee_client_api.h | 0 include/include/tee_command.h | 0 include/include/tee_internal_api.h | 0 include/include/tee_sim_command.h | 0 include/include/teec_data.h | 0 include/include/teestub_command_data.h | 0 log/log.c | 0 log/log.h | 0 osal/OsaCommon.c | 0 osal/OsaIpc.c | 0 osal/OsaLinuxUser.h | 0 osal/OsaQueue.c | 0 osal/OsaSem.c | 0 osal/OsaSignal.c | 0 osal/OsaTask.c | 0 osal/Osal.h | 0 simulatordaemon/inc/ClientCommands/CommandBase.h | 0 simulatordaemon/inc/ClientCommands/CommandCloseSession.h | 0 simulatordaemon/inc/ClientCommands/CommandCloseTASession.h | 0 simulatordaemon/inc/ClientCommands/CommandFinContext.h | 0 simulatordaemon/inc/ClientCommands/CommandInitContext.h | 0 simulatordaemon/inc/ClientCommands/CommandInvokeCommand.h | 0 simulatordaemon/inc/ClientCommands/CommandInvokeTACommand.h | 0 simulatordaemon/inc/ClientCommands/CommandOpenSession.h | 0 simulatordaemon/inc/ClientCommands/CommandOpenTASession.h | 0 simulatordaemon/inc/ClientCommands/CommandPanic.h | 0 simulatordaemon/inc/ClientCommands/CommandRegSharedMem.h | 0 simulatordaemon/inc/ClientCommands/CommandRelSharedMem.h | 0 simulatordaemon/inc/ClientCommands/CommandReqCancellation.h | 0 simulatordaemon/inc/ClientCommands/MakeCommand.h | 0 simulatordaemon/inc/ConnectionSession.h | 0 simulatordaemon/inc/ResponseCommands/ResCommandBase.h | 0 simulatordaemon/inc/ResponseCommands/ResCommandCloseSession.h | 0 simulatordaemon/inc/ResponseCommands/ResCommandInvokeCommand.h | 0 simulatordaemon/inc/ResponseCommands/ResCommandOpenSession.h | 0 simulatordaemon/inc/ResponseCommands/ResCommandReqCancellation.h | 0 simulatordaemon/inc/ResponseCommands/ResMakeCommand.h | 0 simulatordaemon/inc/Session.h | 0 simulatordaemon/inc/SimulatorDaemonServer.h | 0 simulatordaemon/inc/TAFactory.h | 0 simulatordaemon/inc/TAInstance.h | 0 simulatordaemon/inc/TEEContext.h | 0 simulatordaemon/inc/ioService.h | 0 simulatordaemon/inc/path.h | 0 simulatordaemon/src/ClientCommands/CommandCloseSession.cpp | 0 simulatordaemon/src/ClientCommands/CommandCloseTASession.cpp | 0 simulatordaemon/src/ClientCommands/CommandFinContext.cpp | 0 simulatordaemon/src/ClientCommands/CommandInitContext.cpp | 0 simulatordaemon/src/ClientCommands/CommandInvokeCommand.cpp | 0 simulatordaemon/src/ClientCommands/CommandInvokeTACommand.cpp | 0 simulatordaemon/src/ClientCommands/CommandOpenSession.cpp | 0 simulatordaemon/src/ClientCommands/CommandOpenTASession.cpp | 0 simulatordaemon/src/ClientCommands/CommandPanic.cpp | 0 simulatordaemon/src/ClientCommands/CommandRegSharedMem.cpp | 0 simulatordaemon/src/ClientCommands/CommandRelSharedMem.cpp | 0 simulatordaemon/src/ClientCommands/CommandReqCancellation.cpp | 0 simulatordaemon/src/ClientCommands/MakeCommand.cpp | 0 simulatordaemon/src/ConnectionSession.cpp | 0 simulatordaemon/src/ResponseCommands/ResCommandCloseSession.cpp | 0 simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp | 0 simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp | 0 simulatordaemon/src/ResponseCommands/ResCommandReqCancellation.cpp | 0 simulatordaemon/src/ResponseCommands/ResMakeCommand.cpp | 0 simulatordaemon/src/Session.cpp | 0 simulatordaemon/src/SimulatorDaemon.cpp | 0 simulatordaemon/src/SimulatorDaemonServer.cpp | 0 simulatordaemon/src/TABinaryManager/Config.h | 0 simulatordaemon/src/TABinaryManager/Debug/objects.mk | 0 simulatordaemon/src/TABinaryManager/Debug/sources.mk | 0 simulatordaemon/src/TABinaryManager/Debug/subdir.mk | 0 simulatordaemon/src/TABinaryManager/TABinaryManager.cpp | 0 simulatordaemon/src/TABinaryManager/TABinaryManager.h | 0 simulatordaemon/src/TABinaryManager/TAManifest.cpp | 0 simulatordaemon/src/TABinaryManager/TAManifest.h | 0 simulatordaemon/src/TABinaryManager/TAUnpack.cpp | 0 simulatordaemon/src/TABinaryManager/TAUnpack.h | 0 simulatordaemon/src/TABinaryManager/TestMain.cpp | 0 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml.hpp | 0 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_iterators.hpp | 0 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_print.hpp | 0 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_utils.hpp | 0 simulatordaemon/src/TAFactory.cpp | 0 simulatordaemon/src/TAInstance.cpp | 0 simulatordaemon/src/TEEContext.cpp | 0 simulatordaemon/src/ioService.cpp | 0 simulatordaemon/src/rapidxml/rapidxml.hpp | 0 ssflib/dep/cryptocore/include/CC_API.h | 0 ssflib/dep/cryptocore/include/CC_Constants.h | 0 ssflib/dep/cryptocore/include/CC_Context.h | 0 ssflib/dep/cryptocore/include/CC_Type.h | 0 ssflib/dep/cryptocore/include/CryptoCore.h | 0 ssflib/dep/cryptocore/include/base/cc_ANSI_x931.h | 0 ssflib/dep/cryptocore/include/base/cc_aes.h | 0 ssflib/dep/cryptocore/include/base/cc_bignum.h | 0 ssflib/dep/cryptocore/include/base/cc_des.h | 0 ssflib/dep/cryptocore/include/base/cc_ecc.h | 0 ssflib/dep/cryptocore/include/base/cc_fast_math.h | 0 ssflib/dep/cryptocore/include/base/cc_hash.h | 0 ssflib/dep/cryptocore/include/base/cc_md5.h | 0 ssflib/dep/cryptocore/include/base/cc_moo.h | 0 ssflib/dep/cryptocore/include/base/cc_pkcs1_v21.h | 0 ssflib/dep/cryptocore/include/base/cc_rc4.h | 0 ssflib/dep/cryptocore/include/base/cc_sha1.h | 0 ssflib/dep/cryptocore/include/base/cc_sha2.h | 0 ssflib/dep/cryptocore/include/base/cc_snow2.h | 0 ssflib/dep/cryptocore/include/drm_macro.h | 0 ssflib/dep/cryptocore/include/middle/cc_cmac.h | 0 ssflib/dep/cryptocore/include/middle/cc_dh.h | 0 ssflib/dep/cryptocore/include/middle/cc_dsa.h | 0 ssflib/dep/cryptocore/include/middle/cc_ecdh.h | 0 ssflib/dep/cryptocore/include/middle/cc_ecdsa.h | 0 ssflib/dep/cryptocore/include/middle/cc_hmac.h | 0 ssflib/dep/cryptocore/include/middle/cc_rng.h | 0 ssflib/dep/cryptocore/include/middle/cc_rsa.h | 0 ssflib/dep/cryptocore/include/middle/cc_symmetric.h | 0 ssflib/dep/cryptocore/include/middle/cc_tdes.h | 0 ssflib/dep/cryptocore/source/CC_API.c | 0 ssflib/dep/cryptocore/source/base/cc_ANSI_x931.c | 0 ssflib/dep/cryptocore/source/base/cc_aes.c | 0 ssflib/dep/cryptocore/source/base/cc_bignum.c | 0 ssflib/dep/cryptocore/source/base/cc_des.c | 0 ssflib/dep/cryptocore/source/base/cc_ecc.c | 0 ssflib/dep/cryptocore/source/base/cc_fast_math.c | 0 ssflib/dep/cryptocore/source/base/cc_hash.c | 0 ssflib/dep/cryptocore/source/base/cc_md5.c | 0 ssflib/dep/cryptocore/source/base/cc_moo.c | 0 ssflib/dep/cryptocore/source/base/cc_pkcs1_v21.c | 0 ssflib/dep/cryptocore/source/base/cc_rc4.c | 0 ssflib/dep/cryptocore/source/base/cc_sha1.c | 0 ssflib/dep/cryptocore/source/base/cc_sha2.c | 0 ssflib/dep/cryptocore/source/base/cc_snow2.c | 0 ssflib/dep/cryptocore/source/middle/cc_cmac.c | 0 ssflib/dep/cryptocore/source/middle/cc_dh.c | 0 ssflib/dep/cryptocore/source/middle/cc_dsa.c | 0 ssflib/dep/cryptocore/source/middle/cc_ecdh.c | 0 ssflib/dep/cryptocore/source/middle/cc_ecdsa.c | 0 ssflib/dep/cryptocore/source/middle/cc_hmac.c | 0 ssflib/dep/cryptocore/source/middle/cc_rng.c | 0 ssflib/dep/cryptocore/source/middle/cc_rsa.c | 0 ssflib/dep/cryptocore/source/middle/cc_symmetric.c | 0 ssflib/dep/cryptocore/source/middle/cc_tdes.c | 0 ssflib/dep/swdss/include/file_op.h | 0 ssflib/dep/swdss/include/secure_file.h | 0 ssflib/dep/swdss/include/slog.h | 0 ssflib/dep/swdss/include/ss_api.h | 0 ssflib/dep/swdss/include/ss_crypto.h | 0 ssflib/dep/swdss/include/ss_misc.h | 0 ssflib/dep/swdss/include/ss_temp_store.h | 0 ssflib/dep/swdss/include/ss_types.h | 0 ssflib/dep/swdss/source/file_op.cpp | 0 ssflib/dep/swdss/source/secure_file.cpp | 0 ssflib/dep/swdss/source/ss_api.cpp | 0 ssflib/dep/swdss/source/ss_crypto.cpp | 0 ssflib/dep/swdss/source/ss_misc.cpp | 0 ssflib/dep/swdss/source/ss_temp_store.cpp | 0 ssflib/dep/time/ssf_time.cpp | 0 ssflib/dep/uci/include/uci_aes_xcbc_mac.h | 0 ssflib/dep/uci/include/uci_api.h | 0 ssflib/dep/uci/include/uci_cryptocore.h | 0 ssflib/dep/uci/include/uci_hwcrypto.h | 0 ssflib/dep/uci/include/uci_internal.h | 0 ssflib/dep/uci/include/uci_type.h | 0 ssflib/dep/uci/source/uci_aes_xcbc_mac.c | 0 ssflib/dep/uci/source/uci_api.c | 0 ssflib/dep/uci/source/uci_cryptocore.c | 0 ssflib/dep/uci/source/uci_hwcrypto.c | 0 ssflib/inc/app_debug.h | 0 ssflib/inc/ssf_client.h | 0 ssflib/inc/ssf_lib.h | 0 ssflib/inc/ssf_storage.h | 0 ssflib/src/app_debug.c | 0 ssflib/src/ssf_arithmetic.c | 0 ssflib/src/ssf_client.c | 0 ssflib/src/ssf_crypto.c | 0 ssflib/src/ssf_lib.c | 0 ssflib/src/ssf_malloc.c | 0 ssflib/src/ssf_panic.c | 0 ssflib/src/ssf_storage.c | 0 ssflib/src/ssf_taentrypoint.c | 0 261 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 TEECLib/inc/teec_connection.h mode change 100755 => 100644 TEECLib/src/teec_api.c mode change 100755 => 100644 TEECLib/src/teec_connection.c mode change 100755 => 100644 TEEStub/DeveloperReadme.txt mode change 100755 => 100644 TEEStub/PropertyAccess/ClientProperty.cpp mode change 100755 => 100644 TEEStub/PropertyAccess/ClientProperty.h mode change 100755 => 100644 TEEStub/PropertyAccess/Property.h mode change 100755 => 100644 TEEStub/PropertyAccess/PropertyApi.cpp mode change 100755 => 100644 TEEStub/PropertyAccess/PropertyApi.h mode change 100755 => 100644 TEEStub/PropertyAccess/PropertyUtility.cpp mode change 100755 => 100644 TEEStub/PropertyAccess/PropertyUtility.h mode change 100755 => 100644 TEEStub/PropertyAccess/TAProperty.cpp mode change 100755 => 100644 TEEStub/PropertyAccess/TAProperty.h mode change 100755 => 100644 TEEStub/PropertyAccess/TEEProperty.cpp mode change 100755 => 100644 TEEStub/PropertyAccess/TEEProperty.h mode change 100755 => 100644 TEEStub/PropertyAccess/rapidxml/rapidxml.hpp mode change 100755 => 100644 TEEStub/PropertyAccess/rapidxml/rapidxml_iterators.hpp mode change 100755 => 100644 TEEStub/PropertyAccess/rapidxml/rapidxml_print.hpp mode change 100755 => 100644 TEEStub/PropertyAccess/rapidxml/rapidxml_utils.hpp mode change 100755 => 100644 TEEStub/TACommands/CommandBase.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandBase.h mode change 100755 => 100644 TEEStub/TACommands/CommandCloseSession.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandCloseSession.h mode change 100755 => 100644 TEEStub/TACommands/CommandCreateEntryPoint.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandCreateEntryPoint.h mode change 100755 => 100644 TEEStub/TACommands/CommandDestroyEntryPoint.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandDestroyEntryPoint.h mode change 100755 => 100644 TEEStub/TACommands/CommandInvoke.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandInvoke.h mode change 100755 => 100644 TEEStub/TACommands/CommandOpenSession.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandOpenSession.h mode change 100755 => 100644 TEEStub/TACommands/CommandRequestCancel.cpp mode change 100755 => 100644 TEEStub/TACommands/CommandRequestCancel.h mode change 100755 => 100644 TEEStub/TACommands/MakeCommand.cpp mode change 100755 => 100644 TEEStub/TACommands/MakeCommand.h mode change 100755 => 100644 TEEStub/TACommands/SharedMemoryMap.cpp mode change 100755 => 100644 TEEStub/TACommands/SharedMemoryMap.h mode change 100755 => 100644 TEEStub/TEEStubServer/ConnectionSession.cpp mode change 100755 => 100644 TEEStub/TEEStubServer/ConnectionSession.h mode change 100755 => 100644 TEEStub/TEEStubServer/TAProperty.cpp mode change 100755 => 100644 TEEStub/TEEStubServer/TAProperty.h mode change 100755 => 100644 TEEStub/TEEStubServer/TEEStubServer.cpp mode change 100755 => 100644 TEEStub/TEEStubServer/TEEStubServer.h mode change 100755 => 100644 TEEStub/TaskStrategy/SessionState.cpp mode change 100755 => 100644 TEEStub/TaskStrategy/SessionState.h mode change 100755 => 100644 TEEStub/TaskStrategy/TaskQueuedStrategy.cpp mode change 100755 => 100644 TEEStub/TaskStrategy/TaskQueuedStrategy.h mode change 100755 => 100644 TEEStub/TaskStrategy/TaskStrategy.cpp mode change 100755 => 100644 TEEStub/TaskStrategy/TaskStrategy.h mode change 100755 => 100644 TEEStub/teestubmain.cpp mode change 100755 => 100644 build/TEECLib/objects.mk mode change 100755 => 100644 build/TEECLib/sources.mk mode change 100755 => 100644 build/TEECLib/src/subdir.mk mode change 100755 => 100644 build/TEEStub/PropertyAccess/subdir.mk mode change 100755 => 100644 build/TEEStub/TACommands/subdir.mk mode change 100755 => 100644 build/TEEStub/TEEStubServer/subdir.mk mode change 100755 => 100644 build/TEEStub/TaskStrategy/subdir.mk mode change 100755 => 100644 build/TEEStub/objects.mk mode change 100755 => 100644 build/TEEStub/sources.mk mode change 100755 => 100644 build/TEEStub/subdir.mk mode change 100755 => 100644 build/log/objects.mk mode change 100755 => 100644 build/log/sources.mk mode change 100755 => 100644 build/log/subdir.mk mode change 100755 => 100644 build/osal/objects.mk mode change 100755 => 100644 build/osal/sources.mk mode change 100755 => 100644 build/osal/subdir.mk mode change 100755 => 100644 build/simulatordaemon/objects.mk mode change 100755 => 100644 build/simulatordaemon/sources.mk mode change 100755 => 100644 build/simulatordaemon/src/ClientCommands/subdir.mk mode change 100755 => 100644 build/simulatordaemon/src/ResponseCommands/subdir.mk mode change 100755 => 100644 build/simulatordaemon/src/TABinaryManager/subdir.mk mode change 100755 => 100644 build/simulatordaemon/src/subdir.mk mode change 100755 => 100644 build/ssflib/dep/cryptocore/source/base/subdir.mk mode change 100755 => 100644 build/ssflib/dep/cryptocore/source/middle/subdir.mk mode change 100755 => 100644 build/ssflib/dep/cryptocore/source/subdir.mk mode change 100755 => 100644 build/ssflib/dep/swdss/source/subdir.mk mode change 100755 => 100644 build/ssflib/dep/time/subdir.mk mode change 100755 => 100644 build/ssflib/dep/uci/source/subdir.mk mode change 100755 => 100644 build/ssflib/objects.mk mode change 100755 => 100644 build/ssflib/sources.mk mode change 100755 => 100644 build/ssflib/src/subdir.mk mode change 100755 => 100644 include/include/config.h mode change 100755 => 100644 include/include/tee_client_api.h mode change 100755 => 100644 include/include/tee_command.h mode change 100755 => 100644 include/include/tee_internal_api.h mode change 100755 => 100644 include/include/tee_sim_command.h mode change 100755 => 100644 include/include/teec_data.h mode change 100755 => 100644 include/include/teestub_command_data.h mode change 100755 => 100644 log/log.c mode change 100755 => 100644 log/log.h mode change 100755 => 100644 osal/OsaCommon.c mode change 100755 => 100644 osal/OsaIpc.c mode change 100755 => 100644 osal/OsaLinuxUser.h mode change 100755 => 100644 osal/OsaQueue.c mode change 100755 => 100644 osal/OsaSem.c mode change 100755 => 100644 osal/OsaSignal.c mode change 100755 => 100644 osal/OsaTask.c mode change 100755 => 100644 osal/Osal.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandBase.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandCloseSession.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandCloseTASession.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandFinContext.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandInitContext.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandInvokeCommand.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandInvokeTACommand.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandOpenSession.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandOpenTASession.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandPanic.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandRegSharedMem.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandRelSharedMem.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/CommandReqCancellation.h mode change 100755 => 100644 simulatordaemon/inc/ClientCommands/MakeCommand.h mode change 100755 => 100644 simulatordaemon/inc/ConnectionSession.h mode change 100755 => 100644 simulatordaemon/inc/ResponseCommands/ResCommandBase.h mode change 100755 => 100644 simulatordaemon/inc/ResponseCommands/ResCommandCloseSession.h mode change 100755 => 100644 simulatordaemon/inc/ResponseCommands/ResCommandInvokeCommand.h mode change 100755 => 100644 simulatordaemon/inc/ResponseCommands/ResCommandOpenSession.h mode change 100755 => 100644 simulatordaemon/inc/ResponseCommands/ResCommandReqCancellation.h mode change 100755 => 100644 simulatordaemon/inc/ResponseCommands/ResMakeCommand.h mode change 100755 => 100644 simulatordaemon/inc/Session.h mode change 100755 => 100644 simulatordaemon/inc/SimulatorDaemonServer.h mode change 100755 => 100644 simulatordaemon/inc/TAFactory.h mode change 100755 => 100644 simulatordaemon/inc/TAInstance.h mode change 100755 => 100644 simulatordaemon/inc/TEEContext.h mode change 100755 => 100644 simulatordaemon/inc/ioService.h mode change 100755 => 100644 simulatordaemon/inc/path.h mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandCloseSession.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandCloseTASession.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandFinContext.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandInitContext.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandInvokeCommand.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandInvokeTACommand.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandOpenSession.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandOpenTASession.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandPanic.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandRegSharedMem.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandRelSharedMem.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/CommandReqCancellation.cpp mode change 100755 => 100644 simulatordaemon/src/ClientCommands/MakeCommand.cpp mode change 100755 => 100644 simulatordaemon/src/ConnectionSession.cpp mode change 100755 => 100644 simulatordaemon/src/ResponseCommands/ResCommandCloseSession.cpp mode change 100755 => 100644 simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp mode change 100755 => 100644 simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp mode change 100755 => 100644 simulatordaemon/src/ResponseCommands/ResCommandReqCancellation.cpp mode change 100755 => 100644 simulatordaemon/src/ResponseCommands/ResMakeCommand.cpp mode change 100755 => 100644 simulatordaemon/src/Session.cpp mode change 100755 => 100644 simulatordaemon/src/SimulatorDaemon.cpp mode change 100755 => 100644 simulatordaemon/src/SimulatorDaemonServer.cpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/Config.h mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/Debug/objects.mk mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/Debug/sources.mk mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/Debug/subdir.mk mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TABinaryManager.cpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TABinaryManager.h mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TAManifest.cpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TAManifest.h mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TAUnpack.cpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TAUnpack.h mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/TestMain.cpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml.hpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_iterators.hpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_print.hpp mode change 100755 => 100644 simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_utils.hpp mode change 100755 => 100644 simulatordaemon/src/TAFactory.cpp mode change 100755 => 100644 simulatordaemon/src/TAInstance.cpp mode change 100755 => 100644 simulatordaemon/src/TEEContext.cpp mode change 100755 => 100644 simulatordaemon/src/ioService.cpp mode change 100755 => 100644 simulatordaemon/src/rapidxml/rapidxml.hpp mode change 100755 => 100644 ssflib/dep/cryptocore/include/CC_API.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/CC_Constants.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/CC_Context.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/CC_Type.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/CryptoCore.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_ANSI_x931.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_aes.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_bignum.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_des.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_ecc.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_fast_math.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_hash.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_md5.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_moo.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_pkcs1_v21.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_rc4.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_sha1.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_sha2.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/base/cc_snow2.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/drm_macro.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_cmac.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_dh.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_dsa.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_ecdh.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_ecdsa.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_hmac.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_rng.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_rsa.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_symmetric.h mode change 100755 => 100644 ssflib/dep/cryptocore/include/middle/cc_tdes.h mode change 100755 => 100644 ssflib/dep/cryptocore/source/CC_API.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_ANSI_x931.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_aes.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_bignum.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_des.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_ecc.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_fast_math.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_hash.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_md5.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_moo.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_pkcs1_v21.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_rc4.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_sha1.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_sha2.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/base/cc_snow2.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_cmac.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_dh.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_dsa.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_ecdh.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_ecdsa.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_hmac.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_rng.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_rsa.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_symmetric.c mode change 100755 => 100644 ssflib/dep/cryptocore/source/middle/cc_tdes.c mode change 100755 => 100644 ssflib/dep/swdss/include/file_op.h mode change 100755 => 100644 ssflib/dep/swdss/include/secure_file.h mode change 100755 => 100644 ssflib/dep/swdss/include/slog.h mode change 100755 => 100644 ssflib/dep/swdss/include/ss_api.h mode change 100755 => 100644 ssflib/dep/swdss/include/ss_crypto.h mode change 100755 => 100644 ssflib/dep/swdss/include/ss_misc.h mode change 100755 => 100644 ssflib/dep/swdss/include/ss_temp_store.h mode change 100755 => 100644 ssflib/dep/swdss/include/ss_types.h mode change 100755 => 100644 ssflib/dep/swdss/source/file_op.cpp mode change 100755 => 100644 ssflib/dep/swdss/source/secure_file.cpp mode change 100755 => 100644 ssflib/dep/swdss/source/ss_api.cpp mode change 100755 => 100644 ssflib/dep/swdss/source/ss_crypto.cpp mode change 100755 => 100644 ssflib/dep/swdss/source/ss_misc.cpp mode change 100755 => 100644 ssflib/dep/swdss/source/ss_temp_store.cpp mode change 100755 => 100644 ssflib/dep/time/ssf_time.cpp mode change 100755 => 100644 ssflib/dep/uci/include/uci_aes_xcbc_mac.h mode change 100755 => 100644 ssflib/dep/uci/include/uci_api.h mode change 100755 => 100644 ssflib/dep/uci/include/uci_cryptocore.h mode change 100755 => 100644 ssflib/dep/uci/include/uci_hwcrypto.h mode change 100755 => 100644 ssflib/dep/uci/include/uci_internal.h mode change 100755 => 100644 ssflib/dep/uci/include/uci_type.h mode change 100755 => 100644 ssflib/dep/uci/source/uci_aes_xcbc_mac.c mode change 100755 => 100644 ssflib/dep/uci/source/uci_api.c mode change 100755 => 100644 ssflib/dep/uci/source/uci_cryptocore.c mode change 100755 => 100644 ssflib/dep/uci/source/uci_hwcrypto.c mode change 100755 => 100644 ssflib/inc/app_debug.h mode change 100755 => 100644 ssflib/inc/ssf_client.h mode change 100755 => 100644 ssflib/inc/ssf_lib.h mode change 100755 => 100644 ssflib/inc/ssf_storage.h mode change 100755 => 100644 ssflib/src/app_debug.c mode change 100755 => 100644 ssflib/src/ssf_arithmetic.c mode change 100755 => 100644 ssflib/src/ssf_client.c mode change 100755 => 100644 ssflib/src/ssf_crypto.c mode change 100755 => 100644 ssflib/src/ssf_lib.c mode change 100755 => 100644 ssflib/src/ssf_malloc.c mode change 100755 => 100644 ssflib/src/ssf_panic.c mode change 100755 => 100644 ssflib/src/ssf_storage.c mode change 100755 => 100644 ssflib/src/ssf_taentrypoint.c diff --git a/TEECLib/inc/teec_connection.h b/TEECLib/inc/teec_connection.h old mode 100755 new mode 100644 diff --git a/TEECLib/src/teec_api.c b/TEECLib/src/teec_api.c old mode 100755 new mode 100644 diff --git a/TEECLib/src/teec_connection.c b/TEECLib/src/teec_connection.c old mode 100755 new mode 100644 diff --git a/TEEStub/DeveloperReadme.txt b/TEEStub/DeveloperReadme.txt old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/ClientProperty.cpp b/TEEStub/PropertyAccess/ClientProperty.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/ClientProperty.h b/TEEStub/PropertyAccess/ClientProperty.h old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/Property.h b/TEEStub/PropertyAccess/Property.h old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/PropertyApi.cpp b/TEEStub/PropertyAccess/PropertyApi.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/PropertyApi.h b/TEEStub/PropertyAccess/PropertyApi.h old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/PropertyUtility.cpp b/TEEStub/PropertyAccess/PropertyUtility.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/PropertyUtility.h b/TEEStub/PropertyAccess/PropertyUtility.h old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/TAProperty.cpp b/TEEStub/PropertyAccess/TAProperty.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/TAProperty.h b/TEEStub/PropertyAccess/TAProperty.h old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/TEEProperty.cpp b/TEEStub/PropertyAccess/TEEProperty.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/TEEProperty.h b/TEEStub/PropertyAccess/TEEProperty.h old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/rapidxml/rapidxml.hpp b/TEEStub/PropertyAccess/rapidxml/rapidxml.hpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/rapidxml/rapidxml_iterators.hpp b/TEEStub/PropertyAccess/rapidxml/rapidxml_iterators.hpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/rapidxml/rapidxml_print.hpp b/TEEStub/PropertyAccess/rapidxml/rapidxml_print.hpp old mode 100755 new mode 100644 diff --git a/TEEStub/PropertyAccess/rapidxml/rapidxml_utils.hpp b/TEEStub/PropertyAccess/rapidxml/rapidxml_utils.hpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandBase.cpp b/TEEStub/TACommands/CommandBase.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandBase.h b/TEEStub/TACommands/CommandBase.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandCloseSession.cpp b/TEEStub/TACommands/CommandCloseSession.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandCloseSession.h b/TEEStub/TACommands/CommandCloseSession.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandCreateEntryPoint.cpp b/TEEStub/TACommands/CommandCreateEntryPoint.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandCreateEntryPoint.h b/TEEStub/TACommands/CommandCreateEntryPoint.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandDestroyEntryPoint.cpp b/TEEStub/TACommands/CommandDestroyEntryPoint.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandDestroyEntryPoint.h b/TEEStub/TACommands/CommandDestroyEntryPoint.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandInvoke.cpp b/TEEStub/TACommands/CommandInvoke.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandInvoke.h b/TEEStub/TACommands/CommandInvoke.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandOpenSession.cpp b/TEEStub/TACommands/CommandOpenSession.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandOpenSession.h b/TEEStub/TACommands/CommandOpenSession.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandRequestCancel.cpp b/TEEStub/TACommands/CommandRequestCancel.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/CommandRequestCancel.h b/TEEStub/TACommands/CommandRequestCancel.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/MakeCommand.cpp b/TEEStub/TACommands/MakeCommand.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/MakeCommand.h b/TEEStub/TACommands/MakeCommand.h old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/SharedMemoryMap.cpp b/TEEStub/TACommands/SharedMemoryMap.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TACommands/SharedMemoryMap.h b/TEEStub/TACommands/SharedMemoryMap.h old mode 100755 new mode 100644 diff --git a/TEEStub/TEEStubServer/ConnectionSession.cpp b/TEEStub/TEEStubServer/ConnectionSession.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TEEStubServer/ConnectionSession.h b/TEEStub/TEEStubServer/ConnectionSession.h old mode 100755 new mode 100644 diff --git a/TEEStub/TEEStubServer/TAProperty.cpp b/TEEStub/TEEStubServer/TAProperty.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TEEStubServer/TAProperty.h b/TEEStub/TEEStubServer/TAProperty.h old mode 100755 new mode 100644 diff --git a/TEEStub/TEEStubServer/TEEStubServer.cpp b/TEEStub/TEEStubServer/TEEStubServer.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TEEStubServer/TEEStubServer.h b/TEEStub/TEEStubServer/TEEStubServer.h old mode 100755 new mode 100644 diff --git a/TEEStub/TaskStrategy/SessionState.cpp b/TEEStub/TaskStrategy/SessionState.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TaskStrategy/SessionState.h b/TEEStub/TaskStrategy/SessionState.h old mode 100755 new mode 100644 diff --git a/TEEStub/TaskStrategy/TaskQueuedStrategy.cpp b/TEEStub/TaskStrategy/TaskQueuedStrategy.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TaskStrategy/TaskQueuedStrategy.h b/TEEStub/TaskStrategy/TaskQueuedStrategy.h old mode 100755 new mode 100644 diff --git a/TEEStub/TaskStrategy/TaskStrategy.cpp b/TEEStub/TaskStrategy/TaskStrategy.cpp old mode 100755 new mode 100644 diff --git a/TEEStub/TaskStrategy/TaskStrategy.h b/TEEStub/TaskStrategy/TaskStrategy.h old mode 100755 new mode 100644 diff --git a/TEEStub/teestubmain.cpp b/TEEStub/teestubmain.cpp old mode 100755 new mode 100644 diff --git a/build/TEECLib/objects.mk b/build/TEECLib/objects.mk old mode 100755 new mode 100644 diff --git a/build/TEECLib/sources.mk b/build/TEECLib/sources.mk old mode 100755 new mode 100644 diff --git a/build/TEECLib/src/subdir.mk b/build/TEECLib/src/subdir.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/PropertyAccess/subdir.mk b/build/TEEStub/PropertyAccess/subdir.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/TACommands/subdir.mk b/build/TEEStub/TACommands/subdir.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/TEEStubServer/subdir.mk b/build/TEEStub/TEEStubServer/subdir.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/TaskStrategy/subdir.mk b/build/TEEStub/TaskStrategy/subdir.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/objects.mk b/build/TEEStub/objects.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/sources.mk b/build/TEEStub/sources.mk old mode 100755 new mode 100644 diff --git a/build/TEEStub/subdir.mk b/build/TEEStub/subdir.mk old mode 100755 new mode 100644 diff --git a/build/log/objects.mk b/build/log/objects.mk old mode 100755 new mode 100644 diff --git a/build/log/sources.mk b/build/log/sources.mk old mode 100755 new mode 100644 diff --git a/build/log/subdir.mk b/build/log/subdir.mk old mode 100755 new mode 100644 diff --git a/build/osal/objects.mk b/build/osal/objects.mk old mode 100755 new mode 100644 diff --git a/build/osal/sources.mk b/build/osal/sources.mk old mode 100755 new mode 100644 diff --git a/build/osal/subdir.mk b/build/osal/subdir.mk old mode 100755 new mode 100644 diff --git a/build/simulatordaemon/objects.mk b/build/simulatordaemon/objects.mk old mode 100755 new mode 100644 diff --git a/build/simulatordaemon/sources.mk b/build/simulatordaemon/sources.mk old mode 100755 new mode 100644 diff --git a/build/simulatordaemon/src/ClientCommands/subdir.mk b/build/simulatordaemon/src/ClientCommands/subdir.mk old mode 100755 new mode 100644 diff --git a/build/simulatordaemon/src/ResponseCommands/subdir.mk b/build/simulatordaemon/src/ResponseCommands/subdir.mk old mode 100755 new mode 100644 diff --git a/build/simulatordaemon/src/TABinaryManager/subdir.mk b/build/simulatordaemon/src/TABinaryManager/subdir.mk old mode 100755 new mode 100644 diff --git a/build/simulatordaemon/src/subdir.mk b/build/simulatordaemon/src/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/dep/cryptocore/source/base/subdir.mk b/build/ssflib/dep/cryptocore/source/base/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/dep/cryptocore/source/middle/subdir.mk b/build/ssflib/dep/cryptocore/source/middle/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/dep/cryptocore/source/subdir.mk b/build/ssflib/dep/cryptocore/source/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/dep/swdss/source/subdir.mk b/build/ssflib/dep/swdss/source/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/dep/time/subdir.mk b/build/ssflib/dep/time/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/dep/uci/source/subdir.mk b/build/ssflib/dep/uci/source/subdir.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/objects.mk b/build/ssflib/objects.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/sources.mk b/build/ssflib/sources.mk old mode 100755 new mode 100644 diff --git a/build/ssflib/src/subdir.mk b/build/ssflib/src/subdir.mk old mode 100755 new mode 100644 diff --git a/include/include/config.h b/include/include/config.h old mode 100755 new mode 100644 diff --git a/include/include/tee_client_api.h b/include/include/tee_client_api.h old mode 100755 new mode 100644 diff --git a/include/include/tee_command.h b/include/include/tee_command.h old mode 100755 new mode 100644 diff --git a/include/include/tee_internal_api.h b/include/include/tee_internal_api.h old mode 100755 new mode 100644 diff --git a/include/include/tee_sim_command.h b/include/include/tee_sim_command.h old mode 100755 new mode 100644 diff --git a/include/include/teec_data.h b/include/include/teec_data.h old mode 100755 new mode 100644 diff --git a/include/include/teestub_command_data.h b/include/include/teestub_command_data.h old mode 100755 new mode 100644 diff --git a/log/log.c b/log/log.c old mode 100755 new mode 100644 diff --git a/log/log.h b/log/log.h old mode 100755 new mode 100644 diff --git a/osal/OsaCommon.c b/osal/OsaCommon.c old mode 100755 new mode 100644 diff --git a/osal/OsaIpc.c b/osal/OsaIpc.c old mode 100755 new mode 100644 diff --git a/osal/OsaLinuxUser.h b/osal/OsaLinuxUser.h old mode 100755 new mode 100644 diff --git a/osal/OsaQueue.c b/osal/OsaQueue.c old mode 100755 new mode 100644 diff --git a/osal/OsaSem.c b/osal/OsaSem.c old mode 100755 new mode 100644 diff --git a/osal/OsaSignal.c b/osal/OsaSignal.c old mode 100755 new mode 100644 diff --git a/osal/OsaTask.c b/osal/OsaTask.c old mode 100755 new mode 100644 diff --git a/osal/Osal.h b/osal/Osal.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandBase.h b/simulatordaemon/inc/ClientCommands/CommandBase.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandCloseSession.h b/simulatordaemon/inc/ClientCommands/CommandCloseSession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandCloseTASession.h b/simulatordaemon/inc/ClientCommands/CommandCloseTASession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandFinContext.h b/simulatordaemon/inc/ClientCommands/CommandFinContext.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandInitContext.h b/simulatordaemon/inc/ClientCommands/CommandInitContext.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandInvokeCommand.h b/simulatordaemon/inc/ClientCommands/CommandInvokeCommand.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandInvokeTACommand.h b/simulatordaemon/inc/ClientCommands/CommandInvokeTACommand.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandOpenSession.h b/simulatordaemon/inc/ClientCommands/CommandOpenSession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandOpenTASession.h b/simulatordaemon/inc/ClientCommands/CommandOpenTASession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandPanic.h b/simulatordaemon/inc/ClientCommands/CommandPanic.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandRegSharedMem.h b/simulatordaemon/inc/ClientCommands/CommandRegSharedMem.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandRelSharedMem.h b/simulatordaemon/inc/ClientCommands/CommandRelSharedMem.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/CommandReqCancellation.h b/simulatordaemon/inc/ClientCommands/CommandReqCancellation.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ClientCommands/MakeCommand.h b/simulatordaemon/inc/ClientCommands/MakeCommand.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ConnectionSession.h b/simulatordaemon/inc/ConnectionSession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ResponseCommands/ResCommandBase.h b/simulatordaemon/inc/ResponseCommands/ResCommandBase.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ResponseCommands/ResCommandCloseSession.h b/simulatordaemon/inc/ResponseCommands/ResCommandCloseSession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ResponseCommands/ResCommandInvokeCommand.h b/simulatordaemon/inc/ResponseCommands/ResCommandInvokeCommand.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ResponseCommands/ResCommandOpenSession.h b/simulatordaemon/inc/ResponseCommands/ResCommandOpenSession.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ResponseCommands/ResCommandReqCancellation.h b/simulatordaemon/inc/ResponseCommands/ResCommandReqCancellation.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ResponseCommands/ResMakeCommand.h b/simulatordaemon/inc/ResponseCommands/ResMakeCommand.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/Session.h b/simulatordaemon/inc/Session.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/SimulatorDaemonServer.h b/simulatordaemon/inc/SimulatorDaemonServer.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/TAFactory.h b/simulatordaemon/inc/TAFactory.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/TAInstance.h b/simulatordaemon/inc/TAInstance.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/TEEContext.h b/simulatordaemon/inc/TEEContext.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/ioService.h b/simulatordaemon/inc/ioService.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/inc/path.h b/simulatordaemon/inc/path.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandCloseSession.cpp b/simulatordaemon/src/ClientCommands/CommandCloseSession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandCloseTASession.cpp b/simulatordaemon/src/ClientCommands/CommandCloseTASession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandFinContext.cpp b/simulatordaemon/src/ClientCommands/CommandFinContext.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandInitContext.cpp b/simulatordaemon/src/ClientCommands/CommandInitContext.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandInvokeCommand.cpp b/simulatordaemon/src/ClientCommands/CommandInvokeCommand.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandInvokeTACommand.cpp b/simulatordaemon/src/ClientCommands/CommandInvokeTACommand.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandOpenSession.cpp b/simulatordaemon/src/ClientCommands/CommandOpenSession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandOpenTASession.cpp b/simulatordaemon/src/ClientCommands/CommandOpenTASession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandPanic.cpp b/simulatordaemon/src/ClientCommands/CommandPanic.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandRegSharedMem.cpp b/simulatordaemon/src/ClientCommands/CommandRegSharedMem.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandRelSharedMem.cpp b/simulatordaemon/src/ClientCommands/CommandRelSharedMem.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/CommandReqCancellation.cpp b/simulatordaemon/src/ClientCommands/CommandReqCancellation.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ClientCommands/MakeCommand.cpp b/simulatordaemon/src/ClientCommands/MakeCommand.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ConnectionSession.cpp b/simulatordaemon/src/ConnectionSession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ResponseCommands/ResCommandCloseSession.cpp b/simulatordaemon/src/ResponseCommands/ResCommandCloseSession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp b/simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp b/simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ResponseCommands/ResCommandReqCancellation.cpp b/simulatordaemon/src/ResponseCommands/ResCommandReqCancellation.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ResponseCommands/ResMakeCommand.cpp b/simulatordaemon/src/ResponseCommands/ResMakeCommand.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/Session.cpp b/simulatordaemon/src/Session.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/SimulatorDaemon.cpp b/simulatordaemon/src/SimulatorDaemon.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/SimulatorDaemonServer.cpp b/simulatordaemon/src/SimulatorDaemonServer.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/Config.h b/simulatordaemon/src/TABinaryManager/Config.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/Debug/objects.mk b/simulatordaemon/src/TABinaryManager/Debug/objects.mk old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/Debug/sources.mk b/simulatordaemon/src/TABinaryManager/Debug/sources.mk old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/Debug/subdir.mk b/simulatordaemon/src/TABinaryManager/Debug/subdir.mk old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TABinaryManager.h b/simulatordaemon/src/TABinaryManager/TABinaryManager.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TAManifest.cpp b/simulatordaemon/src/TABinaryManager/TAManifest.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TAManifest.h b/simulatordaemon/src/TABinaryManager/TAManifest.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TAUnpack.cpp b/simulatordaemon/src/TABinaryManager/TAUnpack.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TAUnpack.h b/simulatordaemon/src/TABinaryManager/TAUnpack.h old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/TestMain.cpp b/simulatordaemon/src/TABinaryManager/TestMain.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml.hpp b/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml.hpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_iterators.hpp b/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_iterators.hpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_print.hpp b/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_print.hpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_utils.hpp b/simulatordaemon/src/TABinaryManager/rapidxml/rapidxml_utils.hpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TAFactory.cpp b/simulatordaemon/src/TAFactory.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TAInstance.cpp b/simulatordaemon/src/TAInstance.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/TEEContext.cpp b/simulatordaemon/src/TEEContext.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/ioService.cpp b/simulatordaemon/src/ioService.cpp old mode 100755 new mode 100644 diff --git a/simulatordaemon/src/rapidxml/rapidxml.hpp b/simulatordaemon/src/rapidxml/rapidxml.hpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/CC_API.h b/ssflib/dep/cryptocore/include/CC_API.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/CC_Constants.h b/ssflib/dep/cryptocore/include/CC_Constants.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/CC_Context.h b/ssflib/dep/cryptocore/include/CC_Context.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/CC_Type.h b/ssflib/dep/cryptocore/include/CC_Type.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/CryptoCore.h b/ssflib/dep/cryptocore/include/CryptoCore.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_ANSI_x931.h b/ssflib/dep/cryptocore/include/base/cc_ANSI_x931.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_aes.h b/ssflib/dep/cryptocore/include/base/cc_aes.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_bignum.h b/ssflib/dep/cryptocore/include/base/cc_bignum.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_des.h b/ssflib/dep/cryptocore/include/base/cc_des.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_ecc.h b/ssflib/dep/cryptocore/include/base/cc_ecc.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_fast_math.h b/ssflib/dep/cryptocore/include/base/cc_fast_math.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_hash.h b/ssflib/dep/cryptocore/include/base/cc_hash.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_md5.h b/ssflib/dep/cryptocore/include/base/cc_md5.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_moo.h b/ssflib/dep/cryptocore/include/base/cc_moo.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_pkcs1_v21.h b/ssflib/dep/cryptocore/include/base/cc_pkcs1_v21.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_rc4.h b/ssflib/dep/cryptocore/include/base/cc_rc4.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_sha1.h b/ssflib/dep/cryptocore/include/base/cc_sha1.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_sha2.h b/ssflib/dep/cryptocore/include/base/cc_sha2.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/base/cc_snow2.h b/ssflib/dep/cryptocore/include/base/cc_snow2.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/drm_macro.h b/ssflib/dep/cryptocore/include/drm_macro.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_cmac.h b/ssflib/dep/cryptocore/include/middle/cc_cmac.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_dh.h b/ssflib/dep/cryptocore/include/middle/cc_dh.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_dsa.h b/ssflib/dep/cryptocore/include/middle/cc_dsa.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_ecdh.h b/ssflib/dep/cryptocore/include/middle/cc_ecdh.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_ecdsa.h b/ssflib/dep/cryptocore/include/middle/cc_ecdsa.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_hmac.h b/ssflib/dep/cryptocore/include/middle/cc_hmac.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_rng.h b/ssflib/dep/cryptocore/include/middle/cc_rng.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_rsa.h b/ssflib/dep/cryptocore/include/middle/cc_rsa.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_symmetric.h b/ssflib/dep/cryptocore/include/middle/cc_symmetric.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/include/middle/cc_tdes.h b/ssflib/dep/cryptocore/include/middle/cc_tdes.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/CC_API.c b/ssflib/dep/cryptocore/source/CC_API.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_ANSI_x931.c b/ssflib/dep/cryptocore/source/base/cc_ANSI_x931.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_aes.c b/ssflib/dep/cryptocore/source/base/cc_aes.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_bignum.c b/ssflib/dep/cryptocore/source/base/cc_bignum.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_des.c b/ssflib/dep/cryptocore/source/base/cc_des.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_ecc.c b/ssflib/dep/cryptocore/source/base/cc_ecc.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_fast_math.c b/ssflib/dep/cryptocore/source/base/cc_fast_math.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_hash.c b/ssflib/dep/cryptocore/source/base/cc_hash.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_md5.c b/ssflib/dep/cryptocore/source/base/cc_md5.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_moo.c b/ssflib/dep/cryptocore/source/base/cc_moo.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_pkcs1_v21.c b/ssflib/dep/cryptocore/source/base/cc_pkcs1_v21.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_rc4.c b/ssflib/dep/cryptocore/source/base/cc_rc4.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_sha1.c b/ssflib/dep/cryptocore/source/base/cc_sha1.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_sha2.c b/ssflib/dep/cryptocore/source/base/cc_sha2.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/base/cc_snow2.c b/ssflib/dep/cryptocore/source/base/cc_snow2.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_cmac.c b/ssflib/dep/cryptocore/source/middle/cc_cmac.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_dh.c b/ssflib/dep/cryptocore/source/middle/cc_dh.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_dsa.c b/ssflib/dep/cryptocore/source/middle/cc_dsa.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_ecdh.c b/ssflib/dep/cryptocore/source/middle/cc_ecdh.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_ecdsa.c b/ssflib/dep/cryptocore/source/middle/cc_ecdsa.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_hmac.c b/ssflib/dep/cryptocore/source/middle/cc_hmac.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_rng.c b/ssflib/dep/cryptocore/source/middle/cc_rng.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_rsa.c b/ssflib/dep/cryptocore/source/middle/cc_rsa.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_symmetric.c b/ssflib/dep/cryptocore/source/middle/cc_symmetric.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/cryptocore/source/middle/cc_tdes.c b/ssflib/dep/cryptocore/source/middle/cc_tdes.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/file_op.h b/ssflib/dep/swdss/include/file_op.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/secure_file.h b/ssflib/dep/swdss/include/secure_file.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/slog.h b/ssflib/dep/swdss/include/slog.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/ss_api.h b/ssflib/dep/swdss/include/ss_api.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/ss_crypto.h b/ssflib/dep/swdss/include/ss_crypto.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/ss_misc.h b/ssflib/dep/swdss/include/ss_misc.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/ss_temp_store.h b/ssflib/dep/swdss/include/ss_temp_store.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/include/ss_types.h b/ssflib/dep/swdss/include/ss_types.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/source/file_op.cpp b/ssflib/dep/swdss/source/file_op.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/source/secure_file.cpp b/ssflib/dep/swdss/source/secure_file.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/source/ss_api.cpp b/ssflib/dep/swdss/source/ss_api.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/source/ss_crypto.cpp b/ssflib/dep/swdss/source/ss_crypto.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/source/ss_misc.cpp b/ssflib/dep/swdss/source/ss_misc.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/swdss/source/ss_temp_store.cpp b/ssflib/dep/swdss/source/ss_temp_store.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/time/ssf_time.cpp b/ssflib/dep/time/ssf_time.cpp old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/include/uci_aes_xcbc_mac.h b/ssflib/dep/uci/include/uci_aes_xcbc_mac.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/include/uci_api.h b/ssflib/dep/uci/include/uci_api.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/include/uci_cryptocore.h b/ssflib/dep/uci/include/uci_cryptocore.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/include/uci_hwcrypto.h b/ssflib/dep/uci/include/uci_hwcrypto.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/include/uci_internal.h b/ssflib/dep/uci/include/uci_internal.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/include/uci_type.h b/ssflib/dep/uci/include/uci_type.h old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/source/uci_aes_xcbc_mac.c b/ssflib/dep/uci/source/uci_aes_xcbc_mac.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/source/uci_api.c b/ssflib/dep/uci/source/uci_api.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/source/uci_cryptocore.c b/ssflib/dep/uci/source/uci_cryptocore.c old mode 100755 new mode 100644 diff --git a/ssflib/dep/uci/source/uci_hwcrypto.c b/ssflib/dep/uci/source/uci_hwcrypto.c old mode 100755 new mode 100644 diff --git a/ssflib/inc/app_debug.h b/ssflib/inc/app_debug.h old mode 100755 new mode 100644 diff --git a/ssflib/inc/ssf_client.h b/ssflib/inc/ssf_client.h old mode 100755 new mode 100644 diff --git a/ssflib/inc/ssf_lib.h b/ssflib/inc/ssf_lib.h old mode 100755 new mode 100644 diff --git a/ssflib/inc/ssf_storage.h b/ssflib/inc/ssf_storage.h old mode 100755 new mode 100644 diff --git a/ssflib/src/app_debug.c b/ssflib/src/app_debug.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_arithmetic.c b/ssflib/src/ssf_arithmetic.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_client.c b/ssflib/src/ssf_client.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_crypto.c b/ssflib/src/ssf_crypto.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_lib.c b/ssflib/src/ssf_lib.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_malloc.c b/ssflib/src/ssf_malloc.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_panic.c b/ssflib/src/ssf_panic.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_storage.c b/ssflib/src/ssf_storage.c old mode 100755 new mode 100644 diff --git a/ssflib/src/ssf_taentrypoint.c b/ssflib/src/ssf_taentrypoint.c old mode 100755 new mode 100644 -- 2.7.4 From ff9d6e958cd6665b2f370aee540caa2daa23999b Mon Sep 17 00:00:00 2001 From: Lukasz Kostyra Date: Wed, 26 Jul 2017 10:20:05 +0200 Subject: [PATCH 14/16] Import new version of Simulator sources Change-Id: I64f7524b93963128b845b35a8c216ee54c389635 --- TEEStub/PropertyAccess/Property.h | 4 + TEEStub/PropertyAccess/PropertyApi.cpp | 96 +- TEEStub/PropertyAccess/PropertyUtility.cpp | 2 +- TEEStub/PropertyAccess/PropertyUtility.h | 2 +- TEEStub/PropertyAccess/TAProperty.cpp | 51 +- TEEStub/PropertyAccess/TEEProperty.h | 2 +- TEEStub/TACommands/CommandBase.h | 2 +- TEEStub/TACommands/CommandCloseSession.cpp | 2 +- TEEStub/TACommands/CommandInvoke.cpp | 2 +- TEEStub/TACommands/SharedMemoryMap.cpp | 230 +- TEEStub/TACommands/SharedMemoryMap.h | 22 +- TEEStub/TEEStubServer/TADebug.cpp | 126 + TEEStub/teestubmain.cpp | 3 + build/TEECLib/makefile | 1 + build/TEECLib/src/subdir.mk | 12 +- build/TEEStub/TEEStubServer/subdir.mk | 13 +- build/TEEStub/makefile | 5 +- build/TEEStub/subdir.mk | 7 +- build/build.sh | 34 +- build/log/makefile | 1 + build/log/subdir.mk | 4 +- build/osal/makefile | 1 + build/osal/subdir.mk | 3 +- build/simulatordaemon/makefile | 1 + build/simulatordaemon/src/subdir.mk | 14 +- build/ssflib/dep/cryptocore/source/base/subdir.mk | 3 +- .../ssflib/dep/cryptocore/source/middle/subdir.mk | 3 +- build/ssflib/dep/cryptocore/source/subdir.mk | 4 +- build/ssflib/dep/swdss/source/subdir.mk | 3 +- build/ssflib/dep/time/subdir.mk | 3 +- build/ssflib/dep/uci/source/subdir.mk | 3 +- build/ssflib/makefile | 1 + build/ssflib/src/subdir.mk | 31 +- include/include/debug.h | 41 + include/include/log_level.h | 28 + include/include/tee_internal_api.h | 16 +- include/include/tee_sim_command.h | 1 + include/include/teestub_command_data.h | 1 + log/log.h | 2 +- osal/OsaIpc.c | 31 +- osal/OsaSem.c | 70 +- simulatordaemon/inc/Session.h | 1 - simulatordaemon/inc/TEEContext.h | 8 +- .../ResponseCommands/ResCommandInvokeCommand.cpp | 6 +- .../src/ResponseCommands/ResCommandOpenSession.cpp | 6 +- simulatordaemon/src/Session.cpp | 11 +- simulatordaemon/src/SimulatorDaemonServer.cpp | 9 - simulatordaemon/src/TABinaryManager/TAManifest.cpp | 138 +- simulatordaemon/src/TABinaryManager/TAManifest.h | 2 +- simulatordaemon/src/TAInstance.cpp | 9 +- simulatordaemon/src/TEEContext.cpp | 78 +- ssflib/dep/cryptocore/include/CC_Type.h | 11 +- ssflib/dep/cryptocore/include/test_self.h | 30 + ssflib/dep/cryptocore/source/CC_API.c | 19 +- ssflib/dep/cryptocore/source/base/cc_bignum.c | 37 +- ssflib/dep/cryptocore/source/base/cc_fast_math.c | 3 +- ssflib/dep/cryptocore/source/middle/cc_rng.c | 9 +- ssflib/dep/cryptocore/source/middle/cc_rsa.c | 12 +- ssflib/dep/cryptocore/source/middle/cc_symmetric.c | 37 +- ssflib/dep/swdss/include/slog.h | 14 +- ssflib/dep/swdss/include/ss_types.h | 6 +- ssflib/dep/uci/include/uci_aes_xcbc_mac.h | 2 +- ssflib/dep/uci/include/uci_api.h | 16 +- ssflib/dep/uci/include/uci_cryptocore.h | 10 +- ssflib/dep/uci/include/uci_type.h | 2 +- ssflib/dep/uci/source/uci_aes_xcbc_mac.c | 2 +- ssflib/dep/uci/source/uci_api.c | 31 +- ssflib/dep/uci/source/uci_cryptocore.c | 34 +- ssflib/inc/crypto_internal.h | 72 + ssflib/inc/permission.h | 51 + ssflib/inc/ssf_storage.h | 8 +- ssflib/src/{app_debug.c => app_debug.cpp} | 0 .../src/{ssf_arithmetic.c => ssf_arithmetic.cpp} | 55 +- ssflib/src/{ssf_client.c => ssf_client.cpp} | 0 ssflib/src/ssf_crypto.c | 2599 ------------------ ssflib/src/ssf_crypto.cpp | 2869 ++++++++++++++++++++ ssflib/src/{ssf_lib.c => ssf_lib.cpp} | 2 + ssflib/src/{ssf_malloc.c => ssf_malloc.cpp} | 27 +- ssflib/src/{ssf_panic.c => ssf_panic.cpp} | 0 ssflib/src/ssf_permission.cpp | 28 + ssflib/src/{ssf_storage.c => ssf_storage.cpp} | 151 +- .../{ssf_taentrypoint.c => ssf_taentrypoint.cpp} | 85 +- 82 files changed, 4230 insertions(+), 3141 deletions(-) create mode 100644 TEEStub/TEEStubServer/TADebug.cpp create mode 100644 include/include/debug.h create mode 100644 include/include/log_level.h create mode 100644 ssflib/dep/cryptocore/include/test_self.h create mode 100644 ssflib/inc/crypto_internal.h create mode 100644 ssflib/inc/permission.h rename ssflib/src/{app_debug.c => app_debug.cpp} (100%) rename ssflib/src/{ssf_arithmetic.c => ssf_arithmetic.cpp} (94%) rename ssflib/src/{ssf_client.c => ssf_client.cpp} (100%) delete mode 100644 ssflib/src/ssf_crypto.c create mode 100644 ssflib/src/ssf_crypto.cpp rename ssflib/src/{ssf_lib.c => ssf_lib.cpp} (99%) rename ssflib/src/{ssf_malloc.c => ssf_malloc.cpp} (93%) rename ssflib/src/{ssf_panic.c => ssf_panic.cpp} (100%) create mode 100644 ssflib/src/ssf_permission.cpp rename ssflib/src/{ssf_storage.c => ssf_storage.cpp} (93%) rename ssflib/src/{ssf_taentrypoint.c => ssf_taentrypoint.cpp} (57%) diff --git a/TEEStub/PropertyAccess/Property.h b/TEEStub/PropertyAccess/Property.h index a0b3519..bdfa950 100644 --- a/TEEStub/PropertyAccess/Property.h +++ b/TEEStub/PropertyAccess/Property.h @@ -45,12 +45,16 @@ public: virtual bool start() = 0; virtual void reset() = 0; virtual bool getPropertyValue(PropertyValue&) = 0; + void setPropSet(unsigned int propset) { + this->propset = propset; + }; Property() { } ; virtual ~Property() { } ; + unsigned int propset; }; #endif /* PROPERTYACCESS_PROPERTY_H_ */ diff --git a/TEEStub/PropertyAccess/PropertyApi.cpp b/TEEStub/PropertyAccess/PropertyApi.cpp index 161d18c..cb858ea 100644 --- a/TEEStub/PropertyAccess/PropertyApi.cpp +++ b/TEEStub/PropertyAccess/PropertyApi.cpp @@ -27,6 +27,7 @@ #include #include "config.h" #include +#include using namespace std; @@ -47,12 +48,15 @@ bool _allowPropertyAccess = false; * @return NULL if handle is invalid else returns valid handle */ static Property* _GetTargetProperty(TEE_PropSetHandle propsetOrEnumerator); +static uint32_t _GetTargetPropsetType(TEE_PropSetHandle propsetOrEnumerator); //GLOBAL DEFNS typedef struct { Property* property; } PropertyEnumHandle; +std::set propertyEnumHandleSet; + /*----------------------------------------------------------------------------- * Member functions *-----------------------------------------------------------------------------*/ @@ -95,6 +99,16 @@ void DeInitPropertyModule() { delete teeProperty; } +string getQueryProp(TEE_PropSetHandle propsetOrEnumerator, string name) { + size_t pos; + uint32_t propSet = _GetTargetPropsetType(propsetOrEnumerator); + if(propSet == TEE_PROPSET_CURRENT_TA && + (pos = name.rfind(".")) != string::npos) { + return name.substr(pos + 1); + } + return name; +} + //TODO: TEE_ERROR_ITEM_NOT_FOUND also to be returned when the string //received in not UTF8 encoded format //Assuming valueBufferLen is [in] param only. @@ -110,7 +124,7 @@ TEE_Result TEE_GetPropertyAsString(TEE_PropSetHandle propsetOrEnumerator, return TEE_ERROR_ITEM_NOT_FOUND; } - if (NULL != name) queryProp = string(name); + if (NULL != name) queryProp = getQueryProp(propsetOrEnumerator, name); // 1. Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(propsetOrEnumerator); @@ -153,7 +167,7 @@ TEE_Result TEE_GetPropertyAsBool(TEE_PropSetHandle propsetOrEnumerator, Property* targetProperty = NULL; PropertyValue pv; string queryProp = ""; - if (NULL != name) queryProp = string(name); + if (NULL != name) queryProp = getQueryProp(propsetOrEnumerator, name); // 1. Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(propsetOrEnumerator); @@ -186,7 +200,7 @@ TEE_Result TEE_GetPropertyAsU32(TEE_PropSetHandle propsetOrEnumerator, Property* targetProperty = NULL; PropertyValue pv; string queryProp = ""; - if (NULL != name) queryProp = string(name); + if (NULL != name) queryProp = getQueryProp(propsetOrEnumerator,name); // 1. Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(propsetOrEnumerator); @@ -206,8 +220,7 @@ TEE_Result TEE_GetPropertyAsBinaryBlock(TEE_PropSetHandle propsetOrEnumerator, Property* targetProperty = NULL; PropertyValue pv; string queryProp = ""; - if (NULL != name) queryProp = string(name); - + if (NULL != name) queryProp = getQueryProp(propsetOrEnumerator,name); // Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(propsetOrEnumerator); @@ -215,7 +228,6 @@ TEE_Result TEE_GetPropertyAsBinaryBlock(TEE_PropSetHandle propsetOrEnumerator, if (targetProperty && ((NULL != name && targetProperty->getPropertyByName(queryProp, pv)) || (NULL == name && targetProperty->getPropertyValue(pv)))) { - string binaryBlockOut; returnValue = PropertyUtility::convertToBinaryBlock(pv, binaryBlockOut); bool conversionStatus = (returnValue == TEE_SUCCESS) ? true : false; @@ -235,7 +247,7 @@ TEE_Result TEE_GetPropertyAsUUID(TEE_PropSetHandle propsetOrEnumerator, Property* targetProperty = NULL; PropertyValue pv; string queryProp = ""; - if (NULL != name) queryProp = string(name); + if (NULL != name) queryProp = getQueryProp(propsetOrEnumerator,name); // 1. Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(propsetOrEnumerator); @@ -257,7 +269,7 @@ TEE_Result TEE_GetPropertyAsIdentity(TEE_PropSetHandle propsetOrEnumerator, Property* targetProperty = NULL; PropertyValue pv; string queryProp = ""; - if (NULL != name) queryProp = string(name); + if (NULL != name) queryProp = getQueryProp(propsetOrEnumerator,name); // 1. Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(propsetOrEnumerator); @@ -276,6 +288,7 @@ TEE_Result TEE_AllocatePropertyEnumerator(TEE_PropSetHandle* enumerator) { PropertyEnumHandle *newEnumHandle = new PropertyEnumHandle; newEnumHandle->property = NULL; *enumerator = (TEE_PropSetHandle)newEnumHandle; + propertyEnumHandleSet.insert(newEnumHandle); } catch (std::bad_alloc &ba) { return TEE_ERROR_OUT_OF_MEMORY; } @@ -285,9 +298,16 @@ TEE_Result TEE_AllocatePropertyEnumerator(TEE_PropSetHandle* enumerator) { void TEE_FreePropertyEnumerator(TEE_PropSetHandle enumerator) { PropertyEnumHandle* enumeratorHandle = (PropertyEnumHandle*)enumerator; if (enumeratorHandle) { - delete enumeratorHandle->property; - enumeratorHandle = NULL; - delete enumeratorHandle; + set::iterator it = propertyEnumHandleSet.find((PropertyEnumHandle*)enumerator); + if(it != propertyEnumHandleSet.end()) + { + propertyEnumHandleSet.erase(it); + delete enumeratorHandle->property; + delete enumeratorHandle; + } + else { + TEE_Panic(0); + } } } @@ -296,7 +316,7 @@ void TEE_FreePropertyEnumerator(TEE_PropSetHandle enumerator) { void TEE_StartPropertyEnumerator(TEE_PropSetHandle enumerator, TEE_PropSetHandle propSet) { PropertyEnumHandle *newEnumHandle = (PropertyEnumHandle*)enumerator; - switch ((intptr_t)propSet) { + switch ((uint32_t)propSet) { case TEE_PROPSET_CURRENT_TA: { newEnumHandle->property = new TAProperty( string(TEE_TASTORE_ROOT) + thisTAUUIDGlobal + "-ext/" @@ -324,7 +344,8 @@ void TEE_StartPropertyEnumerator(TEE_PropSetHandle enumerator, } } - if (newEnumHandle && newEnumHandle->property) + newEnumHandle->property->setPropSet((uint32_t)propSet); + if (newEnumHandle && newEnumHandle->property) newEnumHandle->property->start(); } @@ -342,7 +363,6 @@ TEE_Result TEE_GetPropertyName(TEE_PropSetHandle enumerator, void* nameBuffer, // 1. Select the enumerator object based on propset or consider given enumerator // if any targetProperty = _GetTargetProperty(enumerator); - PropertyEnumHandle* enumeratorHandle = (PropertyEnumHandle*)enumerator; // Check if enumerator and property are valid //if (enumeratorHandle && enumeratorHandle->property) { @@ -354,12 +374,8 @@ TEE_Result TEE_GetPropertyName(TEE_PropSetHandle enumerator, void* nameBuffer, strncpy((char*)nameBuffer, propName.c_str(), *nameBufferLen); } // item not found or enumerator end has reached - else { - return TEE_ERROR_ITEM_NOT_FOUND; - } - } else { - return TEE_ERROR_ITEM_NOT_FOUND; - } + else return TEE_ERROR_ITEM_NOT_FOUND; + } else return TEE_ERROR_ITEM_NOT_FOUND; return TEE_SUCCESS; } @@ -370,12 +386,31 @@ TEE_Result TEE_GetNextProperty(TEE_PropSetHandle enumerator) { && enumeratorHandle->property->getNextProperty()) { return TEE_SUCCESS; } else return TEE_ERROR_ITEM_NOT_FOUND; +} +uint32_t _GetTargetPropsetType(TEE_PropSetHandle propsetOrEnumerator) { + switch ((uint32_t)propsetOrEnumerator) { + case TEE_PROPSET_TEE_IMPLEMENTATION: + case TEE_PROPSET_CURRENT_CLIENT: + case TEE_PROPSET_CURRENT_TA: + return (uint32_t)propsetOrEnumerator; + } + set::iterator it = + propertyEnumHandleSet.find((PropertyEnumHandle*)propsetOrEnumerator); + if(it != propertyEnumHandleSet.end()) { + Property *targetProperty = NULL; + PropertyEnumHandle *enumHandle = + (PropertyEnumHandle*)propsetOrEnumerator; + if (enumHandle && enumHandle->property) + targetProperty = enumHandle->property; + return targetProperty->propset; + } + return 0; } Property* _GetTargetProperty(TEE_PropSetHandle propsetOrEnumerator) { Property *targetProperty = NULL; - switch ((intptr_t)propsetOrEnumerator) { + switch ((uint32_t)propsetOrEnumerator) { case TEE_PROPSET_TEE_IMPLEMENTATION: { targetProperty = teeProperty; break; @@ -392,14 +427,17 @@ Property* _GetTargetProperty(TEE_PropSetHandle propsetOrEnumerator) { targetProperty = taProperty; break; } -/* default: { - PropertyEnumHandle *newEnumHandle = - (PropertyEnumHandle*)propsetOrEnumerator; - - if (newEnumHandle && newEnumHandle->property) - targetProperty = newEnumHandle->property; - break; + } + if(targetProperty == NULL) { + set::iterator it = + propertyEnumHandleSet.find((PropertyEnumHandle*)propsetOrEnumerator); + if(it != propertyEnumHandleSet.end()) { + PropertyEnumHandle *enumHandle = + (PropertyEnumHandle*)propsetOrEnumerator; + if (enumHandle && enumHandle->property) + targetProperty = enumHandle->property; } -*/ } + } return targetProperty; } + diff --git a/TEEStub/PropertyAccess/PropertyUtility.cpp b/TEEStub/PropertyAccess/PropertyUtility.cpp index 7603aa0..7a13f5a 100644 --- a/TEEStub/PropertyAccess/PropertyUtility.cpp +++ b/TEEStub/PropertyAccess/PropertyUtility.cpp @@ -117,7 +117,7 @@ TEE_Result PropertyUtility::convertToUUID(const PropertyValue& in, string tokensString[8]; int i = 0; for (i = 0; i < 8; i++) { - strncpy(&tokensString[i][0], &text[4 * i], 4); + tokensString[i] = text.substr(4*i, 4); } // convert each token sscanf((tokensString[0] + tokensString[1]).c_str(), "%8x", &uuid.timeLow); diff --git a/TEEStub/PropertyAccess/PropertyUtility.h b/TEEStub/PropertyAccess/PropertyUtility.h index a74eaca..88da10f 100644 --- a/TEEStub/PropertyAccess/PropertyUtility.h +++ b/TEEStub/PropertyAccess/PropertyUtility.h @@ -23,7 +23,7 @@ * Include files *-----------------------------------------------------------------------------*/ #include "tee_internal_api.h" -#include "log.h" +#include #include #include #include diff --git a/TEEStub/PropertyAccess/TAProperty.cpp b/TEEStub/PropertyAccess/TAProperty.cpp index 0fcb988..5b4f2d7 100644 --- a/TEEStub/PropertyAccess/TAProperty.cpp +++ b/TEEStub/PropertyAccess/TAProperty.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include using namespace rapidxml; @@ -40,7 +42,6 @@ using namespace rapidxml; TAProperty::TAProperty(string filePath) { currentItr = propertiesMap.begin(); this->filePath = filePath; - } /** @@ -69,19 +70,65 @@ bool TAProperty::readPropertyFile() { string type; //1a. Get property value newValue.value = attr->value(); - + string typeName = attr->name(); //1b. Identify type // TODO: UUID type to be added yet if (PropertyUtility::isNumber(newValue.value)) { type = "integer"; } else if (newValue.value == "true" || newValue.value == "false") type = "boolean"; + else if (typeName == "appID") + type = "uuid"; else type = "string"; + //1c. Assign type identified newValue.type = type; //2. Assign property value to map propertiesMap[attr->name()] = newValue; } + + xml_node<> *policyName; + xml_node<> *permissionName; + xml_node<> *childnode; + unsigned int permissionValue = 0; + + policyName = doc.first_node("manifest")->first_node("policy"); + + if (policyName != NULL) { + PropertyValue newValue; + string type = "integer"; + + permissionName = policyName->first_node("permission"); + if(permissionName != NULL) { + for (childnode = policyName->first_node("permission")->first_node("uses-permission"); childnode; childnode = childnode->next_sibling()) { + if (!strncmp(childnode->first_attribute()->value(), "system.permission.CRYPTO", + strlen("system.permission.CRYPTO"))) { + permissionValue |= PERM_CRYPTO; + } else if (!strncmp(childnode->first_attribute()->value(), "system.permission.STORAGE", + strlen("system.permission.STORAGE"))) { + permissionValue |= PERM_STORAGE; + } else if (!strncmp(childnode->first_attribute()->value(), "system.permission.DISPLAY", + strlen("system.permission.DISPLAY"))) { + permissionValue |= PERM_DISPLAY; + } else if (!strncmp(childnode->first_attribute()->value(), "system.permission.NETWORK", + strlen("system.permission.NETWORK"))) { + permissionValue |= PERM_NETWORK; + } else if (!strncmp(childnode->first_attribute()->value(), "system.permission.TIME", + strlen("system.permission.TIME"))) { + permissionValue |= PERM_TIME; + } else if (!strncmp(childnode->first_attribute()->value(), "system.permission.ARITHMETIC", + strlen("system.permission.ARITHMETIC"))) { + permissionValue |= PERM_ARITHMETIC; + } + } + } + + std::stringstream ss; + ss << permissionValue; + newValue.type = type; + newValue.value = ss.str(); + propertiesMap["permission"] = newValue; + } } // Catch rapid xml errors catch (rapidxml::parse_error &e) { diff --git a/TEEStub/PropertyAccess/TEEProperty.h b/TEEStub/PropertyAccess/TEEProperty.h index 690c8c2..0403643 100644 --- a/TEEStub/PropertyAccess/TEEProperty.h +++ b/TEEStub/PropertyAccess/TEEProperty.h @@ -23,7 +23,7 @@ * Include files *-----------------------------------------------------------------------------*/ #include -#include "log.h" +#include #include /*----------------------------------------------------------------------------- diff --git a/TEEStub/TACommands/CommandBase.h b/TEEStub/TACommands/CommandBase.h index d7048d3..c63f8d2 100644 --- a/TEEStub/TACommands/CommandBase.h +++ b/TEEStub/TACommands/CommandBase.h @@ -24,7 +24,7 @@ *-----------------------------------------------------------------------------*/ #include "tee_sim_command.h" #include "tee_internal_api.h" -#include "log.h" +#include #include "boost/shared_ptr.hpp" #include #include diff --git a/TEEStub/TACommands/CommandCloseSession.cpp b/TEEStub/TACommands/CommandCloseSession.cpp index 5f9cf27..0dd05dc 100644 --- a/TEEStub/TACommands/CommandCloseSession.cpp +++ b/TEEStub/TACommands/CommandCloseSession.cpp @@ -41,7 +41,7 @@ CommandCloseSession::CommandCloseSession(CloseTASessionData data) : */ TEE_Result CommandCloseSession::execute() { TOGGLE_PROPERTY_ACCESS; - TA_CloseSessionEntryPoint(&sessionContext); + TA_CloseSessionEntryPoint(sessionContext); LOGD(TEE_STUB, "TA_CloseSessionEntryPoint done"); TOGGLE_PROPERTY_ACCESS; return TEE_SUCCESS; diff --git a/TEEStub/TACommands/CommandInvoke.cpp b/TEEStub/TACommands/CommandInvoke.cpp index 86a22cb..88feca8 100644 --- a/TEEStub/TACommands/CommandInvoke.cpp +++ b/TEEStub/TACommands/CommandInvoke.cpp @@ -53,7 +53,7 @@ TEE_Result CommandInvoke::execute() { TOGGLE_PROPERTY_ACCESS; sharedResult = SharedMemoryMap::allocateSharedMemory(data.op); if (sharedResult) { - data.returnValue = TA_InvokeCommandEntryPoint(&sessionContext, + data.returnValue = TA_InvokeCommandEntryPoint(sessionContext, data.commandID, data.op.paramTypes, data.op.params); LOGD(TEE_STUB, "TA_InvokeCommandEntryPoint done"); } else { diff --git a/TEEStub/TACommands/SharedMemoryMap.cpp b/TEEStub/TACommands/SharedMemoryMap.cpp index 0122085..db31401 100644 --- a/TEEStub/TACommands/SharedMemoryMap.cpp +++ b/TEEStub/TACommands/SharedMemoryMap.cpp @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include using namespace std; /*----------------------------------------------------------------------------- @@ -31,7 +34,7 @@ using namespace std; #define PAGE_SIZE 0x1000 #define PAGE_MASK (~(PAGE_SIZE - 1)) -map SharedMemoryMap::shmMap; +map SharedMemoryMap::shmMap; /*----------------------------------------------------------------------------- * Member functions @@ -41,8 +44,8 @@ map SharedMemoryMap::shmMap; * @param key[in] Shared memory key * @param pBuffer[in] Pointer to shared memory */ -void SharedMemoryMap::addToMap(const uint32_t key, void* pBuffer) { - shmMap[key] = pBuffer; +void SharedMemoryMap::addToMap(const uint32_t key, pRegisterItem reg) { + shmMap[key] = *reg; } /** @@ -51,9 +54,10 @@ void SharedMemoryMap::addToMap(const uint32_t key, void* pBuffer) { * @return true if successfully detached else false. */ bool SharedMemoryMap::deleteFromMap(uint32_t key) { - map::iterator it = shmMap.find(key); + map::iterator it = shmMap.find(key); if (it != shmMap.end()) { - if (-1 != shmdt(it->second)) { + registerItem item = it->second; + if (-1 != shmdt(item.pBuffer)) { shmMap.erase(it); return true; } else return false; @@ -62,6 +66,93 @@ bool SharedMemoryMap::deleteFromMap(uint32_t key) { } /** + * Verify that the key exists + * @param key[in] Shared memory key + * @param reg[out] Pointer to registerItem + */ +bool SharedMemoryMap::isExist(uint32_t key, pRegisterItem reg) +{ + map::iterator it = shmMap.find(key); + if (it != shmMap.end()) { + if(reg != 0) + *reg = it->second; + return true; + } + return false; +} + +void* SharedMemoryMap::newOnceSharedMemory(uint32_t size) { + static uint32_t add_value = 0; + if(++add_value == 10000) add_value = 0; + srand(time(NULL) + add_value + (uint32_t)&size); + uint32_t useKey = rand(); + + //uint32_t useKey = (uint32_t)&size; + while(isExist(useKey, 0)) + { + LOGD(TEE_STUB, "Exist Key(%u)",useKey); + useKey += 1; + } + LOGD(TEE_STUB, "Key for shm(size : %u) : %u", size, useKey); + + bool sharedResult = true; + uint32_t shmid = shmget(useKey, size, IPC_CREAT | 0666); + if(shmid <= 0) + { + LOGE(TEE_STUB, "shmid failed(%d)",(int32_t)shmid); + sharedResult = false; + } + /* Allocate page aligned buffer */ + if (size < PAGE_SIZE) { + size = PAGE_SIZE; + } else if (size & (PAGE_SIZE - 1)) { + size = (size & ~(PAGE_SIZE - 1)) + PAGE_SIZE; + } + size = (size + (PAGE_SIZE - 1)) & PAGE_MASK; + void* buffer = (void*)shmat(shmid, NULL, 0); + if (buffer == (void*)-1) { + LOGE(TEE_STUB, "shmat failed(%d(shmid:%d))",(int32_t)buffer, shmid); + sharedResult = false; + } + if (!buffer) { + LOGE(TEE_STUB, "allocate failed"); + sharedResult = false; + } + + if(sharedResult != false) { + registerItem item; + item.pBuffer = buffer; + item.size = size; + // Add shared memory allocated to shared memory map so that + // it can be detached on closing the sessions or exiting the TA + SharedMemoryMap::addToMap(useKey, &item); + LOGD(TEE_STUB, "newOnceSharedMemory return %p(size:%u)", buffer, size); + return buffer; + } + LOGE(TEE_STUB, "newOnceSharedMemory return NULL"); + return 0; +} + +bool SharedMemoryMap::deleteOnceSharedMemory(void* buffer) { + for (map::iterator it = shmMap.begin(); it != shmMap.end(); + it++) { + registerItem item = it->second; + if(buffer == item.pBuffer) { + if (-1 != shmdt(item.pBuffer)) { + LOGD(TEE_STUB, "deleteOnceSharedMemory return true(%p(%u))",item.pBuffer, item.size); + shmMap.erase(it); + return true; + } else { + LOGE(TEE_STUB, "deleteOnceSharedMemory return false(shmdt return fail %p)", buffer); + return false; + } + } + } + LOGE(TEE_STUB, "deleteOnceSharedMemory return false(can not find %p)", buffer); + return false; +} + +/** * Allocates shared memory from a pre-shared key * @param op Operation values which contain param types and params. * @return true if shared memory was successfully created else false. @@ -76,30 +167,44 @@ bool SharedMemoryMap::allocateSharedMemory(Operation &op) { && (type != TEE_PARAM_TYPE_VALUE_INOUT) && (type != TEE_PARAM_TYPE_NONE)) { uint32_t size = op.params[i].memref.size; - uint32_t shmid = shmget(op.shmID[i], size, 0666); - - //LOGD(TEE_STUB, "SHM KEY: %d SHM ID: %d", op.shmID[i], shmid); - /* Allocate page aligned buffer */ - if (size < PAGE_SIZE) { - size = PAGE_SIZE; - } else if (size & (PAGE_SIZE - 1)) { - size = (size & ~(PAGE_SIZE - 1)) + PAGE_SIZE; + uint32_t offset = op.shmOffset[i]; + registerItem item; + if(SharedMemoryMap::isExist(op.shmID[i], &item)) + { + op.params[i].memref.buffer = + (void*)((char*)item.pBuffer + offset); } - size = (size + (PAGE_SIZE - 1)) & PAGE_MASK; - op.params[i].memref.buffer = (void*)shmat(shmid, NULL, 0); - if (op.params[i].memref.buffer == (void*)-1) { - LOGE(TEE_STUB, "shmat failed"); - sharedResult = false; - } - if (!op.params[i].memref.buffer) { - LOGE(TEE_STUB, "allocate failed"); - sharedResult = false; - } - //memset(op.params[i].memref.buffer, 0x00, size); + else + { + uint32_t shmid = shmget(op.shmID[i], size, 0666); + /* Allocate page aligned buffer */ + if (size < PAGE_SIZE) { + size = PAGE_SIZE; + } else if (size & (PAGE_SIZE - 1)) { + size = (size & ~(PAGE_SIZE - 1)) + PAGE_SIZE; + } + size = (size + (PAGE_SIZE - 1)) & PAGE_MASK; + op.params[i].memref.buffer = (void*)shmat(shmid, NULL, 0); + if (op.params[i].memref.buffer == (void*)-1) { + LOGE(TEE_STUB, "shmat failed"); + sharedResult = false; + } + if (!op.params[i].memref.buffer) { + LOGE(TEE_STUB, "allocate failed"); + sharedResult = false; + } - // Add shared memory allocated to shared memory map so that - // it can be detached on closing the sessions or exiting the TA - SharedMemoryMap::addToMap(op.shmID[i], op.params[i].memref.buffer); + if(sharedResult != false) { + registerItem item; + item.pBuffer = op.params[i].memref.buffer; + item.size = size; + op.params[i].memref.buffer = + (void*)(((char*)op.params[i].memref.buffer) + offset); + // Add shared memory allocated to shared memory map so that + // it can be detached on closing the sessions or exiting the TA + SharedMemoryMap::addToMap(op.shmID[i], &item); + } + } } } return sharedResult; @@ -123,9 +228,11 @@ bool SharedMemoryMap::deleteSharedMemory(Operation &op) { LOGE(TEE_STUB, "de-allocate failed"); sharedResult = false; } - // Add shared memory allocated to shared memory map so that - // it can be detached on closing the sessions or exiting the TA - SharedMemoryMap::deleteFromMap(op.shmID[i]); + if(sharedResult != false) { + // Add shared memory allocated to shared memory map so that + // it can be detached on closing the sessions or exiting the TA + SharedMemoryMap::deleteFromMap(op.shmID[i]); + } } } return sharedResult; @@ -138,17 +245,55 @@ bool SharedMemoryMap::deleteSharedMemory(Operation &op) { */ bool SharedMemoryMap::deleteAllSharedMemory() { bool sharedResult = true; - for (map::iterator it = shmMap.begin(); it != shmMap.end(); + for (map::iterator it = shmMap.begin(); it != shmMap.end(); it++) { - if (-1 == shmdt(it->second)) { + registerItem item = it->second; + LOGE(TEE_STUB, "item will be free(%p(%u))",item.pBuffer, item.size); + if (-1 == shmdt(item.pBuffer)) { sharedResult = false; } + LOGE(TEE_STUB, "item will be free end(%p(%u))",item.pBuffer, item.size); } return sharedResult; } -bool deleteAllSharedMemory() { - return SharedMemoryMap::deleteAllSharedMemory(); +char* SharedMemoryMap::getSharedMemoryAddress(uint32_t shmID) { + for (map::iterator it = shmMap.begin(); it != shmMap.end(); + it++) { + if (it->first == shmID) { + registerItem item = it->second; + return (char*)item.pBuffer; + } + } + return 0; +} + +uint32_t SharedMemoryMap::getSharedMemoryShmID(void* buffer) { + for (map::iterator it = shmMap.begin(); it != shmMap.end(); + it++) { + registerItem item = it->second; + if(item.pBuffer == buffer) + return it->first; + } + return 0; +} + +uint32_t SharedMemoryMap::getSharedMemorySize(void* buffer) { + for (map::iterator it = shmMap.begin(); it != shmMap.end(); + it++) { + registerItem item = it->second; + if(item.pBuffer == buffer) + return item.size; + } + return 0; +} + +void* newOnceSharedMemory(uint32_t size) { + return SharedMemoryMap::newOnceSharedMemory(size); +} + +bool deleteOnceSharedMemory(void* buffer) { + return SharedMemoryMap::deleteOnceSharedMemory(buffer); } bool allocateSharedMemory(Operation &op) { @@ -158,3 +303,20 @@ bool allocateSharedMemory(Operation &op) { bool deleteSharedMemory(Operation &op) { return SharedMemoryMap::deleteSharedMemory(op); } + +bool deleteAllSharedMemory() { + return SharedMemoryMap::deleteAllSharedMemory(); +} + +char* getSharedMemoryAddress(uint32_t shmID) { + return SharedMemoryMap::getSharedMemoryAddress(shmID); +} + +uint32_t getSharedMemoryShmID(void* buffer) { + return SharedMemoryMap::getSharedMemoryShmID(buffer); +} + +uint32_t getSharedMemorySize(void* buffer) { + return SharedMemoryMap::getSharedMemorySize(buffer); +} + diff --git a/TEEStub/TACommands/SharedMemoryMap.h b/TEEStub/TACommands/SharedMemoryMap.h index 098768f..b53afff 100644 --- a/TEEStub/TACommands/SharedMemoryMap.h +++ b/TEEStub/TACommands/SharedMemoryMap.h @@ -23,12 +23,16 @@ * Include files *-----------------------------------------------------------------------------*/ #include -#include "log.h" #include "tee_internal_api.h" #include "tee_sim_command.h" using namespace std; +typedef struct _registerItem { + void* pBuffer; + uint32_t size; +}registerItem, *pRegisterItem; + /*----------------------------------------------------------------------------- * Class definitions *-----------------------------------------------------------------------------*/ @@ -41,20 +45,30 @@ using namespace std; */ class SharedMemoryMap { private: - // map - static map shmMap; - static void addToMap(const uint32_t key, void* shmid); + static map shmMap; + static void addToMap(const uint32_t key, pRegisterItem reg); static bool deleteFromMap(uint32_t key); + static bool isExist(uint32_t key, pRegisterItem reg); public: + static void* newOnceSharedMemory(uint32_t size); + static bool deleteOnceSharedMemory(void* buffer); static bool allocateSharedMemory(Operation &op); static bool deleteSharedMemory(Operation &op); static bool deleteAllSharedMemory(); + static char* getSharedMemoryAddress(uint32_t shmID); + static uint32_t getSharedMemoryShmID(void* buffer); + static uint32_t getSharedMemorySize(void* buffer); }; extern "C" { +void* newOnceSharedMemory(uint32_t size); +bool deleteOnceSharedMemory(void* buffer); bool allocateSharedMemory(Operation &op); bool deleteSharedMemory(Operation &op); bool deleteAllSharedMemory(); +char* getSharedMemoryAddress(uint32_t shmID); +uint32_t getSharedMemoryShmID(void* buffer); +uint32_t getSharedMemorySize(void* buffer); } #endif /* TACOMMANDS_SHAREDMEMORYMAP_H_ */ diff --git a/TEEStub/TEEStubServer/TADebug.cpp b/TEEStub/TEEStubServer/TADebug.cpp new file mode 100644 index 0000000..bf5a7f2 --- /dev/null +++ b/TEEStub/TEEStubServer/TADebug.cpp @@ -0,0 +1,126 @@ +/* + * ===================================================================================== + * + * Filename: TADebug.cpp + * + * Description: ta debug function + * + * Version: 1.0 + * Revision: Original + * Compiler: gcc + * + * Author: jklolo.lee@samsung.com + * Organization: Samsung Electronics + * + * ===================================================================================== + */ + +/*----------------------------------------------------------------------------- + * Include files + *-----------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include +#include + +#define LOG_LABEL_SIZE 64 +#define LOG_BUFFER_SIZE 4096 + +static int level = TA_LOG_LEVEL; +static char log_label[LOG_LABEL_SIZE]; +static char log_one_buffer[LOG_BUFFER_SIZE]; + +extern "C" void setDebugLogName(const char* __name); +extern "C" int __logger_log(const char* tag, const usr_log_level lv, + const char* fmt, const char* function, + const int line, ...) +{ + va_list args; + int len = 0; + + if(fmt == NULL || function == NULL) + return 0; + + if(tag != NULL && strlen(log_label) == 0) + setDebugLogName(tag); + + if(level >= lv && level != LOG_SILENT) { + log_priority dlog_level = DLOG_DEBUG; + switch(lv) + { + case LOG_DEBUG: + dlog_level = DLOG_DEBUG; + break; + case LOG_INFO: + case LOG_NOTICE: + dlog_level = DLOG_INFO; + break; + case LOG_WARNING: + dlog_level = DLOG_WARN; + break; + case LOG_ERR: + case LOG_CRIT: + case LOG_ALERT: + case LOG_EMERG: + dlog_level = DLOG_ERROR; + break; + default: + break; + } + + va_start(args, line); + len = vsnprintf(log_one_buffer, sizeof(log_one_buffer), fmt, args); + va_end(args); + len += strlen(log_label); + dlog_print(dlog_level, log_label, "%s\n", log_one_buffer); + printf("[%s] %s %d : %s\n", + log_label, function, line, log_one_buffer); + } + return len; +} + +extern "C" void initDebugLogLevel(const char* fmt, ...) +{ + va_list args; + va_start(args, fmt); + __logger_log("Level", LOG_DEBUG, fmt, __FILE__, __LINE__, args); + va_end(args); +} + +extern "C" void setDebugLogLevelNum(const usr_log_level __level) +{ + level = __level; +} + +extern "C" int getDebugLogLevelNum(void) +{ + return level; +} + +extern "C" void setDebugLogLevel(const char* __level) +{ + if(__level != NULL) + level = atoi(__level); +} + +extern "C" void setDebugLogName(const char* __name) +{ + if(__name == NULL) + return; + + strncpy(log_label, __name, sizeof(log_label)-1); + log_label[sizeof(log_label)-1] = 0; +} + +extern "C" void getDebugLogName(char* __name) +{ + if(__name != NULL) + { + int length = strlen(log_label); + strncpy(__name, log_label, length); + __name[length] = '\0'; + } +} + diff --git a/TEEStub/teestubmain.cpp b/TEEStub/teestubmain.cpp index 9f1a9b6..c87be23 100644 --- a/TEEStub/teestubmain.cpp +++ b/TEEStub/teestubmain.cpp @@ -70,6 +70,9 @@ int main(int argc, char* argv[]) { if (argc < 2) { LOGE(TEE_STUB, "Invalid arguments to TEE Stub"); } + //for export function + getSharedMemoryAddress(0); + // Initialize Properties module // TODO: fetch login method from Context, not to be hardcoded TEE_Result initStatus; diff --git a/build/TEECLib/makefile b/build/TEECLib/makefile index 75048f7..7c44a62 100755 --- a/build/TEECLib/makefile +++ b/build/TEECLib/makefile @@ -2,6 +2,7 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux +TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ diff --git a/build/TEECLib/src/subdir.mk b/build/TEECLib/src/subdir.mk index 5bdd5c9..a6539e2 100644 --- a/build/TEECLib/src/subdir.mk +++ b/build/TEECLib/src/subdir.mk @@ -1,23 +1,21 @@ -# Add inputs and outputs from these tool invocations to the build variables +# Add inputs and outputs from these tool invocations to the build variables C_SRCS += \ $(TEECLIB_SOURCE)/src/teec_api.c \ -$(TEECLIB_SOURCE)/src/teec_connection.c +$(TEECLIB_SOURCE)/src/teec_connection.c OBJS += \ ./src/teec_api.o \ -./src/teec_connection.o +./src/teec_connection.o C_DEPS += \ ./src/teec_api.d \ -./src/teec_connection.d - -C_FLAGS += -fPIC +./src/teec_connection.d # Each subdirectory must supply rules for building sources it contributes src/%.o: $(TEECLIB_SOURCE)/src/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/TEEStub/TEEStubServer/subdir.mk b/build/TEEStub/TEEStubServer/subdir.mk index 4e40be9..9cd6bcb 100644 --- a/build/TEEStub/TEEStubServer/subdir.mk +++ b/build/TEEStub/TEEStubServer/subdir.mk @@ -1,25 +1,28 @@ -# Add inputs and outputs from these tool invocations to the build variables +# Add inputs and outputs from these tool invocations to the build variables CPP_SRCS += \ $(TEESTUB_SOURCE)/TEEStubServer/ConnectionSession.cpp \ $(TEESTUB_SOURCE)/TEEStubServer/TAProperty.cpp \ -$(TEESTUB_SOURCE)/TEEStubServer/TEEStubServer.cpp +$(TEESTUB_SOURCE)/TEEStubServer/TEEStubServer.cpp \ +$(TEESTUB_SOURCE)/TEEStubServer/TADebug.cpp OBJS += \ ./TEEStubServer/ConnectionSession.o \ ./TEEStubServer/TAProperty.o \ -./TEEStubServer/TEEStubServer.o +./TEEStubServer/TEEStubServer.o \ +./TEEStubServer/TADebug.o CPP_DEPS += \ ./TEEStubServer/ConnectionSession.d \ ./TEEStubServer/TAProperty.d \ -./TEEStubServer/TEEStubServer.d +./TEEStubServer/TEEStubServer.d \ +./TEEStubServer/TADebug.d # Each subdirectory must supply rules for building sources it contributes TEEStubServer/%.o: $(TEESTUB_SOURCE)/TEEStubServer/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -Ldlog -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/TEEStub/makefile b/build/TEEStub/makefile index 4ec32ee..e007903 100755 --- a/build/TEEStub/makefile +++ b/build/TEEStub/makefile @@ -2,6 +2,7 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux +TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr @@ -44,7 +45,7 @@ endif -include ../makefile.defs -# Add inputs and outputs from these tool invocations to the build variables +# Add inputs and outputs from these tool invocations to the build variables # All Target all: libTEEStub.a @@ -53,7 +54,7 @@ all: libTEEStub.a libTEEStub.a: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' @echo 'Invoking: GCC Archiver' - $(TOOLCHAIN)ar -r "libTEEStub.a" $(OBJS) $(USER_OBJS) $(LIBS) ../log/log.o + $(TOOLCHAIN)ar -r "libTEEStub.a" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' diff --git a/build/TEEStub/subdir.mk b/build/TEEStub/subdir.mk index ff324bd..815be7e 100644 --- a/build/TEEStub/subdir.mk +++ b/build/TEEStub/subdir.mk @@ -3,18 +3,17 @@ CPP_SRCS += \ $(TEESTUB_SOURCE)/teestubmain.cpp OBJS += \ -./teestubmain.o +./teestubmain.o CPP_DEPS += \ -./teestubmain.d +./teestubmain.d # Each subdirectory must supply rules for building sources it contributes %.o: $(TEESTUB_SOURCE)/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" -g + $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' - diff --git a/build/build.sh b/build/build.sh index c0bc759..4eac26d 100755 --- a/build/build.sh +++ b/build/build.sh @@ -23,10 +23,6 @@ SSFLIB_PATH=$DIR/ssflib TEESTUB_PATH=$DIR/TEEStub SIMDAEMON_PATH=$DIR/simulatordaemon Package=$2 -TOOLCHAIN=$3 - -CA_SIMULATOR_LIB=$Package/CA/simulator/usr/lib/ -TA_SIMULATOR_LIB=$Package/TA/simulator/usr/lib/ #check error case check_make_error() @@ -68,7 +64,7 @@ build_log() cd $LOG_PATH make clean check_make_error -make TOOLCHAIN=$TOOLCHAIN +make check_make_error cd $DIR } @@ -78,7 +74,7 @@ build_osal() cd $OSAL_PATH make clean check_make_error -make TOOLCHAIN=$TOOLCHAIN +make check_make_error cd $DIR } @@ -88,11 +84,10 @@ build_libteec() cd $TEECLIB_PATH make clean check_make_error -make TOOLCHAIN=$TOOLCHAIN +make check_make_error echo "Copying libteec.so in Package" -mkdir -p $CA_SIMULATOR_LIB -cp libteec2.so $CA_SIMULATOR_LIB +cp libteec2.so $Package/CA/simulator/usr/lib/ check_make_error cd $DIR } @@ -102,11 +97,10 @@ build_ssflib() cd $SSFLIB_PATH make clean check_make_error -make TOOLCHAIN=$TOOLCHAIN +make check_make_error echo "Copying libssflib.so in Package" -mkdir -p $TA_SIMULATOR_LIB -cp libssflib.so $TA_SIMULATOR_LIB +cp libssflib.so $Package/TA/simulator/usr/lib/ check_make_error cd $DIR } @@ -116,11 +110,10 @@ build_teestub() cd $TEESTUB_PATH make clean check_make_error -make TOOLCHAIN=$TOOLCHAIN +make check_make_error echo "Copying libTEEStub.a in Package" -mkdir -p $TA_SIMULATOR_LIB -cp libTEEStub.a $TA_SIMULATOR_LIB +cp libTEEStub.a $Package/TA/simulator/usr/lib/ check_make_error cd $DIR } @@ -130,11 +123,10 @@ build_simdaemon() cd $SIMDAEMON_PATH make clean check_make_error -make TOOLCHAIN=$TOOLCHAIN +make check_make_error echo "Copying SimulatorDaemon in Package" -mkdir -p $CA_SIMULATOR_LIB -cp SimulatorDaemon $CA_SIMULATOR_LIB +cp SimulatorDaemon $Package/CA/simulator/usr/lib/ check_make_error cd $DIR } @@ -144,8 +136,8 @@ cd $DIR echo_invalid() { echo "Simulator Build script Invalid arguments -Format: ./build.sh -Example:./build.sh buildall ~/Package \"\" +Format: ./build.sh +Example:./build.sh buildall ~/Package log : Build Logger module @@ -160,7 +152,7 @@ Example:./build.sh buildall ~/Package \"\" } # Verify number of arguments to build.sh -if [[ "$#" -ne 3 ]]; then +if [[ "$#" -ne 2 ]]; then echo "Illegal number of arguments" echo_invalid exit 0 diff --git a/build/log/makefile b/build/log/makefile index 2466dac..c351a93 100755 --- a/build/log/makefile +++ b/build/log/makefile @@ -2,6 +2,7 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux +TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ LOG_SOURCE = ../../log diff --git a/build/log/subdir.mk b/build/log/subdir.mk index 42ea68f..354843c 100644 --- a/build/log/subdir.mk +++ b/build/log/subdir.mk @@ -8,13 +8,11 @@ OBJS += \ C_DEPS += \ ./log.d -C_FLAGS += -fPIC - # Each subdirectory must supply rules for building sources it contributes %.o: $(LOG_SOURCE)/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/osal/makefile b/build/osal/makefile index 3a815f0..af05f50 100755 --- a/build/osal/makefile +++ b/build/osal/makefile @@ -2,6 +2,7 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux +TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ OSAL_SOURCE = ../../osal diff --git a/build/osal/subdir.mk b/build/osal/subdir.mk index f508fed..4f05c36 100644 --- a/build/osal/subdir.mk +++ b/build/osal/subdir.mk @@ -23,13 +23,12 @@ C_DEPS += \ ./OsaSignal.d \ ./OsaTask.d -C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes %.o: $(OSAL_SOURCE)/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/simulatordaemon/makefile b/build/simulatordaemon/makefile index d3ab23c..7e56eaa 100755 --- a/build/simulatordaemon/makefile +++ b/build/simulatordaemon/makefile @@ -2,6 +2,7 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux +TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ diff --git a/build/simulatordaemon/src/subdir.mk b/build/simulatordaemon/src/subdir.mk index a34517c..3ce8aac 100644 --- a/build/simulatordaemon/src/subdir.mk +++ b/build/simulatordaemon/src/subdir.mk @@ -2,14 +2,12 @@ CPP_SRCS += \ $(SIMDAEMON_SOURCE)/src/ConnectionSession.cpp \ $(SIMDAEMON_SOURCE)/src/Session.cpp \ -$(SIMDAEMON_SOURCE)/src/SecurityChecker.cpp \ $(SIMDAEMON_SOURCE)/src/SimulatorDaemon.cpp \ $(SIMDAEMON_SOURCE)/src/SimulatorDaemonServer.cpp \ $(SIMDAEMON_SOURCE)/src/TAFactory.cpp \ $(SIMDAEMON_SOURCE)/src/TAInstance.cpp \ $(SIMDAEMON_SOURCE)/src/TEEContext.cpp \ -$(SIMDAEMON_SOURCE)/src/ioService.cpp \ -$(SIMDAEMON_SOURCE)/src/security.c +$(SIMDAEMON_SOURCE)/src/ioService.cpp OBJS += \ ./src/ConnectionSession.o \ @@ -19,9 +17,7 @@ OBJS += \ ./src/TAFactory.o \ ./src/TAInstance.o \ ./src/TEEContext.o \ -./src/ioService.o \ -./src/SecurityChecker.o \ -./src/security.o +./src/ioService.o CPP_DEPS += \ ./src/ConnectionSession.d \ @@ -31,16 +27,14 @@ CPP_DEPS += \ ./src/TAFactory.d \ ./src/TAInstance.d \ ./src/TEEContext.d \ -./src/ioService.d \ -./src/SecurityChecker.d \ -./src/security.d +./src/ioService.d # Each subdirectory must supply rules for building sources it contributes src/%.o: $(SIMDAEMON_SOURCE)/src/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/simulatordaemon/src/TABinaryManager" -I"$(HOME)/simulatordaemon/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/simulatordaemon/src/TABinaryManager" -I"$(HOME)/simulatordaemon/inc" -I$(INCLUDE) -O0 -g3 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/cryptocore/source/base/subdir.mk b/build/ssflib/dep/cryptocore/source/base/subdir.mk index c6fdf8b..5f01c31 100644 --- a/build/ssflib/dep/cryptocore/source/base/subdir.mk +++ b/build/ssflib/dep/cryptocore/source/base/subdir.mk @@ -47,13 +47,12 @@ C_DEPS += \ ./dep/cryptocore/source/base/cc_sha2.d \ ./dep/cryptocore/source/base/cc_snow2.d -C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/cryptocore/source/base/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/base/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/cryptocore/source/middle/subdir.mk b/build/ssflib/dep/cryptocore/source/middle/subdir.mk index f709eb5..73d96ca 100644 --- a/build/ssflib/dep/cryptocore/source/middle/subdir.mk +++ b/build/ssflib/dep/cryptocore/source/middle/subdir.mk @@ -35,13 +35,12 @@ C_DEPS += \ ./dep/cryptocore/source/middle/cc_symmetric.d \ ./dep/cryptocore/source/middle/cc_tdes.d -C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/cryptocore/source/middle/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/middle/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/cryptocore/source/subdir.mk b/build/ssflib/dep/cryptocore/source/subdir.mk index 23e59c8..0b82019 100644 --- a/build/ssflib/dep/cryptocore/source/subdir.mk +++ b/build/ssflib/dep/cryptocore/source/subdir.mk @@ -8,14 +8,12 @@ OBJS += \ C_DEPS += \ ./dep/cryptocore/source/CC_API.d -C_FLAGS += -fPIC - # Each subdirectory must supply rules for building sources it contributes dep/cryptocore/source/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/swdss/source/subdir.mk b/build/ssflib/dep/swdss/source/subdir.mk index 93190bd..fd93294 100644 --- a/build/ssflib/dep/swdss/source/subdir.mk +++ b/build/ssflib/dep/swdss/source/subdir.mk @@ -23,13 +23,12 @@ CPP_DEPS += \ ./dep/swdss/source/ss_misc.d \ ./dep/swdss/source/ss_temp_store.d -C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/swdss/source/%.o: $(SSFLIB_SOURCE)/dep/swdss/source/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/time/subdir.mk b/build/ssflib/dep/time/subdir.mk index 12cc093..58955f9 100644 --- a/build/ssflib/dep/time/subdir.mk +++ b/build/ssflib/dep/time/subdir.mk @@ -8,13 +8,12 @@ OBJS += \ CPP_DEPS += \ ./dep/time/ssf_time.d -C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/time/%.o: $(SSFLIB_SOURCE)/dep/time/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/dep/uci/source/subdir.mk b/build/ssflib/dep/uci/source/subdir.mk index 5823e7a..e103ce3 100644 --- a/build/ssflib/dep/uci/source/subdir.mk +++ b/build/ssflib/dep/uci/source/subdir.mk @@ -17,13 +17,12 @@ C_DEPS += \ ./dep/uci/source/uci_cryptocore.d \ ./dep/uci/source/uci_hwcrypto.d -C_FLAGS += -fPIC # Each subdirectory must supply rules for building sources it contributes dep/uci/source/%.o: $(SSFLIB_SOURCE)/dep/uci/source/%.c @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/build/ssflib/makefile b/build/ssflib/makefile index 0b25637..d979fa5 100755 --- a/build/ssflib/makefile +++ b/build/ssflib/makefile @@ -2,6 +2,7 @@ GIT_SDK = ../../.. TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux +TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ diff --git a/build/ssflib/src/subdir.mk b/build/ssflib/src/subdir.mk index f1ddb62..15bb64c 100644 --- a/build/ssflib/src/subdir.mk +++ b/build/ssflib/src/subdir.mk @@ -1,14 +1,15 @@ -# Add inputs and outputs from these tool invocations to the build variables +# Add inputs and outputs from these tool invocations to the build variables C_SRCS += \ -$(SSFLIB_SOURCE)/src/ssf_arithmetic.c \ -$(SSFLIB_SOURCE)/src/ssf_client.c \ -$(SSFLIB_SOURCE)/src/ssf_crypto.c \ -$(SSFLIB_SOURCE)/src/ssf_lib.c \ -$(SSFLIB_SOURCE)/src/ssf_malloc.c \ -$(SSFLIB_SOURCE)/src/ssf_panic.c \ -$(SSFLIB_SOURCE)/src/ssf_storage.c \ -$(SSFLIB_SOURCE)/src/ssf_taentrypoint.c \ -$(SSFLIB_SOURCE)/src/app_debug.c +$(SSFLIB_SOURCE)/src/ssf_arithmetic.cpp \ +$(SSFLIB_SOURCE)/src/ssf_client.cpp \ +$(SSFLIB_SOURCE)/src/ssf_crypto.cpp \ +$(SSFLIB_SOURCE)/src/ssf_lib.cpp \ +$(SSFLIB_SOURCE)/src/ssf_malloc.cpp \ +$(SSFLIB_SOURCE)/src/ssf_panic.cpp \ +$(SSFLIB_SOURCE)/src/ssf_storage.cpp \ +$(SSFLIB_SOURCE)/src/ssf_taentrypoint.cpp \ +$(SSFLIB_SOURCE)/src/ssf_permission.cpp \ +$(SSFLIB_SOURCE)/src/app_debug.cpp OBJS += \ ./src/ssf_arithmetic.o \ @@ -18,7 +19,8 @@ OBJS += \ ./src/ssf_malloc.o \ ./src/ssf_panic.o \ ./src/ssf_storage.o \ -./src/ssf_taentrypoint.o \ +./src/ssf_taentrypoint.o \ +./src/ssf_permission.o \ ./src/app_debug.o C_DEPS += \ @@ -30,16 +32,15 @@ C_DEPS += \ ./src/ssf_panic.d \ ./src/ssf_storage.d \ ./src/ssf_taentrypoint.d \ +./src/ssf_permission.d \ ./src/app_debug.d -C_FLAGS += -fPIC - # Each subdirectory must supply rules for building sources it contributes -src/%.o: $(SSFLIB_SOURCE)/src/%.c +src/%.o: $(SSFLIB_SOURCE)/src/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ $(C_FLAGS) -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" + $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O2 -g2 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/include/include/debug.h b/include/include/debug.h new file mode 100644 index 0000000..42bf9c3 --- /dev/null +++ b/include/include/debug.h @@ -0,0 +1,41 @@ +/* + * debug.h + * + * This source file is proprietary property of Samsung Electronics Co., Ltd. + * + * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Contact: Jaemin Ryu + * + */ + +#ifndef __ALLOC_DEBUG_H__ +#define __ALLOC_DEBUG_H__ + +#include +#ifdef __cplusplus +extern "C" { +#endif + +#define TEE_STUB "TEE_STUB" +#define LOG_LABEL_SIZE 64 + +int __logger_log(const char* tag, const usr_log_level lv, const char* fmt, const char* function, const int line, ...); + +#define LOGD(Tag, Fmt, ...) __logger_log(Tag, LOG_DEBUG, Fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOGI(Tag, Fmt, ...) __logger_log(Tag, LOG_INFO, Fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOGW(Tag, Fmt, ...) __logger_log(Tag, LOG_WARNING, Fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOGE(Tag, Fmt, ...) __logger_log(Tag, LOG_ERR, Fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define LOGC(Tag, Fmt, ...) __logger_log(Tag, LOG_CRIT, Fmt, __FUNCTION__, __LINE__, ##__VA_ARGS__) + +void setDebugLogLevelNum(const usr_log_level __level); +int getDebugLogLevelNum(void); +void setDebugLogLevel(const char* __level); +void setDebugLogName(const char* __name); /* buffer(__name) size should be LOG_LABEL_SIZE(64) */ +void getDebugLogName(char* __name); /* buffer(__name) size should be LOG_LABEL_SIZE(64) */ + +#ifdef __cplusplus +} +#endif + +#endif /* ALLOC_DEBUG_H */ diff --git a/include/include/log_level.h b/include/include/log_level.h new file mode 100644 index 0000000..5c53426 --- /dev/null +++ b/include/include/log_level.h @@ -0,0 +1,28 @@ +/* + * log_level.h + * + * This source file is proprietary property of Samsung Electronics Co., Ltd. + * + * Copyright (C) 2016 - 2016 Samsung Electronics Co., Ltd All Rights Reserved + * + */ + +#ifndef __LOG_LEVEL_H__ +#define __LOG_LEVEL_H__ + +typedef enum { + LOG_EMERG = 0, + LOG_ALERT, + LOG_CRIT, + LOG_ERR, + LOG_WARNING, + LOG_NOTICE, + LOG_INFO, + LOG_DEBUG, + LOG_SILENT, +} usr_log_level; + +/* Tee World */ +#define TA_LOG_LEVEL LOG_DEBUG /* Generation Default */ + +#endif diff --git a/include/include/tee_internal_api.h b/include/include/tee_internal_api.h index 65025c5..71b349d 100644 --- a/include/include/tee_internal_api.h +++ b/include/include/tee_internal_api.h @@ -1425,9 +1425,9 @@ TEE_Result TEE_MACComputeFinal(TEE_OperationHandle operation, void* mac, size_t *macLen); TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, - const void* message, + void* message, size_t messageLen, - const void* mac, + void* mac, size_t *macLen); /****************************************************************************** @@ -1435,28 +1435,28 @@ TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, ******************************************************************************/ TEE_Result TEE_AEInit(TEE_OperationHandle operation, - const void* nonce, + void* nonce, size_t nonceLen, uint32_t tagLen, uint32_t AADLen, uint32_t payloadLen); void TEE_AEUpdateAAD(TEE_OperationHandle operation, - const void* AADdata, + void* AADdata, size_t AADdataLen); TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, - const void* srcData, + void* srcData, size_t srcLen, void* destData, size_t *destLen); TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, - const void* srcData, + void* srcData, size_t srcLen, void* destData, size_t* destLen, void* tag, size_t* tagLen); TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, - const void* srcData, + void* srcData, size_t srcLen, void* destData, size_t *destLen, @@ -1502,7 +1502,7 @@ TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation, ******************************************************************************/ void TEE_DeriveKey(TEE_OperationHandle operation, - const TEE_Attribute* params, + TEE_Attribute* params, uint32_t paramCount, TEE_ObjectHandle derivedKey); diff --git a/include/include/tee_sim_command.h b/include/include/tee_sim_command.h index 2133842..4277f28 100644 --- a/include/include/tee_sim_command.h +++ b/include/include/tee_sim_command.h @@ -36,6 +36,7 @@ typedef struct { uint32_t paramTypes; TEE_Param params[4]; uint32_t shmID[4]; + uint32_t shmOffset[4]; } Operation; typedef struct { diff --git a/include/include/teestub_command_data.h b/include/include/teestub_command_data.h index e4c8c06..bedef92 100644 --- a/include/include/teestub_command_data.h +++ b/include/include/teestub_command_data.h @@ -25,6 +25,7 @@ typedef OperationData IntTAOperationData; typedef struct { + TEE_UUID source; TEE_UUID destination; uint32_t cancelTimeOut; IntTAOperationData operation; diff --git a/log/log.h b/log/log.h index 534ae68..c88baab 100644 --- a/log/log.h +++ b/log/log.h @@ -32,7 +32,7 @@ #define INOUT #define OUT -#define _LOGGING +//#define _LOGGING #ifdef _WIN typedef int int8_t; diff --git a/osal/OsaIpc.c b/osal/OsaIpc.c index 6f2824e..57bb384 100644 --- a/osal/OsaIpc.c +++ b/osal/OsaIpc.c @@ -131,27 +131,6 @@ typedef struct { #define MAX_NAMEDSEM_MGR 256 -static UlOsaSem_t* sem[MAX_NAMEDSEM_MGR]={0}; - - -unsigned int addptr(UlOsaSem_t*s) { - for (int i=0; i < MAX_NAMEDSEM_MGR; ++i) { - if (sem[i]==NULL) {sem[i]=s; return i;} - } - return -1; -} - - -UlOsaSem_t* getptr(unsigned int id) { - return sem[id]; -} - - -void rmid(unsigned int id) { - sem[id]=NULL; -} - - static int UlOsaNamedSemCreate(const char pcName[10], int iCount, int iAttribute, unsigned int* puiSmid) { int iRetVal = OSAL_OK; @@ -196,7 +175,7 @@ static int UlOsaNamedSemCreate(const char pcName[10], int iCount, memcpy((void*)sem->bName, (const void*)pcName, (size_t)10); sem->bName[10] = '\0'; - *puiSmid = addptr(sem); + *puiSmid = (unsigned int)sem; return iRetVal; } @@ -228,7 +207,7 @@ static int UlOsaNamedSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { struct timeval tv; int ret; - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; if (!sem) { return OSAL_ERROR; @@ -288,7 +267,7 @@ static int UlOsaNamedSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { } static int UlOsaNamedSemRelease(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; struct sembuf semBuf; if (!sem) { @@ -309,7 +288,7 @@ static int UlOsaNamedSemRelease(unsigned int uiSmid) { } static int UlOsaNamedSemReset(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; union semun semUnion; if (!sem) { @@ -327,7 +306,7 @@ static int UlOsaNamedSemReset(unsigned int uiSmid) { } static int UlOsaNamedSemGetval(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; int n; if (!sem) { diff --git a/osal/OsaSem.c b/osal/OsaSem.c index c2865ec..eaef3e1 100644 --- a/osal/OsaSem.c +++ b/osal/OsaSem.c @@ -37,30 +37,6 @@ typedef struct _UlOsaSem { *-----------------------------------------------------------------------------*/ /* TODO: apply iAttribute */ // COMMON_071008_1 - -#define MAX_NAMEDSEM_MGR 256 -static UlOsaSem_t* sem[MAX_NAMEDSEM_MGR]={0}; - - -unsigned int addptr(UlOsaSem_t*s) { - for (int i=0; i < MAX_NAMEDSEM_MGR; ++i) { - if (sem[i]==NULL) {sem[i]=s; return i;} - } - return -1; -} - - -UlOsaSem_t* getptr(unsigned int id) { - return sem[id]; -} - - -void rmid(unsigned int id) { - sem[id]=NULL; -} - - - static int UlOsaSemCreate(const char bName[10], int iCount, int iAttribute, unsigned int* puiSmid) { UlOsaSem_t* sem; @@ -83,13 +59,13 @@ static int UlOsaSemCreate(const char bName[10], int iCount, int iAttribute, memcpy((void*)sem->bName, (const void*)bName, (size_t)10); sem->bName[10] = '\0'; - *puiSmid = addptr(sem); + *puiSmid = (unsigned int)sem; return OSAL_OK; } static int UlOsaSemDelete(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; if (!sem) { return OSAL_ERROR; @@ -97,14 +73,13 @@ static int UlOsaSemDelete(unsigned int uiSmid) { sem_destroy(&sem->sem); free(sem); - rmid(uiSmid); return OSAL_OK; } static int UlOsaSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { int ret; - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; if (!sem) { return OSAL_ERROR; @@ -173,7 +148,7 @@ static int UlOsaSemGet(unsigned int uiSmid, int iFlags, int iTimeout) { } static int UlOsaSemRelease(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; if (!sem) { return OSAL_ERROR; } @@ -188,7 +163,7 @@ static int UlOsaSemRelease(unsigned int uiSmid) { } static int UlOsaSemReset(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; if (!sem) { return OSAL_ERROR; } @@ -208,7 +183,7 @@ static int UlOsaSemReset(unsigned int uiSmid) { } static int UlOsaSemGetval(unsigned int uiSmid) { - UlOsaSem_t *sem = getptr(uiSmid); + UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; int n; if (!sem) { return OSAL_ERROR; @@ -326,28 +301,6 @@ int OsaSemReset(unsigned int uiSmid) { //------------------------------------------------------------------------------ // $$$ */ - - -pthread_mutex_t* mutexes[MAX_NAMEDSEM_MGR] = {0}; - -unsigned int add_mutex(pthread_mutex_t* s) { - for (int i=0; i < MAX_NAMEDSEM_MGR; ++i) { - if (mutexes[i]==NULL) {mutexes[i]=s; return i;} - } - return -1; -} - - -pthread_mutex_t* get_mutex(unsigned int id) { - return mutexes[id]; -} - - -void rmid_mutex(unsigned int id) { - mutexes[id]=NULL; -} - - int OsaMutCreate(const char bName[10], int iAttributes, unsigned int* puiMutid) { pthread_mutexattr_t attr_t; pthread_mutex_t* pmutex_t; @@ -375,7 +328,7 @@ int OsaMutCreate(const char bName[10], int iAttributes, unsigned int* puiMutid) break; } - (*puiMutid) = add_mutex(pmutex_t); + (*puiMutid) = (unsigned int)pmutex_t; pthread_mutexattr_destroy(&attr_t); } else { @@ -405,7 +358,7 @@ int OsaMutCreate(const char bName[10], int iAttributes, unsigned int* puiMutid) int OsaMutDelete(unsigned int uiMutid) { int iRet; - pthread_mutex_t* pmutex_t = get_mutex(uiMutid); + pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; if (pmutex_t == NULL) { return OSAL_OK; } @@ -418,7 +371,6 @@ int OsaMutDelete(unsigned int uiMutid) { } free(pmutex_t); - rmid_mutex(uiMutid); return OSAL_OK; } @@ -438,7 +390,7 @@ int OsaMutDelete(unsigned int uiMutid) { int OsaMutRelease(unsigned int uiMutid) { int iRet; - pthread_mutex_t* pmutex_t = get_mutex(uiMutid); + pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; iRet = pthread_mutex_unlock(pmutex_t); if (iRet < 0) { perror("In OsaMutRelease() : failed "); @@ -462,7 +414,7 @@ int OsaMutRelease(unsigned int uiMutid) { */ int OsaMutGet(unsigned int uiMutid, int iFlags, int iTimeout) { int iRet; - pthread_mutex_t* pmutex_t = get_mutex(uiMutid); + pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; iRet = pthread_mutex_lock(pmutex_t); if (iRet < 0) { perror("In OsaMutGet() : failed "); @@ -486,7 +438,7 @@ int OsaMutGet(unsigned int uiMutid, int iFlags, int iTimeout) { int OsaMutTryGet(unsigned int uiMutid, int iFlags, int iTimeout) { int iRet; - pthread_mutex_t* pmutex_t = get_mutex(uiMutid); + pthread_mutex_t* pmutex_t = (pthread_mutex_t *)uiMutid; iRet = pthread_mutex_trylock(pmutex_t); if (iRet) { return ((int)iRet); diff --git a/simulatordaemon/inc/Session.h b/simulatordaemon/inc/Session.h index da37b37..8569059 100644 --- a/simulatordaemon/inc/Session.h +++ b/simulatordaemon/inc/Session.h @@ -24,7 +24,6 @@ *-----------------------------------------------------------------------------*/ #include #include -#include #include "ISession.h" /*----------------------------------------------------------------------------- diff --git a/simulatordaemon/inc/TEEContext.h b/simulatordaemon/inc/TEEContext.h index 5c70da7..c1fc73b 100644 --- a/simulatordaemon/inc/TEEContext.h +++ b/simulatordaemon/inc/TEEContext.h @@ -31,8 +31,6 @@ #include "Session.h" #include "tee_command.h" #include "IConnectionSession.h" -#include "ConnectionSession.h" -#include "SecurityChecker.h" using namespace std; /*----------------------------------------------------------------------------- @@ -55,14 +53,11 @@ public: IConnectionSession* mConnSess; // ContextID assigned to the instance uint32_t mContextID; - /* Security checker wich can tell us if client has different Tizen's policy permissions*/ - SecurityChecker mConnSecChecker; - /* For TA internal APIs support, dummy Context is created and for recognizing * the context as dummy isInternal member variable is used */ bool isInternal; - TEEContext(uint32_t contextID, ConnectionSession* connSession); + TEEContext(uint32_t contextID, IConnectionSession* connSession); TEEC_Result initContext(InitContextData* data); void finContext(FinalizeContextData data); TEEC_Result openSession(OpenSessionData data); @@ -73,6 +68,7 @@ public: TEEC_Result invokeTACommand(IntTAInvokeCommandData data); TEEC_Result registerSharedMemory(RegSharedMemData data); TEEC_Result releaseSharedMemory(RelSharedMemData data); + TEEC_Result checkTADomain(IntTAOpenSessionData data); void reqCancel(ReqCancellationData data); ~TEEContext(); }; diff --git a/simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp b/simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp index e26e6b4..a7fd561 100644 --- a/simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp +++ b/simulatordaemon/src/ResponseCommands/ResCommandInvokeCommand.cpp @@ -61,7 +61,8 @@ void ResCommandInvokeCommand::execute() { // No operation data } else { idata.operation.params[i].mem.size = data->op.params[i].memref.size; - idata.operation.params[i].mem.shmKey = data->op.shmID[i]; + idata.operation.params[i].mem.shmKey = data->op.params[i].memref.memid; + idata.operation.params[i].mem.offset = data->op.shmOffset[i]; } } idata.returnValue = data->returnValue; @@ -89,7 +90,8 @@ void ResCommandInvokeCommand::execute() { // No operation data } else { idata.operation.params[i].mem.size = data->op.params[i].memref.size; - idata.operation.params[i].mem.shmKey = data->op.shmID[i]; + idata.operation.params[i].mem.shmKey = data->op.params[i].memref.memid; + idata.operation.params[i].mem.offset = data->op.shmOffset[i]; } } idata.returnValue = data->returnValue; diff --git a/simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp b/simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp index c1debd6..bc493e1 100644 --- a/simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp +++ b/simulatordaemon/src/ResponseCommands/ResCommandOpenSession.cpp @@ -61,7 +61,8 @@ void ResCommandOpenSession::execute() { // No operation data } else { odata.operation.params[i].mem.size = data->op.params[i].memref.size; - odata.operation.params[i].mem.shmKey = data->op.shmID[i]; + odata.operation.params[i].mem.shmKey = data->op.params[i].memref.memid; + odata.operation.params[i].mem.offset = data->op.shmOffset[i]; } } odata.returnValue = data->returnValue; @@ -88,7 +89,8 @@ void ResCommandOpenSession::execute() { // No operation data } else { odata.operation.params[i].mem.size = data->op.params[i].memref.size; - odata.operation.params[i].mem.shmKey = data->op.shmID[i]; + odata.operation.params[i].mem.shmKey = data->op.params[i].memref.memid; + odata.operation.params[i].mem.offset = data->op.shmOffset[i]; } } odata.returnValue = data->returnValue; diff --git a/simulatordaemon/src/Session.cpp b/simulatordaemon/src/Session.cpp index 1500539..4939b2f 100644 --- a/simulatordaemon/src/Session.cpp +++ b/simulatordaemon/src/Session.cpp @@ -102,13 +102,6 @@ TEEC_Result Session::createSession(OpenSessionData data) { string TAUUID = TABin->getUUIDAsString(data.uuid); string argvPort = TABin->getPort(TAUUID); - string TAName(TAUUID); - std::transform(TAName.begin(), TAName.end(), TAName.begin(), ::toupper); - if(!mContext->nConnSecChecker.clientHasAccessToTa(TAUUID)){ - LOGE(SIM_DAEMON, "Client has no permission for access TA: %s ", TAName.c_str()); - return TEEC_ERROR_ACCESS_DENIED; - } - if (argvPort != "") { pthread_rwlock_wrlock(&TAFact->mTAInstanceMapLock); multimap::iterator itr; @@ -181,7 +174,9 @@ TEEC_Result Session::createSession(OpenSessionData data) { // No operation data } else { tdata.op.params[i].memref.size = data.operation.params[i].mem.size; + tdata.op.params[i].memref.memid = data.operation.params[i].mem.shmKey; tdata.op.shmID[i] = data.operation.params[i].mem.shmKey; + tdata.op.shmOffset[i] = data.operation.params[i].mem.offset; } } // Send OPENSESSION request to TA @@ -227,7 +222,9 @@ TEEC_Result Session::handleCommand(InvokeCommandData data) { // No operation data } else { idata.op.params[i].memref.size = data.operation.params[i].mem.size; + idata.op.params[i].memref.memid = data.operation.params[i].mem.shmKey; idata.op.shmID[i] = data.operation.params[i].mem.shmKey; + idata.op.shmOffset[i] = data.operation.params[i].mem.offset; } } diff --git a/simulatordaemon/src/SimulatorDaemonServer.cpp b/simulatordaemon/src/SimulatorDaemonServer.cpp index 42a3da5..7d06878 100644 --- a/simulatordaemon/src/SimulatorDaemonServer.cpp +++ b/simulatordaemon/src/SimulatorDaemonServer.cpp @@ -20,7 +20,6 @@ * Include files *-----------------------------------------------------------------------------*/ #include "SimulatorDaemonServer.h" -#include "SecurityChecker.h" /*----------------------------------------------------------------------------- * Member functions @@ -46,7 +45,6 @@ void SimulatorDaemonServer::startAccept() { ConnectionSession::session_ptr new_session = ConnectionSession::create( acceptor.get_io_service()); - acceptor.async_accept(new_session->socket(), boost::bind(&SimulatorDaemonServer::handleAccept, this, new_session, boost::asio::placeholders::error)); @@ -60,14 +58,7 @@ void SimulatorDaemonServer::startAccept() { void SimulatorDaemonServer::handleAccept( ConnectionSession::session_ptr new_session, const boost::system::error_code& error) { - - const string privelege("http://tizen.org/privilege/account.read"); LOGD(SIM_DAEMON, "Entry"); - if (!SecurityChecker::clientHasCynaraPermission(new_session.get(), privelege)){ - LOGE("Client has no permission to use TEE"); - return; - } - if (!error) { new_session->start(); } diff --git a/simulatordaemon/src/TABinaryManager/TAManifest.cpp b/simulatordaemon/src/TABinaryManager/TAManifest.cpp index ae14cbe..6bd111c 100644 --- a/simulatordaemon/src/TABinaryManager/TAManifest.cpp +++ b/simulatordaemon/src/TABinaryManager/TAManifest.cpp @@ -52,96 +52,105 @@ bool TAManifest::processXML(const string &xmlManifestPath) { try { // 1. PROPERTIES xml_node<> *node = doc.first_node("manifest")->first_node("properties"); - { + + if (node != NULL) { stringstream sstream; // GENERAL xml_node<> *propertiesGeneral = node->first_node("general"); - properties.general.appID = string( - propertiesGeneral->first_attribute("appID")->value()); - properties.general.singleInstance = - string(propertiesGeneral->first_attribute("singleInstance")->value()) - .compare("true") == 0 ? true : false; - properties.general.multiSession = - string(propertiesGeneral->first_attribute("multiSession")->value()) - .compare("true") == 0 ? true : false; - properties.general.instanceKeepAlive = - string( - propertiesGeneral->first_attribute("instanceKeepAlive")->value()) - .compare("true") == 0 ? true : false; - - sstream.clear(); - sstream.str( - string(propertiesGeneral->first_attribute("stackSize")->value())); - sstream >> properties.general.stackSize; - - sstream.clear(); - sstream.str( - string(propertiesGeneral->first_attribute("dataSize")->value())); - sstream >> properties.general.dataSize; + + if (propertiesGeneral != NULL) { + properties.general.appID = string(propertiesGeneral->first_attribute("appID")->value()); + properties.general.singleInstance = string(propertiesGeneral->first_attribute("singleInstance")->value()) + .compare("true") == 0 ? true : false; + properties.general.multiSession = string(propertiesGeneral->first_attribute("multiSession")->value()) + .compare("true") == 0 ? true : false; + properties.general.instanceKeepAlive =string(propertiesGeneral->first_attribute("instanceKeepAlive")->value()) + .compare("true") == 0 ? true : false; + + sstream.clear(); + sstream.str(string(propertiesGeneral->first_attribute("stackSize")->value())); + sstream >> properties.general.stackSize; + + sstream.clear(); + sstream.str(string(propertiesGeneral->first_attribute("dataSize")->value())); + sstream >> properties.general.dataSize; + } + // EXTENSION xml_node<> *propertiesExtension = node->first_node("extension"); - properties.extension.appName = string( - propertiesExtension->first_attribute("appName")->value()); - properties.extension.appVersion = string( - propertiesExtension->first_attribute("appVersion")->value()); - /*properties.extension.type = string( - propertiesExtension->first_attribute("type")->value()); - properties.extension.zone = string( - propertiesExtension->first_attribute("zone")->value());*/ - properties.extension.sdkVersion = string( - propertiesExtension->first_attribute("sdkVersion")->value()); - // Removed, taEncrypion flag used now - //properties.extension.secret = string( - // propertiesExtension->first_attribute("secret")->value()); - properties.extension.launchMode = string( - propertiesExtension->first_attribute("launchMode")->value()); + + if (propertiesExtension != NULL) { + properties.extension.appName = string(propertiesExtension->first_attribute("appName")->value()); + properties.extension.appVersion = string(propertiesExtension->first_attribute("appVersion")->value()); + + /*properties.extension.type = string(propertiesExtension->first_attribute("type")->value()); + properties.extension.zone = string(propertiesExtension->first_attribute("zone")->value());*/ + properties.extension.sdkVersion = string(propertiesExtension->first_attribute("sdkVersion")->value()); + + // Removed, taEncrypion flag used now + //properties.extension.secret = string(propertiesExtension->first_attribute("secret")->value()); + + properties.extension.launchMode = string(propertiesExtension->first_attribute("launchMode")->value()); + } } // 2. POLICY node = doc.first_node("manifest")->first_node("policy"); - { + + if (node != NULL) { // PRIVILEGE xml_node<> *policyPrivilege = node->first_node("privilege"); - policy.privilegeName = string( - policyPrivilege->first_attribute("name")->value()); + + if (policyPrivilege != NULL) { + policy.privilegeName = string( + policyPrivilege->first_attribute("name")->value()); + } + // PROTECTION DOMAIN xml_node<> *policyProtectionDomain = node->first_node("protectionDomain"); - policy.protectionDomain.createDomain = string( - policyProtectionDomain->first_node("createDomain")->first_attribute( - "name")->value()); - policy.protectionDomain.allowedDomain = string( - policyProtectionDomain->first_node("allowedDomain")->first_attribute( - "name")->value()); + + if (policyProtectionDomain != NULL) { + policy.protectionDomain.createDomain = string( + policyProtectionDomain->first_node("createDomain")->first_attribute("name")->value()); + for (xml_node<> *childnode = policyProtectionDomain->first_node("allowedDomain"); childnode; childnode = childnode->next_sibling()) { + policy.protectionDomain.allowedDomain.push_back(string(childnode->first_attribute("name")->value())); + } + } + // PERMISSION - vector xml_node<> *policyPermission = node->first_node("permission"); - for (xml_node<> *childnode = policyPermission->first_node( - "uses-permission"); childnode; childnode = - childnode->next_sibling()) { - //std::cout << "[SIM_DAEMON] Permission vector: " << string(childnode->first_attribute("name")->value()) << endl; - policy.usesPermission.push_back( - string(childnode->first_attribute("name")->value())); + + if (policyPermission != NULL) { + for (xml_node<> *childnode = policyPermission->first_node("uses-permission"); childnode; childnode = childnode->next_sibling()) { + //std::cout << "[SIM_DAEMON] Permission vector: " << string(childnode->first_attribute("name")->value()) << endl; + policy.usesPermission.push_back(string(childnode->first_attribute("name")->value())); + } } + } // 3. TA ENC node = doc.first_node("manifest")->first_node("taEncryption"); - { + + if (node != NULL) { // MODEL xml_node<> *model = node->first_node("model"); - taencryption.model.modelName = string( - model->first_node("modelName")->first_attribute("value")->value()); - taencryption.model.plainkeydata = string( - model->first_node("plainkeydata")->first_attribute("value")->value()); + + if (model != NULL) { + taencryption.model.modelName = string(model->first_node("modelName")->first_attribute("value")->value()); + taencryption.model.plainkeydata = string(model->first_node("plainkeydata")->first_attribute("value")->value()); + } } + // 4. INFORMATION node = doc.first_node("manifest")->first_node("information"); - { - information.description = string( - node->first_node("description")->value()); + + if (node!= NULL) { + information.description = string(node->first_node("description")->value()); information.author = string(node->first_node("author")->value()); information.terms = string(node->first_node("terms")->value()); information.copyright = string(node->first_node("copyright")->value()); - } + ret = true; } // Catch rapid xml errors @@ -185,7 +194,10 @@ void TAManifest::printProcessedData() const { std::cout << "[SIM_DAEMON] policy.privilegeName: " << policy.privilegeName << endl; - std::cout << "[SIM_DAEMON] " << policy.protectionDomain.allowedDomain << endl; + for (unsigned int i = 0; i < policy.protectionDomain.allowedDomain.size(); i++) { + std::cout << "[SIM_DAEMON] \tpolicy.protectionDomain.allowedDomain: " + << policy.protectionDomain.allowedDomain[i] << endl; + } std::cout << "[SIM_DAEMON] " << policy.protectionDomain.createDomain << endl; for (unsigned int i = 0; i < policy.usesPermission.size(); i++) { std::cout << "[SIM_DAEMON] \tpolicy.usesPermission: " diff --git a/simulatordaemon/src/TABinaryManager/TAManifest.h b/simulatordaemon/src/TABinaryManager/TAManifest.h index da7edcd..2f7e838 100644 --- a/simulatordaemon/src/TABinaryManager/TAManifest.h +++ b/simulatordaemon/src/TABinaryManager/TAManifest.h @@ -66,7 +66,7 @@ typedef struct { typedef struct { string createDomain; - string allowedDomain; + vector allowedDomain; } StructPolicyProtectionDomain; typedef struct { diff --git a/simulatordaemon/src/TAInstance.cpp b/simulatordaemon/src/TAInstance.cpp index d11ebb7..2b1650f 100644 --- a/simulatordaemon/src/TAInstance.cpp +++ b/simulatordaemon/src/TAInstance.cpp @@ -176,7 +176,7 @@ TEEC_Result TAInstance::connecttoTA(std::stringstream& str) { LOGD(SIM_DAEMON, "Connect to TEEStub"); // Try to connect to TA RETRY_COUNT number of times while (error && (retry_count < RETRY_COUNT)) { -#if 0 +#if 0 LOGD(SIM_DAEMON, "Trying to connect to TEEStub"); LOGE(SIM_DAEMON, "Response returned with error code %d", error.value()); LOGE(SIM_DAEMON, "Response returned with error code %s", @@ -415,14 +415,11 @@ TEEC_Result TAInstance::receiveCreateResponse() { */ void TAInstance::closeConnectionToTA() { LOGD(SIM_DAEMON, "Entry"); - TEEC_Result result = TEEC_ERROR_COMMUNICATION; boost::system::error_code ec; - + mTAConnectionSocket.close(ec); - if(!ec) - result = TEEC_SUCCESS; - else + if(ec) LOGE(SIM_DAEMON, "TA Connection close FAILED"); } diff --git a/simulatordaemon/src/TEEContext.cpp b/simulatordaemon/src/TEEContext.cpp index f2cbea4..51ccd4f 100644 --- a/simulatordaemon/src/TEEContext.cpp +++ b/simulatordaemon/src/TEEContext.cpp @@ -20,6 +20,7 @@ * Include files *-----------------------------------------------------------------------------*/ #include "TEEContext.h" +#include "TABinaryManager.h" /*----------------------------------------------------------------------------- * Globals @@ -36,9 +37,7 @@ uint32_t sessID = 51; * @param contextID ID for Context reference * @param connSession ConnectionSession instance associated with the context */ -TEEContext::TEEContext(uint32_t contextID, ConnectionSession* connSession) - :mConnSecChecker(connSession) -{ +TEEContext::TEEContext(uint32_t contextID, IConnectionSession* connSession) { LOGD(SIM_DAEMON, "ContextID: %d", contextID); @@ -368,6 +367,21 @@ TEEC_Result TEEContext::openTASession(IntTAOpenSessionData data) { sdata.operation = data.operation; memcpy(&sdata.uuid, &data.destination, sizeof(TEEC_UUID)); + result = checkTADomain(data); + if (TEEC_SUCCESS != result) { + data.returnValue = result; + + /* Write the response back to SSFLIB in case of failure */ + result = mConnSess->write(OPEN_TA_SESSION, (char*)&data, + sizeof(IntTAOpenSessionData)); + + if (result != TEEC_SUCCESS) { + LOGE(SIM_DAEMON, "Open TA Session response write to CA FAILED"); + } + + return result; + } + /* Create a new Session instance */ ISession *mSession = new Session(this); @@ -534,6 +548,64 @@ TEEC_Result TEEContext::releaseSharedMemory(RelSharedMemData data) { return result; } +TEEC_Result TEEContext::checkTADomain(IntTAOpenSessionData data) { + TEEC_Result result = TEEC_ERROR_GENERIC; + + LOGD(SIM_DAEMON, "Entry"); + + const TAManifest* srcTAManifest; + const TAManifest* dstTAManifest; + string source_uuid, dest_uuid; + string srcCreateDomain; + string dstAllowedDomain; + unsigned int dstAllowedDomainCount; + + TEEC_UUID src, dst; + TABinaryManager *TABin = TABinaryManager::getInstance(); + if(TABin == NULL) { + LOGE(SIM_DAEMON, "Creating TABinaryManager Instance FAILED - "); + return TEEC_ERROR_GENERIC; + } + + memcpy(&src, &data.source, sizeof(TEEC_UUID)); + memcpy(&dst, &data.destination, sizeof(TEEC_UUID)); + + source_uuid = TABin->getUUIDAsString(src); + dest_uuid = TABin->getUUIDAsString(dst); + + std::transform(source_uuid.begin(), source_uuid.end(), source_uuid.begin(), ::toupper); + std::transform(dest_uuid.begin(), dest_uuid.end(), dest_uuid.begin(), ::toupper); + + dstTAManifest = TABin->getManifest(dest_uuid); + srcTAManifest = TABin->getManifest(source_uuid); + + srcCreateDomain = srcTAManifest->policy.protectionDomain.createDomain; + dstAllowedDomainCount = dstTAManifest->policy.protectionDomain.allowedDomain.size(); + + if (dstAllowedDomainCount == 0) { + return TEEC_SUCCESS; + } + + for (unsigned int i = 0; i < dstAllowedDomainCount; i++) { + dstAllowedDomain = dstTAManifest->policy.protectionDomain.allowedDomain[i]; + + /* + * When comparing source`s createDomain and destination`s allowedDomain strings, + * It should be compared only length of the string with not included null character. + * + * ex) In the below case, openTASession should be success. + * source`s createDomain : [mainDomain/subDomain] + * destination`s allowedDomain : [mainDomain] + */ + if (strncmp(dstAllowedDomain.c_str(), srcCreateDomain.c_str(), dstAllowedDomain.size()) == 0) { + result = TEEC_SUCCESS; + break; + } + } + + return result; +} + /** * TEEContext destructer. */ diff --git a/ssflib/dep/cryptocore/include/CC_Type.h b/ssflib/dep/cryptocore/include/CC_Type.h index 94afd90..1de5240 100644 --- a/ssflib/dep/cryptocore/include/CC_Type.h +++ b/ssflib/dep/cryptocore/include/CC_Type.h @@ -12,16 +12,15 @@ #ifndef _CC_TYPE_H_ #define _CC_TYPE_H_ -#include /*! @brief 1-byte data type */ -typedef uint8_t cc_u8; +typedef unsigned char cc_u8; /*! @brief 2-byte data type */ -typedef uint16_t cc_u16; +typedef unsigned short cc_u16; /*! @brief 4-byte data type */ -typedef uint32_t cc_u32; +typedef unsigned int cc_u32; #ifndef _OP64_NOTSUPPORTED @@ -29,11 +28,11 @@ typedef uint32_t cc_u32; #ifdef _WIN32 typedef unsigned __int64 cc_u64; #else - typedef uint64_t cc_u64; + typedef unsigned long long cc_u64; #endif //_WIN32 #endif //_OP64_NOTSUPPORTED #endif //_CC_TYPE_H_ -/***************************** End of File *****************************/ +/***************************** End of File *****************************/ \ No newline at end of file diff --git a/ssflib/dep/cryptocore/include/test_self.h b/ssflib/dep/cryptocore/include/test_self.h new file mode 100644 index 0000000..ecc0a31 --- /dev/null +++ b/ssflib/dep/cryptocore/include/test_self.h @@ -0,0 +1,30 @@ +#ifndef _SELFTEST_H_ +#define _SELFTEST_H_ + +#include "CC_API.h" + + + +int fips_aes_selftest(void); +int fips_des_selftest(void); +int fips_dh_selftest(void); +int fips_dsa_selftest(void); +int fips_hmac_selftest(void); +int fips_rand_selftest(void); +int fips_rsa_selftest(void); +int fips_sha_selftest(void); + +int fips_cmac_selftest(void); +int fips_ecdh_selftest(void); +int fips_ecdsa_selftest(void); +int fips_drbg_hmac_selftest(void); + +int fips_selftest_check(void); + +#if (defined(unix) || defined(__linux__) || defined(__unix__) || defined(__unix) || defined(__ANDROID__)) && defined(CC_BUILD_TARGET_UNIX) +int integrity_check(); +#endif + + + +#endif //_SELFTEST_H_ \ No newline at end of file diff --git a/ssflib/dep/cryptocore/source/CC_API.c b/ssflib/dep/cryptocore/source/CC_API.c index 9fa7d66..7fc023e 100644 --- a/ssflib/dep/cryptocore/source/CC_API.c +++ b/ssflib/dep/cryptocore/source/CC_API.c @@ -64,7 +64,11 @@ void CCFree(void *ptr) CryptoCoreContainer *create_CryptoCoreContainer(cc_u32 algorithm) { CryptoCoreContainer *crt; - srand((unsigned int)time(NULL)); + + static int add_value = 0; + if(++add_value == 10000) add_value = 0; + + srand(time(NULL) + add_value ); // allocate memory for crypt data structure (by using CCMalloc) crt = (CryptoCoreContainer *)CCMalloc(sizeof(CryptoCoreContainer)); @@ -118,6 +122,8 @@ CryptoCoreContainer *create_CryptoCoreContainer(cc_u32 algorithm) crt->ECDH_Gen1stPhaseKey= NULL; crt->ECDH_GenAuthKey = NULL; + printf("TEST!!! step 1 in create_CryptoCoreContainer(%d)\n",algorithm); + // allocate memory for context data structure // and set up the member functions according to the algorithm crt->alg = algorithm; @@ -339,6 +345,15 @@ CryptoCoreContainer *create_CryptoCoreContainer(cc_u32 algorithm) crt = NULL; break; } + + printf("TEST!!! after in create_CryptoCoreContainer(%p %d)\n",crt, ID_AES128); + printf("TEST!!! after in create_CryptoCoreContainer(%p)\n",crt->SE_init); +/* crt->SE_init = SDRM_AES_init; + crt->SE_process = SDRM_AES_process; + crt->SE_final = SDRM_AES_final; + crt->SE_EncryptOneBlock = SDRM_AES128_Encryption; + crt->SE_DecryptOneBlock = SDRM_AES128_Decryption;*/ + return crt; } @@ -445,4 +460,4 @@ void destroy_CryptoCoreContainer(CryptoCoreContainer* crt) CCFree(crt); } -/***************************** End of File *****************************/ \ No newline at end of file +/***************************** End of File *****************************/ diff --git a/ssflib/dep/cryptocore/source/base/cc_bignum.c b/ssflib/dep/cryptocore/source/base/cc_bignum.c index 07016ab..04d302e 100644 --- a/ssflib/dep/cryptocore/source/base/cc_bignum.c +++ b/ssflib/dep/cryptocore/source/base/cc_bignum.c @@ -2808,9 +2808,11 @@ int SDRM_HEX2BN(cc_u8* pbSrc, SDRM_BIG_NUM *BN_Dst) cc_u32 i, n, k, j; cc_u8 * bufferHex = NULL; + n = (cc_u32)strlen((const char*)pbSrc); + if (!BN_Dst) { - BN_Dst = SDRM_BN_Init(BN_Dst->Length * SDRM_SIZE_OF_DWORD * 8); + BN_Dst = SDRM_BN_Init((n / SDRM_SIZE_BLOCK) * SDRM_SIZE_OF_DWORD * 8); if(BN_Dst == NULL) { return CRYPTO_MEMORY_ALLOC_FAIL; @@ -2822,15 +2824,12 @@ int SDRM_HEX2BN(cc_u8* pbSrc, SDRM_BIG_NUM *BN_Dst) pbSrc[0] = '0'; } - BN_Dst->Length = 0; - n = strlen((const char*)pbSrc); - BN_Dst->Length = n / SDRM_SIZE_BLOCK; //normalize length if( n % SDRM_SIZE_BLOCK != 0 ) { BN_Dst->Length+=1; } -#if 0 //fix prevent problem by guoxing.xu 20140826. move to before +#if 0 //fix prevent problem by guoxing.xu 20140826. move to before if (!BN_Dst) { BN_Dst = SDRM_BN_Init(BN_Dst->Length * SDRM_SIZE_OF_DWORD * 8); @@ -2844,23 +2843,22 @@ int SDRM_HEX2BN(cc_u8* pbSrc, SDRM_BIG_NUM *BN_Dst) //full string: bufferHex mod Length = 0 bufferHex = (cc_u8 *)malloc( sizeof(cc_u8) * (BN_Dst->Length * SDRM_SIZE_BLOCK)); - //init byffer by 0 + //init byffer by 0 for(i = 0; i < BN_Dst->Length * SDRM_SIZE_BLOCK; i++) { bufferHex[i] = '0'; } - k = n - 1; for(i = (BN_Dst->Length * SDRM_SIZE_BLOCK) - 1; (int)k >= 0; i--, k--) { bufferHex[i] = pbSrc[k]; } - + for(i = 0; i < BN_Dst->Length; i++) { for(j = (BN_Dst->Length * SDRM_SIZE_BLOCK) - (i * SDRM_SIZE_BLOCK) - SDRM_SIZE_BLOCK; j < (BN_Dst->Length * SDRM_SIZE_BLOCK) - (i * SDRM_SIZE_BLOCK) ; j++) - { + { switch(bufferHex[j]) { case '0': @@ -2952,13 +2950,16 @@ int SDRM_HEX2BN(cc_u8* pbSrc, SDRM_BIG_NUM *BN_Dst) BN_Dst->pData[i] |= 0xf; break; default: + { + free(bufferHex); return CRYPTO_INVALID_ARGUMENT; + } } } } - + //clear time buffer - free(bufferHex); + free(bufferHex); return CRYPTO_SUCCESS; } @@ -3080,34 +3081,38 @@ cc_u8 * SDRM_BN2STRFOUR(cc_u32 *numberBits, SDRM_BIG_NUM *BN_Src) cc_u8 tempChar[10]; (*numberBits) = 0; + if(strDestTemp == NULL) + { + return NULL; + } + d = SDRM_BN_Init(BN_Src->Size); if( d == NULL)// fix prevent cid =89093 by guoxing.xu { + free(strDestTemp); return NULL; } tempREM = SDRM_BN_Init(BN_Src->Size); num = SDRM_BN_Init(BN_Src->Size); if( num == NULL)//fix prevent cid = 89093 by guoxing.xu { + free(strDestTemp); SDRM_BN_FREE(d); return NULL; } SDRM_BN_Copy(num, BN_Src); SDRM_BN_SetWord(d, 4); - - while (!SDRM_BN_isZero(num)) { - SDRM_BN_Div(num, tempREM, num, d); - //itoa(tempREM->pData[0], (char *)tempChar, 10); + SDRM_BN_Div(num, tempREM, num, d); + //itoa(tempREM->pData[0], (char *)tempChar, 10); //sprintf((char*)tempChar, "%d", tempREM->pData[0]); snprintf((char*)tempChar, sizeof(tempChar), "%d", tempREM->pData[0]);// fix prevnet 60199 by guoxing.xu strDestTemp[(*numberBits)] = tempChar[0]; (*numberBits)++; } - if((*numberBits) != 0) { strDest = (cc_u8*)malloc((*numberBits) + 1); diff --git a/ssflib/dep/cryptocore/source/base/cc_fast_math.c b/ssflib/dep/cryptocore/source/base/cc_fast_math.c index 2718a8b..b00376e 100644 --- a/ssflib/dep/cryptocore/source/base/cc_fast_math.c +++ b/ssflib/dep/cryptocore/source/base/cc_fast_math.c @@ -523,8 +523,7 @@ int SDRM_ll_Rem(IN BasicWord *pOperand, IN BasicWord uOperandLengthInBytes, nWordX = SDRM_ll_getMSW(pOperand, nWordX) + 1; nWordP = SDRM_ll_getMSW(pModule, nWordX) + 1; - // Krishna - pTempResult = (BasicWord*) calloc(nWordX+1,BASICWORD_BYTES_COUNT); + pTempResult = (BasicWord *)calloc(nWordX+1,BASICWORD_BYTES_COUNT); if (!pTempResult) { return CRYPTO_MEMORY_ALLOC_FAIL; diff --git a/ssflib/dep/cryptocore/source/middle/cc_rng.c b/ssflib/dep/cryptocore/source/middle/cc_rng.c index 614aa61..85fb210 100644 --- a/ssflib/dep/cryptocore/source/middle/cc_rng.c +++ b/ssflib/dep/cryptocore/source/middle/cc_rng.c @@ -60,10 +60,15 @@ int SDRM_X931_get(CryptoCoreContainer *crt, cc_u32 bitLength, cc_u8 *data) #ifdef _WIN32_WCE srand(GetTickCount()); #else - srand((unsigned int)time(NULL)); + + static int add_value = 0; + if(++add_value == 10000) add_value = 0; + + srand(time(NULL) + add_value ); + #endif return SDRM_RNG_X931(crt->ctx->x931ctx->Seed, bitLength, data); } -/***************************** End of File *****************************/ \ No newline at end of file +/***************************** End of File *****************************/ diff --git a/ssflib/dep/cryptocore/source/middle/cc_rsa.c b/ssflib/dep/cryptocore/source/middle/cc_rsa.c index 43d6f10..4c65f2d 100644 --- a/ssflib/dep/cryptocore/source/middle/cc_rsa.c +++ b/ssflib/dep/cryptocore/source/middle/cc_rsa.c @@ -1134,14 +1134,14 @@ int SDRM_RSA_encrypt(CryptoCoreContainer *crt, cc_u8 *in, cc_u32 inLen, cc_u8 *o retVal = SDRM_Enpad_Rsaes_oaep(pbBuf, in, inLen, RSA_KeyByteLen, SDRM_HIGH_HALF(crt->ctx->rsactx->pm)); break; case ID_NO_PADDING : - if( inLen != RSA_KeyByteLen) // add by guoxing.xu 20140919 - { - free(pbBuf); - return CRYPTO_INVALID_ARGUMENT; - } + if( inLen != RSA_KeyByteLen) // add by guoxing.xu 20140919 + { + free(pbBuf); + return CRYPTO_INVALID_ARGUMENT; + } memset(pbBuf, 0x00, RSA_KeyByteLen - inLen); memcpy(pbBuf + RSA_KeyByteLen - inLen, in, inLen); - retVal= CRYPTO_SUCCESS;// add by guoxing.xu 20140919 + retVal= CRYPTO_SUCCESS;// add by guoxing.xu 20140919 break; default : free(pbBuf); diff --git a/ssflib/dep/cryptocore/source/middle/cc_symmetric.c b/ssflib/dep/cryptocore/source/middle/cc_symmetric.c index b70f441..cbd1c48 100644 --- a/ssflib/dep/cryptocore/source/middle/cc_symmetric.c +++ b/ssflib/dep/cryptocore/source/middle/cc_symmetric.c @@ -17,7 +17,7 @@ #include "cc_moo.h" #include "cc_rc4.h" #include "cc_snow2.h" -#include + //////////////////////////////////////////////////////////////////////////// // Functions //////////////////////////////////////////////////////////////////////////// @@ -134,19 +134,16 @@ int SDRM_AES_init(CryptoCoreContainer *crt, cc_u32 mode, cc_u32 PADDING, cc_u8 * { return CRYPTO_NULL_POINTER; } - if (!(((mode >= 1111) && (mode <= 1115)) || ((mode >= 1121) && (mode <= 1125)))) { return CRYPTO_INVALID_ARGUMENT; } - if (!((crt->alg == ID_AES128) && (keysize == 16)) && !((crt->alg == ID_AES192) && (keysize == 24)) && !((crt->alg == ID_AES256) && (keysize == 32))) { return CRYPTO_INVALID_ARGUMENT; } - if ((crt->alg != ID_AES128) && (crt->alg != ID_AES192) && (crt->alg != ID_AES256)) { return CRYPTO_INVALID_ARGUMENT; @@ -156,11 +153,9 @@ int SDRM_AES_init(CryptoCoreContainer *crt, cc_u32 mode, cc_u32 PADDING, cc_u8 * { return CRYPTO_INVALID_ARGUMENT; } - crt->ctx->aesctx->moo = mode; crt->ctx->aesctx->padding = PADDING; - if (mode != ID_DEC_ECB && mode != ID_DEC_CBC) { SDRM_getEncRoundKey(crt->alg, key, crt->ctx->aesctx->RoundKey); @@ -169,7 +164,6 @@ int SDRM_AES_init(CryptoCoreContainer *crt, cc_u32 mode, cc_u32 PADDING, cc_u8 * { SDRM_getDecRoundKey(crt->alg, key, crt->ctx->aesctx->RoundKey); } - if (IV) { memcpy(crt->ctx->aesctx->IV, IV, SDRM_AES_BLOCK_SIZ); @@ -178,11 +172,9 @@ int SDRM_AES_init(CryptoCoreContainer *crt, cc_u32 mode, cc_u32 PADDING, cc_u8 * { memset(crt->ctx->aesctx->IV, 0x00, SDRM_AES_BLOCK_SIZ); } - crt->ctx->aesctx->BlockLen = 0; GET_UINT32(crt->ctx->aesctx->CTR_Count, crt->ctx->aesctx->IV + 12, 0); - return CRYPTO_SUCCESS; } @@ -371,9 +363,6 @@ int SDRM_AES_final(CryptoCoreContainer *crt, cc_u8 *input, cc_u32 inputLen, cc_u cc_u8 *Block, PADDING[16]; cc_u32 BlockLen; cc_u8 t; - int i = 0; - - if (outputLen != NULL) { @@ -387,8 +376,7 @@ int SDRM_AES_final(CryptoCoreContainer *crt, cc_u8 *input, cc_u32 inputLen, cc_u Block = crt->ctx->aesctx->Block; BlockLen = crt->ctx->aesctx->BlockLen; - i = 0; - printf("Block [%d]: %d\n", i, Block[0]); + if (crt->ctx->aesctx->moo >= ID_DEC_ECB) { @@ -445,10 +433,7 @@ int SDRM_AES_final(CryptoCoreContainer *crt, cc_u8 *input, cc_u32 inputLen, cc_u } break; default : - { - return CRYPTO_INVALID_ARGUMENT; - } } //encryption @@ -479,9 +464,7 @@ int SDRM_AES_final(CryptoCoreContainer *crt, cc_u8 *input, cc_u32 inputLen, cc_u } break; default : - { - retVal = CRYPTO_INVALID_ARGUMENT; - } + retVal = CRYPTO_INVALID_ARGUMENT; break; } @@ -526,9 +509,7 @@ DECRYPTION: retVal = SDRM_CTR_Dec(crt->alg, Block, Block, crt->ctx->aesctx->RoundKey, crt->ctx->aesctx->IV, crt->ctx->aesctx->CTR_Count++); break; default : - { - return CRYPTO_INVALID_ARGUMENT; - } + return CRYPTO_INVALID_ARGUMENT; } if (retVal != CRYPTO_SUCCESS) @@ -544,17 +525,12 @@ DECRYPTION: { case 0 : case ID_PKCS5 : - { i = 0; - //for (; i < 16; i++) - printf("Block [%d]: %d\n", i, Block[i]); - if ((t > SDRM_AES_BLOCK_SIZ) || (t < 1)) { return CRYPTO_INVALID_ARGUMENT; } memset(PADDING, t, t); break; - } case ID_SSL_PADDING : ++t; if ((t > SDRM_AES_BLOCK_SIZ) || (t < 1)) @@ -606,9 +582,8 @@ DECRYPTION: if (outputLen != NULL) { *outputLen = 0; - - return CRYPTO_INVALID_ARGUMENT; } + return CRYPTO_INVALID_ARGUMENT; } if (memcmp(PADDING, Block + SDRM_AES_BLOCK_SIZ - t, t) != 0) @@ -1700,4 +1675,4 @@ DECRYPTION: } -/***************************** End of File *****************************/ +/***************************** End of File *****************************/ \ No newline at end of file diff --git a/ssflib/dep/swdss/include/slog.h b/ssflib/dep/swdss/include/slog.h index b9dc449..c538e1c 100644 --- a/ssflib/dep/swdss/include/slog.h +++ b/ssflib/dep/swdss/include/slog.h @@ -11,7 +11,7 @@ * 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. + * limitations under the License. */ #ifndef _SWD_LOG_H_ #define _SWD_LOG_H_ @@ -20,12 +20,12 @@ #include #define THE_PRINTF(fmt, ARG...) printf(fmt"\n", ##ARG) -#define SLOGV(FMT, ARG ...) THE_PRINTF("[VBOSE][%s]"FMT, LOG_TAG, ##ARG) -#define SLOGD(FMT, ARG ...) THE_PRINTF("[DEBUG][%s]"FMT, LOG_TAG, ##ARG) -#define SLOGI(FMT, ARG ...) THE_PRINTF("[INFO] [%s]"FMT, LOG_TAG, ##ARG) -#define SLOGW(FMT, ARG ...) THE_PRINTF("[WARN] [%s]"FMT, LOG_TAG, ##ARG) -#define SLOGE(FMT, ARG ...) THE_PRINTF("[ERROR][%s]"FMT, LOG_TAG, ##ARG) -#define SLOGF(FMT, ARG ...) THE_PRINTF("[FATAL][%s]"FMT, LOG_TAG, ##ARG) +#define SLOGV(FMT, ARG ...) THE_PRINTF("[VBOSE][%s]" FMT, LOG_TAG, ##ARG) +#define SLOGD(FMT, ARG ...) THE_PRINTF("[DEBUG][%s]" FMT, LOG_TAG, ##ARG) +#define SLOGI(FMT, ARG ...) THE_PRINTF("[INFO] [%s]" FMT, LOG_TAG, ##ARG) +#define SLOGW(FMT, ARG ...) THE_PRINTF("[WARN] [%s]" FMT, LOG_TAG, ##ARG) +#define SLOGE(FMT, ARG ...) THE_PRINTF("[ERROR][%s]" FMT, LOG_TAG, ##ARG) +#define SLOGF(FMT, ARG ...) THE_PRINTF("[FATAL][%s]" FMT, LOG_TAG, ##ARG) #endif diff --git a/ssflib/dep/swdss/include/ss_types.h b/ssflib/dep/swdss/include/ss_types.h index 89ec412..02f1791 100644 --- a/ssflib/dep/swdss/include/ss_types.h +++ b/ssflib/dep/swdss/include/ss_types.h @@ -17,8 +17,6 @@ #ifndef _SWD_SS_COMMON_H_ #define _SWD_SS_COMMON_H_ -#include - #define SS_MAX_UUID_LEN 64 #define SS_MAX_MODULE_NAME_LEN 32 #define SS_MAX_DATA_NAME_LEN 128 @@ -86,12 +84,16 @@ typedef struct credential { } ss_credential_s; +typedef unsigned char uint8_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; typedef uint8_t CBT_OCTET; typedef uint8_t* CBT_OCTET_PTR; typedef uint32_t CBT_UINT32; typedef uint32_t* CBT_UINT32_PTR; typedef void* CBT_DATA_PTR; typedef CBT_UINT32 CBT_BOOL; +typedef unsigned short uint16_t; #endif diff --git a/ssflib/dep/uci/include/uci_aes_xcbc_mac.h b/ssflib/dep/uci/include/uci_aes_xcbc_mac.h index 176a150..47ff5f0 100644 --- a/ssflib/dep/uci/include/uci_aes_xcbc_mac.h +++ b/ssflib/dep/uci/include/uci_aes_xcbc_mac.h @@ -43,7 +43,7 @@ typedef struct { int xcbc_init(aes_xcbc_state *xcbc, unsigned char *key, unsigned int keylen); int xcbc_process(aes_xcbc_state *xcbc, unsigned char *in, unsigned int inlen); -int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, size_t *outlen); +int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, unsigned int *outlen); #ifdef __cplusplus } diff --git a/ssflib/dep/uci/include/uci_api.h b/ssflib/dep/uci/include/uci_api.h index 4ce1e25..0acb7e4 100644 --- a/ssflib/dep/uci/include/uci_api.h +++ b/ssflib/dep/uci/include/uci_api.h @@ -132,7 +132,7 @@ int uci_mac_update(UCI_HANDLE oh, unsigned char *msg, unsigned int msg_len); * @retval UCI_ERROR if output is NULL. */ int uci_mac_final(UCI_HANDLE oh, unsigned char *output, - size_t *output_len); + unsigned int *output_len); /** * @brief generate c-mac code @@ -298,7 +298,7 @@ int uci_ae_set_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, * @retval UCI_ERROR input or output is NULL.. */ int uci_ae_encrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, - unsigned char * output, size_t* output_len); + unsigned char * output, unsigned int* output_len); /** * @brief RSA Decryption @@ -313,7 +313,7 @@ int uci_ae_encrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, * @retval UCI_ERROR input or output is NULL. */ int uci_ae_decrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, - unsigned char * output, size_t* output_len); + unsigned char * output, unsigned int* output_len); /** * @brief RSA Decryption using CRT @@ -371,7 +371,7 @@ int uci_wbae_decrypt(UCI_HANDLE oh, unsigned char * input, * @retval UCI_ERROR if hash or signature is NULL. */ int uci_ds_sign(UCI_HANDLE oh, unsigned char * hash, unsigned int hash_len, - unsigned char * signature, size_t* sign_len); + unsigned char * signature, unsigned int* sign_len); /** * @brief generate signature for given value @@ -442,13 +442,13 @@ int uci_authcrypt_init(UCI_HANDLE oh, unsigned int mode, unsigned char *nonce, int uci_authcrypt_update_aad(UCI_HANDLE oh, unsigned char *aad, unsigned int aad_len); int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, size_t *dest_len); + unsigned int src_len, unsigned char *dest, unsigned int *dest_len); int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, size_t *dest_len, - unsigned char *tag, size_t *tag_len); + unsigned int src_len, unsigned char *dest, unsigned int *dest_len, + unsigned char *tag, unsigned int *tag_len); int uci_authcrypt_decryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, size_t *dest_len, + unsigned int src_len, unsigned char *dest, unsigned int *dest_len, unsigned char *tag, unsigned int tag_len); /** diff --git a/ssflib/dep/uci/include/uci_cryptocore.h b/ssflib/dep/uci/include/uci_cryptocore.h index 3323971..ab40685 100644 --- a/ssflib/dep/uci/include/uci_cryptocore.h +++ b/ssflib/dep/uci/include/uci_cryptocore.h @@ -126,7 +126,7 @@ int cryptocore_mac_update(UCI_HANDLE oh, unsigned char *msg, */ int cryptocore_mac_final(UCI_HANDLE oh, unsigned char *output, - size_t *output_len); + unsigned int *output_len); /** * @brief generate c-mac code @@ -267,7 +267,7 @@ int cryptocore_ae_set_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, */ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, size_t* output_len); + unsigned int input_len, unsigned char * output, unsigned int* output_len); /** * @brief RSA Decryption @@ -281,7 +281,7 @@ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char * input, * @retval UCI_ERROR other error occured. */ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, size_t* output_len); + unsigned int input_len, unsigned char * output, unsigned int* output_len); /** * @brief RSA Decryption using CRT @@ -295,7 +295,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char * input, * @retvla UCI_ERROR other error occured. */ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, size_t * output_len); + unsigned int input_len, unsigned char * output, unsigned int* output_len); /** * @brief generate signature for given value @@ -309,7 +309,7 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input, * @retval UCI_ERROR other error occured. */ int cryptocore_ds_sign(UCI_HANDLE oh, unsigned char * hash, - unsigned int hash_len, unsigned char * signature, size_t* sign_len); + unsigned int hash_len, unsigned char * signature, unsigned int* sign_len); /** * @brief generate signature for given value diff --git a/ssflib/dep/uci/include/uci_type.h b/ssflib/dep/uci/include/uci_type.h index f123fa8..f3c8843 100644 --- a/ssflib/dep/uci/include/uci_type.h +++ b/ssflib/dep/uci/include/uci_type.h @@ -35,7 +35,7 @@ * @brief UCI handle. * */ -typedef intptr_t UCI_HANDLE; +typedef int UCI_HANDLE; /** * @brief UCI return error type. * diff --git a/ssflib/dep/uci/source/uci_aes_xcbc_mac.c b/ssflib/dep/uci/source/uci_aes_xcbc_mac.c index e20585f..ae3f3b0 100644 --- a/ssflib/dep/uci/source/uci_aes_xcbc_mac.c +++ b/ssflib/dep/uci/source/uci_aes_xcbc_mac.c @@ -94,7 +94,7 @@ int xcbc_process(aes_xcbc_state *xcbc, unsigned char *in, unsigned int inlen) { } return 1; } -int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, size_t *outlen) { +int xcbc_done(aes_xcbc_state *xcbc, unsigned char *out, unsigned int *outlen) { unsigned int x; if (xcbc == NULL || out == NULL) { return 0; diff --git a/ssflib/dep/uci/source/uci_api.c b/ssflib/dep/uci/source/uci_api.c index 59928ae..15cb5fc 100644 --- a/ssflib/dep/uci/source/uci_api.c +++ b/ssflib/dep/uci/source/uci_api.c @@ -83,7 +83,7 @@ UCI_HANDLE uci_context_alloc(unsigned int algorithm, uci_engine_config_e config) ctx = (uci_context_s*)OsaMalloc(sizeof(uci_context_s)); ctx->imp = (aes_xcbc_state *)OsaMalloc(sizeof(aes_xcbc_state)); ctx->alg = ID_UCI_XCBCMAC; - return (UCI_HANDLE)ctx; + return (int)ctx; } if (conf == UCI_SW_CRYPTOCORE) { return cryptocore_context_alloc(algorithm); @@ -172,7 +172,7 @@ int uci_mac_update(UCI_HANDLE oh, unsigned char *msg, unsigned int msg_len) { } int uci_mac_final(UCI_HANDLE oh, unsigned char *output, - size_t *output_len) { + unsigned int *output_len) { int ret = 0; uci_context_s *pctx = (uci_context_s*)oh; if (pctx->alg == ID_UCI_XCBCMAC) { @@ -189,8 +189,8 @@ int uci_mac_final(UCI_HANDLE oh, unsigned char *output, int uci_mac_get_mac(UCI_HANDLE oh, unsigned char *key, unsigned int key_len, unsigned char *msg, unsigned int msg_len, unsigned char *output, - size_t *output_len) { - int ret = 0; + unsigned int *output_len) { + //int ret = 0; uci_context_s *pctx = (uci_context_s*)oh; if (pctx->alg == ID_UCI_XCBCMAC) { if (xcbc_init((aes_xcbc_state *)(pctx->imp), key, key_len) != 1) { @@ -207,11 +207,8 @@ int uci_mac_get_mac(UCI_HANDLE oh, unsigned char *key, unsigned int key_len, return UCI_SUCCESS; } - unsigned int uioutput_len = (unsigned int)(*output_len); - ret = cryptocore_mac_getmac(oh, key, key_len, msg, msg_len, output, - &uioutput_len); - *output_len = (size_t)uioutput_len; - return ret; + return cryptocore_mac_getmac(oh, key, key_len, msg, msg_len, output, + output_len); } int uci_se_init(UCI_HANDLE oh, unsigned int mode, unsigned padding, @@ -318,17 +315,17 @@ int uci_ae_set_keypair(UCI_HANDLE oh, uci_key_s *keymaterial, } int uci_ae_encrypt(UCI_HANDLE oh, unsigned char *input, unsigned int input_len, - unsigned char *output, size_t *output_len) { + unsigned char *output, unsigned int *output_len) { return cryptocore_ae_encrypt(oh, input, input_len, output, output_len); } int uci_ae_decrypt(UCI_HANDLE oh, unsigned char *input, unsigned int input_len, - unsigned char *output, size_t *output_len) { + unsigned char *output, unsigned int *output_len) { return cryptocore_ae_decrypt(oh, input, input_len, output, output_len); } int uci_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, size_t *output_len) { + unsigned int input_len, unsigned char *output, unsigned int *output_len) { return cryptocore_ae_decryptbycrt(oh, input, input_len, output, output_len); } @@ -343,7 +340,7 @@ int uci_wbae_decrypt(UCI_HANDLE oh, unsigned char *input, } int uci_ds_sign(UCI_HANDLE oh, unsigned char *hash, unsigned int hash_len, - unsigned char *signature, size_t *sign_len) { + unsigned char *signature, unsigned int *sign_len) { return cryptocore_ds_sign(oh, hash, hash_len, signature, sign_len); } @@ -446,7 +443,7 @@ int uci_authcrypt_update_aad(UCI_HANDLE oh, unsigned char *aad, return UCI_ERROR; } int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, size_t *dest_len) { + unsigned int src_len, unsigned char *dest, unsigned int *dest_len) { #if 0 uci_context_s *pctx = (uci_context_s*)oh; gcm_context *gctx; @@ -480,8 +477,8 @@ int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, return UCI_ERROR; } int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, size_t *dest_len, - unsigned char *tag, size_t *tag_len) { + unsigned int src_len, unsigned char *dest, unsigned int *dest_len, + unsigned char *tag, unsigned int *tag_len) { #if 0 uci_context_s *pctx = (uci_context_s*)oh; gcm_context *gctx = NULL; @@ -528,7 +525,7 @@ int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, return UCI_ERROR; } int uci_authcrypt_decryptfinal(UCI_HANDLE oh, unsigned char *src, - unsigned int src_len, unsigned char *dest, size_t *dest_len, + unsigned int src_len, unsigned char *dest, unsigned int *dest_len, unsigned char *tag, unsigned int tag_len) { #if 0 uci_context_s *pctx = (uci_context_s*)oh; diff --git a/ssflib/dep/uci/source/uci_cryptocore.c b/ssflib/dep/uci/source/uci_cryptocore.c index a0e1a1b..db15895 100644 --- a/ssflib/dep/uci/source/uci_cryptocore.c +++ b/ssflib/dep/uci/source/uci_cryptocore.c @@ -182,7 +182,7 @@ int cryptocore_mac_update(UCI_HANDLE oh, unsigned char *msg, } int cryptocore_mac_final(UCI_HANDLE oh, unsigned char *output, - size_t *output_len) { + unsigned int *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; if (pctx == NULL) { @@ -193,11 +193,8 @@ int cryptocore_mac_final(UCI_HANDLE oh, unsigned char *output, return UCI_INVALID_HANDLE; } - cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->MAC_final( - (CryptoCoreContainer*)(pctx->imp), output, &output_len32); - *output_len = (size_t)output_len32; - + (CryptoCoreContainer*)(pctx->imp), output, output_len); if (ret != CRYPTO_SUCCESS) { return UCI_ERROR; } @@ -712,7 +709,7 @@ int cryptocore_ae_set_keypair(UCI_HANDLE oh, uci_key_s *keymaterial, } int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, size_t *output_len) { + unsigned int input_len, unsigned char *output, unsigned int *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -727,11 +724,8 @@ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char *input, if (pctx->alg < ID_UCI_RSA || pctx->alg > ID_UCI_RSA512) { return UCI_INVALID_HANDLE; } - - cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->AE_encrypt( - ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32); - *output_len = (size_t)output_len32; + ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len); if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } @@ -742,7 +736,7 @@ int cryptocore_ae_encrypt(UCI_HANDLE oh, unsigned char *input, } int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, size_t *output_len) { + unsigned int input_len, unsigned char *output, unsigned int *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -758,12 +752,8 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input, if (pctx->alg < ID_UCI_RSA || pctx->alg > ID_UCI_RSA512) { return UCI_INVALID_HANDLE; } - - cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->AE_decrypt( - ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32); - *output_len = (size_t)output_len32; - + ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len); if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } @@ -774,7 +764,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input, } int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, - unsigned int input_len, unsigned char *output, size_t *output_len) { + unsigned int input_len, unsigned char *output, unsigned int *output_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -789,10 +779,8 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, // ctr=(CryptoCoreContainer *)(pctx->imp); // ctr->MD_update(ctr,msg,msg_len); - cc_u32 output_len32 = (cc_u32)(*output_len); ret = ((CryptoCoreContainer *)pctx->imp)->AE_decryptByCRT( - ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32); - *output_len = (size_t)output_len32; + ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len); if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } @@ -803,7 +791,7 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input, } int cryptocore_ds_sign(UCI_HANDLE oh, unsigned char *hash, - unsigned int hash_len, unsigned char *signature, size_t *sign_len) { + unsigned int hash_len, unsigned char *signature, unsigned int *sign_len) { int ret; uci_context_s *pctx = (uci_context_s*)oh; @@ -816,10 +804,8 @@ int cryptocore_ds_sign(UCI_HANDLE oh, unsigned char *hash, return UCI_INVALID_HANDLE; } - cc_u32 sign_len32 = (cc_u32)(*sign_len); ret = ((CryptoCoreContainer *)pctx->imp)->DS_sign( - ((CryptoCoreContainer*)pctx->imp), hash, hash_len, signature, &sign_len32); - *sign_len = (size_t)sign_len32; + ((CryptoCoreContainer*)pctx->imp), hash, hash_len, signature, sign_len); if (ret == CRYPTO_MSG_TOO_LONG) { return UCI_MSG_TOO_LONG; } diff --git a/ssflib/inc/crypto_internal.h b/ssflib/inc/crypto_internal.h new file mode 100644 index 0000000..4df29f9 --- /dev/null +++ b/ssflib/inc/crypto_internal.h @@ -0,0 +1,72 @@ +/* + * ace.c + * + * This source file is proprietary property of Samsung Electronics Co., Ltd. + * + * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd All Rights Reserved + * + * Contact: Jaemin Ryu + * + */ + +#include "tee_internal_api.h" + +#define TZSL_CRYPTO_PADDING +#define MAX_BLOCK_SIZE 64 +#define MAX_IVEC_SIZE 16 + +#define TEE_ALG_GENERATE_SECRET_KEY 0x90000000 +#define TEE_ALG_GENERATE_RSA_KEY 0x90000001 +#define TEE_ALG_GENERATE_DSA_KEY 0x90000002 +#define TEE_ALG_GENERATE_DH_KEY 0x90000003 + +typedef enum +{ + CRYPTO_HW_ENGINE, + CRYPTO_SW_ENGINE, + CRYPTO_NO_ENGINE +}crypto_internal_engine; + +typedef enum +{ + CRYPTO_USE_DEFAULT_ENGINE, + CRYPTO_USE_SW_ENGINE +}crypto_internal_engine_type; + +typedef struct +{ + TEE_OperationInfo info; + TEE_ObjectHandle key1; + TEE_ObjectHandle key2; + int crypto; // handle to crypto driver or ponter to crypto library context + unsigned char data[MAX_BLOCK_SIZE]; // accumulated stream data + unsigned int data_len; // accumulated data length + unsigned int block_len; // cipher block data length +} crypto_internal_operation; + +typedef struct +{ + unsigned char *buffer; + unsigned int size; +} crypto_internal_keydata; + +typedef struct +{ + crypto_internal_keydata secret; /* TEE_ATTR_SECRET_VALUE */ + crypto_internal_keydata rsa_modulus; /* TEE_ATTR_RSA_MODULUS */ + crypto_internal_keydata rsa_public; /* TEE_ATTR_RSA_PUBLIC_EXPONENT */ + crypto_internal_keydata rsa_private; /* TEE_ATTR_RSA_PRIVATE_EXPONENT */ + crypto_internal_keydata rsa_prime1; /* TEE_ATTR_RSA_PRIME1 */ + crypto_internal_keydata rsa_prime2; /* TEE_ATTR_RSA_PRIME2 */ + crypto_internal_keydata rsa_exponent1; /* TEE_ATTR_RSA_EXPONENT1 */ + crypto_internal_keydata rsa_exponent2; /* TEE_ATTR_RSA_EXPONENT2 */ + crypto_internal_keydata rsa_coefficient; /* TEE_ATTR_RSA_COEFFICIENT */ +} crypto_internal_keystruct; + +void crypto_internal_set_engine(int set); +int crypto_internal_open(crypto_internal_operation *operation); +int crypto_internal_close(crypto_internal_operation *operation); +int crypto_internal_init(crypto_internal_operation *operation, crypto_internal_keystruct *key, unsigned char *ivec, size_t ivec_len); +int crypto_internal_update(crypto_internal_operation *operation, unsigned char *src_data, size_t src_len, unsigned char *dst_data, size_t *dst_len); +int crypto_internal_final(crypto_internal_operation *operation, unsigned char *src_data, size_t src_len, unsigned char *dst_data, size_t *dst_len); + diff --git a/ssflib/inc/permission.h b/ssflib/inc/permission.h new file mode 100644 index 0000000..87350c0 --- /dev/null +++ b/ssflib/inc/permission.h @@ -0,0 +1,51 @@ +/* + * permission.h + * + * This source file is proprietary property of Samsung Electronics Co., Ltd. + * + * Copyright (C) 2011 - 2015 Samsung Electronics Co., Ltd All Rights Reserved + * + */ + +#ifndef __PERMISSION_H__ +#define __PERMISSION_H__ + +#include + +#define PERMISSION_CHECK(variable) \ + if(CheckPermission(variable)) { \ + LOGE(SSF_LIB, "Permission Denied - Function %s() is not permitted." , __FUNCTION__ ); \ + return TEE_ERROR_ACCESS_DENIED; } + +#define PERMISSION_CHECK_RETURN_VOID(variable) \ + if(CheckPermission(variable)) { \ + LOGE(SSF_LIB, "Permission Denied - Function %s() is not permitted." , __FUNCTION__ ); \ + return; } + +typedef enum { + PERM_CRYPTO = 0x00000001, + PERM_STORAGE = 0x00000002, + PERM_TIME = 0x00000004, + PERM_ARITHMETIC = 0x00000008, + PERM_DISPLAY = 0x00000010, + PERM_NETWORK = 0x00000020, +} ACCESS_PERMISSION; + +typedef enum { + TA_PRIVILEGE_PUBLIC=1, + TA_PRIVILEGE_PARTNER, + TA_PRIVILEGE_PLATFORM, +} TA_PRIVILEGE; + +#define TA_UID 1 +#define TA_PLATFORM_GID 100 +#define TA_PARTNER_GID 200 +#define TA_PUBLIC_GID 255 + +#define GP_TEE_TIME_PROTECTION_LEVEL_PROPERTY_REE 100 +#define GP_TEE_TIME_PROTECTION_LEVEL_PROPERTY_TEE 1000 + +int CheckPermission(const int flag); + +#endif + diff --git a/ssflib/inc/ssf_storage.h b/ssflib/inc/ssf_storage.h index 0000976..c5fb4be 100644 --- a/ssflib/inc/ssf_storage.h +++ b/ssflib/inc/ssf_storage.h @@ -238,9 +238,9 @@ persistent_object_info* find_po_info(po_info_file* pi_file, // po share rule int init_share_info(po_share_info* share_info); -int check_share_rule(po_share_info* share_info, uint32_t handleFlags); -int update_share_info(po_share_info* share_info, uint32_t handleFlags, - int b_open); +int check_share_rule(po_share_info* share_info, uint32_t handleFlags, uint32_t origFlags); +int update_share_info(po_share_info* share_info, uint32_t handleFlags, uint32_t origFlags, + int b_open, persistent_object* po); int release_share_info(po_share_info* share_info); void lock_po_share_info(po_share_info* share_info); void unlock_po_share_info(po_share_info* share_info); @@ -248,6 +248,8 @@ void unlock_po_share_info(po_share_info* share_info); // po list operations void add_to_po_list(persistent_object* po); void rem_from_po_list(persistent_object* po); +po_user* get_po_user_from_po_list(uint32_t storageID, const void* objectID, + size_t objectIDLen); void cleanup(); void regist_clean_up(); diff --git a/ssflib/src/app_debug.c b/ssflib/src/app_debug.cpp similarity index 100% rename from ssflib/src/app_debug.c rename to ssflib/src/app_debug.cpp diff --git a/ssflib/src/ssf_arithmetic.c b/ssflib/src/ssf_arithmetic.cpp similarity index 94% rename from ssflib/src/ssf_arithmetic.c rename to ssflib/src/ssf_arithmetic.cpp index cbe4e68..2ba88d9 100644 --- a/ssflib/src/ssf_arithmetic.c +++ b/ssflib/src/ssf_arithmetic.cpp @@ -20,6 +20,7 @@ * Include files *-----------------------------------------------------------------------------*/ #include +#include #include "tee_internal_api.h" #include "CC_API.h" #include "base/cc_bignum.h" @@ -44,6 +45,7 @@ */ void TEE_BigIntInit(TEE_BigInt* value, const size_t length) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); LOGD(TAG, "TEE_BigIntInit - length : %d", length); uint32_t teeMaxBigIntSize; TEE_Result result = TEE_GetPropertyAsU32( @@ -51,17 +53,19 @@ void TEE_BigIntInit(TEE_BigInt* value, const size_t length) { "gpd.tee.arith.maxBigIntSize", &teeMaxBigIntSize); LOGD(TAG, "TEE_GetPropertyAsU32(arith.maxBigIntSize) : %d (ret:%d)", teeMaxBigIntSize, result); -#ifndef PASS_NOT_IMP_CODE + if(result == TEE_SUCCESS) { +#ifndef PASS_NOT_IMP_CODE if(teeMaxBigIntSize == 0 || (length - SDRM_API_METADATA_LENGTH_IN_U32) * SDRM_SIZE_OF_DWORD * CNT_OF_BIT_IN_BYTE < teeMaxBigIntSize) { LOGE(TAG, "Panic Reason: BN size is creater than max allowed"); TEE_Panic(TEE_ERROR_OUT_OF_MEMORY); } - } #endif + } + if (length <= SDRM_API_METADATA_LENGTH_IN_U32) { LOGE(TAG, "Panic Reason: insufficient length"); TEE_Panic(TEE_ERROR_OUT_OF_MEMORY); @@ -90,6 +94,8 @@ void TEE_BigIntInit(TEE_BigInt* value, const size_t length) { TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt* dest, const uint8_t* buffer, const size_t sz_buffer, const int32_t sign) { + PERMISSION_CHECK(PERM_ARITHMETIC); + LOGD(TAG, "TEE_BigIntConvertFromOctetString - dest:%p buffer:%p sz_buffer:%d sign:%d", dest, buffer, sz_buffer, sign); @@ -125,6 +131,7 @@ TEE_Result TEE_BigIntConvertFromOctetString(TEE_BigInt* dest, TEE_Result TEE_BigIntConvertToOctetString(void* buffer, size_t* sz_buffer_out, const TEE_BigInt* value) { + PERMISSION_CHECK(PERM_ARITHMETIC); LOGD(TAG, "TEE_BigIntConvertToOctetString - buffer:%p value:%p", buffer, value); TEE_Result result = TEE_SUCCESS; @@ -156,6 +163,7 @@ TEE_Result TEE_BigIntConvertToOctetString(void* buffer, size_t* sz_buffer_out, * @param input Input value */ void TEE_BigIntConvertFromS32(TEE_BigInt* result, const int32_t input) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bn = (SDRM_BIG_NUM*)result; bn->pData[0] = ((input < 0) ? (input * -1) : (input)); bn->Length = 1; @@ -172,6 +180,7 @@ void TEE_BigIntConvertFromS32(TEE_BigInt* result, const int32_t input) { */ TEE_Result TEE_BigIntConvertToS32(int32_t* value_result, const TEE_BigInt* input) { + PERMISSION_CHECK(PERM_ARITHMETIC); SDRM_BIG_NUM *bn = (SDRM_BIG_NUM*)input; *value_result = (bn->sign == 1) ? (bn->pData[0] * -1) : (bn->pData[0]); LOGD(TAG, "Success"); @@ -184,6 +193,7 @@ TEE_Result TEE_BigIntConvertToS32(int32_t* value_result, * @param op2 Pointer to the second operand */ int32_t TEE_BigIntCmp(const TEE_BigInt* op1, const TEE_BigInt* op2) { + PERMISSION_CHECK(PERM_ARITHMETIC); SDRM_BIG_NUM *bn1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bn2 = (SDRM_BIG_NUM*)op2; int ret = SDRM_BN_Cmp_sign(bn1, bn2); @@ -198,6 +208,7 @@ int32_t TEE_BigIntCmp(const TEE_BigInt* op1, const TEE_BigInt* op2) { * @param value2 Pointer to the second operand */ int32_t TEE_BigIntCmpS32(const TEE_BigInt* value1_raw, const int32_t value2) { + PERMISSION_CHECK(PERM_ARITHMETIC); int32_t value1 = 0; TEE_Result result = TEE_BigIntConvertToS32(&value1, value1_raw); if (result != TEE_SUCCESS) { @@ -225,6 +236,8 @@ int32_t TEE_BigIntCmpS32(const TEE_BigInt* value1_raw, const int32_t value2) { */ void TEE_BigIntShiftRight(TEE_BigInt* destination_raw, const TEE_BigInt* source_raw, const size_t bits) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); + SDRM_BIG_NUM *dstBn = (SDRM_BIG_NUM*)destination_raw; SDRM_BIG_NUM *srcBn = (SDRM_BIG_NUM*)source_raw; int ret = SDRM_BN_SHR(dstBn, srcBn, bits); @@ -238,15 +251,16 @@ void TEE_BigIntShiftRight(TEE_BigInt* destination_raw, /** * The TEE_BigIntGetBit function returns the indexth bit of the natural binary - * representation of |object_raw|. A true return value indicates a “1” and a - * false return value indicates a “0” in the indexth position. If index is + * representation of |object_raw|. A true return value indicates a “1” and a + * false return value indicates a “0” in the indexth position. If index is * larger than the number of bits in object_raw, the return value is false, - * thus indicating a “0”. + * thus indicating a “0”. * @param object_raw Pointer to the integer * @param index The offset of the bit to be read, starting at offset 0 for the * least significant bit */ bool TEE_BigIntGetBit(const TEE_BigInt* object_raw, const uint32_t index) { + PERMISSION_CHECK(PERM_ARITHMETIC); SDRM_BIG_NUM *objBn = (SDRM_BIG_NUM*)object_raw; bool bitValue = (bool)SDRM_BN_num_bits_index(objBn, index); LOGD(TAG, "Success"); @@ -261,6 +275,7 @@ bool TEE_BigIntGetBit(const TEE_BigInt* object_raw, const uint32_t index) { * @param object_raw Pointer to the integer */ uint32_t TEE_BigIntGetBitCount(const TEE_BigInt* object_raw) { + PERMISSION_CHECK(PERM_ARITHMETIC); SDRM_BIG_NUM *objBn = (SDRM_BIG_NUM*)object_raw; int retCnt = SDRM_BN_num_bits(objBn); LOGD(TAG, "Success"); @@ -276,6 +291,7 @@ uint32_t TEE_BigIntGetBitCount(const TEE_BigInt* object_raw) { */ void TEE_BigIntAdd(TEE_BigInt* dest, const TEE_BigInt* op1, const TEE_BigInt* op2) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bn1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bn2 = (SDRM_BIG_NUM*)op2; SDRM_BIG_NUM *dst = (SDRM_BIG_NUM*)dest; @@ -289,7 +305,7 @@ void TEE_BigIntAdd(TEE_BigInt* dest, const TEE_BigInt* op1, } /** - * The TEE_BigIntSub function computes dest = op1 – op2. All or some of dest, + * The TEE_BigIntSub function computes dest = op1 – op2. All or some of dest, * op1, and op2 MAY point to the same memory region. * @param dest Pointer to TEE_BigInt to store the result op1 - op2 * @param op1 Pointer to the first operand @@ -300,6 +316,7 @@ void TEE_BigIntSub(TEE_BigInt* dest, const TEE_BigInt* op1, SDRM_BIG_NUM *bn1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bn2 = (SDRM_BIG_NUM*)op2; SDRM_BIG_NUM *dst = (SDRM_BIG_NUM*)dest; + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); int ret = SDRM_BN_Sub(dst, bn1, bn2); if (ret == CRYPTO_SUCCESS) { LOGD(TAG, "Success"); @@ -316,6 +333,7 @@ void TEE_BigIntSub(TEE_BigInt* dest, const TEE_BigInt* op1, * @param op Pointer to the operand to be negated */ void TEE_BigIntNeg(TEE_BigInt* dest, const TEE_BigInt* op) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnOp = (SDRM_BIG_NUM*)op; if (dest == op) bnOp->sign = ((bnOp->sign == 1) ? 0 : 1); @@ -336,6 +354,7 @@ void TEE_BigIntNeg(TEE_BigInt* dest, const TEE_BigInt* op) { */ void TEE_BigIntMul(TEE_BigInt* dest, const TEE_BigInt* op1, const TEE_BigInt* op2) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bn1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bn2 = (SDRM_BIG_NUM*)op2; SDRM_BIG_NUM *dst = (SDRM_BIG_NUM*)dest; @@ -355,6 +374,7 @@ void TEE_BigIntMul(TEE_BigInt* dest, const TEE_BigInt* op1, * @param op Pointer to the operand to be squared */ void TEE_BigIntSquare(TEE_BigInt* dest, const TEE_BigInt* op) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); TEE_BigIntMul(dest, op, op); LOGD(TAG, "Called"); } @@ -372,6 +392,7 @@ void TEE_BigIntSquare(TEE_BigInt* dest, const TEE_BigInt* op) { */ void TEE_BigIntDiv(TEE_BigInt* dest_q, TEE_BigInt* dest_r, const TEE_BigInt* op1, const TEE_BigInt* op2) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *dst_q = (SDRM_BIG_NUM*)dest_q; SDRM_BIG_NUM *dst_r = (SDRM_BIG_NUM*)dest_r; SDRM_BIG_NUM *bn1 = (SDRM_BIG_NUM*)op1; @@ -407,7 +428,7 @@ void TEE_BigIntDiv(TEE_BigInt* dest_q, TEE_BigInt* dest_r, * @param n Pointer to the modulus. Modulus MUST be larger than 1. */ void TEE_BigIntMod(TEE_BigInt* dest, const TEE_BigInt* op, const TEE_BigInt* n) { - + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnDst = (SDRM_BIG_NUM*)dest; SDRM_BIG_NUM *bnOp = (SDRM_BIG_NUM*)op; SDRM_BIG_NUM *bnN = (SDRM_BIG_NUM*)n; @@ -439,7 +460,7 @@ void TEE_BigIntMod(TEE_BigInt* dest, const TEE_BigInt* op, const TEE_BigInt* n) */ void TEE_BigIntAddMod(TEE_BigInt* dest, const TEE_BigInt* op1, const TEE_BigInt* op2, const TEE_BigInt* n) { - + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnDst = (SDRM_BIG_NUM*)dest; SDRM_BIG_NUM *bnOp1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bnOp2 = (SDRM_BIG_NUM*)op2; @@ -472,7 +493,7 @@ void TEE_BigIntAddMod(TEE_BigInt* dest, const TEE_BigInt* op1, */ void TEE_BigIntSubMod(TEE_BigInt* dest, const TEE_BigInt* op1, const TEE_BigInt* op2, const TEE_BigInt* n) { - + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnDst = (SDRM_BIG_NUM*)dest; SDRM_BIG_NUM *bnOp1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bnOp2 = (SDRM_BIG_NUM*)op2; @@ -505,7 +526,7 @@ void TEE_BigIntSubMod(TEE_BigInt* dest, const TEE_BigInt* op1, */ void TEE_BigIntMulMod(TEE_BigInt* dest, const TEE_BigInt* op1, const TEE_BigInt* op2, const TEE_BigInt* n) { - + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnDst = (SDRM_BIG_NUM*)dest; SDRM_BIG_NUM *bnOp1 = (SDRM_BIG_NUM*)op1; SDRM_BIG_NUM *bnOp2 = (SDRM_BIG_NUM*)op2; @@ -536,7 +557,7 @@ void TEE_BigIntMulMod(TEE_BigInt* dest, const TEE_BigInt* op1, */ void TEE_BigIntSquareMod(TEE_BigInt* dest, const TEE_BigInt* op, const TEE_BigInt* n) { - + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnN = (SDRM_BIG_NUM*)n; int32_t integerN = 0; TEE_BigIntConvertToS32(&integerN, (TEE_BigInt*)bnN); @@ -560,7 +581,7 @@ void TEE_BigIntSquareMod(TEE_BigInt* dest, const TEE_BigInt* op, */ void TEE_BigIntInvMod(TEE_BigInt* dest, const TEE_BigInt* op, const TEE_BigInt* n) { - + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); SDRM_BIG_NUM *bnDst = (SDRM_BIG_NUM*)dest; SDRM_BIG_NUM *bnOp = (SDRM_BIG_NUM*)op; SDRM_BIG_NUM *bnN = (SDRM_BIG_NUM*)n; @@ -590,6 +611,7 @@ void TEE_BigIntInvMod(TEE_BigInt* dest, const TEE_BigInt* op, * @param op2 Pointer to the second operand */ bool TEE_BigIntRelativePrime(const TEE_BigInt* op1, const TEE_BigInt* op2) { + PERMISSION_CHECK(PERM_ARITHMETIC); (void)op1; (void)op2; return false; @@ -611,6 +633,7 @@ bool TEE_BigIntRelativePrime(const TEE_BigInt* op1, const TEE_BigInt* op2) { */ void TEE_BigIntComputeExtendedGcd(TEE_BigInt* gcd, TEE_BigInt* u, TEE_BigInt* v, const TEE_BigInt* op1, const TEE_BigInt* op2) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); (void)gcd; (void)u; (void)v; @@ -638,6 +661,7 @@ void TEE_BigIntComputeExtendedGcd(TEE_BigInt* gcd, TEE_BigInt* u, TEE_BigInt* v, */ int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt* op, uint32_t confidenceLevel) { + PERMISSION_CHECK(PERM_ARITHMETIC); (void)op; (void)confidenceLevel; return 0; @@ -651,6 +675,7 @@ int32_t TEE_BigIntIsProbablePrime(const TEE_BigInt* op, * @param modulusSizeInBits Size of modulus in bits */ size_t TEE_BigIntFMMSizeInU32(size_t modulusSizeInBits) { + PERMISSION_CHECK(PERM_ARITHMETIC); return TEE_BigIntSizeInU32(modulusSizeInBits); } @@ -662,6 +687,7 @@ size_t TEE_BigIntFMMSizeInU32(size_t modulusSizeInBits) { * @param len The size in uint32_t of the memory pointed to by bigIntFMM */ void TEE_BigIntInitFMM(TEE_BigIntFMM* object, const size_t len) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); TEE_BigIntInit((TEE_BigInt*)object, len); } @@ -672,6 +698,7 @@ void TEE_BigIntInitFMM(TEE_BigIntFMM* object, const size_t len) { * @param modulusSizeInBits Size of modulus in bits */ size_t TEE_BigIntFMMContextSizeInU32(const size_t modulusSizeInBits) { + PERMISSION_CHECK(PERM_ARITHMETIC); return TEE_BigIntSizeInU32(modulusSizeInBits); } @@ -687,6 +714,7 @@ size_t TEE_BigIntFMMContextSizeInU32(const size_t modulusSizeInBits) { */ void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext* context, const size_t len, const TEE_BigInt* modulus) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); } /** @@ -703,6 +731,7 @@ void TEE_BigIntInitFMMContext(TEE_BigIntFMMContext* context, const size_t len, */ void TEE_BigIntConvertToFMM(TEE_BigIntFMM* dest, const TEE_BigInt* src, const TEE_BigInt* n, const TEE_BigIntFMMContext* context) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); } /** @@ -718,6 +747,7 @@ void TEE_BigIntConvertToFMM(TEE_BigIntFMM* dest, const TEE_BigInt* src, */ void TEE_BigIntConvertFromFMM(TEE_BigInt* dest, const TEE_BigIntFMM* src, const TEE_BigInt* n, const TEE_BigIntFMMContext* context) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); } /** @@ -738,4 +768,5 @@ void TEE_BigIntConvertFromFMM(TEE_BigInt* dest, const TEE_BigIntFMM* src, void TEE_BigIntComputeFMM(TEE_BigIntFMM* dest, const TEE_BigIntFMM* op1, const TEE_BigIntFMM* op2, const TEE_BigInt* n, const TEE_BigIntFMMContext* context) { + PERMISSION_CHECK_RETURN_VOID(PERM_ARITHMETIC); } diff --git a/ssflib/src/ssf_client.c b/ssflib/src/ssf_client.cpp similarity index 100% rename from ssflib/src/ssf_client.c rename to ssflib/src/ssf_client.cpp diff --git a/ssflib/src/ssf_crypto.c b/ssflib/src/ssf_crypto.c deleted file mode 100644 index fc14963..0000000 --- a/ssflib/src/ssf_crypto.c +++ /dev/null @@ -1,2599 +0,0 @@ -/* - * ===================================================================================== - * - * Filename: ssf_crypto.c - * - * Description: SSF crypto functions - * - * Version: 1.0 - * Created: 23 April 2015 12:41:39 IST - * Revision: Original - * Compiler: gcc - * - * Author: krishna (Kr), k.devale@samsung.com - * Organization: Samsung Electronics - * - * ===================================================================================== - */ -#define _CRT_RAND_S -/*----------------------------------------------------------------------------- - * Include files - *-----------------------------------------------------------------------------*/ -#include "uci_api.h" -#include -#include -#include -#include -#include -#include "unistd.h" -#include "uci_internal.h" -#include "tee_internal_api.h" -#include -#include - - -/*----------------------------------------------------------------------------- - * MACROS - *-----------------------------------------------------------------------------*/ -#define g_bTAdbug 1 -#define TZ_PRINT(fmt...) \ - do {if (g_bTAdbug) printf("[SSFLIB] ");printf(fmt);}while(0) -#define TZ_ERROR(fmt...) \ - do {if (g_bTAdbug) printf("[SSFLIB] ");printf(fmt);}while(0) -#undef PrintBYTE -#define PrintBYTE(msg, Data, DataLen) { \ - int idx; \ - TZ_PRINT("%10s =", msg); \ - for(idx=0; idx<(int)DataLen; idx++) { \ - if((idx!=0) && ((idx%16)==0)) TZ_PRINT("\n"); \ - if((idx % 4) == 0) TZ_PRINT(" 0x"); \ - TZ_PRINT("%.2x", Data[idx]); \ - } \ - TZ_PRINT("\n"); \ - } - -/*----------------------------------------------------------------------------- - * Definitions - *-----------------------------------------------------------------------------*/ -struct __TEE_ObjectHandle { - TEE_ObjectInfo info; -}; - -struct __TEE_OperationHandle { - TEE_OperationInfo info; -}; - -struct TEE_Operation { - TEE_OperationInfo info; - TEE_ObjectHandle key1; - TEE_ObjectHandle key2; - int crypto; // handle to crypto driver or ponter to crypto library context -}; - -static long getClock(void) { - struct timeval tv; - gettimeofday (&tv, NULL); - return (tv.tv_sec * 1000 + tv.tv_usec / 1000); -} - -/*----------------------------------------------------------------------------- - * Local functions - *-----------------------------------------------------------------------------*/ -static uint32_t object_type_from_algorithm(uint32_t alg, uint32_t *obj_type, - uint32_t * uci_type) { - switch (alg) { - - // KRISHNA: ADDED BELOW, VERIFY ONCE - case TEE_ALG_AES_ECB_PKCS5: - case TEE_ALG_AES_ECB_PKCS7: - case TEE_ALG_AES_ECB_ISO9797_M1: - case TEE_ALG_AES_ECB_ISO9797_M2: - case TEE_ALG_AES_CBC_PKCS5: - case TEE_ALG_AES_CBC_PKCS7: - case TEE_ALG_AES_CBC_ISO9797_M1: - case TEE_ALG_AES_CBC_ISO9797_M2: - // OLD CODE - case TEE_ALG_AES_ECB_NOPAD: - case TEE_ALG_AES_CBC_NOPAD: - case TEE_ALG_AES_CTR: - case TEE_ALG_AES_CTR_NOPAD: - case TEE_ALG_AES_CTS: - case TEE_ALG_AES_XTS: - case TEE_ALG_AES_CCM: - case TEE_ALG_AES_GCM: - *obj_type = TEE_TYPE_AES; - *uci_type = ID_UCI_AES; - break; - case TEE_ALG_AES_CBC_MAC_NOPAD: - *obj_type = TEE_TYPE_AES; - *uci_type = ID_UCI_XCBCMAC; - break; - case TEE_ALG_AES_CBC_MAC_PKCS5: - case TEE_ALG_AES_CMAC: - case TEE_ALG_DES_CBC_MAC_NOPAD: - case TEE_ALG_DES_CBC_MAC_PKCS5: - case TEE_ALG_DES3_CBC_MAC_NOPAD: - case TEE_ALG_DES3_CBC_MAC_PKCS5: - *obj_type = TEE_TYPE_AES; - *uci_type = ID_UCI_CMAC; - break; - case TEE_ALG_DES_ECB_NOPAD: - case TEE_ALG_DES_CBC_NOPAD: - *obj_type = TEE_TYPE_DES; - *uci_type = ID_UCI_DES; - break; - case TEE_ALG_DES3_ECB_NOPAD: - case TEE_ALG_DES3_CBC_NOPAD: - *obj_type = TEE_TYPE_DES3; - *uci_type = ID_UCI_TDES; - break; - case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: - case TEE_ALG_RSAES_PKCS1_V1_5: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: - case TEE_ALG_RSA_NOPAD: - *obj_type = TEE_TYPE_RSA_KEYPAIR; - *uci_type = 0; - break; - case TEE_ALG_DSA_SHA1: - *obj_type = TEE_TYPE_DSA_KEYPAIR; - *uci_type = ID_UCI_DSA; - break; -#ifdef ECC_IMPLEMENTATION - case TEE_ALG_ECDSA_P160: - case TEE_ALG_ECDSA_P192: - case TEE_ALG_ECDSA_P224: - case TEE_ALG_ECDSA_P256: - case TEE_ALG_ECDSA_P384: - case TEE_ALG_ECDSA_P521: - *obj_type = TEE_TYPE_ECDSA_KEYPAIR; - *uci_type = ID_UCI_ECDSA; - break; - case TEE_ALG_ECDH_P192: - case TEE_ALG_ECDH_P224: - case TEE_ALG_ECDH_P256: - case TEE_ALG_ECDH_P384: - case TEE_ALG_ECDH_P521: - *obj_type = TEE_TYPE_ECDH_KEYPAIR; - *uci_type = ID_UCI_ECDH; - break; -#endif - case TEE_ALG_DH_DERIVE_SHARED_SECRET: - *obj_type = TEE_TYPE_DH_KEYPAIR; - *uci_type = ID_UCI_DH; - break; - case TEE_ALG_HMAC_MD5: - *obj_type = TEE_TYPE_HMAC_MD5; - *uci_type = ID_UCI_HMD5; - break; - case TEE_ALG_HMAC_SHA1: - *obj_type = TEE_TYPE_HMAC_SHA1; - *uci_type = ID_UCI_HSHA1; - break; - case TEE_ALG_HMAC_SHA224: - *obj_type = TEE_TYPE_HMAC_SHA224; - *uci_type = ID_UCI_HSHA224; - break; - case TEE_ALG_HMAC_SHA256: - *obj_type = TEE_TYPE_HMAC_SHA256; - *uci_type = ID_UCI_HSHA256; - break; - case TEE_ALG_HMAC_SHA384: - *obj_type = TEE_TYPE_HMAC_SHA384; - *uci_type = ID_UCI_HSHA384; - break; - case TEE_ALG_HMAC_SHA512: - *obj_type = TEE_TYPE_HMAC_SHA512; - *uci_type = ID_UCI_HSHA512; - break; - case TEE_ALG_MD5: - *uci_type = ID_UCI_MD5; - break; - case TEE_ALG_SHA1: - *uci_type = ID_UCI_SHA1; - break; - case TEE_ALG_SHA224: - *uci_type = ID_UCI_SHA224; - break; - case TEE_ALG_SHA256: - *uci_type = ID_UCI_SHA256; - break; - case TEE_ALG_SHA384: - *uci_type = ID_UCI_SHA384; - break; - case TEE_ALG_SHA512: - *uci_type = ID_UCI_SHA512; - break; - } - return *obj_type; -} - -static int crypto_lib_init_operation(TEE_OperationHandle operation) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - if (uci_md_init(op->crypto) != UCI_SUCCESS) { - TEE_Panic(0); - } - return 0; -} - -/*----------------------------------------------------------------------------- - * TEE API implementation - *-----------------------------------------------------------------------------*/ -// Generic Operation Functions -TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, - uint32_t algorithm, uint32_t mode, uint32_t maxKeySize) { - struct TEE_Operation * op; - uint32_t alg_class = 0; - uint32_t object_type = 0; - uint32_t uci_type = 0; - TEE_Result rc; - TEE_ObjectHandle key1 = TEE_HANDLE_NULL; - TEE_ObjectHandle key2 = TEE_HANDLE_NULL; - int digest_len = 0; - uint32_t block_len = 0; - uint32_t key_object_type = 0; - /* NEW CODE FROM PLATFORM CODE BASE OF SECURE OS */ - // check parameters compatibility - switch(algorithm) - { - /* Algorithm Class is SYMMETRIC CIPHER */ - case TEE_ALG_AES_ECB_NOPAD: - case TEE_ALG_AES_CBC_NOPAD: - case TEE_ALG_AES_CTR: - case TEE_ALG_AES_CTR_NOPAD: - case TEE_ALG_AES_ECB_PKCS5: - case TEE_ALG_AES_ECB_PKCS7: - case TEE_ALG_AES_ECB_ISO9797_M1: - case TEE_ALG_AES_ECB_ISO9797_M2: - case TEE_ALG_AES_CBC_PKCS5: - case TEE_ALG_AES_CBC_PKCS7: - case TEE_ALG_AES_CBC_ISO9797_M1: - case TEE_ALG_AES_CBC_ISO9797_M2: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_AES; - block_len = 16; - digest_len = 0; - break; - - case TEE_ALG_AES_XTS: - case TEE_ALG_AES_CTS: - return TEE_ERROR_NOT_SUPPORTED; - break; - - case TEE_ALG_DES_ECB_NOPAD: - case TEE_ALG_DES_CBC_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_DES; - block_len = 8; - digest_len = 0; - break; - - case TEE_ALG_DES3_ECB_NOPAD: - case TEE_ALG_DES3_CBC_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_DES3; - block_len = 8; - digest_len = 0; - break; - - /* Algorithm Class is AE */ - case TEE_ALG_AES_CCM: - case TEE_ALG_AES_GCM: - return TEE_ERROR_NOT_SUPPORTED; - break; - - /* Algorithm Class is MAC */ - case TEE_ALG_AES_CBC_MAC_NOPAD: - case TEE_ALG_AES_CBC_MAC_PKCS5: - case TEE_ALG_DES_CBC_MAC_NOPAD: - case TEE_ALG_DES_CBC_MAC_PKCS5: - case TEE_ALG_AES_CMAC: - case TEE_ALG_DES3_CBC_MAC_NOPAD: - case TEE_ALG_DES3_CBC_MAC_PKCS5: - return TEE_ERROR_NOT_SUPPORTED; - break; - - - - case TEE_ALG_HMAC_MD5: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_MD5; - block_len = 64; - digest_len = 16; - break; - - case TEE_ALG_HMAC_SHA1: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA1; - block_len = 64; - digest_len = 20; - break; - - case TEE_ALG_HMAC_SHA224: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA224; - block_len = 64; - digest_len = 28; - break; - - case TEE_ALG_HMAC_SHA256: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA256; - block_len = 64; - digest_len = 32; - break; - - case TEE_ALG_HMAC_SHA384: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA384; - block_len = 64; - digest_len = 48; - break; - - case TEE_ALG_HMAC_SHA512: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA512; - block_len = 64; - digest_len = 64; - break; - - /* Algorithm Class is DIGIT */ - case TEE_ALG_MD5: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 16; - block_len = 64; - break; - - case TEE_ALG_SHA1: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 20; - block_len = 64; - break; - - case TEE_ALG_SHA224: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 28; - block_len = 64; - break; - - case TEE_ALG_SHA256: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 32; - block_len = 64; - break; - - case TEE_ALG_SHA384: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 48; - block_len = 64; - break; - - case TEE_ALG_SHA512: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 64; - block_len = 64; - break; - - /* Algorithm Class is ASYMMETRIC CIPHER */ - case TEE_ALG_RSAES_PKCS1_V1_5: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: - case TEE_ALG_RSA_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_CIPHER; - key_object_type = TEE_TYPE_RSA_KEYPAIR; - block_len = 0; - digest_len = 0; - break; - - /* Algorithm Class is SIGNATURE */ - case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - key_object_type = TEE_TYPE_RSA_KEYPAIR; - break; - - case TEE_ALG_ECDSA_P160: - case TEE_ALG_ECDSA_P192: - case TEE_ALG_ECDSA_P224: - case TEE_ALG_ECDSA_P256: - case TEE_ALG_ECDSA_P384: - case TEE_ALG_ECDSA_P521: - return TEE_ERROR_NOT_SUPPORTED; - break; - - case TEE_ALG_DSA_SHA1: - case TEE_ALG_ECDH_P192: - case TEE_ALG_ECDH_P224: - case TEE_ALG_ECDH_P256: - case TEE_ALG_ECDH_P384: - case TEE_ALG_ECDH_P521: - return TEE_ERROR_NOT_SUPPORTED; - break; - - /* Algorithm Class is KEY DERIVATION */ - case TEE_ALG_DH_DERIVE_SHARED_SECRET: - return TEE_ERROR_NOT_SUPPORTED; - break; - - default: - //printf("Not Support Algorithm : %X", algorithm); - TZ_ERROR("Not Support Algorithm %d,%s %X\n", __LINE__, __func__, algorithm); - rc = TEE_ERROR_NOT_SUPPORTED; - goto exit; - break; - } - - - - - - - /* - // OLD SWITCH - switch (algorithm) { - case TEE_ALG_AES_XTS: - return TEE_ERROR_NOT_SUPPORTED; - break; - case TEE_ALG_AES_ECB_NOPAD: - case TEE_ALG_AES_CBC_NOPAD: - case TEE_ALG_AES_CTR: - case TEE_ALG_AES_CTS: - case TEE_ALG_DES_ECB_NOPAD: - case TEE_ALG_DES_CBC_NOPAD: - case TEE_ALG_DES3_ECB_NOPAD: - case TEE_ALG_DES3_CBC_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - alg_class = TEE_OPERATION_CIPHER; - break; - case TEE_ALG_AES_CCM: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 0; // will be set during initialisation - alg_class = TEE_OPERATION_AE; - break; - case TEE_ALG_AES_GCM: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 0; // will be set during initialisation - alg_class = TEE_OPERATION_AE; - break; - case TEE_ALG_AES_CBC_MAC_NOPAD: - case TEE_ALG_AES_CBC_MAC_PKCS5: - case TEE_ALG_AES_CMAC: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - alg_class = TEE_OPERATION_MAC; - break; - case TEE_ALG_DES_CBC_MAC_NOPAD: - case TEE_ALG_DES_CBC_MAC_PKCS5: - case TEE_ALG_DES3_CBC_MAC_NOPAD: - case TEE_ALG_DES3_CBC_MAC_PKCS5: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - alg_class = TEE_OPERATION_MAC; - return TEE_ERROR_NOT_SUPPORTED; - case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: - case TEE_ALG_DSA_SHA1: -#ifdef ECC_IMPLEMENTATION - case TEE_ALG_ECDSA_P160: - case TEE_ALG_ECDSA_P192: - case TEE_ALG_ECDSA_P224: - case TEE_ALG_ECDSA_P256: - case TEE_ALG_ECDSA_P384: - case TEE_ALG_ECDSA_P521: -#endif - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { - return TEE_ERROR_NOT_SUPPORTED; - } - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - break; - case TEE_ALG_RSAES_PKCS1_V1_5: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: - case TEE_ALG_RSA_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - alg_class = TEE_OPERATION_ASYMMETRIC_CIPHER; - break; - case TEE_ALG_DH_DERIVE_SHARED_SECRET: - if (mode != TEE_MODE_DERIVE) { - return TEE_ERROR_NOT_SUPPORTED; - } - alg_class = TEE_OPERATION_KEY_DERIVATION; - break; - case TEE_ALG_MD5: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 16; - alg_class = TEE_OPERATION_DIGEST; - break; - case TEE_ALG_SHA1: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 20; - alg_class = TEE_OPERATION_DIGEST; - break; - case TEE_ALG_SHA224: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 28; - alg_class = TEE_OPERATION_DIGEST; - break; - case TEE_ALG_SHA256: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 32; - alg_class = TEE_OPERATION_DIGEST; - break; - case TEE_ALG_SHA384: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 48; - alg_class = TEE_OPERATION_DIGEST; - break; - case TEE_ALG_SHA512: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 64; - alg_class = TEE_OPERATION_DIGEST; - break; - case TEE_ALG_HMAC_MD5: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 16; - alg_class = TEE_OPERATION_MAC; - break; - case TEE_ALG_HMAC_SHA1: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 20; - alg_class = TEE_OPERATION_MAC; - break; - case TEE_ALG_HMAC_SHA224: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 28; - alg_class = TEE_OPERATION_MAC; - break; - case TEE_ALG_HMAC_SHA256: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 32; - alg_class = TEE_OPERATION_MAC; - break; - case TEE_ALG_HMAC_SHA384: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 48; - alg_class = TEE_OPERATION_MAC; - break; - case TEE_ALG_HMAC_SHA512: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - digest_len = 64; - alg_class = TEE_OPERATION_MAC; - break; - default: - TZ_ERROR("algorithm error %d,%s\n", __LINE__, __func__); - return TEE_ERROR_NOT_SUPPORTED; - } - */ - object_type = object_type_from_algorithm(algorithm, &object_type, &uci_type); - if (alg_class != TEE_OPERATION_DIGEST) { - rc = TEE_AllocateTransientObject(object_type, maxKeySize, &key1); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_AllocateTransientObject error %d,%s\n", __LINE__, __func__); - return rc; - } -#if 0 - // TODO: TEE_ALG_AES_XTS not supported - if (algorithm == TEE_ALG_AES_XTS)// 2 keys for TEE_ALG_AES_XTS - { - rc = TEE_AllocateTransientObject(object_type, maxKeySize, &key2); - if (rc != TEE_SUCCESS) { - TEE_CloseObject(key1); - TZ_ERROR("TEE_AllocateTransientObject error %d,%s\n", - __LINE__, - __func__); - return rc; - } - } -#endif - } - //ALLOC MEMORY - op = (TEE_Operation*)OsaMalloc(sizeof(struct TEE_Operation)); - if (!op) { - if (key1) { - TEE_CloseObject(key1); - } -#if 0 - // TODO: TEE_ALG_AES_XTS not supported - if (key2) { - TEE_CloseObject(key2); - } -#endif - TZ_ERROR("malloc error %d,%s\n", __LINE__, __func__); - return TEE_ERROR_OUT_OF_MEMORY; - } - memset(op, 0, sizeof(struct TEE_Operation)); - op->info.algorithm = algorithm; - op->info.mode = mode; - op->info.maxKeySize = maxKeySize; - op->info.digestLength = digest_len; - op->info.keySize = 0; - op->info.operationClass = alg_class; - op->info.requiredKeyUsage = 0; - switch (mode) { - case TEE_MODE_ENCRYPT: - op->info.requiredKeyUsage |= TEE_USAGE_ENCRYPT; - break; - case TEE_MODE_DECRYPT: - op->info.requiredKeyUsage |= TEE_USAGE_DECRYPT; - break; - case TEE_MODE_MAC: - op->info.requiredKeyUsage |= TEE_USAGE_MAC; - break; - case TEE_MODE_DERIVE: - op->info.requiredKeyUsage |= TEE_USAGE_DERIVE; - break; - case TEE_MODE_SIGN: - op->info.requiredKeyUsage |= TEE_USAGE_SIGN; - break; - case TEE_MODE_VERIFY: - op->info.requiredKeyUsage |= TEE_USAGE_VERIFY; - break; - } - op->info.handleState = 0; - if (alg_class == TEE_OPERATION_DIGEST) { - op->info.handleState |= TEE_HANDLE_FLAG_KEY_SET; - } -#if 1 - // TODO: TEE_ALG_AES_XTS not supported - if (algorithm == TEE_ALG_AES_XTS) { - op->info.handleState |= TEE_HANDLE_FLAG_EXPECT_TWO_KEYS; - } - - /* key1 alloc */ - if (key_object_type) { - if (TEE_AllocateTransientObject(key_object_type, maxKeySize, &key1) != TEE_SUCCESS) { - rc = TEE_ERROR_OUT_OF_MEMORY; - goto error; - } - } - - /* key2 alloc for XTS */ - if (algorithm == TEE_ALG_AES_XTS) { - if (TEE_AllocateTransientObject(key_object_type, maxKeySize, &key2) != TEE_SUCCESS) { - rc = TEE_ERROR_OUT_OF_MEMORY; - goto error; - } - } -#endif - op->key1 = key1; - op->key2 = key2; - // [TODO] NEED TO FIX THIS STRUCTURE TO INCLUDE BLOCK_LEN MEMBER - //op->block_len = block_len; - if (uci_type != 0) { - op->crypto = uci_context_alloc(uci_type, UCI_SW); - } else { - op->crypto = 0; - } - *operation = (TEE_OperationHandle)&op->info; - - if (alg_class == TEE_OPERATION_DIGEST) { - crypto_lib_init_operation(*operation); //in case hash contex will not inited. - } - return TEE_SUCCESS; - - -error: - if (key1) { - TEE_CloseObject(key1); - } - if (key2) { - TEE_CloseObject(key2); - } - if (op) { - free(op); - } -exit: - *operation = TEE_HANDLE_NULL; - printf("Error : %X", rc); - - return rc; - -} -// KRISHNA - OLD CODE - - -/*TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, uint32_t algorithm, uint32_t mode, uint32_t maxKeySize) -{ - //PERMISSION_CHECK(PERM_CRYPTO); - - crypto_internal_operation * op; - TEE_Result rc=TEE_SUCCESS; - uint32_t alg_class = 0; - uint32_t key_object_type = 0; - uint32_t digest_len = 0; - uint32_t block_len = 0; - TEE_ObjectHandle key1 = TEE_HANDLE_NULL; - TEE_ObjectHandle key2 = TEE_HANDLE_NULL; - - // check parameters compatibility - switch(algorithm) - { - // Algorithm Class is SYMMETRIC CIPHER - case TEE_ALG_AES_ECB_NOPAD: - case TEE_ALG_AES_CBC_NOPAD: - case TEE_ALG_AES_CTR: - case TEE_ALG_AES_CTR_NOPAD: - case TEE_ALG_AES_ECB_PKCS5: - case TEE_ALG_AES_ECB_PKCS7: - case TEE_ALG_AES_ECB_ISO9797_M1: - case TEE_ALG_AES_ECB_ISO9797_M2: - case TEE_ALG_AES_CBC_PKCS5: - case TEE_ALG_AES_CBC_PKCS7: - case TEE_ALG_AES_CBC_ISO9797_M1: - case TEE_ALG_AES_CBC_ISO9797_M2: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_AES; - block_len = 16; - digest_len = 0; - break; - - case TEE_ALG_AES_XTS: - case TEE_ALG_AES_CTS: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_AES; - block_len = 32; // for CTS & XTS need 2 AES blocks - digest_len = 0; - break; - - case TEE_ALG_DES_ECB_NOPAD: - case TEE_ALG_DES_CBC_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_DES; - block_len = 8; - digest_len = 0; - break; - - case TEE_ALG_DES3_ECB_NOPAD: - case TEE_ALG_DES3_CBC_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_CIPHER; - key_object_type = TEE_TYPE_DES3; - block_len = 8; - digest_len = 0; - break; - - // Algorithm Class is AE - case TEE_ALG_AES_CCM: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_AE; - key_object_type = TEE_TYPE_AES; - block_len = 16; - digest_len = 0; - break; - - case TEE_ALG_AES_GCM: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_AE; - key_object_type = TEE_TYPE_AES; - block_len = 16; - digest_len = 0; - break; - - // Algorithm Class is MAC - case TEE_ALG_AES_CBC_MAC_NOPAD: - case TEE_ALG_AES_CBC_MAC_PKCS5: - case TEE_ALG_AES_CMAC: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_AES; - block_len = 16; - digest_len = 16; - break; - - case TEE_ALG_DES_CBC_MAC_NOPAD: - case TEE_ALG_DES_CBC_MAC_PKCS5: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_DES; - block_len = 8; - digest_len = 8; - break; - - case TEE_ALG_DES3_CBC_MAC_NOPAD: - case TEE_ALG_DES3_CBC_MAC_PKCS5: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_DES3; - block_len = 8; - digest_len = 8; - break; - - case TEE_ALG_HMAC_MD5: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_MD5; - block_len = 64; - digest_len = 16; - break; - - case TEE_ALG_HMAC_SHA1: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA1; - block_len = 64; - digest_len = 20; - break; - - case TEE_ALG_HMAC_SHA224: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA224; - block_len = 64; - digest_len = 28; - break; - - case TEE_ALG_HMAC_SHA256: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA256; - block_len = 64; - digest_len = 32; - break; - - case TEE_ALG_HMAC_SHA384: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA384; - block_len = 64; - digest_len = 48; - break; - - case TEE_ALG_HMAC_SHA512: - if (mode != TEE_MODE_MAC) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_MAC; - key_object_type = TEE_TYPE_HMAC_SHA512; - block_len = 64; - digest_len = 64; - break; - - // Algorithm Class is DIGIT - case TEE_ALG_MD5: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 16; - block_len = 64; - break; - - case TEE_ALG_SHA1: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 20; - block_len = 64; - break; - - case TEE_ALG_SHA224: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 28; - block_len = 64; - break; - - case TEE_ALG_SHA256: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 32; - block_len = 64; - break; - - case TEE_ALG_SHA384: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 48; - block_len = 64; - break; - - case TEE_ALG_SHA512: - if (mode != TEE_MODE_DIGEST) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_DIGEST; - key_object_type = 0; - digest_len = 64; - block_len = 64; - break; - - // Algorithm Class is ASYMMETRIC CIPHER - case TEE_ALG_RSAES_PKCS1_V1_5: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: - case TEE_ALG_RSA_NOPAD: - if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_CIPHER; - key_object_type = TEE_TYPE_RSA_KEYPAIR; - block_len = 0; - digest_len = 0; - break; - - // Algorithm Class is SIGNATURE - case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - key_object_type = TEE_TYPE_RSA_KEYPAIR; - break; - - case TEE_ALG_ECDSA_P160: - case TEE_ALG_ECDSA_P192: - case TEE_ALG_ECDSA_P224: - case TEE_ALG_ECDSA_P256: - case TEE_ALG_ECDSA_P384: - case TEE_ALG_ECDSA_P521: - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - key_object_type = TEE_TYPE_RSA_KEYPAIR; - break; - - case TEE_ALG_DSA_SHA1: - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - key_object_type = TEE_TYPE_DSA_KEYPAIR; - break; - - case TEE_ALG_ECDH_P192: - case TEE_ALG_ECDH_P224: - case TEE_ALG_ECDH_P256: - case TEE_ALG_ECDH_P384: - case TEE_ALG_ECDH_P521: - if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; - key_object_type = TEE_TYPE_ECDH_KEYPAIR; - break; - - // Algorithm Class is KEY DERIVATION - case TEE_ALG_DH_DERIVE_SHARED_SECRET: - if (mode != TEE_MODE_DERIVE) { - return TEE_ERROR_NOT_SUPPORTED; - } - - alg_class = TEE_OPERATION_KEY_DERIVATION; - key_object_type = TEE_TYPE_DH_KEYPAIR; - break; - - default: - LOGE(TAG, "Not Support Algorithm : %X", algorithm); - rc = TEE_ERROR_NOT_SUPPORTED; - goto exit; - break; - } - - // first malloc for crypto operation - op = malloc(sizeof (crypto_internal_operation)); - if (!op) { - rc = TEE_ERROR_OUT_OF_MEMORY; - goto exit; - } - - memset(op, 0, sizeof (crypto_internal_operation)); - - // Set TEE_OperationInfo - op->info.algorithm = algorithm; - op->info.operationClass = alg_class; - op->info.mode = mode; - op->info.digestLength = digest_len; - op->info.maxKeySize = maxKeySize; - op->info.keySize = maxKeySize; - - if (mode == TEE_MODE_ENCRYPT) { - op->info.requiredKeyUsage |= TEE_USAGE_ENCRYPT; - } - if (mode == TEE_MODE_DECRYPT) { - op->info.requiredKeyUsage |= TEE_USAGE_DECRYPT; - } - if (mode == TEE_MODE_MAC) { - op->info.requiredKeyUsage |= TEE_USAGE_MAC; - } - if (mode == TEE_MODE_DERIVE) { - op->info.requiredKeyUsage |= TEE_USAGE_DERIVE; - } - if (mode == TEE_MODE_SIGN) { - op->info.requiredKeyUsage |= TEE_USAGE_SIGN; - } - if (mode == TEE_MODE_VERIFY) { - op->info.requiredKeyUsage |= TEE_USAGE_VERIFY; - } - if (algorithm == TEE_ALG_RSA_NOPAD) - { - if (mode == TEE_MODE_ENCRYPT) { - op->info.requiredKeyUsage |= TEE_USAGE_VERIFY; - } - else if (mode == TEE_MODE_DECRYPT) { - op->info.requiredKeyUsage |= TEE_USAGE_SIGN; - } - } - - if (algorithm == TEE_ALG_AES_XTS) { - op->info.handleState |= TEE_HANDLE_FLAG_EXPECT_TWO_KEYS; - } - - // get handle - if(crypto_internal_open(op)!=0) { - rc = TEE_ERROR_NOT_SUPPORTED; - goto error; - } - - // key1 alloc - if (key_object_type) { - if (TEE_AllocateTransientObject(key_object_type, maxKeySize, &key1) != TEE_SUCCESS) { - rc = TEE_ERROR_OUT_OF_MEMORY; - goto error; - } - } - - // key2 alloc for XTS - if (algorithm == TEE_ALG_AES_XTS) { - if (TEE_AllocateTransientObject(key_object_type, maxKeySize, &key2) != TEE_SUCCESS) { - rc = TEE_ERROR_OUT_OF_MEMORY; - goto error; - } - } - - // key map for crypto operation - op->key1 = key1; - op->key2 = key2; - op->block_len = block_len; - - *operation = (TEE_OperationHandle) &op->info; - if (alg_class == TEE_OPERATION_DIGEST) { - TEE_DigestInit(*operation); - } - - return TEE_SUCCESS; - -error: - crypto_internal_close(op); - if (key1) { - TEE_CloseObject(key1); - } - if (key2) { - TEE_CloseObject(key2); - } - if (op) { - free(op); - } -exit: - *operation = TEE_HANDLE_NULL; - LOGE(TAG, "Error : %X", rc); - return rc; -} -*/ - - - -void TEE_FreeOperation(TEE_OperationHandle operation) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - if (op->key1) { - TEE_CloseObject(op->key1); - } - if (op->key2) { - TEE_CloseObject(op->key2); - } - if (uci_context_free(op->crypto) != UCI_SUCCESS) { - TZ_ERROR("free error %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - OsaFree(op); -} - -void TEE_GetOperationInfo(TEE_OperationHandle operation, - TEE_OperationInfo* operationInfo) { - operationInfo->algorithm = operation->info.algorithm; - operationInfo->digestLength = operation->info.digestLength; - operationInfo->handleState = operation->info.handleState; - operationInfo->keySize = operation->info.keySize; - operationInfo->maxKeySize = operation->info.maxKeySize; - operationInfo->mode = operation->info.mode; - operationInfo->operationClass = operation->info.operationClass; - operationInfo->requiredKeyUsage = operation->info.requiredKeyUsage; -} - -void TEE_ResetOperation(TEE_OperationHandle operation) { - operation->info.handleState &= ~TEE_HANDLE_FLAG_INITIALIZED; -} - -TEE_Result TEE_SetOperationKey(TEE_OperationHandle operation, - TEE_ObjectHandle key) { - uci_key_s ucikey; - uci_param_s uciparam; - TEE_Result rc; - unsigned char pub[384]; - unsigned char priv[384]; - unsigned char module[384]; - size_t pubLen = 384; - size_t privLen = 384; - size_t moduleLen = 384; - unsigned int alg; - memset(&ucikey, 0, sizeof(uci_key_s)); - memset(&uciparam, 0, sizeof(uci_param_s)); - - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass == TEE_OPERATION_DIGEST - || operation->info.algorithm == TEE_ALG_AES_XTS) { - TZ_ERROR("operation error %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (key == TEE_HANDLE_NULL) { - TEE_CloseObject(op->key1); - op->key1 = TEE_HANDLE_NULL; - return TEE_SUCCESS; - } - // check key usage flags - if ((key->info.objectUsage | ~op->info.requiredKeyUsage) != 0xffffffff) { - TZ_ERROR("Usage don't match line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - - //set key pair - switch (op->info.algorithm) { - //SIGN OR VERIFY - case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PKCS15_MD5; - break; - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PKCS15_SHA1; - break; - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PKCS15_SHA224; - break; - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PKCS15_SHA256; - break; - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PKCS15_SHA384; - break; - case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PKCS15_SHA512; - break; - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PSS_SHA1; - break; - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PSS_SHA224; - break; - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PSS_SHA256; - break; - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PSS_SHA384; - break; - case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: - uciparam.ucip_rsa_padding = ID_UCI_RSASSA_PSS_SHA512; - break; - case TEE_ALG_DSA_SHA1: - break; - //ENCRYPT OR DECRYPT - case TEE_ALG_RSAES_PKCS1_V1_5: - uciparam.ucip_rsa_padding = ID_UCI_RSAES_PKCS15; - break; - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: - uciparam.ucip_rsa_padding = ID_UCI_RSAES_OAEP_SHA1; - break; - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: - uciparam.ucip_rsa_padding = ID_UCI_RSAES_OAEP_SHA224; - break; - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: - uciparam.ucip_rsa_padding = ID_UCI_RSAES_OAEP_SHA256; - break; - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: - uciparam.ucip_rsa_padding = ID_UCI_RSAES_OAEP_SHA384; - break; - case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: - uciparam.ucip_rsa_padding = ID_UCI_RSAES_OAEP_SHA512; - break; - case TEE_ALG_RSA_NOPAD: - uciparam.ucip_rsa_padding = ID_UCI_NO_PADDING; - break; - } - size_t obj_size = (size_t)(key->info.objectSize); - switch (key->info.objectType) { - case TEE_TYPE_RSA_PUBLIC_KEY: - case TEE_TYPE_RSA_KEYPAIR: - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_RSA_MODULUS, module, - &moduleLen); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_RSA_PUBLIC_EXPONENT, pub, - &pubLen); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - ucikey.ucik_rsa_n = module; - ucikey.ucik_rsa_n_len = moduleLen; - ucikey.ucik_rsa_e = pub; - ucikey.ucik_rsa_e_len = pubLen; - ucikey.ucik_rsa_d = NULL; - ucikey.ucik_rsa_d_len = 0; - - if (key->info.objectType == TEE_TYPE_RSA_KEYPAIR) { - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_RSA_PRIVATE_EXPONENT, - priv, &privLen); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", - __LINE__, __func__); - return rc; - } - ucikey.ucik_rsa_d = priv; - ucikey.ucik_rsa_d_len = privLen; - } - switch (key->info.objectSize) { - case 512: - alg = ID_UCI_RSA512; - break; - case 1024: - alg = ID_UCI_RSA1024; - break; - case 2048: - alg = ID_UCI_RSA2048; - break; - case 3072: - alg = ID_UCI_RSA3072; - break; - default: - TZ_ERROR("key->info.objectSize = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_BAD_PARAMETERS; - } - - //PrintBYTE("N",module,moduleLen); - //PrintBYTE("E",pub,pubLen); - op->crypto = uci_context_alloc(alg, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_BAD_PARAMETERS; - } - - if (uci_ae_set_keypair(op->crypto, &ucikey, &uciparam) != UCI_SUCCESS) { - TZ_ERROR("uci_ae_set_keypair error line = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_BAD_PARAMETERS; - } - - break; - case TEE_TYPE_DSA_PUBLIC_KEY: - case TEE_TYPE_DSA_KEYPAIR: - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_PUBLIC_VALUE, pub, - &pubLen); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - - if (key->info.objectType == TEE_TYPE_DSA_KEYPAIR) { - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_PRIVATE_VALUE, priv, - &privLen); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", - __LINE__, __func__); - return rc; - } - ucikey.ucik_dsa_privkey = priv; - ucikey.ucik_dsa_privk_len = privLen; - } - ucikey.ucik_dsa_pubkey = pub; - ucikey.ucik_dsa_pubk_len = pubLen; - - uciparam.ucip_dsa_tsize = 0; - uciparam.ucip_dsa_p = (unsigned char*)OsaMalloc(key->info.objectSize); - uciparam.ucip_dsa_q = (unsigned char*)OsaMalloc(key->info.objectSize); - uciparam.ucip_dsa_g = (unsigned char*)OsaMalloc(key->info.objectSize); - uciparam.ucip_dsa_p_len = key->info.objectSize; - uciparam.ucip_dsa_g_len = key->info.objectSize; - uciparam.ucip_dsa_q_len = key->info.objectSize; - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_PRIME, - uciparam.ucip_dsa_p, &obj_size); - if (rc != TEE_SUCCESS) { - OsaFree(uciparam.ucip_dsa_p); - OsaFree(uciparam.ucip_dsa_q); - OsaFree(uciparam.ucip_dsa_g); - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_BASE, - uciparam.ucip_dsa_g, &obj_size); - if (rc != TEE_SUCCESS) { - OsaFree(uciparam.ucip_dsa_p); - OsaFree(uciparam.ucip_dsa_q); - OsaFree(uciparam.ucip_dsa_g); - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DSA_SUBPRIME, - uciparam.ucip_dsa_q, &obj_size); - if (rc != TEE_SUCCESS) { - OsaFree(uciparam.ucip_dsa_p); - OsaFree(uciparam.ucip_dsa_q); - OsaFree(uciparam.ucip_dsa_g); - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - if (uci_ae_set_keypair(op->crypto, &ucikey, &uciparam) != UCI_SUCCESS) { - OsaFree(uciparam.ucip_dsa_p); - OsaFree(uciparam.ucip_dsa_q); - OsaFree(uciparam.ucip_dsa_g); - TZ_ERROR("uci_ae_set_keypair error line = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_BAD_PARAMETERS; - } - - OsaFree(uciparam.ucip_dsa_p); - OsaFree(uciparam.ucip_dsa_q); - OsaFree(uciparam.ucip_dsa_g); - break; - case TEE_TYPE_DH_KEYPAIR: - uciparam.ucip_dh_prime = (unsigned char*)OsaMalloc(key->info.objectSize); - uciparam.ucip_dh_generator = (unsigned char*)OsaMalloc( - key->info.objectSize); - uciparam.ucip_dh_len = key->info.objectSize; - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DH_PRIME, - uciparam.ucip_dh_prime, &obj_size); - if (rc != TEE_SUCCESS) { - OsaFree(uciparam.ucip_dh_prime); - OsaFree(uciparam.ucip_dh_generator); - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - rc = TEE_GetObjectBufferAttribute(key, TEE_ATTR_DH_BASE, - uciparam.ucip_dh_generator, &obj_size); - if (rc != TEE_SUCCESS) { - OsaFree(uciparam.ucip_dh_prime); - OsaFree(uciparam.ucip_dh_generator); - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return rc; - } - if (uci_ae_set_keypair(op->crypto, &ucikey, &uciparam) != UCI_SUCCESS) { - OsaFree(uciparam.ucip_dh_prime); - OsaFree(uciparam.ucip_dh_generator); - TZ_ERROR("uci_ae_set_keypair error line = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_BAD_PARAMETERS; - } - OsaFree(uciparam.ucip_dh_prime); - OsaFree(uciparam.ucip_dh_generator); - } - if ((key->info.objectType == TEE_TYPE_RSA_PUBLIC_KEY - && op->key1->info.objectType == TEE_TYPE_RSA_KEYPAIR) - || (key->info.objectType == TEE_TYPE_DSA_PUBLIC_KEY - && op->key1->info.objectType == TEE_TYPE_DSA_KEYPAIR)) { - - op->key1->info.objectType = key->info.objectType; // change object object type of key1 in DSA or RSA case - } - TEE_CopyObjectAttributes(op->key1, key); // will Panic inside in the case of incompatible objects - operation->info.handleState |= TEE_HANDLE_FLAG_KEY_SET; - return TEE_SUCCESS; -} - -TEE_Result TEE_SetOperationKey2(TEE_OperationHandle operation, - TEE_ObjectHandle key1, TEE_ObjectHandle key2) { - - struct TEE_Operation * op = (struct TEE_Operation*)operation; - if ((key1 && !key2) || (!key1 && key2)) { - TZ_ERROR("key error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (operation->info.algorithm != TEE_ALG_AES_XTS) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!key1 && !key2) { - TEE_CloseObject(op->key1); - op->key1 = TEE_HANDLE_NULL; - TEE_CloseObject(op->key2); - op->key2 = TEE_HANDLE_NULL; - return TEE_SUCCESS; - } - // check key usage flags - if (key1 && (key1->info.objectUsage | ~op->info.requiredKeyUsage) != 0xffffffff) { - TZ_ERROR("Usage don't match line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (key2 && (key2->info.objectUsage | ~op->info.requiredKeyUsage) != 0xffffffff) { - TZ_ERROR("Usage don't match line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if(key1 != NULL) { - TEE_CopyObjectAttributes(op->key1, key1); - } - if(key2 != NULL) { - TEE_CopyObjectAttributes(op->key2, key2); - } - operation->info.handleState |= TEE_HANDLE_FLAG_KEY_SET; - return TEE_SUCCESS; -} - -void TEE_CopyOperation(TEE_OperationHandle dstOperation, - TEE_OperationHandle srcOperation) { - - struct TEE_Operation * dstOp = (struct TEE_Operation*)dstOperation; - struct TEE_Operation * srcOp = (struct TEE_Operation*)srcOperation; - - if (dstOperation->info.mode != srcOperation->info.mode - || dstOperation->info.algorithm != srcOperation->info.algorithm) { - TZ_ERROR("Operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (dstOperation->info.maxKeySize < srcOperation->info.maxKeySize) { - TZ_ERROR("Operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - dstOperation->info.algorithm = srcOperation->info.algorithm; - dstOperation->info.digestLength = srcOperation->info.digestLength; - dstOperation->info.handleState = srcOperation->info.handleState; - dstOperation->info.keySize = srcOperation->info.keySize; - dstOperation->info.maxKeySize = srcOperation->info.maxKeySize; - dstOperation->info.mode = srcOperation->info.mode; - dstOperation->info.operationClass = srcOperation->info.operationClass; - dstOperation->info.requiredKeyUsage = srcOperation->info.requiredKeyUsage; - - if (dstOp->key1) { - TEE_CopyObjectAttributes(dstOp->key1, srcOp->key1); - } - if (dstOp->key2) { - TEE_CopyObjectAttributes(dstOp->key2, srcOp->key2); - } - if (uci_dup_handle(srcOp->crypto, dstOp->crypto) != UCI_SUCCESS) { - TZ_ERROR("uci_dup_handle error , line = %d, %s\n", __LINE__, __func__); - TEE_Panic(0); - } -} - -// Message Digest Functions -void TEE_DigestUpdate(TEE_OperationHandle operation, const void* chunk, - size_t chunkSize) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_DIGEST) { - TZ_ERROR("param error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_md_update(op->crypto, (unsigned char*)chunk, chunkSize) != UCI_SUCCESS) { - TZ_ERROR("uci_md_update error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } -} - -TEE_Result TEE_DigestDoFinal(TEE_OperationHandle operation, const void* chunk, - size_t chunkLen, void* hash, size_t *hashLen) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (!hash || !hashLen) { - return TEE_ERROR_SHORT_BUFFER; - } - if (operation->info.operationClass != TEE_OPERATION_DIGEST) { - TZ_ERROR("param error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (chunk - != NULL&& uci_md_update(op->crypto, (unsigned char*)chunk, chunkLen) != UCI_SUCCESS) { - TZ_ERROR("uci_md_update error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_md_final(op->crypto, (unsigned char*)hash) != UCI_SUCCESS) { - TZ_ERROR("uci_md_final error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - *hashLen = op->info.digestLength; - return TEE_SUCCESS; -} - -// Symmetric Cipher Functions -void TEE_CipherInit(TEE_OperationHandle operation, const void* IV, size_t IVLen) { - int ret; - unsigned int mode; - unsigned char key1[32] = {0x0, }; - //unsigned char key2[32] = {0x0, }; - size_t key_len1 = sizeof(key1); - //unsigned int key_len2 = sizeof(key2); - size_t uci_alg; - TEE_Result rc; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_CIPHER) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (op->key1) { - rc = TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_SECRET_VALUE, key1, - &key_len1); - if (rc != TEE_SUCCESS) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - } - switch (op->info.algorithm) { - case TEE_ALG_AES_ECB_NOPAD: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_ECB; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_ECB; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - switch (key_len1) { - case 16: - uci_alg = ID_UCI_AES128; - break; - case 24: - uci_alg = ID_UCI_AES192; - break; - case 32: - uci_alg = ID_UCI_AES256; - break; - default: - TZ_ERROR("key len error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(uci_alg, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - - - // KRISHNA - ADDED NEW ALGO - case TEE_ALG_AES_ECB_PKCS7: - case TEE_ALG_AES_ECB_PKCS5: - case TEE_ALG_AES_ECB_ISO9797_M1 : - case TEE_ALG_AES_ECB_ISO9797_M2 : - - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_ECB; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_ECB; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - switch (key_len1) { - case 16: - uci_alg = ID_UCI_AES128; - break; - case 24: - uci_alg = ID_UCI_AES192; - break; - case 32: - uci_alg = ID_UCI_AES256; - break; - default: - TZ_ERROR("key len error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - - op->crypto = uci_context_alloc(uci_alg, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - - - - - case TEE_ALG_AES_CBC_NOPAD: - case TEE_ALG_AES_CBC_PKCS5: - case TEE_ALG_AES_CBC_PKCS7: - case TEE_ALG_AES_CBC_ISO9797_M1: - case TEE_ALG_AES_CBC_ISO9797_M2: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_CBC; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_CBC; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - switch (key_len1) { - case 16: - uci_alg = ID_UCI_AES128; - break; - case 24: - uci_alg = ID_UCI_AES192; - break; - case 32: - uci_alg = ID_UCI_AES256; - break; - default: - TZ_ERROR("key len error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(uci_alg, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - case TEE_ALG_AES_CTR: - case TEE_ALG_AES_CTR_NOPAD: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_CTR; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_CTR; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - switch (key_len1) { - case 16: - uci_alg = ID_UCI_AES128; - break; - case 24: - uci_alg = ID_UCI_AES192; - break; - case 32: - uci_alg = ID_UCI_AES256; - break; - default: - TZ_ERROR("key len error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(uci_alg, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - case TEE_ALG_AES_CTS: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_CTS; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_CTS; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - switch (key_len1) { - case 16: - uci_alg = ID_UCI_AES128; - break; - case 24: - uci_alg = ID_UCI_AES192; - break; - case 32: - uci_alg = ID_UCI_AES256; - break; - default: - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(uci_alg, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_ZERO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - case TEE_ALG_AES_XTS: - TZ_ERROR("TEE_ALG_AES_XTS not support NOW!!"); - TEE_Panic(0); - break; - case TEE_ALG_DES_ECB_NOPAD: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_ECB; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_ECB; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(ID_UCI_DES, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - case TEE_ALG_DES_CBC_NOPAD: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_CBC; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_CBC; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(ID_UCI_DES, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - case TEE_ALG_DES3_ECB_NOPAD: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_ECB; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_ECB; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(ID_UCI_TDES, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - case TEE_ALG_DES3_CBC_NOPAD: - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = ID_UCI_ENC_CBC; - } else if (op->info.mode == TEE_MODE_DECRYPT) { - mode = ID_UCI_DEC_CBC; - } else { - TZ_ERROR("Invalid mode error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - op->crypto = uci_context_alloc(ID_UCI_TDES, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_se_init(op->crypto, mode, ID_UCI_NO_PADDING, key1, key_len1, - (unsigned char *)IV); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - break; - default: - TZ_ERROR("algorithm error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - operation->info.handleState |= TEE_HANDLE_FLAG_INITIALIZED; -} - -TEE_Result TEE_CipherUpdate(TEE_OperationHandle operation, const void* srcData, - size_t srcLen, void* destData, size_t *destLen) { - int ret; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_CIPHER) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (destData == NULL) { - return TEE_ERROR_SHORT_BUFFER; - } - ret = uci_se_process(op->crypto, (unsigned char *)srcData, srcLen, - (unsigned char*)destData, (unsigned int*)destLen); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_process error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - ; - } - return TEE_SUCCESS; -} - -TEE_Result TEE_CipherDoFinal(TEE_OperationHandle operation, const void* srcData, - size_t srcLen, void* destData, size_t *destLen) { - int ret; - size_t blocksize = 8; - int tmp = 0; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_CIPHER) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (destData == NULL) { - return TEE_ERROR_SHORT_BUFFER; - } - *destLen = 0; - if (op->info.algorithm == TEE_ALG_AES_CTS) { - - ret = uci_se_final(op->crypto, (unsigned char *)srcData, srcLen, - (unsigned char*)destData, (unsigned int*)destLen); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_final error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - ; - } - return TEE_SUCCESS; - } - if (op->info.algorithm == TEE_ALG_AES_ECB_NOPAD - || op->info.algorithm == TEE_ALG_AES_CBC_NOPAD - || op->info.algorithm == TEE_ALG_AES_CTR - || op->info.algorithm == TEE_ALG_AES_XTS - ) { - - blocksize = 16; - } - // printf("srcLen is %d, blocksize is %d\n",srcLen, blocksize); - if (srcLen > blocksize) { - ret = uci_se_process(op->crypto, (unsigned char *)srcData, - srcLen - blocksize, (unsigned char*)destData, (unsigned int*)&tmp); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_final error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - - *destLen = tmp; - ret = uci_se_final(op->crypto, (unsigned char *)srcData + tmp, blocksize, - (unsigned char*)destData + tmp, (unsigned int*)&tmp); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_final error line = %d,%s,ret=%d\n", __LINE__, __func__, ret); - TEE_Panic(0); - ; - } - *destLen += tmp; - } else { - - ret = uci_se_final(op->crypto, (unsigned char *)srcData, srcLen, - (unsigned char*)destData, (unsigned int*)destLen); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_se_final error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - ; - } - } - return TEE_SUCCESS; -} - -// MAC Functions -void TEE_MACInit(TEE_OperationHandle operation, const void* IV, size_t IVLen) { - TEE_Result rc = TEE_SUCCESS; - unsigned char key[128] = {0x0, }; - size_t key_len = sizeof(key); - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_MAC) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (op->key1) { - rc = TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_SECRET_VALUE, key, - &key_len); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - TEE_Panic(0); - } - } - if (uci_mac_init(op->crypto, key, key_len) != UCI_SUCCESS) { - TZ_ERROR("uci_mac_init error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - operation->info.handleState |= TEE_HANDLE_FLAG_INITIALIZED; -} - -void TEE_MACUpdate(TEE_OperationHandle operation, const void* chunk, - size_t chunkSize) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_MAC) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_mac_update(op->crypto, (unsigned char *)chunk, - chunkSize) != UCI_SUCCESS) { - TZ_ERROR("uci_mac_update error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } -} - -TEE_Result TEE_MACComputeFinal(TEE_OperationHandle operation, - const void* message, size_t messageLen, void* mac, size_t *macLen) { - - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_MAC) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_mac_update(op->crypto, (unsigned char *)message, - messageLen) != UCI_SUCCESS) { - TZ_ERROR("uci_mac_update error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_mac_final(op->crypto, (unsigned char*)mac, macLen) != UCI_SUCCESS) { - TZ_ERROR("uci_mac_final error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -TEE_Result TEE_MACCompareFinal(TEE_OperationHandle operation, - const void* message, size_t messageLen, const void* mac, size_t *macLen) { - unsigned char tmpmac[128]; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_MAC) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_mac_update(op->crypto, (unsigned char*)message, - messageLen) != UCI_SUCCESS) { - TZ_ERROR("uci_mac_update error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_mac_final(op->crypto, tmpmac, macLen) != UCI_SUCCESS) { - TZ_ERROR("uci_mac_final error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (memcmp(mac, tmpmac, *macLen) != 0) { - return TEE_ERROR_MAC_INVALID; - } - return TEE_SUCCESS; -} - -// Authenticated Encryption Functions - -TEE_Result TEE_AEInit(TEE_OperationHandle operation, const void* nonce, - size_t nonceLen, uint32_t tagLen, uint32_t AADLen, uint32_t payloadLen) { - - TEE_Result rc = TEE_SUCCESS; - unsigned char key[128]; - size_t key_len = sizeof(key); - int ret; - int mode; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_AE) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (op->key1) { - rc = TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_SECRET_VALUE, key, - &key_len); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - TEE_Panic(0); - } - } - if (op->info.mode == TEE_MODE_ENCRYPT) { - mode = 1; - } else { - mode = 0; - } - if (operation->info.algorithm == TEE_ALG_AES_CCM) { - if (tagLen != 128 && tagLen != 112 && tagLen != 96 && tagLen != 64 - && tagLen != 48 && tagLen != 32) { - TZ_ERROR("tagLen error line = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_NOT_SUPPORTED; - } - op->crypto = uci_context_alloc(ID_UCI_AE_CCM, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - - ret = uci_authcrypt_init(op->crypto, mode, (unsigned char*)nonce, nonceLen, - tagLen / 8, AADLen, payloadLen, key, key_len); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_authcrypt_init error line = %d,%s \n", __LINE__, __func__); - TEE_Panic(0); - } - } else if (operation->info.algorithm == TEE_ALG_AES_GCM) { - if (tagLen != 128 && tagLen != 120 && tagLen != 112 && tagLen != 104 - && tagLen != 96) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - return TEE_ERROR_NOT_SUPPORTED; - } - op->crypto = uci_context_alloc(ID_UCI_AE_GCM, UCI_SW); - if (op->crypto == UCI_ERROR || op->crypto == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_authcrypt_init(op->crypto, mode, (unsigned char*)nonce, nonceLen, - tagLen / 8, 0, 0, key, key_len); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_authcrypt_init error line = %d,%s \n", __LINE__, __func__); - TEE_Panic(0); - } - } - operation->info.digestLength = tagLen; - operation->info.handleState |= TEE_HANDLE_FLAG_INITIALIZED; - return TEE_SUCCESS; -} - -void TEE_AEUpdateAAD(TEE_OperationHandle operation, const void* AADdata, - size_t AADdataLen) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_AE) { - TZ_ERROR("operation error line = %d,%s \n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s \n", __LINE__, __func__); - TEE_Panic(0); - } - if (operation->info.algorithm == TEE_ALG_AES_CCM - || operation->info.algorithm == TEE_ALG_AES_GCM) { - if (uci_authcrypt_update_aad(op->crypto, (unsigned char*)AADdata, - AADdataLen) != UCI_SUCCESS) { - TZ_ERROR("uci_authcrypt_update_aad error line = %d,%s \n", __LINE__, - __func__); - TEE_Panic(0); - } - } -} - -TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, const void* srcData, - size_t srcLen, void* destData, size_t *destLen) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_AE) { - TZ_ERROR("operation error line = %d,%s \n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s \n", __LINE__, __func__); - TEE_Panic(0); - } - if (*destLen < srcLen) { - return TEE_ERROR_SHORT_BUFFER; - } - if (operation->info.algorithm == TEE_ALG_AES_CCM - || operation->info.algorithm == TEE_ALG_AES_GCM) { - if (uci_authcrypt_update(op->crypto, (unsigned char*)srcData, srcLen, - (unsigned char*)destData, destLen) != UCI_SUCCESS) { - TZ_ERROR("uci_authcrypt_update_aad error line = %d,%s \n", __LINE__, - __func__); - TEE_Panic(0); - } - } - return TEE_SUCCESS; -} - -TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, - const void* srcData, size_t srcLen, void* destData, size_t* destLen, - void* tag, size_t* tagLen) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_AE) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (*destLen < srcLen) { - return TEE_ERROR_SHORT_BUFFER; - } - if (uci_authcrypt_encryptfinal(op->crypto, (unsigned char*)srcData, srcLen, - (unsigned char*)destData, destLen, (unsigned char*)tag, - tagLen) != UCI_SUCCESS) { - TZ_ERROR("uci_authcrypt_encryptfinal error line = %d,%s \n", __LINE__, - __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, - const void* srcData, size_t srcLen, void* destData, size_t *destLen, - void* tag, size_t tagLen) { - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_AE) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (*destLen < srcLen) { - TZ_ERROR("destLen error line = %d,%s \n", __LINE__, __func__); - return TEE_ERROR_SHORT_BUFFER; - } - if (uci_authcrypt_decryptfinal(op->crypto, (unsigned char*)srcData, srcLen, - (unsigned char*)destData, destLen, (unsigned char*)tag, - tagLen) != UCI_SUCCESS) { - TZ_ERROR("uci_authcrypt_decryptfinal error line = %d,%s \n", __LINE__, - __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -TEE_Result TEE_AsymmetricEncrypt(TEE_OperationHandle operation, - const TEE_Attribute* params, uint32_t paramCount, const void* srcData, - size_t srcLen, void* destData, size_t *destLen) { - int ret; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_ASYMMETRIC_CIPHER) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_ae_encrypt(op->crypto, (unsigned char *)srcData, srcLen, - (unsigned char*)destData, destLen); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_ae_encrypt error. ret= %d,line = %d,%s\n", ret, __LINE__, - __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -TEE_Result TEE_AsymmetricDecrypt(TEE_OperationHandle operation, - const TEE_Attribute* params, uint32_t paramCount, const void* srcData, - size_t srcLen, void* destData, size_t *destLen) { - int ret; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_ASYMMETRIC_CIPHER) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_ae_decrypt(op->crypto, (unsigned char *)srcData, srcLen, - (unsigned char*)destData, destLen); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_ae_decrypt error. ret= %d,line = %d,%s\n", ret, __LINE__, - __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation, - const TEE_Attribute* params, uint32_t paramCount, const void* digest, - size_t digestLen, void* signature, size_t *signatureLen) { - int ret; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_ASYMMETRIC_SIGNATURE) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_ds_sign(op->crypto, (unsigned char *)digest, digestLen, - (unsigned char*)signature, signatureLen); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_ds_sign error. ret= %d,line = %d,%s\n", ret, __LINE__, - __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -TEE_Result TEE_AsymmetricVerifyDigest(TEE_OperationHandle operation, - const TEE_Attribute* params, uint32_t paramCount, const void* digest, - size_t digestLen, void* signature, size_t signatureLen) { - int ret = UCI_ERROR; - int result = -1; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (operation->info.operationClass != TEE_OPERATION_ASYMMETRIC_SIGNATURE) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(operation->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - ret = uci_ds_verify(op->crypto, (unsigned char *)digest, digestLen, - (unsigned char*)signature, signatureLen, &result); - if (ret != UCI_SUCCESS) { - TZ_ERROR("uci_ds_verify error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (result != UCI_VALID_SIGN) { - TZ_ERROR("uci_ds_verify error. ret= %d,line = %d,%s\n", result, __LINE__, - __func__); - TEE_Panic(0); - } - return TEE_SUCCESS; -} - -void TEE_DeriveKey(TEE_OperationHandle operation, const TEE_Attribute* params, - uint32_t paramCount, TEE_ObjectHandle derivedKey) { - uint32_t i = 0; - unsigned char authkey[512]; - unsigned char privkey[512]; - unsigned char *pubkey = NULL; - size_t pubkey_len = 0; - size_t privkey_len = sizeof(privkey); - TEE_Attribute attrs[1]; - TEE_Result rc; - struct TEE_Operation * op = (struct TEE_Operation*)operation; - - if (op->info.operationClass != TEE_OPERATION_KEY_DERIVATION) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!params) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (op->info.mode != TEE_MODE_DERIVE) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - for (i = 0; i < paramCount; i++) { - if (params[i].attributeID == TEE_ATTR_DH_PUBLIC_VALUE) { - pubkey = (unsigned char*)params[i].content.ref.buffer; - pubkey_len = params[i].content.ref.length / 8; - break; - } - } - rc = TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_DH_PRIVATE_VALUE, - privkey, &privkey_len); - if (rc != TEE_SUCCESS) { - TZ_ERROR("TEE_GetObjectBufferAttribute error line = %d,%s\n", __LINE__, - __func__); - return; - } - if (pubkey_len == 0 || !pubkey || privkey_len == 0) { - TZ_ERROR("params error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if ((i = uci_dh_gen_authkey(op->crypto, privkey, pubkey, authkey)) - != UCI_SUCCESS) { - TZ_ERROR(" uci_dh_gen_authkey error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - PrintBYTE("privkey", privkey, privkey_len); - PrintBYTE("pubkey", pubkey, privkey_len); - TEE_InitRefAttribute(&attrs[0], TEE_ATTR_SECRET_VALUE, authkey, pubkey_len); - TEE_PopulateTransientObject(derivedKey, attrs, 1); -} - -void TEE_GenerateRandom(void* randomBuffer, size_t randomBufferLen) { - int i = 0; - unsigned char seed[16]; - //unsigned int seedLen = 16; - unsigned int res; - unsigned long get_time = getClock(); - - srand(get_time); - - for (i = 0; i < 16; i++) { - res = rand(); - seed[i] = res & 0xFF; - } - UCI_HANDLE oh = uci_context_alloc(ID_UCI_X931, UCI_SW); - if (oh == UCI_ERROR || oh == UCI_MEM_ALLOR_ERROR) { - TZ_ERROR("uci_context_alloc error line = %d, %s", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_prng_seed(oh, seed) != UCI_SUCCESS) { - TZ_ERROR("uci_prng_seed line = %d, %s", __LINE__, __func__); - TEE_Panic(0); - } - if (uci_prng_get(oh, randomBufferLen, - (unsigned char*)randomBuffer) != UCI_SUCCESS) { - TZ_ERROR("uci_prng_get line = %d, %s", __LINE__, __func__); - TEE_Panic(0); - } -} diff --git a/ssflib/src/ssf_crypto.cpp b/ssflib/src/ssf_crypto.cpp new file mode 100644 index 0000000..083c9f9 --- /dev/null +++ b/ssflib/src/ssf_crypto.cpp @@ -0,0 +1,2869 @@ +/* + * ===================================================================================== + * + * Filename: ssf_crypto.c + * + * Description: SSF crypto functions + * + * Version: 1.0 + * Created: 23 April 2015 12:41:39 IST + * Revision: Original + * Compiler: gcc + * + * Author: krishna (Kr), k.devale@samsung.com + * Organization: Samsung Electronics + * + * ===================================================================================== + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "CC_API.h" + +// #include + +#define TAG "TEE:Crypto" + +#define CRYPTO_PANIC do{LOGE(SSF_LIB, "This Line!");TEE_Panic(0);}while(0) + +#define MAX_ATTRIBUTE_NUMBER 35 // Maximum number of attributes for each object + +#if 0 //ndef NDEBUG +#define CRYPTO_INTERNAL_LOG(_f, _a...) printf("[%s]%d: " _f "\n", __func__ , __LINE__ , ## _a) +#define CRYPTO_INTERNAL_LOG_BYTE(msg, Data, DataLen) { \ + int idx; \ + printf("%10s =", msg); \ + printf("\n"); \ + for( idx=0; idx<(int)DataLen; idx++) { \ + if( (idx!=0) && ((idx%16)==0) ) printf("\n"); \ + if((idx % 16) == 0) printf("\t\""); \ + printf("%.2X", Data[idx]); \ + if( (idx!=0) && ((idx%16)==15) ) printf("\""); \ + } \ + printf("\n"); \ +} +#else +#define CRYPTO_INTERNAL_LOG(_f, _a...) +#define CRYPTO_INTERNAL_LOG_BYTE(msg, Data, DataLen) +#endif + +struct __TEE_Attributees +{ + int attr_number; + TEE_Attribute attr_array[MAX_ATTRIBUTE_NUMBER]; +}; + +struct TransientObject +{ + TEE_ObjectInfo info; + struct __TEE_Attributees attr; +}; + +struct __TEE_ObjectHandle +{ + struct TransientObject tr; + int drv_hndl; +}; + +struct __TEE_OperationHandle +{ + TEE_OperationInfo info; +}; + +//static int crypto_engine_type = CRYPTO_USE_SW_ENGINE; + +static int sw_crypto_ioctl_init(crypto_internal_operation *operation, crypto_internal_keystruct *key, unsigned char *ivec, unsigned int ivec_len) +{ + (void)ivec_len; /* actually always==16 */ + int rc=0; + int mode; + unsigned int padding=ID_NO_PADDING; + CryptoCoreContainer *handle=(CryptoCoreContainer *)operation->crypto; + + switch(operation->info.algorithm) + { + /* TEE_OPERATION_CIPHER */ + case TEE_ALG_AES_ECB_NOPAD: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_ECB; + else mode=ID_DEC_ECB; + padding = ID_NO_PADDING; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_ECB_PKCS5: + case TEE_ALG_AES_ECB_PKCS7: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_ECB; + else mode=ID_DEC_ECB; + padding = ID_NO_PADDING /* ID_PKCS5 */; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_ECB_ISO9797_M1: + case TEE_ALG_AES_ECB_ISO9797_M2: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_ECB; + else mode=ID_DEC_ECB; + padding = ID_NO_PADDING /* ID_PKCS5 */; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_CBC_NOPAD: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_CBC; + else mode=ID_DEC_CBC; + padding = ID_NO_PADDING; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_CBC_PKCS5: + case TEE_ALG_AES_CBC_PKCS7: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_CBC; + else mode=ID_DEC_CBC; + padding = ID_NO_PADDING/* ID_PKCS5 */; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_CBC_ISO9797_M1: + case TEE_ALG_AES_CBC_ISO9797_M2: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_CBC; + else mode=ID_DEC_CBC; + padding = ID_NO_PADDING /* ID_PKCS5 */; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_CTR: + case TEE_ALG_AES_CTR_NOPAD: + if(operation->info.mode == TEE_MODE_ENCRYPT) mode=ID_ENC_CTR; + else mode=ID_DEC_CTR; + padding = ID_NO_PADDING; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_AES_CTS: + case TEE_ALG_AES_XTS: + break; + + case TEE_ALG_DES_ECB_NOPAD: + case TEE_ALG_DES3_ECB_NOPAD: + if(operation->info.mode == TEE_MODE_ENCRYPT) { + mode=ID_ENC_ECB; + } + else { + mode=ID_DEC_ECB; + } + padding = ID_NO_PADDING; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_DES_CBC_NOPAD: + case TEE_ALG_DES3_CBC_NOPAD: + if(operation->info.mode == TEE_MODE_ENCRYPT) { + mode=ID_ENC_CBC; + } + else { + mode=ID_DEC_CBC; + } + padding = ID_NO_PADDING; + rc=handle->SE_init(handle, mode, padding, key->secret.buffer, key->secret.size, ivec); + break; + + case TEE_ALG_HMAC_MD5: + case TEE_ALG_HMAC_SHA1: + case TEE_ALG_HMAC_SHA224: + case TEE_ALG_HMAC_SHA256: + case TEE_ALG_HMAC_SHA384: + case TEE_ALG_HMAC_SHA512: + case TEE_ALG_AES_CBC_MAC_NOPAD: + case TEE_ALG_AES_CBC_MAC_PKCS5: + case TEE_ALG_DES_CBC_MAC_NOPAD: + case TEE_ALG_DES_CBC_MAC_PKCS5: + case TEE_ALG_AES_CMAC: + case TEE_ALG_DES3_CBC_MAC_NOPAD: + case TEE_ALG_DES3_CBC_MAC_PKCS5: + rc=handle->MAC_init(handle, key->secret.buffer, key->secret.size); + break; + + case TEE_ALG_AES_CCM: + case TEE_ALG_AES_GCM: + break; + + case TEE_ALG_MD5: + case TEE_ALG_SHA1: + case TEE_ALG_SHA224: + case TEE_ALG_SHA256: + case TEE_ALG_SHA384: + case TEE_ALG_SHA512: + rc=handle->MD_init(handle); + break; + + case TEE_ALG_RSA_NOPAD: + padding = ID_NO_PADDING; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSAES_PKCS1_V1_5: + padding = ID_RSAES_PKCS15; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: + padding = ID_RSAES_OAEP_SHA1; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: + padding = ID_RSAES_OAEP_SHA224; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: + padding = ID_RSAES_OAEP_SHA256; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: + padding = ID_RSAES_OAEP_SHA384; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: + padding = ID_RSAES_OAEP_SHA512; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: + padding = ID_RSASSA_PKCS15_MD5; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: + padding = ID_RSASSA_PKCS15_SHA1; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: + padding = ID_RSASSA_PKCS15_SHA224; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: + padding = ID_RSASSA_PKCS15_SHA256; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: + padding = ID_RSASSA_PKCS15_SHA384; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: + padding = ID_RSASSA_PKCS15_SHA512; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: + padding = ID_RSASSA_PSS_SHA1; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: + padding = ID_RSASSA_PSS_SHA224; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: + padding = ID_RSASSA_PSS_SHA256; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: + padding = ID_RSASSA_PSS_SHA384; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: + padding = ID_RSASSA_PSS_SHA512; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_DSA_SHA1: + padding = 0; + rc=handle->RSA_setKeypairForCRT(handle, padding, + key->rsa_modulus.buffer, key->rsa_modulus.size, + key->rsa_public.buffer, key->rsa_public.size, + key->rsa_private.buffer, key->rsa_private.size, + key->rsa_prime1.buffer, key->rsa_prime1.size, + key->rsa_prime2.buffer, key->rsa_prime2.size, + key->rsa_exponent1.buffer, key->rsa_exponent1.size, + key->rsa_exponent2.buffer, key->rsa_exponent2.size, + key->rsa_coefficient.buffer, key->rsa_coefficient.size); + break; + + case TEE_ALG_GENERATE_SECRET_KEY: + rc=handle->PRNG_get(handle, key->secret.size, key->secret.buffer); + /* Ignore return value to avoid CRYPTO_PANIC. Only SDRM_X931_ConditionalTest() can return TEE_ERROR.*/ + rc = TEE_SUCCESS; + break; + + case TEE_ALG_GENERATE_RSA_KEY: + { + unsigned char E[3] = {0x01, 0x00, 0x01}; + unsigned int ELen = 3; + + rc=handle->RSA_genKeypairWithEforCRT(handle, padding, + E, ELen, + key->rsa_modulus.buffer, &key->rsa_modulus.size, + key->rsa_private.buffer, &key->rsa_private.size, + key->rsa_prime1.buffer, &key->rsa_prime1.size, + key->rsa_prime2.buffer, &key->rsa_prime2.size, + key->rsa_exponent1.buffer, &key->rsa_exponent1.size, + key->rsa_exponent2.buffer, &key->rsa_exponent2.size, + key->rsa_coefficient.buffer, &key->rsa_coefficient.size); + + /*if(rc == (-ETIMEDOUT)) + { + LOGE(SSF_LIB, "Algorithm - %X : TIMEOUT \n", operation->info.algorithm); + rc = TEE_ERROR_TIMEOUT; + }*/ + + memcpy(key->rsa_public.buffer, E, ELen); + key->rsa_public.size = ELen; + } + break; + + default: + LOGE(SSF_LIB, "Not Support Algorithm : %X ", operation->info.algorithm); + break; + } + + CRYPTO_INTERNAL_LOG("rc=%d ", rc); + return rc; +} + +static int sw_crypto_ioctl_update (crypto_internal_operation *operation, unsigned char* src_addr, unsigned int src_size, unsigned char* dst_addr, unsigned int* dst_size) +{ + int rc; + CryptoCoreContainer *handle=(CryptoCoreContainer *)operation->crypto; + + switch(operation->info.algorithm) + { + /* TEE_OPERATION_CIPHER */ + case TEE_ALG_AES_ECB_NOPAD: + case TEE_ALG_AES_ECB_PKCS5: + case TEE_ALG_AES_ECB_PKCS7: + case TEE_ALG_AES_ECB_ISO9797_M1: + case TEE_ALG_AES_ECB_ISO9797_M2: + case TEE_ALG_AES_CBC_NOPAD: + case TEE_ALG_AES_CBC_PKCS5: + case TEE_ALG_AES_CBC_PKCS7: + case TEE_ALG_AES_CBC_ISO9797_M1: + case TEE_ALG_AES_CBC_ISO9797_M2: + case TEE_ALG_AES_CTR: + case TEE_ALG_AES_CTR_NOPAD: + case TEE_ALG_DES_ECB_NOPAD: + case TEE_ALG_DES3_ECB_NOPAD: + case TEE_ALG_DES_CBC_NOPAD: + case TEE_ALG_DES3_CBC_NOPAD: + rc=handle->SE_process(handle, src_addr, src_size, dst_addr, dst_size); + break; + + case TEE_ALG_HMAC_MD5: + case TEE_ALG_HMAC_SHA1: + case TEE_ALG_HMAC_SHA224: + case TEE_ALG_HMAC_SHA256: + case TEE_ALG_HMAC_SHA384: + case TEE_ALG_HMAC_SHA512: + case TEE_ALG_AES_CBC_MAC_NOPAD: + case TEE_ALG_AES_CBC_MAC_PKCS5: + case TEE_ALG_DES_CBC_MAC_NOPAD: + case TEE_ALG_DES_CBC_MAC_PKCS5: + case TEE_ALG_AES_CMAC: + case TEE_ALG_DES3_CBC_MAC_NOPAD: + case TEE_ALG_DES3_CBC_MAC_PKCS5: + rc=handle->MAC_update(handle, src_addr, src_size); + break; + + case TEE_ALG_MD5: + case TEE_ALG_SHA1: + case TEE_ALG_SHA224: + case TEE_ALG_SHA256: + case TEE_ALG_SHA384: + case TEE_ALG_SHA512: + rc=handle->MD_update(handle, src_addr, src_size); + break; + + default: + LOGE(SSF_LIB, "Not Support Algorithm : %X", operation->info.algorithm); + rc=-1; + break; + } + + if(src_size && dst_size) {CRYPTO_INTERNAL_LOG("rc=%d src_size=%d dst_size=%d", rc, src_size, *dst_size);} + else {CRYPTO_INTERNAL_LOG("rc=%d", rc);} + return rc; +} + +static int sw_crypto_ioctl_final (crypto_internal_operation *operation, unsigned char* src_addr, unsigned int src_size, unsigned char* dst_addr, unsigned int* dst_size) +{ + int rc=-1; + int result=0; + CryptoCoreContainer *handle=(CryptoCoreContainer *)operation->crypto; + + switch(operation->info.algorithm) + { + /* TEE_OPERATION_CIPHER */ + case TEE_ALG_AES_ECB_NOPAD: + case TEE_ALG_AES_ECB_PKCS5: + case TEE_ALG_AES_ECB_PKCS7: + case TEE_ALG_AES_ECB_ISO9797_M1: + case TEE_ALG_AES_ECB_ISO9797_M2: + case TEE_ALG_AES_CBC_NOPAD: + case TEE_ALG_AES_CBC_PKCS5: + case TEE_ALG_AES_CBC_PKCS7: + case TEE_ALG_AES_CBC_ISO9797_M1: + case TEE_ALG_AES_CBC_ISO9797_M2: + case TEE_ALG_AES_CTR_NOPAD: + case TEE_ALG_AES_CTR: + rc=handle->SE_final(handle, src_addr, src_size, dst_addr, dst_size); + break; + + case TEE_ALG_AES_CTS: + case TEE_ALG_AES_XTS: + break; + + case TEE_ALG_DES_ECB_NOPAD: + case TEE_ALG_DES3_ECB_NOPAD: + case TEE_ALG_DES_CBC_NOPAD: + case TEE_ALG_DES3_CBC_NOPAD: + rc=handle->SE_final(handle, src_addr, src_size, dst_addr, dst_size); + break; + + /* TEE_OPERATION_MAC */ + case TEE_ALG_HMAC_MD5: + case TEE_ALG_HMAC_SHA1: + case TEE_ALG_HMAC_SHA224: + case TEE_ALG_HMAC_SHA256: + case TEE_ALG_HMAC_SHA384: + case TEE_ALG_HMAC_SHA512: + case TEE_ALG_AES_CBC_MAC_NOPAD: + case TEE_ALG_AES_CBC_MAC_PKCS5: + case TEE_ALG_DES_CBC_MAC_NOPAD: + case TEE_ALG_DES_CBC_MAC_PKCS5: + case TEE_ALG_AES_CMAC: + case TEE_ALG_DES3_CBC_MAC_NOPAD: + case TEE_ALG_DES3_CBC_MAC_PKCS5: + if(src_addr && src_size!=0) { + handle->MAC_update(handle, src_addr, src_size); + } + rc=handle->MAC_final(handle, dst_addr, dst_size); + break; + + /* TEE_OPERATION_AE */ + case TEE_ALG_AES_CCM: + case TEE_ALG_AES_GCM: + break; + + /* TEE_OPERATION_DIGEST */ + case TEE_ALG_MD5: + case TEE_ALG_SHA1: + case TEE_ALG_SHA224: + case TEE_ALG_SHA256: + case TEE_ALG_SHA384: + case TEE_ALG_SHA512: + if(src_addr && src_size!=0) { + handle->MD_update(handle, src_addr, src_size); + } + rc=handle->MD_final(handle, dst_addr); + *dst_size = operation->info.digestLength; + break; + + /* TEE_OPERATION_ASYMMETRIC_CIPHER */ + case TEE_ALG_RSA_NOPAD: + case TEE_ALG_RSAES_PKCS1_V1_5: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: + if (operation->info.mode == TEE_MODE_ENCRYPT ) { + rc=handle->AE_encrypt(handle, src_addr, src_size, dst_addr, dst_size); + } + else{ + rc=handle->AE_decrypt(handle, src_addr, src_size, dst_addr, dst_size); + } + break; + + /* TEE_OPERATION_ASYMMETRIC_SIGNATURE */ + case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: + if (operation->info.mode == TEE_MODE_SIGN ) { + rc=handle->DS_sign(handle, src_addr, src_size, dst_addr, dst_size); + } + else { + rc=handle->DS_verify(handle, src_addr, src_size, dst_addr, *dst_size, &result); + if(result != rc) { + rc=result; + } + } + break; + + case TEE_ALG_GENERATE_SECRET_KEY: + rc=0; + break; + + case TEE_ALG_GENERATE_RSA_KEY: + rc=0; + break; + + default: + LOGE(SSF_LIB, "Not Support Algorithm : %X", operation->info.algorithm); + break; + } + + if(src_size && dst_size) {CRYPTO_INTERNAL_LOG("rc=%d src_size=%d dst_size=%d", rc, src_size, *dst_size);} + else {CRYPTO_INTERNAL_LOG("rc=%d", rc);} + return rc; +} + +static int sw_crypto_open(crypto_internal_operation *operation) +{ + unsigned int alg; + + switch(operation->info.algorithm) + { + /* TEE_OPERATION_CIPHER */ + case TEE_ALG_AES_ECB_NOPAD: + case TEE_ALG_AES_CBC_NOPAD: + case TEE_ALG_AES_CTR: + case TEE_ALG_AES_CTR_NOPAD: + case TEE_ALG_AES_ECB_PKCS5: + case TEE_ALG_AES_ECB_PKCS7: + case TEE_ALG_AES_ECB_ISO9797_M1: + case TEE_ALG_AES_ECB_ISO9797_M2: + case TEE_ALG_AES_CBC_PKCS5: + case TEE_ALG_AES_CBC_PKCS7: + case TEE_ALG_AES_CBC_ISO9797_M1: + case TEE_ALG_AES_CBC_ISO9797_M2: + if (operation->info.keySize== 128) { + alg=ID_AES128; + } + else if (operation->info.keySize== 192) { + alg=ID_AES192; + } + else if (operation->info.keySize== 256) { + alg=ID_AES256; + } + else { + goto error; + } + break; + case TEE_ALG_AES_XTS: + case TEE_ALG_AES_CTS: + goto error; + break; + case TEE_ALG_DES_ECB_NOPAD: + case TEE_ALG_DES_CBC_NOPAD: + alg=ID_DES; + break; + case TEE_ALG_DES3_ECB_NOPAD: + case TEE_ALG_DES3_CBC_NOPAD: + alg=ID_TDES; + break; + + /* TEE_OPERATION_MAC */ + case TEE_ALG_AES_CBC_MAC_NOPAD: + case TEE_ALG_AES_CBC_MAC_PKCS5: + case TEE_ALG_AES_CMAC: + case TEE_ALG_DES_CBC_MAC_NOPAD: + case TEE_ALG_DES_CBC_MAC_PKCS5: + case TEE_ALG_DES3_CBC_MAC_NOPAD: + case TEE_ALG_DES3_CBC_MAC_PKCS5: + goto error; + break; + case TEE_ALG_HMAC_MD5: + alg = ID_HMD5; + break; + case TEE_ALG_HMAC_SHA1: + alg = ID_HSHA1; + break; + case TEE_ALG_HMAC_SHA224: + alg = ID_HSHA224; + break; + case TEE_ALG_HMAC_SHA256: + alg = ID_HSHA256; + break; + case TEE_ALG_HMAC_SHA384: + alg = ID_HSHA384; + break; + case TEE_ALG_HMAC_SHA512: + alg = ID_HSHA512; + break; + + /* TEE_OPERATION_AE */ + case TEE_ALG_AES_CCM: + case TEE_ALG_AES_GCM: + goto error; + break; + + /* TEE_OPERATION_DIGEST */ + case TEE_ALG_MD5: + alg = ID_MD5; + break; + case TEE_ALG_SHA1: + alg = ID_SHA1; + break; + case TEE_ALG_SHA224: + alg = ID_SHA224; + break; + case TEE_ALG_SHA256: + alg = ID_SHA256; + break; + case TEE_ALG_SHA384: + alg = ID_SHA384; + break; + case TEE_ALG_SHA512: + alg = ID_SHA512; + break; + + /* TEE_OPERATION_ASYMMETRIC_CIPHER */ + case TEE_ALG_RSA_NOPAD: + case TEE_ALG_RSAES_PKCS1_V1_5: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: + if (operation->info.keySize== 1024) { + alg=ID_RSA1024; + } + else if (operation->info.keySize== 2048) { + alg=ID_RSA2048; + } + else if (operation->info.keySize== 3072) { + alg=ID_RSA3072; + } + else { + goto error; + } + break; + + /* TEE_OPERATION_ASYMMETRIC_SIGNATURE */ + case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: + if (operation->info.keySize== 1024) { + alg=ID_RSA1024; + } + else if (operation->info.keySize== 2048) { + alg=ID_RSA2048; + } + else if (operation->info.keySize== 3072) { + alg=ID_RSA3072; + } + else { + goto error; + } + break; + + case TEE_ALG_DSA_SHA1: + goto error; + break; + + case TEE_ALG_ECDSA_P160: + case TEE_ALG_ECDSA_P192: + case TEE_ALG_ECDSA_P224: + case TEE_ALG_ECDSA_P256: + case TEE_ALG_ECDSA_P384: + case TEE_ALG_ECDSA_P521: + goto error; + break; + + /* TEE_OPERATION_KEY_DERIVATION */ + case TEE_ALG_DH_DERIVE_SHARED_SECRET: + goto error; + break; + + case TEE_ALG_ECDH_P192: + case TEE_ALG_ECDH_P224: + case TEE_ALG_ECDH_P256: + case TEE_ALG_ECDH_P384: + case TEE_ALG_ECDH_P521: + goto error; + break; + + case TEE_ALG_GENERATE_SECRET_KEY: + alg=ID_X931; + break; + + case TEE_ALG_GENERATE_RSA_KEY: + if (operation->info.keySize== 1024) { + alg=ID_RSA1024; + } + else if (operation->info.keySize== 2048) { + alg=ID_RSA2048; + } + else if (operation->info.keySize== 3072) { + alg=ID_RSA3072; + } + else { + goto error; + } + break; + + default: + LOGE(SSF_LIB, "Not Support Algorithm : %X ", operation->info.algorithm); + goto error; + break; + } + + operation->crypto=(int)create_CryptoCoreContainer(alg); + + if(operation->crypto==0) { + goto error; + } + return 0; + +error: + return -1; +} + +static int sw_crypto_close(crypto_internal_operation *operation) +{ + int rc = 0; + if(operation->crypto) { + destroy_CryptoCoreContainer((CryptoCoreContainer*)operation->crypto); + } + operation->crypto = -1; + return rc; +} + +#if 0 +static int hw_crypto_ioctl_init(crypto_internal_operation *operation, crypto_internal_keystruct *key, unsigned char *ivec, unsigned int ivec_len) +{ + int rc; + unsigned int mode = 0; + struct crypt_info info; + memset(&info, 0, sizeof(info)); + + switch(operation->info.algorithm) + { + /* TEE_OPERATION_CIPHER */ + case TEE_ALG_AES_ECB_NOPAD: + case TEE_ALG_AES_ECB_PKCS5: + case TEE_ALG_AES_ECB_PKCS7: + case TEE_ALG_AES_ECB_ISO9797_M1: + case TEE_ALG_AES_ECB_ISO9797_M2: + mode=MI_AES_ECB; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_AES_CBC_NOPAD: + case TEE_ALG_AES_CBC_PKCS5: + case TEE_ALG_AES_CBC_PKCS7: + case TEE_ALG_AES_CBC_ISO9797_M1: + case TEE_ALG_AES_CBC_ISO9797_M2: + mode=MI_AES_CBC; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_AES_CTR: + case TEE_ALG_AES_CTR_NOPAD: + mode=MI_AES_CTR; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_AES_CTS: + case TEE_ALG_AES_XTS: + break; + + case TEE_ALG_DES_ECB_NOPAD: + mode=MI_DES_ECB; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_DES3_ECB_NOPAD: + mode=MI_TDES_ECB; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_DES_CBC_NOPAD: + mode=MI_DES_CBC; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_DES3_CBC_NOPAD: + mode=MI_TDES_CBC; + if (operation->info.mode == TEE_MODE_DECRYPT) { + mode |= _MODE_DEC_; + } + break; + + case TEE_ALG_MD5: + mode=MI_MD5; + break; + + case TEE_ALG_SHA1: + mode=MI_SHA1; + break; + + case TEE_ALG_SHA224: + mode=MI_SHA224; + break; + + case TEE_ALG_SHA256: + mode=MI_HMAC_SHA256; + break; + + case TEE_ALG_SHA384: + mode=MI_SHA384; + break; + + case TEE_ALG_SHA512: + mode=MI_SHA512; + break; + + case TEE_ALG_RSA_NOPAD: + case TEE_ALG_RSAES_PKCS1_V1_5: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: + case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: + case TEE_ALG_DSA_SHA1: + case TEE_ALG_GENERATE_SECRET_KEY: + case TEE_ALG_GENERATE_RSA_KEY: + LOGE(SSF_LIB, "Not Support Algorithm : %X ", operation->info.algorithm); + break; + + default: + LOGE(SSF_LIB, "Not Support Algorithm : %X ", operation->info.algorithm); + break; + } + + if(mode==0) + { + rc = -1; + } + else + { + /* Set Key Type */ + info.keytype = KEYID_USER_KEY; + info.mode = mode; + /* Set Key */ + if(key->secret.buffer && key->secret.size !=0 && key->secret.size < MAX_KEY_LEN) { + info.keylen = key->secret.size; + memcpy(info.key, key->secret.buffer, key->secret.size); + } + /* Set IV */ + if(ivec && ivec_len !=0 && ivec_len < MAX_IV_LEN) { + info.ivlen = ivec_len; + memcpy(info.iv, ivec, ivec_len); + } + rc= ioctl(operation->crypto, IOCTL_CRYPTO_INIT, (unsigned long)&info); + } + + CRYPTO_INTERNAL_LOG("rc=%d ", rc); + return rc; +} + +static int hw_crypto_ioctl_update(crypto_internal_operation *operation, unsigned char* src_addr, unsigned int src_size, unsigned char* dst_addr, unsigned int* dst_size) +{ + int ret; + struct crypt_oper oper; + + oper.src_addr=src_addr; + oper.dst_addr=dst_addr; + oper.src_len=src_size; + oper.dst_len=dst_size; + oper.final=0; + + ret = ioctl(operation->crypto, IOCTL_CRYPTO_CRYPT, (unsigned long)&oper); + return ret; +} + +static int hw_crypto_ioctl_final(crypto_internal_operation *operation, unsigned char* src_addr, unsigned int src_size, unsigned char* dst_addr, unsigned int* dst_size) +{ + int ret; + struct crypt_oper oper; + + oper.src_addr=src_addr; + oper.dst_addr=dst_addr; + oper.src_len=src_size; + oper.dst_len=dst_size; + oper.final=1; + + ret = ioctl(operation->crypto, IOCTL_CRYPTO_CRYPT, (unsigned long)&oper); + return ret; +} + +static int hw_crypto_open(crypto_internal_operation *operation) +{ + operation->crypto = open("/dev/crypto", 0, 0); + if(operation->crypto) { + return 0; + } + return -1; +} + +static int hw_crypto_close(crypto_internal_operation *operation) +{ + close(operation->crypto); + operation->crypto=-1; + return 0; +} + +static crypto_internal_engine crypto_internal_select_engine(uint32_t alg) +{ + return CRYPTO_SW_ENGINE; +} + +void crypto_internal_set_engine(int set) +{ + crypto_engine_type=set; +} +#endif + +int crypto_internal_open(crypto_internal_operation *operation) +{ + int rc = -1; + /*crypto_internal_engine engine; + + engine=crypto_internal_select_engine(operation->info.algorithm); + if (engine==CRYPTO_HW_ENGINE) { + rc=hw_crypto_open(operation); + } + else if (engine==CRYPTO_SW_ENGINE) {*/ + rc=sw_crypto_open(operation); + //} + return rc; +} + +int crypto_internal_close(crypto_internal_operation *operation) +{ + int rc = -1; + /*crypto_internal_engine engine; + + engine=crypto_internal_select_engine(operation->info.algorithm); + if (engine==CRYPTO_HW_ENGINE) { + rc=hw_crypto_close(operation); + } + else if (engine==CRYPTO_SW_ENGINE) {*/ + rc=sw_crypto_close(operation); + //} + return rc; +} + +int crypto_internal_init(crypto_internal_operation *operation, crypto_internal_keystruct *key, unsigned char *ivec, size_t ivec_len) +{ + int rc = -1; + /*crypto_internal_engine engine; + + engine=crypto_internal_select_engine(operation->info.algorithm); + if (engine==CRYPTO_HW_ENGINE) { + rc = hw_crypto_ioctl_init(operation, key, ivec, ivec_len); + } + else if (engine==CRYPTO_SW_ENGINE) {*/ + rc=sw_crypto_ioctl_init(operation, key, ivec, ivec_len); + //} + return rc; +} + +int crypto_internal_update(crypto_internal_operation *operation, unsigned char *src_data, size_t src_len, unsigned char *dst_data, size_t *dst_len) +{ + //crypto_internal_engine engine; + unsigned char* in_data=NULL; + unsigned char* out_data=NULL; + unsigned int in_size=0; + unsigned int out_size=0; + unsigned int num=0; + unsigned int processing_len=0; + unsigned int total_processing_len=0; + int (*crypto_update_engine)(crypto_internal_operation *, unsigned char *, unsigned int, unsigned char *, unsigned int*); + + /*engine=crypto_internal_select_engine(operation->info.algorithm); + if (engine==CRYPTO_HW_ENGINE) { + crypto_update_engine=hw_crypto_ioctl_update; + } + else if (engine==CRYPTO_SW_ENGINE) {*/ + crypto_update_engine=sw_crypto_ioctl_update; + //} + //else { + // goto error; + //} + + if(src_data) { + in_data=(unsigned char*)src_data; + } + if(dst_data) { + out_data=(unsigned char*)dst_data; + } + if(src_len) { + in_size=(unsigned int)src_len; + } + if(dst_len) { + out_size=(unsigned int)*dst_len; + } + + CRYPTO_INTERNAL_LOG("--------------------------------------------------------------"); + CRYPTO_INTERNAL_LOG("in_size=%d out_size=%d op->data_len=%d, processed=%d", in_size, out_size, operation->data_len, total_processing_len); + + if(operation->info.operationClass == TEE_OPERATION_CIPHER) + { + if (operation->data_len != 0) + { + if (in_size < (size_t)(operation->block_len - operation->data_len)) { + num = in_size; + } + else { + num = (size_t)(operation->block_len - operation->data_len); + } + + CRYPTO_INTERNAL_LOG("num=%d in_size=%d out_size=%d processed=%d", num, in_size, out_size, total_processing_len); + if(num != 0) { + memcpy(operation->data + operation->data_len, in_data, num); + + operation->data_len += num; + in_size -= num; + in_data = (unsigned char*)((unsigned long)in_data + num); + + /* accumulated data is full */ + if (operation->data_len == operation->block_len) + { + processing_len = out_size; + if (crypto_update_engine(operation, operation->data, operation->data_len, out_data, &processing_len)) { + goto error; + } + total_processing_len += processing_len; + out_size -= processing_len; + out_data = (unsigned char*)((unsigned long) out_data + processing_len); + operation->data_len = 0; + } + } + CRYPTO_INTERNAL_LOG("num=%d in_size=%d out_size=%d processed=%d", num, in_size, out_size, total_processing_len); + } + + if (in_size != 0) + { + size_t should_be_processed_of_bytes = (size_t)in_size/operation->block_len*operation->block_len; + size_t remaining_number_of_bytes = in_size-should_be_processed_of_bytes; + + CRYPTO_INTERNAL_LOG("should_be_processed_of_bytes=%d remaining_number_of_bytes=%d processed=%d", should_be_processed_of_bytes, remaining_number_of_bytes, total_processing_len); + if (should_be_processed_of_bytes != 0) + { + processing_len = out_size-total_processing_len; + if (crypto_update_engine(operation, in_data, should_be_processed_of_bytes, out_data, &processing_len)) { + goto error; + } + total_processing_len += processing_len; + in_size -= processing_len; + in_data = (unsigned char*)((unsigned long) in_data + processing_len); + } + + if(remaining_number_of_bytes != 0) { + memcpy(operation->data, in_data, remaining_number_of_bytes); + operation->data_len = remaining_number_of_bytes; + } + } + } + else if(operation->info.operationClass == TEE_OPERATION_MAC || operation->info.operationClass == TEE_OPERATION_DIGEST) + { + if (operation->data_len != 0) + { + if (in_size < (size_t)(operation->block_len - operation->data_len)) { + num = in_size; + } + else { + num = (size_t)(operation->block_len - operation->data_len); + } + + CRYPTO_INTERNAL_LOG("num=%d in_size=%d processed=%d", num, in_size, total_processing_len); + if(num != 0) { + memcpy(operation->data + operation->data_len, in_data, num); + + operation->data_len += num; + in_size -= num; + in_data = (unsigned char*)((unsigned long)in_data + num); + + /* accumulated data is full */ + if (operation->data_len == operation->block_len) + { + if (crypto_update_engine(operation, operation->data, operation->data_len, NULL, NULL)) { + goto error; + } + operation->data_len = 0; + } + + total_processing_len += num; + } + CRYPTO_INTERNAL_LOG("num=%d in_size=%d processed=%d", num, in_size, total_processing_len); + } + + if (in_size != 0) + { + size_t should_be_processed_of_bytes = (size_t)in_size/operation->block_len*operation->block_len; + size_t remaining_number_of_bytes = in_size-should_be_processed_of_bytes; + + CRYPTO_INTERNAL_LOG("should_be_processed_of_bytes=%d remaining_number_of_bytes=%d processed=%d", should_be_processed_of_bytes, remaining_number_of_bytes, total_processing_len); + if (should_be_processed_of_bytes != 0) + { + if (crypto_update_engine(operation, in_data, should_be_processed_of_bytes, NULL, NULL)) { + goto error; + } + total_processing_len += should_be_processed_of_bytes; + in_size -= should_be_processed_of_bytes; + in_data = (unsigned char*)((unsigned long) in_data + should_be_processed_of_bytes); + } + + if(remaining_number_of_bytes != 0) { + memcpy(operation->data, in_data, remaining_number_of_bytes); + total_processing_len += remaining_number_of_bytes; + operation->data_len = remaining_number_of_bytes; + in_size -= remaining_number_of_bytes; + } + } + } + else + { + if(crypto_update_engine(operation, in_data, in_size, out_data, &out_size)) { + goto error; + } + } + + CRYPTO_INTERNAL_LOG("in_size=%d processed=%d", in_size, total_processing_len); + CRYPTO_INTERNAL_LOG("--------------------------------------------------------------"); + if(operation->info.operationClass == TEE_OPERATION_CIPHER && dst_len) { + *dst_len = total_processing_len; + } + return 0; +error: + return -1; +} + +int crypto_internal_final(crypto_internal_operation *operation, unsigned char *src_data, size_t src_len, unsigned char *dst_data, size_t *dst_len) +{ + //crypto_internal_engine engine; + unsigned char* in_data=NULL; + unsigned char* out_data=NULL; + unsigned int in_size=0; + unsigned int out_size=0; + unsigned int num=0; + unsigned int processing_len=0; + unsigned int total_processing_len=0; + int (*crypto_update_engine)(crypto_internal_operation *, unsigned char *, unsigned int, unsigned char *, unsigned int*); + int (*crypto_final_engine)(crypto_internal_operation *, unsigned char *, unsigned int, unsigned char *, unsigned int*); + + /*engine=crypto_internal_select_engine(operation->info.algorithm); + if (engine==CRYPTO_HW_ENGINE) { + crypto_update_engine=hw_crypto_ioctl_update; + crypto_final_engine=hw_crypto_ioctl_final; + } + else if (engine==CRYPTO_SW_ENGINE) {*/ + crypto_update_engine=sw_crypto_ioctl_update; + crypto_final_engine=sw_crypto_ioctl_final; + /*} + else { + goto error; + }*/ + + if(src_data) { + in_data=(unsigned char*)src_data; + } + if(dst_data) { + out_data=(unsigned char*)dst_data; + } + if(src_len) { + in_size=(unsigned int)src_len; + } + if(dst_len) { + out_size=(unsigned int)*dst_len; + } + + CRYPTO_INTERNAL_LOG("--------------------------------------------------------------"); + CRYPTO_INTERNAL_LOG("in_size=%d out_size=%d op->data_len=%d processed=%d", in_size, out_size, operation->data_len, total_processing_len); + + if(operation->info.operationClass == TEE_OPERATION_CIPHER) + { + if (operation->data_len != 0) + { + if (in_size < (size_t)(operation->block_len - operation->data_len)) { + num = in_size; + } + else { + num = (size_t)(operation->block_len - operation->data_len); + } + + CRYPTO_INTERNAL_LOG("num=%d in_size=%d out_size=%d processed=%d", num, in_size, out_size, total_processing_len); + if(num != 0) { + memcpy(operation->data + operation->data_len, in_data, num); + + operation->data_len += num; + in_size -= num; + in_data = (unsigned char*)((unsigned long)in_data + num); + + /* accumulated data is full */ + if (operation->data_len == operation->block_len) + { + processing_len = out_size; + if (crypto_update_engine(operation, operation->data, operation->data_len, out_data, &processing_len)) { + goto error; + } + total_processing_len += processing_len; + out_size -= processing_len; + out_data = (unsigned char*)((unsigned long) out_data + processing_len); + operation->data_len = 0; + } + } + + if (in_size == 0 && operation->data_len != 0) { + in_size = operation->data_len; + in_data = operation->data; + operation->data_len = 0; + } + CRYPTO_INTERNAL_LOG("num=%d in_size=%d out_size=%d processed=%d", num, in_size, out_size, total_processing_len); + } + + // process remaining data + { + size_t should_be_processed_of_bytes = (size_t)in_size/operation->block_len*operation->block_len; + size_t remaining_number_of_bytes = in_size-should_be_processed_of_bytes; + + CRYPTO_INTERNAL_LOG("should_be_processed_of_bytes=%d remaining_number_of_bytes=%d processed=%d", should_be_processed_of_bytes, remaining_number_of_bytes, total_processing_len); + if (should_be_processed_of_bytes != 0) + { + processing_len = out_size-total_processing_len; + if (crypto_update_engine(operation, in_data, should_be_processed_of_bytes, out_data, &processing_len)) { + goto error; + } + total_processing_len += processing_len; + in_size -= processing_len; + in_data = (unsigned char*)((unsigned long) in_data + processing_len); + out_data = (unsigned char*)((unsigned long) out_data + processing_len); + } + + if(operation->info.mode==TEE_MODE_ENCRYPT) + { + unsigned int pad_byte; + size_t should_be_processed_of_pad_bytes = 0; + + /* NOPAD */ + if (operation->info.algorithm==TEE_ALG_AES_ECB_NOPAD ||operation->info.algorithm==TEE_ALG_AES_CBC_NOPAD|| + operation->info.algorithm==TEE_ALG_DES_ECB_NOPAD ||operation->info.algorithm==TEE_ALG_DES_CBC_NOPAD|| + operation->info.algorithm==TEE_ALG_DES3_ECB_NOPAD || operation->info.algorithm==TEE_ALG_DES3_CBC_NOPAD) + { + CRYPTO_INTERNAL_LOG("ENC NOPAD : Ignore remaining_number_of_bytes=%d !!", remaining_number_of_bytes); + goto exit; + } + + memcpy(operation->data, in_data, remaining_number_of_bytes); + operation->data_len += remaining_number_of_bytes; + + if (dst_len && *dst_len < total_processing_len+operation->block_len) { + return TEE_ERROR_SHORT_BUFFER; + } + + pad_byte = operation->block_len - remaining_number_of_bytes; + + if (operation->info.algorithm==TEE_ALG_AES_ECB_PKCS5 ||operation->info.algorithm==TEE_ALG_AES_ECB_PKCS7 || + operation->info.algorithm==TEE_ALG_AES_CBC_PKCS5 ||operation->info.algorithm==TEE_ALG_AES_CBC_PKCS7) + { + should_be_processed_of_pad_bytes = operation->block_len; + + memset(operation->data + operation->data_len, pad_byte, pad_byte); + CRYPTO_INTERNAL_LOG("ENC PKCS : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[0], operation->data[1], operation->data[2], operation->data[3], operation->data[4], operation->data[5], operation->data[6], operation->data[7]); + CRYPTO_INTERNAL_LOG("ENC PKCS : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[8], operation->data[9], operation->data[10], operation->data[11], operation->data[12], operation->data[13], operation->data[14], operation->data[15]); + } + else if(operation->info.algorithm==TEE_ALG_AES_ECB_ISO9797_M1 ||operation->info.algorithm==TEE_ALG_AES_CBC_ISO9797_M1) + { + if(pad_byte != 0 && (operation->block_len != pad_byte)) + { + should_be_processed_of_pad_bytes = operation->block_len; + + memset(operation->data + operation->data_len, 0x00, pad_byte); + CRYPTO_INTERNAL_LOG("ENC ZERO : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[0], operation->data[1], operation->data[2], operation->data[3], operation->data[4], operation->data[5], operation->data[6], operation->data[7]); + CRYPTO_INTERNAL_LOG("ENC ZERO : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[8], operation->data[9], operation->data[10], operation->data[11], operation->data[12], operation->data[13], operation->data[14], operation->data[15]); + } + else + { + should_be_processed_of_pad_bytes = 0; + } + } + else if (operation->info.algorithm==TEE_ALG_AES_ECB_ISO9797_M2 || operation->info.algorithm==TEE_ALG_AES_CBC_ISO9797_M2) + { + should_be_processed_of_pad_bytes = operation->block_len; + + memset(operation->data + operation->data_len, 0x00, pad_byte); + CRYPTO_INTERNAL_LOG("ENC ZERO : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[0], operation->data[1], operation->data[2], operation->data[3], operation->data[4], operation->data[5], operation->data[6], operation->data[7]); + CRYPTO_INTERNAL_LOG("ENC ZERO : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[8], operation->data[9], operation->data[10], operation->data[11], operation->data[12], operation->data[13], operation->data[14], operation->data[15]); + + operation->data[operation->data_len] = 0x80; + CRYPTO_INTERNAL_LOG("ENC ISO9797 : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[0], operation->data[1], operation->data[2], operation->data[3], operation->data[4], operation->data[5], operation->data[6], operation->data[7]); + CRYPTO_INTERNAL_LOG("ENC ISO9797 : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[8], operation->data[9], operation->data[10], operation->data[11], operation->data[12], operation->data[13], operation->data[14], operation->data[15]); + } + else if(operation->info.algorithm==TEE_ALG_AES_CTR || operation->info.algorithm==TEE_ALG_AES_CTR_NOPAD) + { + should_be_processed_of_pad_bytes = remaining_number_of_bytes; + } + + if (crypto_final_engine(operation, operation->data, should_be_processed_of_pad_bytes, out_data, &processing_len)) { + goto error; + } + + total_processing_len += processing_len; + } + else if(operation->info.mode==TEE_MODE_DECRYPT) { + unsigned char * pad = out_data; + unsigned int npad=0; + + if (operation->info.algorithm==TEE_ALG_AES_ECB_NOPAD || operation->info.algorithm==TEE_ALG_AES_CBC_NOPAD|| + operation->info.algorithm==TEE_ALG_DES_ECB_NOPAD || operation->info.algorithm==TEE_ALG_DES_CBC_NOPAD|| + operation->info.algorithm==TEE_ALG_DES3_ECB_NOPAD || operation->info.algorithm==TEE_ALG_DES3_CBC_NOPAD) + { + CRYPTO_INTERNAL_LOG("DEC NOPAD : Ignore remaining_number_of_bytes=%d !!", remaining_number_of_bytes); + goto exit; + } + /* PAD */ + else if ( + operation->info.algorithm==TEE_ALG_AES_ECB_PKCS5 ||operation->info.algorithm==TEE_ALG_AES_ECB_PKCS7 || + operation->info.algorithm==TEE_ALG_AES_CBC_PKCS5 ||operation->info.algorithm==TEE_ALG_AES_CBC_PKCS7) + { + memcpy(operation->data, pad-operation->block_len, operation->block_len); + CRYPTO_INTERNAL_LOG("DEC PKCS : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[0], operation->data[1], operation->data[2], operation->data[3], operation->data[4], operation->data[5], operation->data[6], operation->data[7]); + CRYPTO_INTERNAL_LOG("DEC PKCS : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[8], operation->data[9], operation->data[10], operation->data[11], operation->data[12], operation->data[13], operation->data[14], operation->data[15]); + + pad--; //last byte + npad = *pad; + + if (npad <= operation->block_len) // can't be more than block length + { + unsigned int i; + int ok = 1; + for(i = 0; i < npad; i++, pad--) { + if (*pad != npad) { + ok = 0; + break; + } + } + + if (ok) { + total_processing_len -= npad; // padding OK. Othewise padding will not be removed + } + } + } + else if(operation->info.algorithm==TEE_ALG_AES_ECB_ISO9797_M1 ||operation->info.algorithm==TEE_ALG_AES_CBC_ISO9797_M1) + { + CRYPTO_INTERNAL_LOG("DEC ISO9797 M1 : Ignore remaining_number_of_bytes=%d !!", remaining_number_of_bytes); + goto exit; + } + else if (operation->info.algorithm==TEE_ALG_AES_ECB_ISO9797_M2 || operation->info.algorithm==TEE_ALG_AES_CBC_ISO9797_M2) + { + memcpy(operation->data, pad-operation->block_len, operation->block_len); + CRYPTO_INTERNAL_LOG("DEC ISO9797 M2 : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[0], operation->data[1], operation->data[2], operation->data[3], operation->data[4], operation->data[5], operation->data[6], operation->data[7]); + CRYPTO_INTERNAL_LOG("DEC ISO9797 M2 : op->data=%2X%2X%2X%2X%2X%2X%2X%2X", operation->data[8], operation->data[9], operation->data[10], operation->data[11], operation->data[12], operation->data[13], operation->data[14], operation->data[15]); + + pad--; //last byte + npad = 0; + + if (*pad==0x00) // remove 0s + for(; npad < operation->block_len-1 && *pad==0x00; npad++,pad--); + + if (*pad==0x80) { // correct M2 padding + npad++; // remove 1st PAD byte 0x80 + } + else { // M2 padding error + npad = 0; // don't remove any padding + } + + total_processing_len -= npad; + } + else if(operation->info.algorithm==TEE_ALG_AES_CTR || operation->info.algorithm==TEE_ALG_AES_CTR_NOPAD) + { + memcpy(operation->data, in_data, remaining_number_of_bytes); + operation->data_len += remaining_number_of_bytes; + + if (crypto_final_engine(operation, operation->data, remaining_number_of_bytes, out_data, &processing_len)) { + goto error; + } + total_processing_len += remaining_number_of_bytes; + } + } + else + { + goto error; + } + } + } + else if(operation->info.operationClass == TEE_OPERATION_MAC || operation->info.operationClass == TEE_OPERATION_DIGEST) + { + if (operation->data_len != 0) + { + if (in_size < (size_t)(operation->block_len - operation->data_len)) { + num = in_size; + } + else { + num = (size_t)(operation->block_len - operation->data_len); + } + + CRYPTO_INTERNAL_LOG("num=%d in_size=%d processed=%d", num, in_size, total_processing_len); + if(num != 0) { + memcpy(operation->data + operation->data_len, in_data, num); + + operation->data_len += num; + in_size -= num; + in_data = (unsigned char*)((unsigned long)in_data + num); + + /* accumulated data is full */ + if (operation->data_len == operation->block_len) + { + if (crypto_update_engine(operation, operation->data, operation->data_len, NULL, NULL)) { + goto error; + } + operation->data_len = 0; + } + } + + if (in_size == 0 && operation->data_len != 0) { + in_size = operation->data_len; + in_data = operation->data; + operation->data_len = 0; + } + CRYPTO_INTERNAL_LOG("num=%d in_size=%d op->data_len=%d", num, in_size, operation->data_len); + } + + if (in_size != 0) + { + if(crypto_final_engine(operation, in_data, in_size, out_data, &out_size)) { + goto error; + } + total_processing_len += in_size; + } + } + else + { + if(crypto_final_engine(operation, in_data, in_size, out_data, &out_size)) { + goto error; + } + total_processing_len += in_size; + } +exit: + CRYPTO_INTERNAL_LOG("in_size=%d out_size=%d processed=%d", in_size, out_size, total_processing_len); + CRYPTO_INTERNAL_LOG("--------------------------------------------------------------"); + if(operation->info.operationClass == TEE_OPERATION_CIPHER && dst_len) { + *dst_len = total_processing_len; + } + else if(operation->info.operationClass == TEE_OPERATION_MAC && dst_len) { + *dst_len = out_size; + } + else if(operation->info.operationClass == TEE_OPERATION_AE && dst_len) { + *dst_len = total_processing_len; + } + else if(operation->info.operationClass == TEE_OPERATION_DIGEST && dst_len) { + *dst_len = out_size; + } + else if(operation->info.operationClass == TEE_OPERATION_ASYMMETRIC_CIPHER && dst_len) { + *dst_len = out_size; + } + else if(operation->info.operationClass == TEE_OPERATION_ASYMMETRIC_SIGNATURE && dst_len) { + *dst_len = out_size; + } + return 0; +error: + LOGE(SSF_LIB, "THIS HERE!!!"); + CRYPTO_INTERNAL_LOG("--------------------------------------------------------------"); + return -1; +} + + +void TEE_DigestInit(TEE_OperationHandle operation); + +TEE_Result TEE_AllocateOperation(TEE_OperationHandle *operation, uint32_t algorithm, uint32_t mode, uint32_t maxKeySize) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op; + TEE_Result rc=TEE_SUCCESS; + uint32_t alg_class = 0; + uint32_t key_object_type = 0; + uint32_t digest_len = 0; + uint32_t block_len = 0; + TEE_ObjectHandle key1 = TEE_HANDLE_NULL; + TEE_ObjectHandle key2 = TEE_HANDLE_NULL; + + // check parameters compatibility + switch(algorithm) + { + /* Algorithm Class is SYMMETRIC CIPHER */ + case TEE_ALG_AES_ECB_NOPAD: + case TEE_ALG_AES_CBC_NOPAD: + case TEE_ALG_AES_CTR: + case TEE_ALG_AES_CTR_NOPAD: + case TEE_ALG_AES_ECB_PKCS5: + case TEE_ALG_AES_ECB_PKCS7: + case TEE_ALG_AES_ECB_ISO9797_M1: + case TEE_ALG_AES_ECB_ISO9797_M2: + case TEE_ALG_AES_CBC_PKCS5: + case TEE_ALG_AES_CBC_PKCS7: + case TEE_ALG_AES_CBC_ISO9797_M1: + case TEE_ALG_AES_CBC_ISO9797_M2: + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_CIPHER; + key_object_type = TEE_TYPE_AES; + block_len = 16; + digest_len = 0; + break; + + case TEE_ALG_AES_XTS: + case TEE_ALG_AES_CTS: + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_CIPHER; + key_object_type = TEE_TYPE_AES; + block_len = 32; // for CTS & XTS need 2 AES blocks + digest_len = 0; + break; + + case TEE_ALG_DES_ECB_NOPAD: + case TEE_ALG_DES_CBC_NOPAD: + + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_CIPHER; + key_object_type = TEE_TYPE_DES; + block_len = 8; + digest_len = 0; + break; + + case TEE_ALG_DES3_ECB_NOPAD: + case TEE_ALG_DES3_CBC_NOPAD: + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_CIPHER; + key_object_type = TEE_TYPE_DES3; + block_len = 8; + digest_len = 0; + break; + + /* Algorithm Class is AE */ + case TEE_ALG_AES_CCM: + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_AE; + key_object_type = TEE_TYPE_AES; + block_len = 16; + digest_len = 0; + break; + + case TEE_ALG_AES_GCM: + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_AE; + key_object_type = TEE_TYPE_AES; + block_len = 16; + digest_len = 0; + break; + + /* Algorithm Class is MAC */ + case TEE_ALG_AES_CBC_MAC_NOPAD: + case TEE_ALG_AES_CBC_MAC_PKCS5: + case TEE_ALG_AES_CMAC: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_AES; + block_len = 16; + digest_len = 16; + break; + + case TEE_ALG_DES_CBC_MAC_NOPAD: + case TEE_ALG_DES_CBC_MAC_PKCS5: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_DES; + block_len = 8; + digest_len = 8; + break; + + case TEE_ALG_DES3_CBC_MAC_NOPAD: + case TEE_ALG_DES3_CBC_MAC_PKCS5: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_DES3; + block_len = 8; + digest_len = 8; + break; + + case TEE_ALG_HMAC_MD5: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_HMAC_MD5; + block_len = 64; + digest_len = 16; + break; + + case TEE_ALG_HMAC_SHA1: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_HMAC_SHA1; + block_len = 64; + digest_len = 20; + break; + + case TEE_ALG_HMAC_SHA224: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_HMAC_SHA224; + block_len = 64; + digest_len = 28; + break; + + case TEE_ALG_HMAC_SHA256: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_HMAC_SHA256; + block_len = 64; + digest_len = 32; + break; + + case TEE_ALG_HMAC_SHA384: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_HMAC_SHA384; + block_len = 64; + digest_len = 48; + break; + + case TEE_ALG_HMAC_SHA512: + if (mode != TEE_MODE_MAC) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_MAC; + key_object_type = TEE_TYPE_HMAC_SHA512; + block_len = 64; + digest_len = 64; + break; + + /* Algorithm Class is DIGIT */ + case TEE_ALG_MD5: + if (mode != TEE_MODE_DIGEST) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_DIGEST; + key_object_type = 0; + digest_len = 16; + block_len = 64; + break; + + case TEE_ALG_SHA1: + if (mode != TEE_MODE_DIGEST) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_DIGEST; + key_object_type = 0; + digest_len = 20; + block_len = 64; + break; + + case TEE_ALG_SHA224: + if (mode != TEE_MODE_DIGEST) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_DIGEST; + key_object_type = 0; + digest_len = 28; + block_len = 64; + break; + + case TEE_ALG_SHA256: + if (mode != TEE_MODE_DIGEST) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_DIGEST; + key_object_type = 0; + digest_len = 32; + block_len = 64; + break; + + case TEE_ALG_SHA384: + if (mode != TEE_MODE_DIGEST) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_DIGEST; + key_object_type = 0; + digest_len = 48; + block_len = 64; + break; + + case TEE_ALG_SHA512: + if (mode != TEE_MODE_DIGEST) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_DIGEST; + key_object_type = 0; + digest_len = 64; + block_len = 64; + break; + + /* Algorithm Class is ASYMMETRIC CIPHER */ + case TEE_ALG_RSAES_PKCS1_V1_5: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA1: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA224: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA256: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA384: + case TEE_ALG_RSAES_PKCS1_OAEP_MGF1_SHA512: + case TEE_ALG_RSA_NOPAD: + if (mode != TEE_MODE_ENCRYPT && mode != TEE_MODE_DECRYPT) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_ASYMMETRIC_CIPHER; + key_object_type = TEE_TYPE_RSA_KEYPAIR; + block_len = 0; + digest_len = 0; + break; + + /* Algorithm Class is SIGNATURE */ + case TEE_ALG_RSASSA_PKCS1_V1_5_MD5: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA1: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA224: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA256: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA384: + case TEE_ALG_RSASSA_PKCS1_V1_5_SHA512: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA1: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA224: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA256: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA384: + case TEE_ALG_RSASSA_PKCS1_PSS_MGF1_SHA512: + if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; + key_object_type = TEE_TYPE_RSA_KEYPAIR; + break; + + case TEE_ALG_ECDSA_P160: + case TEE_ALG_ECDSA_P192: + case TEE_ALG_ECDSA_P224: + case TEE_ALG_ECDSA_P256: + case TEE_ALG_ECDSA_P384: + case TEE_ALG_ECDSA_P521: + if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; + key_object_type = TEE_TYPE_RSA_KEYPAIR; + break; + + case TEE_ALG_DSA_SHA1: + if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; + key_object_type = TEE_TYPE_DSA_KEYPAIR; + break; + + case TEE_ALG_ECDH_P192: + case TEE_ALG_ECDH_P224: + case TEE_ALG_ECDH_P256: + case TEE_ALG_ECDH_P384: + case TEE_ALG_ECDH_P521: + if (mode != TEE_MODE_SIGN && mode != TEE_MODE_VERIFY) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_ASYMMETRIC_SIGNATURE; + key_object_type = TEE_TYPE_ECDH_KEYPAIR; + break; + + /* Algorithm Class is KEY DERIVATION */ + case TEE_ALG_DH_DERIVE_SHARED_SECRET: + if (mode != TEE_MODE_DERIVE) { + return TEE_ERROR_NOT_SUPPORTED; + } + + alg_class = TEE_OPERATION_KEY_DERIVATION; + key_object_type = TEE_TYPE_DH_KEYPAIR; + break; + + default: + LOGE(SSF_LIB, "Not Support Algorithm : %X", algorithm); + rc = TEE_ERROR_NOT_SUPPORTED; + goto exit; + break; + } + + /* first malloc for crypto operation */ + op = (crypto_internal_operation *)malloc(sizeof (crypto_internal_operation)); + if (!op) { + rc = TEE_ERROR_OUT_OF_MEMORY; + goto exit; + } + + memset(op, 0, sizeof (crypto_internal_operation)); + + /* Set TEE_OperationInfo */ + op->info.algorithm = algorithm; + op->info.operationClass = alg_class; + op->info.mode = mode; + op->info.digestLength = digest_len; + op->info.maxKeySize = maxKeySize; + op->info.keySize = maxKeySize; + + if (mode == TEE_MODE_ENCRYPT) { + op->info.requiredKeyUsage |= TEE_USAGE_ENCRYPT; + } + if (mode == TEE_MODE_DECRYPT) { + op->info.requiredKeyUsage |= TEE_USAGE_DECRYPT; + } + if (mode == TEE_MODE_MAC) { + op->info.requiredKeyUsage |= TEE_USAGE_MAC; + } + if (mode == TEE_MODE_DERIVE) { + op->info.requiredKeyUsage |= TEE_USAGE_DERIVE; + } + if (mode == TEE_MODE_SIGN) { + op->info.requiredKeyUsage |= TEE_USAGE_SIGN; + } + if (mode == TEE_MODE_VERIFY) { + op->info.requiredKeyUsage |= TEE_USAGE_VERIFY; + } + if (algorithm == TEE_ALG_RSA_NOPAD) + { + if (mode == TEE_MODE_ENCRYPT) { + op->info.requiredKeyUsage |= TEE_USAGE_VERIFY; + } + else if (mode == TEE_MODE_DECRYPT) { + op->info.requiredKeyUsage |= TEE_USAGE_SIGN; + } + } + + if (algorithm == TEE_ALG_AES_XTS) { + op->info.handleState |= TEE_HANDLE_FLAG_EXPECT_TWO_KEYS; + } + + /* get handle */ + if(crypto_internal_open(op)!=0) { + rc = TEE_ERROR_NOT_SUPPORTED; + goto error; + } + + /* key1 alloc */ + if (key_object_type) { + if (TEE_AllocateTransientObject(key_object_type, maxKeySize, &key1) != TEE_SUCCESS) { + rc = TEE_ERROR_OUT_OF_MEMORY; + goto error; + } + } + + /* key2 alloc for XTS */ + if (algorithm == TEE_ALG_AES_XTS) { + if (TEE_AllocateTransientObject(key_object_type, maxKeySize, &key2) != TEE_SUCCESS) { + rc = TEE_ERROR_OUT_OF_MEMORY; + goto error; + } + } + + /* key map for crypto operation */ + op->key1 = key1; + op->key2 = key2; + op->block_len = block_len; + + *operation = (TEE_OperationHandle) &op->info; + + if (alg_class == TEE_OPERATION_DIGEST) { + TEE_DigestInit(*operation); + } + + return TEE_SUCCESS; + +error: + crypto_internal_close(op); + if (key1) { + TEE_CloseObject(key1); + } + if (key2) { + TEE_CloseObject(key2); + } + if (op) { + free(op); + } +exit: + *operation = TEE_HANDLE_NULL; + LOGE(SSF_LIB, "Error : %X", rc); + return rc; +} + +void TEE_FreeOperation(TEE_OperationHandle operation) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + + crypto_internal_operation * op; + + if (operation == TEE_HANDLE_NULL) { + return; + } + op = (crypto_internal_operation*)operation; + if (op->key1) { + TEE_CloseObject(op->key1); + } + if (op->key2) { + TEE_CloseObject(op->key2); + } + crypto_internal_close(op); + free(op); + return; +} + +void TEE_GetOperationInfo( TEE_OperationHandle operation, TEE_OperationInfo* operationInfo) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + operationInfo->algorithm = op->info.algorithm; + operationInfo->digestLength = op->info.digestLength; + operationInfo->handleState = op->info.handleState; + operationInfo->keySize = op->info.keySize; + operationInfo->maxKeySize = op->info.maxKeySize; + operationInfo->mode = op->info.mode; + operationInfo->operationClass = op->info.operationClass; + operationInfo->requiredKeyUsage = op->info.requiredKeyUsage; +} + +void TEE_ResetOperation( TEE_OperationHandle operation) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + + crypto_internal_operation * op = (crypto_internal_operation*) operation; + op->info.handleState &= ~TEE_HANDLE_FLAG_INITIALIZED; + return; +} + +TEE_Result TEE_SetOperationKey( TEE_OperationHandle operation, TEE_ObjectHandle key) +{ + PERMISSION_CHECK(PERM_CRYPTO); + + crypto_internal_operation * op = (crypto_internal_operation*) operation; + if (!op || op->info.operationClass == TEE_OPERATION_DIGEST || op->info.algorithm == TEE_ALG_AES_XTS) + { + LOGE(SSF_LIB, "op->info.operationClass == TEE_OPERATION_DIGEST\n"); + return TEE_ERROR_BAD_PARAMETERS; + + }; + + if (key == TEE_HANDLE_NULL) + { + TEE_CloseObject(op->key1); + op->key1 = TEE_HANDLE_NULL; + return TEE_SUCCESS; + } + + if ((key->tr.info.objectUsage | ~(op->info.requiredKeyUsage)) != 0xffffffff) + { + LOGE(SSF_LIB, "(key->tr.info.objectUsage | ~(op->info.requiredKeyUsage)) != 0xffffffff\n"); + return TEE_ERROR_BAD_PARAMETERS; + + }; + + TEE_CopyObjectAttributes(op->key1, key); + + op->info.handleState |= TEE_HANDLE_FLAG_KEY_SET; + return TEE_SUCCESS; +} + +TEE_Result TEE_SetOperationKey2( TEE_OperationHandle operation, TEE_ObjectHandle key1, TEE_ObjectHandle key2) +{ + PERMISSION_CHECK(PERM_CRYPTO); + + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if ( (key1 && !key2) || (!key1 && key2)) { + CRYPTO_PANIC; + } + if (!op || op->info.algorithm != TEE_ALG_AES_XTS) { + CRYPTO_PANIC; + } + + if (!key1 && !key2) + { + TEE_CloseObject(op->key1); + TEE_CloseObject(op->key2); + op->key1 = TEE_HANDLE_NULL; + op->key2 = TEE_HANDLE_NULL; + return TEE_SUCCESS; + } + + if ((key1->tr.info.objectUsage | ~op->info.requiredKeyUsage) != 0xffffffff) { + CRYPTO_PANIC; + } + if ((key2->tr.info.objectUsage | ~op->info.requiredKeyUsage) != 0xffffffff) { + CRYPTO_PANIC; + } + + TEE_CopyObjectAttributes(op->key1, key1); + TEE_CopyObjectAttributes(op->key2, key2); + + op->info.handleState |= TEE_HANDLE_FLAG_KEY_SET; + return TEE_SUCCESS; +} + + +void TEE_CopyOperation( TEE_OperationHandle dstOperation, TEE_OperationHandle srcOperation) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + + crypto_internal_operation * dstOp = (crypto_internal_operation*) dstOperation; + crypto_internal_operation * srcOp = (crypto_internal_operation*) srcOperation; + + if (dstOp->info.mode != srcOp->info.mode || dstOp->info.algorithm != srcOp->info.algorithm) { + CRYPTO_PANIC; + } + if (dstOp->info.maxKeySize < srcOp->info.maxKeySize) { + CRYPTO_PANIC; + } + + dstOp->info.algorithm = srcOp->info.algorithm; + dstOp->info.digestLength = srcOp->info.digestLength; + dstOp->info.handleState = srcOp->info.handleState; + dstOp->info.keySize = srcOp->info.keySize; + dstOp->info.maxKeySize = srcOp->info.maxKeySize; + dstOp->info.mode = srcOp->info.mode; + dstOp->info.operationClass = srcOp->info.operationClass; + dstOp->info.requiredKeyUsage = srcOp->info.requiredKeyUsage; + + if (dstOp->key1) { + TEE_CopyObjectAttributes(dstOp->key1, srcOp->key1); + } + if (dstOp->key2) { + TEE_CopyObjectAttributes(dstOp->key2, srcOp->key2); + } + if (srcOp->crypto) { + if (crypto_internal_open(dstOp) != 0) { + CRYPTO_PANIC; + } + } + else { + dstOp->crypto = -1; + } + return; +} + +// Message Digest Functions +/* +This is not GP Spec function. but I used this +*/ +void TEE_DigestInit(TEE_OperationHandle operation) +{ + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (crypto_internal_init(op, NULL, NULL, 0)) { + CRYPTO_PANIC; + } + op->info.handleState |= TEE_HANDLE_FLAG_KEY_SET; + op->info.handleState |= TEE_HANDLE_FLAG_INITIALIZED; + return; +} + +void TEE_DigestUpdate( TEE_OperationHandle operation, const void* chunk, size_t chunkSize) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (!op || !chunk || !chunkSize) { + return; + } + if (op->info.operationClass != TEE_OPERATION_DIGEST) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { + TEE_DigestInit(operation); + } + if (crypto_internal_update(op, (unsigned char*)chunk, chunkSize, NULL, NULL)) { + CRYPTO_PANIC; + } + return; +} + +TEE_Result TEE_DigestDoFinal( TEE_OperationHandle operation, const void* chunk, size_t chunkLen, void* hash, size_t *hashLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (!hash || *hashLen < op->info.digestLength) { + return TEE_ERROR_SHORT_BUFFER; + } + if (op->info.operationClass != TEE_OPERATION_DIGEST) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { + TEE_DigestInit(operation); + } + if(crypto_internal_final(op, (unsigned char*)chunk, chunkLen, (unsigned char*)hash, hashLen)) { + CRYPTO_PANIC; + } + return TEE_SUCCESS; +} + +// Symmetric Cipher Functions +void TEE_CipherInit( TEE_OperationHandle operation, const void* IV, size_t IVLen) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + crypto_internal_keystruct key; + unsigned char key_buf[32] = {0x0, }; + + memset(&key, 0x00, sizeof(crypto_internal_keystruct)); + key.secret.size = sizeof(key_buf); + key.secret.buffer = key_buf; + + if (op->info.operationClass != TEE_OPERATION_CIPHER) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_SECRET_VALUE, + (void*)key.secret.buffer, (size_t*)&key.secret.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (!key.secret.buffer) { + CRYPTO_PANIC; + } + if (crypto_internal_init(op, &key, (unsigned char*)IV, IVLen)) { + CRYPTO_PANIC; + } + op->info.handleState |= TEE_HANDLE_FLAG_INITIALIZED; + return; +} + +TEE_Result TEE_CipherUpdate( TEE_OperationHandle operation, const void* srcData, size_t srcLen, void* destData, size_t *destLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (*destLen < srcLen) { + return TEE_ERROR_SHORT_BUFFER; + } + if (op->info.operationClass != TEE_OPERATION_CIPHER) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { + CRYPTO_PANIC; + } + if (crypto_internal_update(op, (unsigned char*)srcData, srcLen, (unsigned char*)destData, destLen)) { + CRYPTO_PANIC; + } + return TEE_SUCCESS; +} + +TEE_Result TEE_CipherDoFinal( TEE_OperationHandle operation, const void* srcData, size_t srcLen, void* destData, size_t *destLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (*destLen < srcLen) { + return TEE_ERROR_SHORT_BUFFER; + } + if (op->info.operationClass != TEE_OPERATION_CIPHER) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { + CRYPTO_PANIC; + } + if (crypto_internal_final(op, (unsigned char*)srcData, srcLen, (unsigned char*)destData, destLen)) { + CRYPTO_PANIC; + } + return TEE_SUCCESS; +} + +// MAC Functions +void TEE_MACInit( TEE_OperationHandle operation, const void* IV, size_t IVLen) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + crypto_internal_keystruct key; + unsigned char key_buf[128] = {0x0, }; + + memset(&key, 0x00, sizeof(crypto_internal_keystruct)); + key.secret.size = sizeof(key_buf); + key.secret.buffer = key_buf; + + if (op->info.operationClass != TEE_OPERATION_MAC) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_SECRET_VALUE, + (void*)key.secret.buffer, (size_t*)&key.secret.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (!key.secret.buffer) { + CRYPTO_PANIC; + } + if (crypto_internal_init(op, &key, (unsigned char*)IV, IVLen)) { + CRYPTO_PANIC; + } + op->info.handleState |= TEE_HANDLE_FLAG_INITIALIZED; + return; +} + +void TEE_MACUpdate( TEE_OperationHandle operation, const void* chunk, size_t chunkSize) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (!chunk || !chunkSize) { + return; + } + if (op->info.operationClass != TEE_OPERATION_MAC) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { + CRYPTO_PANIC; + } + if (crypto_internal_update(op, (unsigned char*)chunk, chunkSize, NULL, NULL)) { + CRYPTO_PANIC; + } + return; +} + +TEE_Result TEE_MACComputeFinal( TEE_OperationHandle operation, const void* message, size_t messageLen, void* mac, size_t *macLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (!mac || *macLen < op->info.digestLength) { + return TEE_ERROR_SHORT_BUFFER; + } + if (op->info.operationClass != TEE_OPERATION_MAC) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_INITIALIZED)) { + CRYPTO_PANIC; + } + if(crypto_internal_final(op, (unsigned char*)message, messageLen, (unsigned char*)mac, macLen)) { + CRYPTO_PANIC; + } + return TEE_SUCCESS; +} + +TEE_Result TEE_MACCompareFinal( TEE_OperationHandle operation, void* message, size_t messageLen, void* mac, size_t *macLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + char result[64]; + size_t result_len = sizeof result; + + if (!mac || !macLen || *macLen != op->info.digestLength) { + return TEE_ERROR_MAC_INVALID; + } + if (TEE_MACComputeFinal(operation, (unsigned char*)message, messageLen, result, &result_len) != TEE_SUCCESS) { + return TEE_ERROR_MAC_INVALID; + } + if (memcmp(mac, result, *macLen)) { + return TEE_ERROR_MAC_INVALID; + } + + return TEE_SUCCESS; +} + +// Authenticated Encryption Functions +TEE_Result TEE_AEInit(TEE_OperationHandle operation, void* nonce, size_t nonceLen, uint32_t tagLen, uint32_t AADLen, uint32_t payloadLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + (void)operation; + (void)nonce; + (void)nonceLen; + (void)tagLen; + (void)AADLen; + (void)payloadLen; + return TEE_SUCCESS; +} + +void TEE_AEUpdateAAD(TEE_OperationHandle operation, void* AADdata, size_t AADdataLen) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + (void)operation; + (void)AADdata; + (void)AADdataLen; + return; +} + +TEE_Result TEE_AEUpdate(TEE_OperationHandle operation, void* srcData, size_t srcLen, void* destData, size_t *destLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + (void)operation; + (void)srcData; + (void)srcLen; + (void)destData; + (void)destLen; + return TEE_SUCCESS; +} + +TEE_Result TEE_AEEncryptFinal(TEE_OperationHandle operation, void* srcData, size_t srcLen, void* destData, size_t* destLen, void* tag, size_t* tagLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (op->info.operationClass != TEE_OPERATION_AE) { + CRYPTO_PANIC; + } + if (op->info.mode != TEE_MODE_ENCRYPT) { + CRYPTO_PANIC; + } + (void)srcData; + (void)srcLen; + (void)destData; + (void)destLen; + (void)tag; + (void)tagLen; + return TEE_SUCCESS; +} + +TEE_Result TEE_AEDecryptFinal(TEE_OperationHandle operation, void* srcData, size_t srcLen, void* destData, size_t *destLen, void* tag, size_t tagLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + crypto_internal_operation * op = (crypto_internal_operation*) operation; + + if (op->info.operationClass != TEE_OPERATION_AE) { + CRYPTO_PANIC; + } + if (op->info.mode != TEE_MODE_DECRYPT) { + CRYPTO_PANIC; + } + (void)srcData; + (void)srcLen; + (void)destData; + (void)destLen; + (void)tag; + (void)tagLen; + return TEE_SUCCESS; +} + +TEE_Result TEE_AsymmetricEncrypt( TEE_OperationHandle operation,const TEE_Attribute* params, uint32_t paramCount, const void* srcData, size_t srcLen, void* destData, size_t *destLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + (void)params; + (void)paramCount; + crypto_internal_operation *op = (crypto_internal_operation*) operation; + crypto_internal_keystruct key; + unsigned char module_buf[384] = {0x0, }; + unsigned char pub_buf[384] = {0x0, }; + + memset(&key, 0x00, sizeof(crypto_internal_keystruct)); + key.rsa_modulus.size = sizeof(module_buf); + key.rsa_modulus.buffer = module_buf; + key.rsa_public.size = sizeof(pub_buf); + key.rsa_public.buffer = pub_buf; + + if (op->info.operationClass != TEE_OPERATION_ASYMMETRIC_CIPHER) { + CRYPTO_PANIC; + } + if (op->info.mode != TEE_MODE_ENCRYPT ) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_MODULUS, + (void*)key.rsa_modulus.buffer, (size_t*)&key.rsa_modulus.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PUBLIC_EXPONENT, + (void*)key.rsa_public.buffer, (size_t*)&key.rsa_public.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if(!key.rsa_modulus.buffer || !key.rsa_public.buffer ) { + CRYPTO_PANIC; + } + if (crypto_internal_init(op, &key, NULL, 0)) { + CRYPTO_PANIC; + } + if (crypto_internal_final(op, (unsigned char*)srcData, srcLen, (unsigned char*)destData, destLen)) { + return TEE_ERROR_SIGNATURE_INVALID; + } + return TEE_SUCCESS; +} + +TEE_Result TEE_AsymmetricDecrypt( TEE_OperationHandle operation, const TEE_Attribute* params, uint32_t paramCount, const void* srcData, size_t srcLen, void* destData, size_t *destLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + + (void)params; + (void)paramCount; + crypto_internal_operation * op = (crypto_internal_operation*) operation; + crypto_internal_keystruct key; + + unsigned char module_buf[384] = {0x0, }; + unsigned char pub_buf[384] = {0x0, }; + unsigned char priv_buf[384] = {0x0, }; + + memset(&key, 0x00, sizeof(crypto_internal_keystruct)); + key.rsa_modulus.size = sizeof(module_buf); + key.rsa_modulus.buffer = module_buf; + key.rsa_public.size = sizeof(pub_buf); + key.rsa_public.buffer = pub_buf; + key.rsa_private.size = sizeof(priv_buf); + key.rsa_private.buffer = priv_buf; + + if (op->info.operationClass != TEE_OPERATION_ASYMMETRIC_CIPHER) { + CRYPTO_PANIC; + } + if (op->info.mode != TEE_MODE_DECRYPT) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_MODULUS, + (void*)key.rsa_modulus.buffer, (size_t*)&key.rsa_modulus.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PUBLIC_EXPONENT, + (void*)key.rsa_public.buffer, (size_t*)&key.rsa_public.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PRIVATE_EXPONENT, + (void*)key.rsa_private.buffer, (size_t*)&key.rsa_private.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } +#if 0 /* Not Support */ + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PRIME1, + (void*)key.rsa_prime1.buffer, (size_t*)&key.rsa_prime1.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PRIME2, + (void*)key.rsa_prime2.buffer, (size_t*)&key.rsa_prime2.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_EXPONENT1, + (void*)key.rsa_exponent1.buffer, (size_t*)&key.rsa_exponent1.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_EXPONENT2, + (void*)key.rsa_exponent2.buffer, (size_t*)&key.rsa_exponent2.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_COEFFICIENT, + (void*)key.rsa_coefficient.buffer, (size_t*)&key.rsa_coefficient.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } +#endif + if(!key.rsa_modulus.buffer || !key.rsa_public.buffer || !key.rsa_private.buffer + /*|| !key.rsa_prime1.buffer || !key.rsa_prime2.buffer || !key.rsa_exponent1.buffer + || !key.rsa_exponent2.buffer || !key.rsa_coefficient.buffer*/) { + CRYPTO_PANIC; + } + if (crypto_internal_init(op, &key, NULL, 0)) { + CRYPTO_PANIC; + } + if (crypto_internal_final(op, (unsigned char*)srcData, srcLen, (unsigned char*)destData, destLen)) { + CRYPTO_PANIC; + } + return TEE_SUCCESS; +} + +TEE_Result TEE_AsymmetricSignDigest( TEE_OperationHandle operation, const TEE_Attribute* params, uint32_t paramCount, const void* digest, size_t digestLen, void* signature, size_t *signatureLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + (void)params; + (void)paramCount; + crypto_internal_operation *op = (crypto_internal_operation*) operation; + crypto_internal_keystruct key; + + unsigned char module_buf[384] = {0x0, }; + unsigned char pub_buf[384] = {0x0, }; + unsigned char priv_buf[384] = {0x0, }; + + memset(&key, 0x00, sizeof(crypto_internal_keystruct)); + key.rsa_modulus.size = sizeof(module_buf); + key.rsa_modulus.buffer = module_buf; + key.rsa_public.size = sizeof(pub_buf); + key.rsa_public.buffer = pub_buf; + key.rsa_private.size = sizeof(priv_buf); + key.rsa_private.buffer = priv_buf; + + if (op->info.operationClass != TEE_OPERATION_ASYMMETRIC_SIGNATURE) { + CRYPTO_PANIC; + } + if (op->info.mode != TEE_MODE_SIGN ) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_MODULUS, + (void*)key.rsa_modulus.buffer, (size_t*)&key.rsa_modulus.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PUBLIC_EXPONENT, + (void*)key.rsa_public.buffer, (size_t*)&key.rsa_public.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PRIVATE_EXPONENT, + (void*)key.rsa_private.buffer, (size_t*)&key.rsa_private.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } +#if 0 /* Not Support */ + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PRIME1, + (void*)key.rsa_prime1.buffer, (size_t*)&key.rsa_prime1.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PRIME2, + (void*)key.rsa_prime2.buffer, (size_t*)&key.rsa_prime2.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_EXPONENT1, + (void*)key.rsa_exponent1.buffer, (size_t*)&key.rsa_exponent1.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_EXPONENT2, + (void*)key.rsa_exponent2.buffer, (size_t*)&key.rsa_exponent2.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_COEFFICIENT, + (void*)key.rsa_coefficient.buffer, (size_t*)&key.rsa_coefficient.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } +#endif + if(!key.rsa_modulus.buffer || !key.rsa_public.buffer || !key.rsa_private.buffer + /*|| !key.rsa_prime1.buffer || !key.rsa_prime2.buffer || !key.rsa_exponent1.buffer + || !key.rsa_exponent2.buffer || !key.rsa_coefficient.buffer*/) { + CRYPTO_PANIC; + } + if (crypto_internal_init(op, &key, NULL, 0)) { + CRYPTO_PANIC; + } + if (crypto_internal_final(op, (unsigned char*)digest, digestLen, (unsigned char*)signature, signatureLen)) { + return TEE_ERROR_SHORT_BUFFER; + } + return TEE_SUCCESS; +} + +TEE_Result TEE_AsymmetricVerifyDigest( TEE_OperationHandle operation, const TEE_Attribute* params, uint32_t paramCount, const void* digest, size_t digestLen, void* signature, size_t signatureLen) +{ + PERMISSION_CHECK(PERM_CRYPTO); + (void)params; + (void)paramCount; + crypto_internal_operation *op = (crypto_internal_operation*) operation; + crypto_internal_keystruct key; + size_t sign_len=signatureLen; + + unsigned char module_buf[384] = {0x0, }; + unsigned char pub_buf[384] = {0x0, }; + + memset(&key, 0x00, sizeof(crypto_internal_keystruct)); + key.rsa_modulus.size = sizeof(module_buf); + key.rsa_modulus.buffer = module_buf; + key.rsa_public.size = sizeof(pub_buf); + key.rsa_public.buffer = pub_buf; + + if (op->info.operationClass != TEE_OPERATION_ASYMMETRIC_SIGNATURE) { + CRYPTO_PANIC; + } + if (op->info.mode != TEE_MODE_VERIFY ) { + CRYPTO_PANIC; + } + if (!(op->info.handleState & TEE_HANDLE_FLAG_KEY_SET)) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_MODULUS, + (void*)key.rsa_modulus.buffer, (size_t*)&key.rsa_modulus.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if (TEE_GetObjectBufferAttribute(op->key1, TEE_ATTR_RSA_PUBLIC_EXPONENT, + (void*)key.rsa_public.buffer, (size_t*)&key.rsa_public.size) != TEE_SUCCESS) { + CRYPTO_PANIC; + } + if(!key.rsa_modulus.buffer || !key.rsa_public.buffer ) { + CRYPTO_PANIC; + } + if (crypto_internal_init(op, &key, NULL, 0)) { + CRYPTO_PANIC; + } + if (crypto_internal_final(op, (unsigned char*)digest, digestLen, (unsigned char*)signature, &sign_len)) { + return TEE_ERROR_SIGNATURE_INVALID; + } + return TEE_SUCCESS; +} + +// Key Derivation Functions +void TEE_DeriveKey( TEE_OperationHandle operation, TEE_Attribute* params, uint32_t paramCount, TEE_ObjectHandle derivedKey) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + (void)operation; + (void)params; + (void)paramCount; + (void)derivedKey; + return; +} + +void TEE_GenerateRandom(void* randomBuffer, size_t randomBufferLen) +{ + PERMISSION_CHECK_RETURN_VOID(PERM_CRYPTO); + crypto_internal_operation op; + crypto_internal_keystruct key; + unsigned char random[512] = {0}; + size_t random_len=512; + memset((void *)&op,0,sizeof(op)); + if(randomBufferLen > 512) + { + LOGE(SSF_LIB, "currently only support less than 512 byte random data"); + return; + } + op.info.algorithm = TEE_ALG_GENERATE_SECRET_KEY; + op.info.keySize = randomBufferLen; + /*cryptocore need bit_length*/ + key.secret.buffer = random; + key.secret.size = random_len*8; + + if (crypto_internal_open(&op)!=0) { + CRYPTO_PANIC; + } + if (crypto_internal_init(&op, &key, NULL, 0)) { + CRYPTO_PANIC; + } + if (crypto_internal_final(&op, NULL, 0, NULL, NULL)) { + CRYPTO_PANIC; + } + if (crypto_internal_close(&op)) { + CRYPTO_PANIC; + } + memcpy(randomBuffer, random, randomBufferLen); + return; +} diff --git a/ssflib/src/ssf_lib.c b/ssflib/src/ssf_lib.cpp similarity index 99% rename from ssflib/src/ssf_lib.c rename to ssflib/src/ssf_lib.cpp index 428c053..288e740 100644 --- a/ssflib/src/ssf_lib.c +++ b/ssflib/src/ssf_lib.cpp @@ -35,6 +35,7 @@ TeeStubSSFSharedData sharedData = {false, false, true}; /*----------------------------------------------------------------------------- * Local functions *-----------------------------------------------------------------------------*/ + extern "C"{ /** @@ -55,6 +56,7 @@ __attribute__((destructor)) void deinitializeSSF() { LOGD(SIM_DAEMON, "Done"); } } + /* ========================================================================= * OPERATION CANCELLATION * ========================================================================= diff --git a/ssflib/src/ssf_malloc.c b/ssflib/src/ssf_malloc.cpp similarity index 93% rename from ssflib/src/ssf_malloc.c rename to ssflib/src/ssf_malloc.cpp index 77e27a7..75d0b40 100644 --- a/ssflib/src/ssf_malloc.c +++ b/ssflib/src/ssf_malloc.cpp @@ -23,6 +23,7 @@ #include #include #include "ssf_lib.h" +#include "../../TEEStub/TACommands/SharedMemoryMap.h" /*----------------------------------------------------------------------------- * Globals @@ -59,8 +60,8 @@ static void* globalTAInstanceData = 0; * NULL pointer is returned. */ void* TEE_Malloc(size_t size, uint32_t hint) { - void* buf = OsaMalloc(size); - if (NULL == buf) { + void* buf = newOnceSharedMemory(size); + if (buf == NULL) { return NULL; } if (0 == hint) { @@ -83,9 +84,27 @@ void* TEE_Malloc(size_t size, uint32_t hint) { * TEE_Realloc returns a NULL pointer. */ void* TEE_Realloc(const void* buffer, uint32_t newSize) { - return realloc((void*)buffer, newSize); + if (NULL == buffer || 0 == newSize) { + return NULL; + } + void* newBuf = TEE_Malloc(newSize, 0); + if(newBuf != NULL) { + uint32_t copySize = 0; + uint32_t oriSize = getSharedMemorySize((void*)buffer); + if(oriSize != 0) + { + if(oriSize > newSize) copySize = newSize; + else copySize = oriSize; + TEE_MemMove(newBuf, buffer, copySize); + TEE_Free((void*)buffer); + return newBuf; + } + else TEE_Free(newBuf); + } + return NULL; } + /** * Causes the space pointed to by buffer to be deallocated * @@ -100,7 +119,7 @@ void* TEE_Realloc(const void* buffer, uint32_t newSize) { */ void TEE_Free(const void *buffer) { if (buffer) { - OsaFree((void*)buffer); + deleteOnceSharedMemory((void*)buffer); } } diff --git a/ssflib/src/ssf_panic.c b/ssflib/src/ssf_panic.cpp similarity index 100% rename from ssflib/src/ssf_panic.c rename to ssflib/src/ssf_panic.cpp diff --git a/ssflib/src/ssf_permission.cpp b/ssflib/src/ssf_permission.cpp new file mode 100644 index 0000000..eadfba4 --- /dev/null +++ b/ssflib/src/ssf_permission.cpp @@ -0,0 +1,28 @@ +/* + * ssf_permission.c + * + * This source file is proprietary property of Samsung Electronics Co., Ltd. + * + * Copyright (C) 2011 - 2015 Samsung Electronics Co., Ltd All Rights Reserved + * + */ + +#include +#include +#include +#include + +int CheckPermission(const int flag) { + TEE_Result propertyResult; + uint32_t outValue; + propertyResult = TEE_GetPropertyAsU32((TEE_PropSetHandle)TEE_PROPSET_CURRENT_TA, "permission", &outValue); + + if(propertyResult == TEE_SUCCESS) { + if(flag & outValue) { + return 0; + } + } + + return TEE_ERROR_ACCESS_DENIED; +} + diff --git a/ssflib/src/ssf_storage.c b/ssflib/src/ssf_storage.cpp similarity index 93% rename from ssflib/src/ssf_storage.c rename to ssflib/src/ssf_storage.cpp index 60ad4fb..dbb54a3 100644 --- a/ssflib/src/ssf_storage.c +++ b/ssflib/src/ssf_storage.cpp @@ -22,6 +22,8 @@ #include "ssf_storage.h" #include #include +#include +#include /*----------------------------------------------------------------------------- * MACROS @@ -454,7 +456,7 @@ TEE_Result create_po(persistent_object* po, TransientObject* attr, return TEE_ERROR_GENERIC; } // update po share info - if (0 != update_share_info(&po->share_info, po->attr.info.handleFlags, 1)) { + if (0 != update_share_info(&po->share_info, po->attr.info.handleFlags,0, 1, po)) { return TEE_ERROR_GENERIC; } // add to po list @@ -468,16 +470,17 @@ TEE_Result open_po(persistent_object* po) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); } - int ret = update_share_info(&po->share_info, po->attr.info.handleFlags, 1); + + // read and parse + int ret = load_po_file(po); if (0 != ret) { - return (1 == ret) ? TEE_ERROR_ACCESS_CONFLICT : TEE_ERROR_GENERIC; + return (1 == ret) ? TEE_ERROR_ITEM_NOT_FOUND : TEE_ERROR_GENERIC; } - // read and parse - ret = load_po_file(po); + ret = update_share_info(&po->share_info, po->attr.info.handleFlags, (po->po_file.po_info.handleFlags), 1, po); if (0 != ret) { - ret = (1 == ret) ? TEE_ERROR_ITEM_NOT_FOUND : TEE_ERROR_GENERIC; - goto out; + return (1 == ret) ? TEE_ERROR_ACCESS_CONFLICT : TEE_ERROR_GENERIC; } + if (deserialise_attr((char*)po->po_file.attr, (TransientObject*)&po->attr)) { ret = TEE_ERROR_GENERIC; goto out; @@ -492,7 +495,7 @@ TEE_Result open_po(persistent_object* po) { ret = TEE_SUCCESS; out: if (ret) { - update_share_info(&po->share_info, po->attr.info.handleFlags, 0); + update_share_info(&po->share_info, po->attr.info.handleFlags, 0, 0, po); } return ret; } @@ -615,10 +618,11 @@ void close_po(persistent_object* po) { if (NULL == po) { return; } - update_share_info(&po->share_info, po->attr.info.handleFlags, 0); + update_share_info(&po->share_info, po->attr.info.handleFlags, 0, 0, po); // remove from po list rem_from_po_list(po); + // free online attributes TEE_Attribute* attrs = po->attr.attr.attr_array; int i; @@ -712,7 +716,7 @@ int load_po_file(persistent_object* po) { uint8_t* tmp_ptr = NULL; uint32_t read_size = 0; int ret = ss_read(&retbuf, &read_size, 0, po->po_file.file_name, - &po->po_file.cred, SS_OPT_DEFAULT); + &(po->po_file.cred), SS_OPT_DEFAULT); if (SS_RET_CANT_FIND_REQUESTED_DATA == ret) { MSG("Po file not exist."); return 1; @@ -1040,11 +1044,38 @@ int init_share_info(po_share_info* share_info) { return 0; } -int check_share_rule(po_share_info* share_info, uint32_t handleFlags) { +int check_share_rule(po_share_info* share_info, uint32_t handleFlags, uint32_t origFlags) { if ((NULL == share_info) || (-1 == init_share_info(share_info))) { return -1; } int ret = 0; + if(origFlags & TEE_DATA_FLAG_ACCESS_READ && origFlags & TEE_DATA_FLAG_ACCESS_WRITE && + origFlags & TEE_DATA_FLAG_SHARE_READ && origFlags & TEE_DATA_FLAG_SHARE_WRITE) { + if(handleFlags != 0 && share_info->usr_info->x_user > 0) { + ret = -1; + goto out; + } + } + if((origFlags & TEE_DATA_FLAG_ACCESS_READ && !(origFlags & TEE_DATA_FLAG_ACCESS_WRITE) && + handleFlags & TEE_DATA_FLAG_ACCESS_WRITE) || + (origFlags & TEE_DATA_FLAG_ACCESS_WRITE && !(origFlags & TEE_DATA_FLAG_ACCESS_READ) && + handleFlags & TEE_DATA_FLAG_ACCESS_READ)) { + ret = -1; + goto out; + } + if ((0 < share_info->usr_info->rs_user && + handleFlags & TEE_DATA_FLAG_ACCESS_READ && !(handleFlags & TEE_DATA_FLAG_SHARE_READ)) || + (0 < share_info->usr_info->ws_user && + handleFlags & TEE_DATA_FLAG_ACCESS_WRITE && !(handleFlags & TEE_DATA_FLAG_SHARE_WRITE))) { + ret = -1; + goto out; + } + if ((1 == share_info->usr_info->rs_user && handleFlags & TEE_DATA_FLAG_SHARE_WRITE) || + (1 == share_info->usr_info->ws_user && handleFlags & TEE_DATA_FLAG_SHARE_READ)) { + ret = -1; + goto out; + } + // no user if ((0 == share_info->usr_info->x_user) && (0 == share_info->usr_info->rs_user) @@ -1074,31 +1105,35 @@ int check_share_rule(po_share_info* share_info, uint32_t handleFlags) { && (0 == share_info->usr_info->ws_user) && (0 == share_info->usr_info->rws_user))) { ret = -1; + goto out; } } out: return ret; } int update_share_info(po_share_info* share_info, uint32_t handleFlags, - int b_open) { + uint32_t origFlags, int b_open, persistent_object* po) { if (NULL == share_info->usr_info) { - if (-1 == init_share_info(share_info)) { - return -1; + share_info->usr_info = get_po_user_from_po_list(po->storage_id, po->object_id, po->obj_id_len); + if(NULL == share_info->usr_info) { + if (-1 == init_share_info(share_info)) { + return -1; + } } } + // lock // TODO: Commented for debugging, to be uncommented lock_po_share_info(share_info); int ret = 0; if (b_open) { - if (check_share_rule(share_info, handleFlags)) { + if (check_share_rule(share_info, handleFlags, origFlags)) { MSG("Access conflict!"); ret = 1; goto out; } } - handleFlags &= ~TEE_DATA_FLAG_ACCESS_READ; - handleFlags &= ~TEE_DATA_FLAG_ACCESS_WRITE; + handleFlags &= ~TEE_HANDLE_FLAG_PERSISTENT; handleFlags &= ~TEE_HANDLE_FLAG_INITIALIZED; @@ -1121,14 +1156,17 @@ int update_share_info(po_share_info* share_info, uint32_t handleFlags, b_open ? share_info->usr_info->ws_user++ : share_info->usr_info->ws_user--; goto out; } + if (handleFlags & TEE_DATA_FLAG_ACCESS_READ) { + b_open ? share_info->usr_info->rs_user++ : share_info->usr_info->rs_user--; + goto out; + } + if (handleFlags & TEE_DATA_FLAG_ACCESS_WRITE) { + b_open ? share_info->usr_info->ws_user++ : share_info->usr_info->ws_user--; + goto out; + } + out: - if ((0 == share_info->usr_info->x_user) - && (0 == share_info->usr_info->rs_user) - && (0 == share_info->usr_info->ws_user) - && (0 == share_info->usr_info->rws_user)) { - release_share_info(share_info); - } unlock_po_share_info(share_info); return ret; } @@ -1142,7 +1180,15 @@ int release_share_info(po_share_info* share_info) { } shm_unlink(share_info->name); #endif - OsaFree(share_info->usr_info); + if(share_info->usr_info != NULL) { + if ((0 == share_info->usr_info->x_user) + && (0 == share_info->usr_info->rs_user) + && (0 == share_info->usr_info->ws_user) + && (0 == share_info->usr_info->rws_user)) { + OsaFree(share_info->usr_info); + share_info->usr_info = NULL; + } + } return 0; } @@ -1262,6 +1308,26 @@ void rem_from_po_list(persistent_object* po) { //debug_list(); } +po_user* get_po_user_from_po_list(uint32_t storageID, const void* objectID, + size_t objectIDLen) +{ + MSG("=====To find PO %d %s=====", storageID, (char *)objectID); + po_list_node* node = g_po_list.next; + while (node != NULL) { + MSG("======PO list : %d %s =====", node->po->storage_id, node->po->object_id); + if(node->po->storage_id == storageID && + strncmp(node->po->object_id, (char*)objectID, objectIDLen) == 0 && + node->po->share_info.usr_info != NULL) + { + MSG("======PO find ====="); + return node->po->share_info.usr_info; + } + node = node->next; + } + MSG("======PO find end====="); + return NULL; +} + void cleanup(void) { po_list_node* node = g_po_list.next; while (NULL != node) { @@ -1284,6 +1350,7 @@ void regist_clean_up() { // object general operations //////////////////////////////////////////////////////////////////////////////////// void TEE_GetObjectInfo(TEE_ObjectHandle object, TEE_ObjectInfo* objectInfo) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); if (objectInfo) { objectInfo->objectType = object->tr.info.objectType; objectInfo->objectSize = object->tr.info.objectSize; @@ -1302,6 +1369,7 @@ void TEE_RestrictObjectUsage(TEE_ObjectHandle object, uint32_t objectUsage) { TEE_Result TEE_GetObjectBufferAttribute(TEE_ObjectHandle object, uint32_t attributeID, void* buffer, size_t* size) { + PERMISSION_CHECK(PERM_STORAGE); uint32_t len; int i, n = -1; TransientObject * obj = &object->tr; @@ -1344,6 +1412,7 @@ TEE_Result TEE_GetObjectBufferAttribute(TEE_ObjectHandle object, TEE_Result TEE_GetObjectValueAttribute(TEE_ObjectHandle object, uint32_t attributeID, uint32_t* a, uint32_t* b) { + PERMISSION_CHECK(PERM_STORAGE); int i, n = -1; TransientObject * obj = &object->tr; @@ -1397,6 +1466,7 @@ void TEE_CloseObject(TEE_ObjectHandle object) { //////////////////////////////////////////////////////////////////////////////////// TEE_Result TEE_AllocateTransientObject(uint32_t objectType, uint32_t maxObjectSize, TEE_ObjectHandle* object) { + PERMISSION_CHECK(PERM_STORAGE); TEE_Result rc; @@ -1412,13 +1482,12 @@ TEE_Result TEE_AllocateTransientObject(uint32_t objectType, return rc; } *object = (TEE_ObjectHandle)&tr->info; - OsaFree(tr); return TEE_SUCCESS; } void TEE_FreeTransientObject(TEE_ObjectHandle object) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); TransientObject * tr = NULL; - if (object == TEE_HANDLE_NULL) { return; } @@ -1433,8 +1502,8 @@ void TEE_FreeTransientObject(TEE_ObjectHandle object) { } void TEE_ResetTransientObject(TEE_ObjectHandle object) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); TransientObject* tr; - if (object == TEE_HANDLE_NULL) { return; } @@ -1456,6 +1525,7 @@ void TEE_ResetTransientObject(TEE_ObjectHandle object) { TEE_Result TEE_PopulateTransientObject(TEE_ObjectHandle object, const TEE_Attribute* attrs, uint32_t attrCount) { + PERMISSION_CHECK(PERM_STORAGE); unsigned int i; TransientObject* tr = &object->tr; @@ -1552,6 +1622,7 @@ void TEE_InitValueAttribute(TEE_Attribute* attr, uint32_t attributeID, void TEE_CopyObjectAttributes(TEE_ObjectHandle destObject, TEE_ObjectHandle srcObject) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); int attrCount, i; //int offset = 0; TEE_Attribute * attrs; @@ -1594,6 +1665,7 @@ void TEE_CopyObjectAttributes(TEE_ObjectHandle destObject, TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize, const TEE_Attribute* params, uint32_t paramCount) { + PERMISSION_CHECK(PERM_STORAGE); char key[256]; TEE_Attribute attrs[MAX_ATTRIBUTE_NUMBER]; unsigned int i, check = 0; @@ -1762,6 +1834,7 @@ TEE_Result TEE_GenerateKey(TEE_ObjectHandle object, uint32_t keySize, TEE_Result TEE_CreatePersistentObject(uint32_t storageID, const void* objectID, size_t objectIDLen, uint32_t flags, TEE_ObjectHandle attributes, const void* initialData, size_t initialDataLen, TEE_ObjectHandle* object) { + PERMISSION_CHECK(PERM_STORAGE); persistent_object* po = NULL; TEE_Result rc = allocate_persistent_object(&po, storageID, objectID, objectIDLen, flags); @@ -1799,6 +1872,7 @@ TEE_Result TEE_CreatePersistentObject(uint32_t storageID, const void* objectID, TEE_Result TEE_OpenPersistentObject(uint32_t storageID, const void* objectID, size_t objectIDLen, uint32_t flags, TEE_ObjectHandle* object) { + PERMISSION_CHECK(PERM_STORAGE); persistent_object* po = NULL; TEE_Result rc = allocate_persistent_object(&po, storageID, objectID, objectIDLen, flags); @@ -1815,6 +1889,7 @@ TEE_Result TEE_OpenPersistentObject(uint32_t storageID, const void* objectID, } void TEE_CloseAndDeletePersistentObject(TEE_ObjectHandle object) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); persistent_object* op; if (object == TEE_HANDLE_NULL) { return; @@ -1833,6 +1908,7 @@ void TEE_CloseAndDeletePersistentObject(TEE_ObjectHandle object) { TEE_Result TEE_RenamePersistentObject(TEE_ObjectHandle object, const void* newObjectID, size_t newObjectIDLen) { + PERMISSION_CHECK(PERM_STORAGE); if (object == TEE_HANDLE_NULL) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); @@ -1844,11 +1920,8 @@ TEE_Result TEE_RenamePersistentObject(TEE_ObjectHandle object, } persistent_object* po; po = (persistent_object*)object; - if (!(po->attr.info.handleFlags & TEE_DATA_FLAG_EXCLUSIVE)) { - TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); - TEE_Panic(0); - } - if (!(po->attr.info.handleFlags & TEE_DATA_FLAG_ACCESS_WRITE_META)) { + if (!(po->attr.info.handleFlags & TEE_DATA_FLAG_EXCLUSIVE) && + !(po->attr.info.handleFlags & TEE_DATA_FLAG_ACCESS_WRITE_META)) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); } @@ -1864,8 +1937,9 @@ TEE_Result TEE_RenamePersistentObject(TEE_ObjectHandle object, //////////////////////////////////////////////////////////////////////////////////// TEE_Result TEE_AllocatePersistentObjectEnumerator( TEE_ObjectEnumHandle* objectEnumerator) { + PERMISSION_CHECK(PERM_STORAGE); struct __TEE_ObjectEnumHandle* eh; - eh = (__TEE_ObjectEnumHandle *)OsaMalloc( + eh = (struct __TEE_ObjectEnumHandle *)OsaMalloc( sizeof(struct __TEE_ObjectEnumHandle)); if (!eh) { return TEE_ERROR_OUT_OF_MEMORY; @@ -1880,6 +1954,7 @@ TEE_Result TEE_AllocatePersistentObjectEnumerator( } void TEE_FreePersistentObjectEnumerator(TEE_ObjectEnumHandle objectEnumerator) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); if (TEE_HANDLE_NULL == objectEnumerator) { return; } @@ -1888,6 +1963,7 @@ void TEE_FreePersistentObjectEnumerator(TEE_ObjectEnumHandle objectEnumerator) { } void TEE_ResetPersistentObjectEnumerator(TEE_ObjectEnumHandle objectEnumerator) { + PERMISSION_CHECK_RETURN_VOID(PERM_STORAGE); if (TEE_HANDLE_NULL == objectEnumerator) { return; } @@ -1900,6 +1976,7 @@ void TEE_ResetPersistentObjectEnumerator(TEE_ObjectEnumHandle objectEnumerator) TEE_Result TEE_StartPersistentObjectEnumerator( TEE_ObjectEnumHandle objectEnumerator, uint32_t storageID) { + PERMISSION_CHECK(PERM_STORAGE); if (TEE_HANDLE_NULL == objectEnumerator) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); @@ -1928,6 +2005,7 @@ TEE_Result TEE_StartPersistentObjectEnumerator( TEE_Result TEE_GetNextPersistentObject(TEE_ObjectEnumHandle objectEnumerator, TEE_ObjectInfo* objectInfo, void* objectID, size_t* objectIDLen) { + PERMISSION_CHECK(PERM_STORAGE); if (TEE_HANDLE_NULL == objectEnumerator) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); @@ -1955,6 +2033,7 @@ TEE_Result TEE_GetNextPersistentObject(TEE_ObjectEnumHandle objectEnumerator, TEE_Result TEE_ReadObjectData(TEE_ObjectHandle object, void* buffer, size_t size, uint32_t* count) { + PERMISSION_CHECK(PERM_STORAGE); int num; if (object == TEE_HANDLE_NULL) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); @@ -1978,14 +2057,16 @@ TEE_Result TEE_ReadObjectData(TEE_ObjectHandle object, void* buffer, } } *count = num; - +#if 0 /* Prevent slow-processing */ MSG("Data read is:"); printhex((unsigned char*)buffer, num); +#endif return TEE_SUCCESS; } TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, const void* buffer, size_t size) { + PERMISSION_CHECK(PERM_STORAGE); if (object == TEE_HANDLE_NULL) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); @@ -2006,6 +2087,7 @@ TEE_Result TEE_WriteObjectData(TEE_ObjectHandle object, const void* buffer, } TEE_Result TEE_TruncateObjectData(TEE_ObjectHandle object, uint32_t size) { + PERMISSION_CHECK(PERM_STORAGE); if (object == TEE_HANDLE_NULL) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); @@ -2024,6 +2106,7 @@ TEE_Result TEE_TruncateObjectData(TEE_ObjectHandle object, uint32_t size) { TEE_Result TEE_SeekObjectData(TEE_ObjectHandle object, int32_t offset, TEE_Whence whence) { + PERMISSION_CHECK(PERM_STORAGE); if (object == TEE_HANDLE_NULL) { TZ_ERROR("operation error line = %d,%s\n", __LINE__, __func__); TEE_Panic(0); diff --git a/ssflib/src/ssf_taentrypoint.c b/ssflib/src/ssf_taentrypoint.cpp similarity index 57% rename from ssflib/src/ssf_taentrypoint.c rename to ssflib/src/ssf_taentrypoint.cpp index c4695bc..a9e1998 100644 --- a/ssflib/src/ssf_taentrypoint.c +++ b/ssflib/src/ssf_taentrypoint.cpp @@ -25,21 +25,72 @@ #ifdef __DEBUG__ #include #endif +#include "../../TEEStub/TACommands/SharedMemoryMap.h" /*----------------------------------------------------------------------------- * TEE Internal API implementation *-----------------------------------------------------------------------------*/ +extern TEE_UUID ssf_sharedthisTAUUID; + +#define __TEE_Preprocess_Operation \ + uint32_t i, type; \ + for (i = 0; i < 4; i++) { \ + type = ((data.operation.paramTypes) >> (8 * i)) & 0x7f; \ + if ((type == TEEC_VALUE_INPUT) || (type == TEEC_VALUE_OUTPUT) \ + || (type == TEEC_VALUE_INOUT)) { \ + data.operation.params[i].value.a = params[i].value.a; \ + data.operation.params[i].value.b = params[i].value.b; \ + } else if (type == TEEC_NONE) { \ + } else { \ + int getOffset = 0; \ + if(params[i].memref.memid == 0) { \ + params[i].memref.memid = getSharedMemoryShmID(params[i].memref.buffer); \ + } else { \ + char* getAdd = getSharedMemoryAddress(params[i].memref.memid); \ + if(getAdd != 0) \ + getOffset = (char*)params[i].memref.buffer - getAdd; \ + } \ + data.operation.params[i].mem.offset = getOffset; \ + data.operation.params[i].mem.size = params[i].memref.size; \ + data.operation.params[i].mem.shmKey = params[i].memref.memid; \ + } \ + } + +#define __TEE_Postprocess_Operation \ + uint32_t i, type; \ + for (i = 0; i < 4; i++) { \ + type = ((data.operation.paramTypes) >> (8 * i)) & 0x7f; \ + if ((type == TEEC_VALUE_INPUT) || (type == TEEC_VALUE_OUTPUT) \ + || (type == TEEC_VALUE_INOUT)) { \ + params[i].value.a = data.operation.params[i].value.a; \ + params[i].value.b = data.operation.params[i].value.b; \ + } else if (type == TEEC_NONE) { \ + } else { \ + params[i].memref.size = data.operation.params[i].mem.size; \ + params[i].memref.memid = data.operation.params[i].mem.shmKey; \ + } \ + } TEE_Result TEE_OpenTASession(const TEE_UUID* destination, uint32_t cancellationRequestTimeout, uint32_t paramTypes, TEE_Param params[4], TEE_TASessionHandle* session, uint32_t* returnOrigin) { IntTAOpenSessionData data; + if (returnOrigin) { + *returnOrigin = TEE_ORIGIN_API; + } + if (!session || !destination) { + return TEE_ERROR_BAD_PARAMETERS; + } + memset(&data, 0, sizeof(IntTAOpenSessionData)); + data.source = ssf_sharedthisTAUUID; data.destination = *destination; data.cancelTimeOut = cancellationRequestTimeout; data.operation.paramTypes = paramTypes; - - memcpy(data.operation.params, params, sizeof(TEE_Param[4])); + if(params != 0) + { + __TEE_Preprocess_Operation; + } pthread_mutex_lock(&socketLock); sendCommand(socketSimulatorDaemonFD, OPEN_TA_SESSION, &data, @@ -64,10 +115,14 @@ TEE_Result TEE_OpenTASession(const TEE_UUID* destination, // [out] TEE_TASessionHandle* session, // [out] uint32_t* returnOrigin); uint32_t* sessionData = (uint32_t*)OsaMalloc(sizeof(uint32_t)); - memcpy(params, data.operation.params, sizeof(TEE_Param[4])); + if(params != NULL) + { + __TEE_Postprocess_Operation; + } *sessionData = data.session; *session = (TEE_TASessionHandle)sessionData; - *returnOrigin = data.returnOrigin; + if (returnOrigin) + *returnOrigin = TEE_ORIGIN_TRUSTED_APP; return data.returnValue; } @@ -85,12 +140,24 @@ void TEE_CloseTASession(TEE_TASessionHandle session) { TEE_Result TEE_InvokeTACommand(TEE_TASessionHandle session, uint32_t cancellationRequestTimeout, uint32_t commandID, uint32_t paramTypes, TEE_Param params[4], uint32_t* returnOrigin) { + IntTAInvokeCommandData data; + if (returnOrigin) { + *returnOrigin = TEE_ORIGIN_API; + } + if (session == NULL){ + return TEE_ERROR_TARGET_DEAD; + } + memset(&data, 0, sizeof(IntTAInvokeCommandData)); data.session = *(uint32_t*)session; data.cancelTimeOut = cancellationRequestTimeout; data.commandID = commandID; data.operation.paramTypes = paramTypes; - memcpy(data.operation.params, params, sizeof(TEE_Param[4])); + if(params != NULL) + { + __TEE_Preprocess_Operation; + } + pthread_mutex_lock(&socketLock); sendCommand(socketSimulatorDaemonFD, INVOKE_TA_COMMAND, &data, sizeof(IntTAInvokeCommandData)); @@ -112,7 +179,11 @@ TEE_Result TEE_InvokeTACommand(TEE_TASessionHandle session, // Return from the function call // [inout] TEE_Param params[4], // [out] uint32_t* returnOrigin); - memcpy(params, data.operation.params, sizeof(TEE_Param[4])); - *returnOrigin = data.returnOrigin; + if(params != NULL) + { + __TEE_Postprocess_Operation; + } + if(returnOrigin != NULL) + *returnOrigin = TEE_ORIGIN_TRUSTED_APP; return data.returnValue; } -- 2.7.4 From 954be3985cf091b9b8064f73d360baccdb80484a Mon Sep 17 00:00:00 2001 From: Lukasz Kostyra Date: Thu, 6 Jul 2017 10:15:56 +0200 Subject: [PATCH 15/16] Build project with CMake, add rpmbuild spec Change-Id: I79609fde1ed6869d30294f5264988630874e3dcf --- CMakeLists.txt | 108 +++++++++++++ TEECLib/.gitignore | 1 - TEECLib/CMakeLists.txt | 49 ++++++ TEEStub/.gitignore | 1 - TEEStub/CMakeLists.txt | 68 ++++++++ TEEStub/TEEStubServer/ConnectionSession.h | 2 +- TEEStub/TEEStubServer/TAProperty.cpp | 85 ---------- TEEStub/TEEStubServer/TAProperty.h | 60 ------- build/TEECLib/makefile | 51 ------ build/TEECLib/objects.mk | 8 - build/TEECLib/sources.mk | 17 -- build/TEECLib/src/subdir.mk | 22 --- build/TEEStub/PropertyAccess/subdir.mk | 32 ---- build/TEEStub/TACommands/subdir.mk | 44 ------ build/TEEStub/TEEStubServer/subdir.mk | 29 ---- build/TEEStub/TaskStrategy/subdir.mk | 26 ---- build/TEEStub/makefile | 69 -------- build/TEEStub/objects.mk | 8 - build/TEEStub/sources.mk | 31 ---- build/TEEStub/subdir.mk | 19 --- build/build.sh | 173 --------------------- build/log/makefile | 46 ------ build/log/objects.mk | 8 - build/log/sources.mk | 17 -- build/log/subdir.mk | 19 --- build/osal/makefile | 46 ------ build/osal/objects.mk | 8 - build/osal/sources.mk | 17 -- build/osal/subdir.mk | 35 ----- build/simulatordaemon/makefile | 69 -------- build/simulatordaemon/objects.mk | 8 - build/simulatordaemon/sources.mk | 30 ---- build/simulatordaemon/src/ClientCommands/subdir.mk | 55 ------- .../simulatordaemon/src/ResponseCommands/subdir.mk | 32 ---- .../simulatordaemon/src/TABinaryManager/subdir.mk | 29 ---- build/simulatordaemon/src/subdir.mk | 41 ----- build/ssflib/dep/cryptocore/source/base/subdir.mk | 59 ------- .../ssflib/dep/cryptocore/source/middle/subdir.mk | 47 ------ build/ssflib/dep/cryptocore/source/subdir.mk | 20 --- build/ssflib/dep/swdss/source/subdir.mk | 35 ----- build/ssflib/dep/time/subdir.mk | 20 --- build/ssflib/dep/uci/source/subdir.mk | 29 ---- build/ssflib/makefile | 72 --------- build/ssflib/objects.mk | 8 - build/ssflib/sources.mk | 33 ---- build/ssflib/src/subdir.mk | 47 ------ log/.gitignore | 1 - log/CMakeLists.txt | 26 ++++ log/log.h | 22 ++- osal/.gitignore | 1 - osal/CMakeLists.txt | 31 ++++ osal/OsaIpc.c | 2 +- packaging/tef-simulator.manifest | 5 + packaging/tef-simulator.spec | 52 +++++++ simulatordaemon/.gitignore | 1 - simulatordaemon/CMakeLists.txt | 106 +++++++++++++ simulatordaemon/inc/SecurityChecker.h | 5 +- simulatordaemon/inc/TEEContext.h | 4 + simulatordaemon/src/Session.cpp | 7 + simulatordaemon/src/SimulatorDaemonServer.cpp | 12 +- .../src/TABinaryManager/Debug/TABinaryManager | Bin 380816 -> 0 bytes .../src/TABinaryManager/Debug/TABinaryManager.d | 13 -- .../src/TABinaryManager/Debug/TAManifest.d | 10 -- .../src/TABinaryManager/Debug/TAUnpack.d | 3 - .../src/TABinaryManager/Debug/TestMain.d | 13 -- simulatordaemon/src/TABinaryManager/Debug/makefile | 58 ------- .../src/TABinaryManager/Debug/objects.mk | 8 - .../src/TABinaryManager/Debug/sources.mk | 27 ---- .../src/TABinaryManager/Debug/subdir.mk | 33 ---- .../src/TABinaryManager/TABinaryManager.cpp | 14 +- simulatordaemon/src/TAFactory.cpp | 4 +- simulatordaemon/src/security.c | 1 - ssflib/.gitignore | 1 - ssflib/CMakeLists.txt | 107 +++++++++++++ ssflib/dep/swdss/source/secure_file.cpp | 18 +-- ssflib/dep/uci/include/uci_api.h | 44 +++--- ssflib/dep/uci/source/uci_api.c | 22 +-- 77 files changed, 644 insertions(+), 1740 deletions(-) create mode 100644 CMakeLists.txt delete mode 100755 TEECLib/.gitignore create mode 100644 TEECLib/CMakeLists.txt delete mode 100755 TEEStub/.gitignore create mode 100644 TEEStub/CMakeLists.txt delete mode 100644 TEEStub/TEEStubServer/TAProperty.cpp delete mode 100644 TEEStub/TEEStubServer/TAProperty.h delete mode 100755 build/TEECLib/makefile delete mode 100644 build/TEECLib/objects.mk delete mode 100644 build/TEECLib/sources.mk delete mode 100644 build/TEECLib/src/subdir.mk delete mode 100644 build/TEEStub/PropertyAccess/subdir.mk delete mode 100644 build/TEEStub/TACommands/subdir.mk delete mode 100644 build/TEEStub/TEEStubServer/subdir.mk delete mode 100644 build/TEEStub/TaskStrategy/subdir.mk delete mode 100755 build/TEEStub/makefile delete mode 100644 build/TEEStub/objects.mk delete mode 100644 build/TEEStub/sources.mk delete mode 100644 build/TEEStub/subdir.mk delete mode 100755 build/build.sh delete mode 100755 build/log/makefile delete mode 100644 build/log/objects.mk delete mode 100644 build/log/sources.mk delete mode 100644 build/log/subdir.mk delete mode 100755 build/osal/makefile delete mode 100644 build/osal/objects.mk delete mode 100644 build/osal/sources.mk delete mode 100644 build/osal/subdir.mk delete mode 100755 build/simulatordaemon/makefile delete mode 100644 build/simulatordaemon/objects.mk delete mode 100644 build/simulatordaemon/sources.mk delete mode 100644 build/simulatordaemon/src/ClientCommands/subdir.mk delete mode 100644 build/simulatordaemon/src/ResponseCommands/subdir.mk delete mode 100644 build/simulatordaemon/src/TABinaryManager/subdir.mk delete mode 100644 build/simulatordaemon/src/subdir.mk delete mode 100644 build/ssflib/dep/cryptocore/source/base/subdir.mk delete mode 100644 build/ssflib/dep/cryptocore/source/middle/subdir.mk delete mode 100644 build/ssflib/dep/cryptocore/source/subdir.mk delete mode 100644 build/ssflib/dep/swdss/source/subdir.mk delete mode 100644 build/ssflib/dep/time/subdir.mk delete mode 100644 build/ssflib/dep/uci/source/subdir.mk delete mode 100755 build/ssflib/makefile delete mode 100644 build/ssflib/objects.mk delete mode 100644 build/ssflib/sources.mk delete mode 100644 build/ssflib/src/subdir.mk delete mode 100755 log/.gitignore create mode 100644 log/CMakeLists.txt delete mode 100755 osal/.gitignore create mode 100644 osal/CMakeLists.txt create mode 100644 packaging/tef-simulator.manifest create mode 100644 packaging/tef-simulator.spec delete mode 100755 simulatordaemon/.gitignore create mode 100644 simulatordaemon/CMakeLists.txt delete mode 100755 simulatordaemon/src/TABinaryManager/Debug/TABinaryManager delete mode 100755 simulatordaemon/src/TABinaryManager/Debug/TABinaryManager.d delete mode 100755 simulatordaemon/src/TABinaryManager/Debug/TAManifest.d delete mode 100755 simulatordaemon/src/TABinaryManager/Debug/TAUnpack.d delete mode 100755 simulatordaemon/src/TABinaryManager/Debug/TestMain.d delete mode 100755 simulatordaemon/src/TABinaryManager/Debug/makefile delete mode 100644 simulatordaemon/src/TABinaryManager/Debug/objects.mk delete mode 100644 simulatordaemon/src/TABinaryManager/Debug/sources.mk delete mode 100644 simulatordaemon/src/TABinaryManager/Debug/subdir.mk delete mode 100755 ssflib/.gitignore create mode 100644 ssflib/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f1aa4d9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,108 @@ +# 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 Main CMakeLists for tef-simulator +# + +############################# Check minimum CMake version ##################### + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT("tef-simulator") + +############################# cmake packages ################################## + +INCLUDE(FindPkgConfig) + +############################# compiler flags ################################## + +# If supported for the target machine, emit position-independent code,suitable +# for dynamic linking and avoiding any limit on the size of the global offset +# table. This option makes a difference on the m68k, PowerPC and SPARC. +ADD_DEFINITIONS("-fPIC") + +# SECOS SIM define used in the project +ADD_DEFINITIONS("-D_SECOS_SIM_") + +# Disable std::array in boost - daemon is built around boost's implementation of array +ADD_DEFINITIONS("-DBOOST_ASIO_DISABLE_STD_ARRAY") + +ADD_DEFINITIONS("-D_GNU_SOURCE") + +# Set compiler warning flags +# TODO uncomment these when it's cleanup time +#ADD_DEFINITIONS("-Werror") # Make all warnings into errors. +#ADD_DEFINITIONS("-Wall") # Generate all warnings +#ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings + + +IF (CMAKE_BUILD_TYPE MATCHES "DEBUG") + ADD_DEFINITIONS("-DTIZEN_DEBUG_ENABLE") + ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG") + ADD_DEFINITIONS("-ggdb -O0") + # undefine _FORTIFY_SOURCE to supress warnings + ADD_COMPILE_OPTIONS("-U_FORTIFY_SOURCE") +ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG") + +############################# targets ######################################### + +SET(TARGET_TEF_SIMULATOR tef-simulator) +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) + +# below targets need different names due to linking with CAs and TAs (libteec for client) +SET(TARGET_TEF_SIMULATOR_TEEC_LIB teec) +SET(TARGET_TEF_SIMULATOR_TEE_STUB TEEStub) + +############################# sub-project paths ############################### + +# project root +SET(TEF_SIMULATOR_ROOT_PATH ${PROJECT_SOURCE_DIR}) +SET(TEF_SIMULATOR_INCLUDE_PATH ${TEF_SIMULATOR_ROOT_PATH}/include) + +# log +SET(LOG_PATH ${TEF_SIMULATOR_ROOT_PATH}/log) + +# osal +SET(OSAL_PATH ${TEF_SIMULATOR_ROOT_PATH}/osal) + +# ssflib +SET(SSFLIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/ssflib) +SET(SSFLIB_DEP_PATH ${SSFLIB_PATH}/dep) +SET(SSFLIB_DEP_CRYPTOCORE_PATH ${SSFLIB_DEP_PATH}/cryptocore) +SET(SSFLIB_DEP_SWDSS_PATH ${SSFLIB_DEP_PATH}/swdss) +SET(SSFLIB_DEP_TIME_PATH ${SSFLIB_DEP_PATH}/time) +SET(SSFLIB_DEP_UCI_PATH ${SSFLIB_DEP_PATH}/uci) + +# simulatordaemon +SET(DAEMON_PATH ${TEF_SIMULATOR_ROOT_PATH}/simulatordaemon) + +# TEECLib +SET(TEEC_LIB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEECLib) + +# TEEStub +SET(TEE_STUB_PATH ${TEF_SIMULATOR_ROOT_PATH}/TEEStub) + + +############################# subdirectories ################################## + +ADD_SUBDIRECTORY(log) +ADD_SUBDIRECTORY(osal) +ADD_SUBDIRECTORY(simulatordaemon) +ADD_SUBDIRECTORY(ssflib) +ADD_SUBDIRECTORY(TEECLib) +ADD_SUBDIRECTORY(TEEStub) diff --git a/TEECLib/.gitignore b/TEECLib/.gitignore deleted file mode 100755 index 3df573f..0000000 --- a/TEECLib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/TEECLib/CMakeLists.txt b/TEECLib/CMakeLists.txt new file mode 100644 index 0000000..318b9da --- /dev/null +++ b/TEECLib/CMakeLists.txt @@ -0,0 +1,49 @@ +# 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 TEE Client library +# + +FIND_PACKAGE(Threads REQUIRED) + +SET(TEEC_LIB_SOURCES + ${TEEC_LIB_PATH}/src/teec_api.c + ${TEEC_LIB_PATH}/src/teec_connection.c + ) + +ADD_LIBRARY(${TARGET_TEF_SIMULATOR_TEEC_LIB} SHARED + ${TEEC_LIB_SOURCES} + ) + +ADD_DEPENDENCIES(${TARGET_TEF_SIMULATOR_TEEC_LIB} + ${TARGET_TEF_SIMULATOR_OSAL} + ${TARGET_TEF_SIMULATOR_LOG} + ) + +INCLUDE_DIRECTORIES( + ${TEEC_LIB_PATH}/inc + ${TEF_SIMULATOR_INCLUDE_PATH}/include + ${OSAL_PATH} + ${LOG_PATH} + ) + +TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_TEEC_LIB} + ${CMAKE_THREAD_LIBS_INIT} + ${TARGET_TEF_SIMULATOR_OSAL} + ${TARGET_TEF_SIMULATOR_LOG} + ) + +INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_TEEC_LIB} DESTINATION ${LIB_INSTALL_DIR}) diff --git a/TEEStub/.gitignore b/TEEStub/.gitignore deleted file mode 100755 index 3df573f..0000000 --- a/TEEStub/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/TEEStub/CMakeLists.txt b/TEEStub/CMakeLists.txt new file mode 100644 index 0000000..d63c1aa --- /dev/null +++ b/TEEStub/CMakeLists.txt @@ -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 CMakeLists for tef-simulator TEE Stub unit +# + +PKG_CHECK_MODULES(TEE_STUB_DEPS REQUIRED + dlog + ) + +SET(TEE_STUB_SOURCES + ${TEE_STUB_PATH}/teestubmain.cpp + ${TEE_STUB_PATH}/PropertyAccess/ClientProperty.cpp + ${TEE_STUB_PATH}/PropertyAccess/PropertyApi.cpp + ${TEE_STUB_PATH}/PropertyAccess/PropertyUtility.cpp + ${TEE_STUB_PATH}/PropertyAccess/TAProperty.cpp + ${TEE_STUB_PATH}/PropertyAccess/TEEProperty.cpp + ${TEE_STUB_PATH}/TACommands/CommandBase.cpp + ${TEE_STUB_PATH}/TACommands/CommandCloseSession.cpp + ${TEE_STUB_PATH}/TACommands/CommandCreateEntryPoint.cpp + ${TEE_STUB_PATH}/TACommands/CommandDestroyEntryPoint.cpp + ${TEE_STUB_PATH}/TACommands/CommandInvoke.cpp + ${TEE_STUB_PATH}/TACommands/CommandOpenSession.cpp + ${TEE_STUB_PATH}/TACommands/CommandRequestCancel.cpp + ${TEE_STUB_PATH}/TACommands/MakeCommand.cpp + ${TEE_STUB_PATH}/TACommands/SharedMemoryMap.cpp + ${TEE_STUB_PATH}/TaskStrategy/SessionState.cpp + ${TEE_STUB_PATH}/TaskStrategy/TaskQueuedStrategy.cpp + ${TEE_STUB_PATH}/TaskStrategy/TaskStrategy.cpp + ${TEE_STUB_PATH}/TEEStubServer/ConnectionSession.cpp + ${TEE_STUB_PATH}/TEEStubServer/TEEStubServer.cpp + ${TEE_STUB_PATH}/TEEStubServer/TADebug.cpp + ) + +ADD_LIBRARY(${TARGET_TEF_SIMULATOR_TEE_STUB} STATIC + ${TEE_STUB_SOURCES} + ) + +INCLUDE_DIRECTORIES( + ${TEE_STUB_PATH} + ${TEF_SIMULATOR_INCLUDE_PATH}/include + ${OSAL_PATH} + ${LOG_PATH} + ${SSFLIB_PATH}/inc + ) + +TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_TEE_STUB} + ${TARGET_TEF_SIMULATOR_OSAL} + ${TARGET_TEF_SIMULATOR_LOG} + ${TARGET_TEF_SIMULATOR_SSFLIB} + ${TEE_STUB_DEPS_LIBRARIES} + boost_system boost_thread + ) + +INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_TEE_STUB} DESTINATION ${LIB_INSTALL_DIR}) diff --git a/TEEStub/TEEStubServer/ConnectionSession.h b/TEEStub/TEEStubServer/ConnectionSession.h index 51a75ad..d3c55d5 100644 --- a/TEEStub/TEEStubServer/ConnectionSession.h +++ b/TEEStub/TEEStubServer/ConnectionSession.h @@ -22,11 +22,11 @@ /*----------------------------------------------------------------------------- * Include files *-----------------------------------------------------------------------------*/ -#include #include #include #include #include +#include #include "tee_sim_command.h" #include "TaskStrategy/TaskStrategy.h" #include diff --git a/TEEStub/TEEStubServer/TAProperty.cpp b/TEEStub/TEEStubServer/TAProperty.cpp deleted file mode 100644 index acab173..0000000 --- a/TEEStub/TEEStubServer/TAProperty.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * ===================================================================================== - * - * Filename: ConnectionSession.cpp - * - * Description: ConnectionSession class - * - * Version: 1.0 - * Created: 09 April 2015 12:41:39 IST - * Revision: Original - * Compiler: gcc - * - * Author: Krishna (Kr), k.devale@samsung.com - * Organization: Samsung Electronics - * - * ===================================================================================== - */ - -/*----------------------------------------------------------------------------- - * Include files - *-----------------------------------------------------------------------------*/ -#include "TAProperty.h" -#include -#include - -/*----------------------------------------------------------------------------- - * Member functions - *-----------------------------------------------------------------------------*/ -TAProperty::TAProperty() { - singleInstance = false; - multipleSession = false; - uuid.timeLow = 0x0; - uuid.timeMid = 0x0; - uuid.timeHiAndVersion = 0x0; - uuid.clockSeqAndNode[0] = 0x0; - uuid.clockSeqAndNode[1] = 0x0; - uuid.clockSeqAndNode[2] = 0x0; - uuid.clockSeqAndNode[3] = 0x0; - uuid.clockSeqAndNode[4] = 0x0; - uuid.clockSeqAndNode[5] = 0x0; - uuid.clockSeqAndNode[6] = 0x0; - uuid.clockSeqAndNode[7] = 0x0; -} -/** - * Read TA properties from the TA header - */ -void TAProperty::readProperty() { - //TODO: Read property from TA - // Test Code - // Hardcoding the read values - // UUID 79B77788-9789-4a7a-A2BE-B60155EEF5F3 - uuid.timeLow = 0x79b77788; - uuid.timeMid = 0x9789; - uuid.timeHiAndVersion = 0x4a7a; - uuid.clockSeqAndNode[0] = 0xa2; - uuid.clockSeqAndNode[1] = 0xbe; - uuid.clockSeqAndNode[2] = 0xb6; - uuid.clockSeqAndNode[3] = 0x01; - uuid.clockSeqAndNode[4] = 0x55; - uuid.clockSeqAndNode[5] = 0xee; - uuid.clockSeqAndNode[6] = 0xf5; - uuid.clockSeqAndNode[7] = 0xf3; -} - -/** - * Converts UUID from TEE_UUID to a string - * @return string of TEE_UUID - */ -string TAProperty::getUUID(void) { - // E.g. returns a string in the format 79B77788-9789-4a7a-A2BE-B60155EEF5F3 - std::stringstream strStream; - strStream << IntToHex(uuid.timeLow) << "-"; - strStream << IntToHex(uuid.timeMid) << "-"; - strStream << IntToHex(uuid.timeHiAndVersion) << "-"; - strStream << IntToHex((short)uuid.clockSeqAndNode[0], 2); - strStream << IntToHex((short)uuid.clockSeqAndNode[1], 2); - strStream << "-"; - for (int i = 2; i < 8; i++) { - strStream << IntToHex((short)uuid.clockSeqAndNode[i], 2); - } - return strStream.str(); -} - -TAProperty::~TAProperty() { -} diff --git a/TEEStub/TEEStubServer/TAProperty.h b/TEEStub/TEEStubServer/TAProperty.h deleted file mode 100644 index b9c7e93..0000000 --- a/TEEStub/TEEStubServer/TAProperty.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * ===================================================================================== - * - * Filename: TAProperty.h - * - * Description: TAProperty header file - * - * Version: 1.0 - * Created: 09 April 2015 12:41:39 IST - * Revision: Original - * Compiler: gcc - * - * Author: Krishna (Kr), k.devale@samsung.com - * Organization: Samsung Electronics - * - * ===================================================================================== - */ - -#ifndef TAPROPERTY_H_ -#define TAPROPERTY_H_ - -/*----------------------------------------------------------------------------- - * Include files - *-----------------------------------------------------------------------------*/ -#include "tee_internal_api.h" -#include -#include -#include - -using namespace std; - -/*----------------------------------------------------------------------------- - * Class definitions - *-----------------------------------------------------------------------------*/ -class TAProperty { -private: - TEE_UUID uuid; - bool singleInstance; - bool multipleSession; -public: - TAProperty(); - void readProperty(void); - string getUUID(void); - bool isSingleInstance() { - return singleInstance; - } - bool isMultipleSession() { - return multipleSession; - } - virtual ~TAProperty(); -private: - template - std::string IntToHex(T i, int width = sizeof(T) * 2) { - std::stringstream stream; - stream << std::setfill('0') << std::setw(width) << std::hex << i; - return stream.str(); - } -}; - -#endif /* TAPROPERTY_H_ */ diff --git a/build/TEECLib/makefile b/build/TEECLib/makefile deleted file mode 100755 index 7c44a62..0000000 --- a/build/TEECLib/makefile +++ /dev/null @@ -1,51 +0,0 @@ -# Directory where Simulator code is placed - -GIT_SDK = ../../.. -TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- -INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ -SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ - -HOME = $(GIT_SDK)/simulator -TEECLIB_SOURCE = $(HOME)/TEECLib - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include src/subdir.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: libteec2.so - -# Tool invocations -libteec2.so: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC C Linker' - $(TOOLCHAIN)g++ -L"../osal" -L"../log" -shared -o "libteec2.so" $(OBJS) $(USER_OBJS) $(LIBS) $(SYSROOT) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C_DEPS)$(LIBRARIES) libteec2.so - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/build/TEECLib/objects.mk b/build/TEECLib/objects.mk deleted file mode 100644 index 9422d85..0000000 --- a/build/TEECLib/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := -losal -lrt -llog - diff --git a/build/TEECLib/sources.mk b/build/TEECLib/sources.mk deleted file mode 100644 index 1ba014d..0000000 --- a/build/TEECLib/sources.mk +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -OBJS := -C_DEPS := -LIBRARIES := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -src \ - diff --git a/build/TEECLib/src/subdir.mk b/build/TEECLib/src/subdir.mk deleted file mode 100644 index a6539e2..0000000 --- a/build/TEECLib/src/subdir.mk +++ /dev/null @@ -1,22 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(TEECLIB_SOURCE)/src/teec_api.c \ -$(TEECLIB_SOURCE)/src/teec_connection.c - -OBJS += \ -./src/teec_api.o \ -./src/teec_connection.o - -C_DEPS += \ -./src/teec_api.d \ -./src/teec_connection.d - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: $(TEECLIB_SOURCE)/src/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/TEECLib/inc" -I"../../osal" -I$(INCLUDE) -O0 -g3 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/TEEStub/PropertyAccess/subdir.mk b/build/TEEStub/PropertyAccess/subdir.mk deleted file mode 100644 index 89bc675..0000000 --- a/build/TEEStub/PropertyAccess/subdir.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(TEESTUB_SOURCE)/PropertyAccess/ClientProperty.cpp \ -$(TEESTUB_SOURCE)/PropertyAccess/PropertyApi.cpp \ -$(TEESTUB_SOURCE)/PropertyAccess/PropertyUtility.cpp \ -$(TEESTUB_SOURCE)/PropertyAccess/TAProperty.cpp \ -$(TEESTUB_SOURCE)/PropertyAccess/TEEProperty.cpp - -OBJS += \ -./PropertyAccess/ClientProperty.o \ -./PropertyAccess/PropertyApi.o \ -./PropertyAccess/PropertyUtility.o \ -./PropertyAccess/TAProperty.o \ -./PropertyAccess/TEEProperty.o - -CPP_DEPS += \ -./PropertyAccess/ClientProperty.d \ -./PropertyAccess/PropertyApi.d \ -./PropertyAccess/PropertyUtility.d \ -./PropertyAccess/TAProperty.d \ -./PropertyAccess/TEEProperty.d - - -# Each subdirectory must supply rules for building sources it contributes -PropertyAccess/%.o: $(TEESTUB_SOURCE)/PropertyAccess/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/TEEStub/TACommands/subdir.mk b/build/TEEStub/TACommands/subdir.mk deleted file mode 100644 index 9648d87..0000000 --- a/build/TEEStub/TACommands/subdir.mk +++ /dev/null @@ -1,44 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(TEESTUB_SOURCE)/TACommands/CommandBase.cpp \ -$(TEESTUB_SOURCE)/TACommands/CommandCloseSession.cpp \ -$(TEESTUB_SOURCE)/TACommands/CommandCreateEntryPoint.cpp \ -$(TEESTUB_SOURCE)/TACommands/CommandDestroyEntryPoint.cpp \ -$(TEESTUB_SOURCE)/TACommands/CommandInvoke.cpp \ -$(TEESTUB_SOURCE)/TACommands/CommandOpenSession.cpp \ -$(TEESTUB_SOURCE)/TACommands/CommandRequestCancel.cpp \ -$(TEESTUB_SOURCE)/TACommands/MakeCommand.cpp \ -$(TEESTUB_SOURCE)/TACommands/SharedMemoryMap.cpp - -OBJS += \ -./TACommands/CommandBase.o \ -./TACommands/CommandCloseSession.o \ -./TACommands/CommandCreateEntryPoint.o \ -./TACommands/CommandDestroyEntryPoint.o \ -./TACommands/CommandInvoke.o \ -./TACommands/CommandOpenSession.o \ -./TACommands/CommandRequestCancel.o \ -./TACommands/MakeCommand.o \ -./TACommands/SharedMemoryMap.o - -CPP_DEPS += \ -./TACommands/CommandBase.d \ -./TACommands/CommandCloseSession.d \ -./TACommands/CommandCreateEntryPoint.d \ -./TACommands/CommandDestroyEntryPoint.d \ -./TACommands/CommandInvoke.d \ -./TACommands/CommandOpenSession.d \ -./TACommands/CommandRequestCancel.d \ -./TACommands/MakeCommand.d \ -./TACommands/SharedMemoryMap.d - - -# Each subdirectory must supply rules for building sources it contributes -TACommands/%.o: $(TEESTUB_SOURCE)/TACommands/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/TEEStub/TEEStubServer/subdir.mk b/build/TEEStub/TEEStubServer/subdir.mk deleted file mode 100644 index 9cd6bcb..0000000 --- a/build/TEEStub/TEEStubServer/subdir.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(TEESTUB_SOURCE)/TEEStubServer/ConnectionSession.cpp \ -$(TEESTUB_SOURCE)/TEEStubServer/TAProperty.cpp \ -$(TEESTUB_SOURCE)/TEEStubServer/TEEStubServer.cpp \ -$(TEESTUB_SOURCE)/TEEStubServer/TADebug.cpp - -OBJS += \ -./TEEStubServer/ConnectionSession.o \ -./TEEStubServer/TAProperty.o \ -./TEEStubServer/TEEStubServer.o \ -./TEEStubServer/TADebug.o - -CPP_DEPS += \ -./TEEStubServer/ConnectionSession.d \ -./TEEStubServer/TAProperty.d \ -./TEEStubServer/TEEStubServer.d \ -./TEEStubServer/TADebug.d - - -# Each subdirectory must supply rules for building sources it contributes -TEEStubServer/%.o: $(TEESTUB_SOURCE)/TEEStubServer/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -Ldlog -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/TEEStub/TaskStrategy/subdir.mk b/build/TEEStub/TaskStrategy/subdir.mk deleted file mode 100644 index 711898d..0000000 --- a/build/TEEStub/TaskStrategy/subdir.mk +++ /dev/null @@ -1,26 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(TEESTUB_SOURCE)/TaskStrategy/SessionState.cpp \ -$(TEESTUB_SOURCE)/TaskStrategy/TaskQueuedStrategy.cpp \ -$(TEESTUB_SOURCE)/TaskStrategy/TaskStrategy.cpp - -OBJS += \ -./TaskStrategy/SessionState.o \ -./TaskStrategy/TaskQueuedStrategy.o \ -./TaskStrategy/TaskStrategy.o - -CPP_DEPS += \ -./TaskStrategy/SessionState.d \ -./TaskStrategy/TaskQueuedStrategy.d \ -./TaskStrategy/TaskStrategy.d - - -# Each subdirectory must supply rules for building sources it contributes -TaskStrategy/%.o: $(TEESTUB_SOURCE)/TaskStrategy/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/TEEStub/makefile b/build/TEEStub/makefile deleted file mode 100755 index e007903..0000000 --- a/build/TEEStub/makefile +++ /dev/null @@ -1,69 +0,0 @@ -# Directory where Simulator code is placed - -GIT_SDK = ../../.. -TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- -INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ -SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr - -HOME = $(GIT_SDK)/simulator -TEESTUB_SOURCE = $(HOME)/TEEStub - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include TaskStrategy/subdir.mk --include TEEStubServer/subdir.mk --include TACommands/subdir.mk --include PropertyAccess/subdir.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: libTEEStub.a - -# Tool invocations -libTEEStub.a: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC Archiver' - $(TOOLCHAIN)ar -r "libTEEStub.a" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(ARCHIVES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libTEEStub.a - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/build/TEEStub/objects.mk b/build/TEEStub/objects.mk deleted file mode 100644 index 742c2da..0000000 --- a/build/TEEStub/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/TEEStub/sources.mk b/build/TEEStub/sources.mk deleted file mode 100644 index dc0c730..0000000 --- a/build/TEEStub/sources.mk +++ /dev/null @@ -1,31 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -CPP_SRCS := -C_UPPER_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -CXX_SRCS := -C++_SRCS := -CC_SRCS := -OBJS := -C++_DEPS := -C_DEPS := -CC_DEPS := -ARCHIVES := -CPP_DEPS := -CXX_DEPS := -C_UPPER_DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ -TaskStrategy \ -TEEStubServer \ -TACommands \ -PropertyAccess \ - diff --git a/build/TEEStub/subdir.mk b/build/TEEStub/subdir.mk deleted file mode 100644 index 815be7e..0000000 --- a/build/TEEStub/subdir.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(TEESTUB_SOURCE)/teestubmain.cpp - -OBJS += \ -./teestubmain.o - -CPP_DEPS += \ -./teestubmain.d - - -# Each subdirectory must supply rules for building sources it contributes -%.o: $(TEESTUB_SOURCE)/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - diff --git a/build/build.sh b/build/build.sh deleted file mode 100755 index 4eac26d..0000000 --- a/build/build.sh +++ /dev/null @@ -1,173 +0,0 @@ -#!/bin/bash -# -# This script builds all modules in TA SDK Simulator and copies the binaries -# in the package -# -# Written by Cheryl Bansal -# Samsung R & D Institute, Bangalore -# Samsung Electronics -# 7 July, 2015 -# - -# Paths - -# build.sh path -DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - -# Module Paths - -LOG_PATH=$DIR/log -OSAL_PATH=$DIR/osal -TEECLIB_PATH=$DIR/TEECLib -SSFLIB_PATH=$DIR/ssflib -TEESTUB_PATH=$DIR/TEEStub -SIMDAEMON_PATH=$DIR/simulatordaemon -Package=$2 - -#check error case -check_make_error() -{ - if [ "$?" != "0" ]; then - echo "BUILD ERROR! BUILD TERMINATED." - exit 1 - fi -} - -# Clean all modules -clean_all() -{ -cd $LOG_PATH -make clean -check_make_error -cd $OSAL_PATH -make clean -check_make_error -cd $TEECLIB_PATH -make clean -check_make_error -cd $SSFLIB_PATH -make clean -check_make_error -cd $TEESTUB_PATH -make clean -check_make_error -cd $SIMDAEMON_PATH -make clean -check_make_error -cd $DIR -} - -# Build functions for each module - -build_log() -{ -cd $LOG_PATH -make clean -check_make_error -make -check_make_error -cd $DIR -} - -build_osal() -{ -cd $OSAL_PATH -make clean -check_make_error -make -check_make_error -cd $DIR -} - -build_libteec() -{ -cd $TEECLIB_PATH -make clean -check_make_error -make -check_make_error -echo "Copying libteec.so in Package" -cp libteec2.so $Package/CA/simulator/usr/lib/ -check_make_error -cd $DIR -} - -build_ssflib() -{ -cd $SSFLIB_PATH -make clean -check_make_error -make -check_make_error -echo "Copying libssflib.so in Package" -cp libssflib.so $Package/TA/simulator/usr/lib/ -check_make_error -cd $DIR -} - -build_teestub() -{ -cd $TEESTUB_PATH -make clean -check_make_error -make -check_make_error -echo "Copying libTEEStub.a in Package" -cp libTEEStub.a $Package/TA/simulator/usr/lib/ -check_make_error -cd $DIR -} - -build_simdaemon() -{ -cd $SIMDAEMON_PATH -make clean -check_make_error -make -check_make_error -echo "Copying SimulatorDaemon in Package" -cp SimulatorDaemon $Package/CA/simulator/usr/lib/ -check_make_error -cd $DIR -} - -# User help - -echo_invalid() { -echo "Simulator Build script -Invalid arguments -Format: ./build.sh -Example:./build.sh buildall ~/Package - - - log : Build Logger module - osal : Build OSAL module - TEECLib : Build TEE Client Library module - SSFLib : Build SSF Library module - TEEStub : Build TEE Stub module - SimDaemon : Build Simulator Daemon module - buildall : Build all modules - clean : Clean all modules - Exit : To exit this Program" -} - -# Verify number of arguments to build.sh -if [[ "$#" -ne 2 ]]; then - echo "Illegal number of arguments" - echo_invalid - exit 0 -fi - -case $1 in - 'log') build_log ;; - 'osal') build_osal ;; - 'TEECLib') build_log ; build_osal ; build_libteec ;; - 'SSFLib') build_log ; build_osal ; build_ssflib ;; - 'TEEStub') build_log ; build_osal ; build_ssflib ; build_teestub ;; - 'SimDaemon') build_log ; build_osal ; build_simdaemon ;; - 'buildall') build_log ; build_osal ; build_libteec ; build_ssflib ; build_teestub ; build_simdaemon ;; - 'clean') clean_all ;; - 'Exit') exit 0 ;; - *) echo_invalid ;; -esac - diff --git a/build/log/makefile b/build/log/makefile deleted file mode 100755 index c351a93..0000000 --- a/build/log/makefile +++ /dev/null @@ -1,46 +0,0 @@ --include ../makefile.init - -GIT_SDK = ../../.. -TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- -INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ - -LOG_SOURCE = ../../log - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: liblog.a - -# Tool invocations -liblog.a: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC Archiver' - $(TOOLCHAIN)ar -r "liblog.a" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C_DEPS)$(ARCHIVES) liblog.a - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/build/log/objects.mk b/build/log/objects.mk deleted file mode 100644 index 742c2da..0000000 --- a/build/log/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/log/sources.mk b/build/log/sources.mk deleted file mode 100644 index 3e7cfef..0000000 --- a/build/log/sources.mk +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -OBJS := -C_DEPS := -ARCHIVES := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/build/log/subdir.mk b/build/log/subdir.mk deleted file mode 100644 index 354843c..0000000 --- a/build/log/subdir.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(LOG_SOURCE)/log.c - -OBJS += \ -./log.o - -C_DEPS += \ -./log.d - -# Each subdirectory must supply rules for building sources it contributes -%.o: $(LOG_SOURCE)/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c $(SYSROOT) -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/osal/makefile b/build/osal/makefile deleted file mode 100755 index af05f50..0000000 --- a/build/osal/makefile +++ /dev/null @@ -1,46 +0,0 @@ --include ../makefile.init - -GIT_SDK = ../../.. -TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- -INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ - -OSAL_SOURCE = ../../osal - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: libosal.a - -# Tool invocations -libosal.a: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC Archiver' - $(TOOLCHAIN)ar -r "libosal.a" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C_DEPS)$(ARCHIVES) libosal.a - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/build/osal/objects.mk b/build/osal/objects.mk deleted file mode 100644 index 742c2da..0000000 --- a/build/osal/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/build/osal/sources.mk b/build/osal/sources.mk deleted file mode 100644 index 3e7cfef..0000000 --- a/build/osal/sources.mk +++ /dev/null @@ -1,17 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -OBJS := -C_DEPS := -ARCHIVES := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/build/osal/subdir.mk b/build/osal/subdir.mk deleted file mode 100644 index 4f05c36..0000000 --- a/build/osal/subdir.mk +++ /dev/null @@ -1,35 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(OSAL_SOURCE)/OsaCommon.c \ -$(OSAL_SOURCE)/OsaIpc.c \ -$(OSAL_SOURCE)/OsaQueue.c \ -$(OSAL_SOURCE)/OsaSem.c \ -$(OSAL_SOURCE)/OsaSignal.c \ -$(OSAL_SOURCE)/OsaTask.c - -OBJS += \ -./OsaCommon.o \ -./OsaIpc.o \ -./OsaQueue.o \ -./OsaSem.o \ -./OsaSignal.o \ -./OsaTask.o - -C_DEPS += \ -./OsaCommon.d \ -./OsaIpc.d \ -./OsaQueue.d \ -./OsaSem.d \ -./OsaSignal.d \ -./OsaTask.d - - -# Each subdirectory must supply rules for building sources it contributes -%.o: $(OSAL_SOURCE)/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -lrt -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/simulatordaemon/makefile b/build/simulatordaemon/makefile deleted file mode 100755 index 7e56eaa..0000000 --- a/build/simulatordaemon/makefile +++ /dev/null @@ -1,69 +0,0 @@ -# Directory where Simulator code is placed - -GIT_SDK = ../../.. -TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- -INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ -SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ - -HOME = $(GIT_SDK)/simulator -SIMDAEMON_SOURCE = $(HOME)/simulatordaemon - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include src/TABinaryManager/subdir.mk --include src/ResponseCommands/subdir.mk --include src/ClientCommands/subdir.mk --include src/subdir.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: SimulatorDaemon - -# Tool invocations -SimulatorDaemon: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC C++ Linker' - $(TOOLCHAIN)g++ -L"../log" -L"../osal" -o "SimulatorDaemon" $(SYSROOT) $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(CPP_DEPS)$(EXECUTABLES)$(CXX_DEPS)$(C_UPPER_DEPS) SimulatorDaemon - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/build/simulatordaemon/objects.mk b/build/simulatordaemon/objects.mk deleted file mode 100644 index f8a3a8b..0000000 --- a/build/simulatordaemon/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := -lrt -llog -losal -lpthread -lboost_system -lboost_thread - diff --git a/build/simulatordaemon/sources.mk b/build/simulatordaemon/sources.mk deleted file mode 100644 index e2a915a..0000000 --- a/build/simulatordaemon/sources.mk +++ /dev/null @@ -1,30 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -CPP_SRCS := -C_UPPER_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -CXX_SRCS := -C++_SRCS := -CC_SRCS := -OBJS := -C++_DEPS := -C_DEPS := -CC_DEPS := -CPP_DEPS := -EXECUTABLES := -CXX_DEPS := -C_UPPER_DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -src \ -src/TABinaryManager \ -src/ResponseCommands \ -src/ClientCommands \ - diff --git a/build/simulatordaemon/src/ClientCommands/subdir.mk b/build/simulatordaemon/src/ClientCommands/subdir.mk deleted file mode 100644 index a099059..0000000 --- a/build/simulatordaemon/src/ClientCommands/subdir.mk +++ /dev/null @@ -1,55 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandCloseSession.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandCloseTASession.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandFinContext.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandInitContext.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandInvokeCommand.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandInvokeTACommand.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandOpenSession.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandOpenTASession.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandPanic.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandRegSharedMem.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandRelSharedMem.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/CommandReqCancellation.cpp \ -$(SIMDAEMON_SOURCE)/src/ClientCommands/MakeCommand.cpp - -OBJS += \ -./src/ClientCommands/CommandCloseSession.o \ -./src/ClientCommands/CommandCloseTASession.o \ -./src/ClientCommands/CommandFinContext.o \ -./src/ClientCommands/CommandInitContext.o \ -./src/ClientCommands/CommandInvokeCommand.o \ -./src/ClientCommands/CommandInvokeTACommand.o \ -./src/ClientCommands/CommandOpenSession.o \ -./src/ClientCommands/CommandOpenTASession.o \ -./src/ClientCommands/CommandPanic.o \ -./src/ClientCommands/CommandRegSharedMem.o \ -./src/ClientCommands/CommandRelSharedMem.o \ -./src/ClientCommands/CommandReqCancellation.o \ -./src/ClientCommands/MakeCommand.o - -CPP_DEPS += \ -./src/ClientCommands/CommandCloseSession.d \ -./src/ClientCommands/CommandCloseTASession.d \ -./src/ClientCommands/CommandFinContext.d \ -./src/ClientCommands/CommandInitContext.d \ -./src/ClientCommands/CommandInvokeCommand.d \ -./src/ClientCommands/CommandInvokeTACommand.d \ -./src/ClientCommands/CommandOpenSession.d \ -./src/ClientCommands/CommandOpenTASession.d \ -./src/ClientCommands/CommandPanic.d \ -./src/ClientCommands/CommandRegSharedMem.d \ -./src/ClientCommands/CommandRelSharedMem.d \ -./src/ClientCommands/CommandReqCancellation.d \ -./src/ClientCommands/MakeCommand.d - -# Each subdirectory must supply rules for building sources it contributes -src/ClientCommands/%.o: $(SIMDAEMON_SOURCE)/src/ClientCommands/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/simulatordaemon/src/TABinaryManager" -I"$(HOME)/simulatordaemon/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/simulatordaemon/src/ResponseCommands/subdir.mk b/build/simulatordaemon/src/ResponseCommands/subdir.mk deleted file mode 100644 index be7554c..0000000 --- a/build/simulatordaemon/src/ResponseCommands/subdir.mk +++ /dev/null @@ -1,32 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(SIMDAEMON_SOURCE)/src/ResponseCommands/ResCommandCloseSession.cpp \ -$(SIMDAEMON_SOURCE)/src/ResponseCommands/ResCommandInvokeCommand.cpp \ -$(SIMDAEMON_SOURCE)/src/ResponseCommands/ResCommandOpenSession.cpp \ -$(SIMDAEMON_SOURCE)/src/ResponseCommands/ResCommandReqCancellation.cpp \ -$(SIMDAEMON_SOURCE)/src/ResponseCommands/ResMakeCommand.cpp - -OBJS += \ -./src/ResponseCommands/ResCommandCloseSession.o \ -./src/ResponseCommands/ResCommandInvokeCommand.o \ -./src/ResponseCommands/ResCommandOpenSession.o \ -./src/ResponseCommands/ResCommandReqCancellation.o \ -./src/ResponseCommands/ResMakeCommand.o - -CPP_DEPS += \ -./src/ResponseCommands/ResCommandCloseSession.d \ -./src/ResponseCommands/ResCommandInvokeCommand.d \ -./src/ResponseCommands/ResCommandOpenSession.d \ -./src/ResponseCommands/ResCommandReqCancellation.d \ -./src/ResponseCommands/ResMakeCommand.d - - -# Each subdirectory must supply rules for building sources it contributes -src/ResponseCommands/%.o: $(SIMDAEMON_SOURCE)/src/ResponseCommands/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/simulatordaemon/src/TABinaryManager" -I"$(HOME)/simulatordaemon/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/simulatordaemon/src/TABinaryManager/subdir.mk b/build/simulatordaemon/src/TABinaryManager/subdir.mk deleted file mode 100644 index de7446e..0000000 --- a/build/simulatordaemon/src/TABinaryManager/subdir.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(SIMDAEMON_SOURCE)/src/TABinaryManager/TABinaryManager.cpp \ -$(SIMDAEMON_SOURCE)/src/TABinaryManager/TAManifest.cpp \ -$(SIMDAEMON_SOURCE)/src/TABinaryManager/TAUnpack.cpp \ -$(SIMDAEMON_SOURCE)/src/TABinaryManager/TestMain.cpp - -OBJS += \ -./src/TABinaryManager/TABinaryManager.o \ -./src/TABinaryManager/TAManifest.o \ -./src/TABinaryManager/TAUnpack.o \ -./src/TABinaryManager/TestMain.o - -CPP_DEPS += \ -./src/TABinaryManager/TABinaryManager.d \ -./src/TABinaryManager/TAManifest.d \ -./src/TABinaryManager/TAUnpack.d \ -./src/TABinaryManager/TestMain.d - - -# Each subdirectory must supply rules for building sources it contributes -src/TABinaryManager/%.o: $(SIMDAEMON_SOURCE)/src/TABinaryManager/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/simulatordaemon/src/TABinaryManager" -I"$(HOME)/simulatordaemon/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/simulatordaemon/src/subdir.mk b/build/simulatordaemon/src/subdir.mk deleted file mode 100644 index 3ce8aac..0000000 --- a/build/simulatordaemon/src/subdir.mk +++ /dev/null @@ -1,41 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(SIMDAEMON_SOURCE)/src/ConnectionSession.cpp \ -$(SIMDAEMON_SOURCE)/src/Session.cpp \ -$(SIMDAEMON_SOURCE)/src/SimulatorDaemon.cpp \ -$(SIMDAEMON_SOURCE)/src/SimulatorDaemonServer.cpp \ -$(SIMDAEMON_SOURCE)/src/TAFactory.cpp \ -$(SIMDAEMON_SOURCE)/src/TAInstance.cpp \ -$(SIMDAEMON_SOURCE)/src/TEEContext.cpp \ -$(SIMDAEMON_SOURCE)/src/ioService.cpp - -OBJS += \ -./src/ConnectionSession.o \ -./src/Session.o \ -./src/SimulatorDaemon.o \ -./src/SimulatorDaemonServer.o \ -./src/TAFactory.o \ -./src/TAInstance.o \ -./src/TEEContext.o \ -./src/ioService.o - -CPP_DEPS += \ -./src/ConnectionSession.d \ -./src/Session.d \ -./src/SimulatorDaemon.d \ -./src/SimulatorDaemonServer.d \ -./src/TAFactory.d \ -./src/TAInstance.d \ -./src/TEEContext.d \ -./src/ioService.d - - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: $(SIMDAEMON_SOURCE)/src/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/simulatordaemon/src/TABinaryManager" -I"$(HOME)/simulatordaemon/inc" -I$(INCLUDE) -O0 -g3 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/dep/cryptocore/source/base/subdir.mk b/build/ssflib/dep/cryptocore/source/base/subdir.mk deleted file mode 100644 index 5f01c31..0000000 --- a/build/ssflib/dep/cryptocore/source/base/subdir.mk +++ /dev/null @@ -1,59 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_ANSI_x931.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_aes.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_bignum.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_des.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_ecc.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_fast_math.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_hash.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_md5.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_moo.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_pkcs1_v21.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_rc4.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_sha1.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_sha2.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/base/cc_snow2.c - -OBJS += \ -./dep/cryptocore/source/base/cc_ANSI_x931.o \ -./dep/cryptocore/source/base/cc_aes.o \ -./dep/cryptocore/source/base/cc_bignum.o \ -./dep/cryptocore/source/base/cc_des.o \ -./dep/cryptocore/source/base/cc_ecc.o \ -./dep/cryptocore/source/base/cc_fast_math.o \ -./dep/cryptocore/source/base/cc_hash.o \ -./dep/cryptocore/source/base/cc_md5.o \ -./dep/cryptocore/source/base/cc_moo.o \ -./dep/cryptocore/source/base/cc_pkcs1_v21.o \ -./dep/cryptocore/source/base/cc_rc4.o \ -./dep/cryptocore/source/base/cc_sha1.o \ -./dep/cryptocore/source/base/cc_sha2.o \ -./dep/cryptocore/source/base/cc_snow2.o - -C_DEPS += \ -./dep/cryptocore/source/base/cc_ANSI_x931.d \ -./dep/cryptocore/source/base/cc_aes.d \ -./dep/cryptocore/source/base/cc_bignum.d \ -./dep/cryptocore/source/base/cc_des.d \ -./dep/cryptocore/source/base/cc_ecc.d \ -./dep/cryptocore/source/base/cc_fast_math.d \ -./dep/cryptocore/source/base/cc_hash.d \ -./dep/cryptocore/source/base/cc_md5.d \ -./dep/cryptocore/source/base/cc_moo.d \ -./dep/cryptocore/source/base/cc_pkcs1_v21.d \ -./dep/cryptocore/source/base/cc_rc4.d \ -./dep/cryptocore/source/base/cc_sha1.d \ -./dep/cryptocore/source/base/cc_sha2.d \ -./dep/cryptocore/source/base/cc_snow2.d - - -# Each subdirectory must supply rules for building sources it contributes -dep/cryptocore/source/base/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/base/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/dep/cryptocore/source/middle/subdir.mk b/build/ssflib/dep/cryptocore/source/middle/subdir.mk deleted file mode 100644 index 73d96ca..0000000 --- a/build/ssflib/dep/cryptocore/source/middle/subdir.mk +++ /dev/null @@ -1,47 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_cmac.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_dh.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_dsa.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_ecdh.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_ecdsa.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_hmac.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_rng.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_rsa.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_symmetric.c \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/middle/cc_tdes.c - -OBJS += \ -./dep/cryptocore/source/middle/cc_cmac.o \ -./dep/cryptocore/source/middle/cc_dh.o \ -./dep/cryptocore/source/middle/cc_dsa.o \ -./dep/cryptocore/source/middle/cc_ecdh.o \ -./dep/cryptocore/source/middle/cc_ecdsa.o \ -./dep/cryptocore/source/middle/cc_hmac.o \ -./dep/cryptocore/source/middle/cc_rng.o \ -./dep/cryptocore/source/middle/cc_rsa.o \ -./dep/cryptocore/source/middle/cc_symmetric.o \ -./dep/cryptocore/source/middle/cc_tdes.o - -C_DEPS += \ -./dep/cryptocore/source/middle/cc_cmac.d \ -./dep/cryptocore/source/middle/cc_dh.d \ -./dep/cryptocore/source/middle/cc_dsa.d \ -./dep/cryptocore/source/middle/cc_ecdh.d \ -./dep/cryptocore/source/middle/cc_ecdsa.d \ -./dep/cryptocore/source/middle/cc_hmac.d \ -./dep/cryptocore/source/middle/cc_rng.d \ -./dep/cryptocore/source/middle/cc_rsa.d \ -./dep/cryptocore/source/middle/cc_symmetric.d \ -./dep/cryptocore/source/middle/cc_tdes.d - - -# Each subdirectory must supply rules for building sources it contributes -dep/cryptocore/source/middle/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/middle/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/dep/cryptocore/source/subdir.mk b/build/ssflib/dep/cryptocore/source/subdir.mk deleted file mode 100644 index 0b82019..0000000 --- a/build/ssflib/dep/cryptocore/source/subdir.mk +++ /dev/null @@ -1,20 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(SSFLIB_SOURCE)/dep/cryptocore/source/CC_API.c - -OBJS += \ -./dep/cryptocore/source/CC_API.o - -C_DEPS += \ -./dep/cryptocore/source/CC_API.d - - -# Each subdirectory must supply rules for building sources it contributes -dep/cryptocore/source/%.o: $(SSFLIB_SOURCE)/dep/cryptocore/source/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/dep/swdss/source/subdir.mk b/build/ssflib/dep/swdss/source/subdir.mk deleted file mode 100644 index fd93294..0000000 --- a/build/ssflib/dep/swdss/source/subdir.mk +++ /dev/null @@ -1,35 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(SSFLIB_SOURCE)/dep/swdss/source/file_op.cpp \ -$(SSFLIB_SOURCE)/dep/swdss/source/secure_file.cpp \ -$(SSFLIB_SOURCE)/dep/swdss/source/ss_api.cpp \ -$(SSFLIB_SOURCE)/dep/swdss/source/ss_crypto.cpp \ -$(SSFLIB_SOURCE)/dep/swdss/source/ss_misc.cpp \ -$(SSFLIB_SOURCE)/dep/swdss/source/ss_temp_store.cpp - -OBJS += \ -./dep/swdss/source/file_op.o \ -./dep/swdss/source/secure_file.o \ -./dep/swdss/source/ss_api.o \ -./dep/swdss/source/ss_crypto.o \ -./dep/swdss/source/ss_misc.o \ -./dep/swdss/source/ss_temp_store.o - -CPP_DEPS += \ -./dep/swdss/source/file_op.d \ -./dep/swdss/source/secure_file.d \ -./dep/swdss/source/ss_api.d \ -./dep/swdss/source/ss_crypto.d \ -./dep/swdss/source/ss_misc.d \ -./dep/swdss/source/ss_temp_store.d - - -# Each subdirectory must supply rules for building sources it contributes -dep/swdss/source/%.o: $(SSFLIB_SOURCE)/dep/swdss/source/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/dep/time/subdir.mk b/build/ssflib/dep/time/subdir.mk deleted file mode 100644 index 58955f9..0000000 --- a/build/ssflib/dep/time/subdir.mk +++ /dev/null @@ -1,20 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -$(SSFLIB_SOURCE)/dep/time/ssf_time.cpp - -OBJS += \ -./dep/time/ssf_time.o - -CPP_DEPS += \ -./dep/time/ssf_time.d - - -# Each subdirectory must supply rules for building sources it contributes -dep/time/%.o: $(SSFLIB_SOURCE)/dep/time/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/dep/uci/source/subdir.mk b/build/ssflib/dep/uci/source/subdir.mk deleted file mode 100644 index e103ce3..0000000 --- a/build/ssflib/dep/uci/source/subdir.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(SSFLIB_SOURCE)/dep/uci/source/uci_aes_xcbc_mac.c \ -$(SSFLIB_SOURCE)/dep/uci/source/uci_api.c \ -$(SSFLIB_SOURCE)/dep/uci/source/uci_cryptocore.c \ -$(SSFLIB_SOURCE)/dep/uci/source/uci_hwcrypto.c - -OBJS += \ -./dep/uci/source/uci_aes_xcbc_mac.o \ -./dep/uci/source/uci_api.o \ -./dep/uci/source/uci_cryptocore.o \ -./dep/uci/source/uci_hwcrypto.o - -C_DEPS += \ -./dep/uci/source/uci_aes_xcbc_mac.d \ -./dep/uci/source/uci_api.d \ -./dep/uci/source/uci_cryptocore.d \ -./dep/uci/source/uci_hwcrypto.d - - -# Each subdirectory must supply rules for building sources it contributes -dep/uci/source/%.o: $(SSFLIB_SOURCE)/dep/uci/source/%.c - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/build/ssflib/makefile b/build/ssflib/makefile deleted file mode 100755 index d979fa5..0000000 --- a/build/ssflib/makefile +++ /dev/null @@ -1,72 +0,0 @@ -# Directory where Simulator code is placed - -GIT_SDK = ../../.. -TOOLCHAIN_PATH = $(GIT_SDK)/toolchain/linux -TOOLCHAIN = $(TOOLCHAIN_PATH)/i386-linux-gnueabi-gcc-4.6/bin/i386-linux-gnueabi- -INCLUDE = $(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/usr/include/ -SYSROOT = --sysroot=$(TOOLCHAIN_PATH)/rootstraps/mobile-2.3-emulator.core/ - -HOME = $(GIT_SDK)/simulator -SSFLIB_SOURCE = $(HOME)/ssflib - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include src/subdir.mk --include dep/uci/source/subdir.mk --include dep/time/subdir.mk --include dep/swdss/source/subdir.mk --include dep/cryptocore/source/middle/subdir.mk --include dep/cryptocore/source/base/subdir.mk --include dep/cryptocore/source/subdir.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: libssflib.so - -# Tool invocations -libssflib.so: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC C++ Linker' - $(TOOLCHAIN)g++ -L"../log" -L"../osal" $(SYSROOT) -fmessage-length=0 -shared -o "libssflib.so" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(OBJS)$(C++_DEPS)$(C_DEPS)$(CC_DEPS)$(LIBRARIES)$(CPP_DEPS)$(CXX_DEPS)$(C_UPPER_DEPS) libssflib.so - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/build/ssflib/objects.mk b/build/ssflib/objects.mk deleted file mode 100644 index cc72611..0000000 --- a/build/ssflib/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := -lboost_thread -llog -losal -lrt - diff --git a/build/ssflib/sources.mk b/build/ssflib/sources.mk deleted file mode 100644 index 7ed1286..0000000 --- a/build/ssflib/sources.mk +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -O_SRCS := -CPP_SRCS := -C_UPPER_SRCS := -C_SRCS := -S_UPPER_SRCS := -OBJ_SRCS := -ASM_SRCS := -CXX_SRCS := -C++_SRCS := -CC_SRCS := -OBJS := -C++_DEPS := -C_DEPS := -CC_DEPS := -LIBRARIES := -CPP_DEPS := -CXX_DEPS := -C_UPPER_DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -src \ -dep/uci/source \ -dep/time \ -dep/swdss/source \ -dep/cryptocore/source/middle \ -dep/cryptocore/source/base \ -dep/cryptocore/source \ - diff --git a/build/ssflib/src/subdir.mk b/build/ssflib/src/subdir.mk deleted file mode 100644 index 15bb64c..0000000 --- a/build/ssflib/src/subdir.mk +++ /dev/null @@ -1,47 +0,0 @@ -# Add inputs and outputs from these tool invocations to the build variables -C_SRCS += \ -$(SSFLIB_SOURCE)/src/ssf_arithmetic.cpp \ -$(SSFLIB_SOURCE)/src/ssf_client.cpp \ -$(SSFLIB_SOURCE)/src/ssf_crypto.cpp \ -$(SSFLIB_SOURCE)/src/ssf_lib.cpp \ -$(SSFLIB_SOURCE)/src/ssf_malloc.cpp \ -$(SSFLIB_SOURCE)/src/ssf_panic.cpp \ -$(SSFLIB_SOURCE)/src/ssf_storage.cpp \ -$(SSFLIB_SOURCE)/src/ssf_taentrypoint.cpp \ -$(SSFLIB_SOURCE)/src/ssf_permission.cpp \ -$(SSFLIB_SOURCE)/src/app_debug.cpp - -OBJS += \ -./src/ssf_arithmetic.o \ -./src/ssf_client.o \ -./src/ssf_crypto.o \ -./src/ssf_lib.o \ -./src/ssf_malloc.o \ -./src/ssf_panic.o \ -./src/ssf_storage.o \ -./src/ssf_taentrypoint.o \ -./src/ssf_permission.o \ -./src/app_debug.o - -C_DEPS += \ -./src/ssf_arithmetic.d \ -./src/ssf_client.d \ -./src/ssf_crypto.d \ -./src/ssf_lib.d \ -./src/ssf_malloc.d \ -./src/ssf_panic.d \ -./src/ssf_storage.d \ -./src/ssf_taentrypoint.d \ -./src/ssf_permission.d \ -./src/app_debug.d - - -# Each subdirectory must supply rules for building sources it contributes -src/%.o: $(SSFLIB_SOURCE)/src/%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C Compiler' - $(TOOLCHAIN)g++ -D_SECOS_SIM_ -D__DEBUG__ -I"$(HOME)/ssflib/dep/cryptocore/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/include/include" -I"$(HOME)/ssflib/dep/cryptocore/include/base" -I"$(HOME)/ssflib/dep/cryptocore/include/middle" -I"$(HOME)/ssflib/dep/swdss/include" -I"$(HOME)/ssflib/dep/uci/include" -I"$(HOME)/ssflib/inc" -I$(INCLUDE) -O2 -g2 -Wall -Werror -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/log/.gitignore b/log/.gitignore deleted file mode 100755 index 3df573f..0000000 --- a/log/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/log/CMakeLists.txt b/log/CMakeLists.txt new file mode 100644 index 0000000..7f7c19d --- /dev/null +++ b/log/CMakeLists.txt @@ -0,0 +1,26 @@ +# 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 log unit +# + +SET(LOG_SOURCES + ${LOG_PATH}/log.c + ) + +ADD_LIBRARY(${TARGET_TEF_SIMULATOR_LOG} ${LOG_SOURCES}) + +INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_LOG} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) diff --git a/log/log.h b/log/log.h index c88baab..db87ebc 100644 --- a/log/log.h +++ b/log/log.h @@ -83,14 +83,14 @@ typedef enum { #ifdef _LOGGING -#define _LOG(module_level,debug_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,debug_level,__VA_ARGS__) +#define _LOG(module_level,debug_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,debug_level,##__VA_ARGS__) -#define LOGE(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,ERROR_LEVEL_LOG,__VA_ARGS__) -#define LOGV(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,VERBOSE_LEVEL_LOG,__VA_ARGS__) -#define LOGD(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,DEBUG_LEVEL_LOG,__VA_ARGS__) -#define LOGI(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,SECURED_LEVEL_LOG,__VA_ARGS__) -#define LOGS(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,INFO_LEVEL_LOG,__VA_ARGS__) -#define LOGP(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,PACKET_LEVEL_LOG,__VA_ARGS__) +#define LOGE(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,ERROR_LEVEL_LOG,##__VA_ARGS__) +#define LOGV(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,VERBOSE_LEVEL_LOG,##__VA_ARGS__) +#define LOGD(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,DEBUG_LEVEL_LOG,##__VA_ARGS__) +#define LOGI(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,SECURED_LEVEL_LOG,##__VA_ARGS__) +#define LOGS(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,INFO_LEVEL_LOG,##__VA_ARGS__) +#define LOGP(module_level,...) PrintLog(__FUNCTION__,__LINE__,module_level,PACKET_LEVEL_LOG,##__VA_ARGS__) #else //ifdef _LOGGING @@ -103,6 +103,10 @@ typedef enum { #endif //ifdef _LOGGING +#if defined(__cplusplus) +extern "C" { +#endif + /* * This method is to get debug level set * @@ -161,4 +165,8 @@ void PrintLog(IN const char* function_name, IN const int32_t line_no, IN int32_t module_level, IN int32_t debug_level, IN const char* message, ...); +#if defined(__cplusplus) +} // extern "C" +#endif + #endif diff --git a/osal/.gitignore b/osal/.gitignore deleted file mode 100755 index 3df573f..0000000 --- a/osal/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/osal/CMakeLists.txt b/osal/CMakeLists.txt new file mode 100644 index 0000000..1ff385c --- /dev/null +++ b/osal/CMakeLists.txt @@ -0,0 +1,31 @@ +# 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 osal unit +# + +SET(OSAL_SOURCES + ${OSAL_PATH}/OsaCommon.c + ${OSAL_PATH}/OsaIpc.c + ${OSAL_PATH}/OsaQueue.c + ${OSAL_PATH}/OsaSem.c + ${OSAL_PATH}/OsaSignal.c + ${OSAL_PATH}/OsaTask.c + ) + +ADD_LIBRARY(${TARGET_TEF_SIMULATOR_OSAL} ${OSAL_SOURCES}) + +INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_OSAL} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) diff --git a/osal/OsaIpc.c b/osal/OsaIpc.c index 57bb384..489f82b 100644 --- a/osal/OsaIpc.c +++ b/osal/OsaIpc.c @@ -180,7 +180,7 @@ static int UlOsaNamedSemCreate(const char pcName[10], int iCount, return iRetVal; } -#if 0 // unused funciton Á¦°Å. +#if 0 // unused funciton ����. static int UlOsaNamedSemDelete(unsigned int uiSmid) { UlOsaSem_t *sem = (UlOsaSem_t*)uiSmid; diff --git a/packaging/tef-simulator.manifest b/packaging/tef-simulator.manifest new file mode 100644 index 0000000..a76fdba --- /dev/null +++ b/packaging/tef-simulator.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/packaging/tef-simulator.spec b/packaging/tef-simulator.spec new file mode 100644 index 0000000..7eaea97 --- /dev/null +++ b/packaging/tef-simulator.spec @@ -0,0 +1,52 @@ +Name: tef-simulator +Summary: TEF TrustZone simulator and it's utilities +Version: 0.0.1 +Release: 1 +Group: Security +License: Apache-2.0 and BSD-3-Clause +Source0: %{name}-%{version}.tar.gz +BuildRequires: cmake +BuildRequires: boost-devel +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(openssl) +BuildRequires: pkgconfig(cynara-client) +BuildRequires: pkgconfig(cynara-creds-socket) +BuildRequires: pkgconfig(libtzplatform-config) +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} + +%description +TEF Simulator provides a TrustZone simulated environment +which can be used on platforms not supporting ARM TrustZone +environment natively (ex. on an emulator). + +%prep +%setup -q + +%build +%cmake . \ + -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \ + -DBIN_DIR=%{bin_dir} \ + -DSBIN_DIR=%{sbin_dir} +make %{?silent:--silent} %{?jobs:-j%jobs} + +%install +%make_install + +%pre + +%post + +%preun + +%postun + +%files -n tef-simulator +%{bin_dir}/tef-simulator-daemon +%{_libdir}/libtef-simulator-log.so +%{_libdir}/libtef-simulator-osal.so +%{_libdir}/libtef-simulator-ssflib.so +%{_libdir}/libteec.so +%{sbin_dir}/tef-simulator-update-uuid-list.sh diff --git a/simulatordaemon/.gitignore b/simulatordaemon/.gitignore deleted file mode 100755 index 3df573f..0000000 --- a/simulatordaemon/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/simulatordaemon/CMakeLists.txt b/simulatordaemon/CMakeLists.txt new file mode 100644 index 0000000..8c7d710 --- /dev/null +++ b/simulatordaemon/CMakeLists.txt @@ -0,0 +1,106 @@ +# 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 daemon unit +# + +PKG_CHECK_MODULES(DAEMON_DEPS REQUIRED + cynara-client + cynara-creds-socket + security-manager + ) + +FIND_PACKAGE(Threads REQUIRED) + +SET(DAEMON_SOURCES + ${DAEMON_PATH}/src/ConnectionSession.cpp + ${DAEMON_PATH}/src/ioService.cpp + # TODO change Security to cpp module + #${DAEMON_PATH}/src/security.c + # TODO lots of circular dependecies are within SecurityChecker, refactor + #${DAEMON_PATH}/src/SecurityChecker.cpp + ${DAEMON_PATH}/src/Session.cpp + ${DAEMON_PATH}/src/SimulatorDaemon.cpp + ${DAEMON_PATH}/src/SimulatorDaemonServer.cpp + ${DAEMON_PATH}/src/TAFactory.cpp + ${DAEMON_PATH}/src/TAInstance.cpp + ${DAEMON_PATH}/src/TEEContext.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandCloseSession.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandCloseTASession.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandFinContext.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandInitContext.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandInvokeCommand.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandInvokeTACommand.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandOpenSession.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandOpenTASession.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandPanic.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandRegSharedMem.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandRelSharedMem.cpp + ${DAEMON_PATH}/src/ClientCommands/CommandReqCancellation.cpp + ${DAEMON_PATH}/src/ClientCommands/MakeCommand.cpp + ${DAEMON_PATH}/src/ResponseCommands/ResCommandCloseSession.cpp + ${DAEMON_PATH}/src/ResponseCommands/ResCommandInvokeCommand.cpp + ${DAEMON_PATH}/src/ResponseCommands/ResCommandOpenSession.cpp + ${DAEMON_PATH}/src/ResponseCommands/ResCommandReqCancellation.cpp + ${DAEMON_PATH}/src/ResponseCommands/ResMakeCommand.cpp + ${DAEMON_PATH}/src/TABinaryManager/TABinaryManager.cpp + ${DAEMON_PATH}/src/TABinaryManager/TAManifest.cpp + ${DAEMON_PATH}/src/TABinaryManager/TAUnpack.cpp + ) + + +ADD_EXECUTABLE(${TARGET_TEF_SIMULATOR_DAEMON} + ${DAEMON_SOURCES} + ) + +ADD_DEPENDENCIES(${TARGET_TEF_SIMULATOR_DAEMON} + ${TARGET_TEF_SIMULATOR_OSAL} + ${TARGET_TEF_SIMULATOR_LOG} + ) + +INCLUDE_DIRECTORIES( + ${DAEMON_PATH}/inc + ${DAEMON_PATH}/inc/ClientCommands + ${DAEMON_PATH}/inc/ResponseCommands + # TODO move TABinaryManager headers to inc directory + ${DAEMON_PATH}/src/TABinaryManager/ + ${TEF_SIMULATOR_INCLUDE_PATH}/include + ${LOG_PATH} + ${OSAL_PATH} + ${DAEMON_DEPS_INCLUDE_DIRS} + ) + +LINK_DIRECTORIES( + ${LOG_PATH} + ) + +SET_TARGET_PROPERTIES( + ${TARGET_TEF_SIMULATOR_DAEMON} + PROPERTIES + COMPILE_FLAGS "-U_FORTIFY_SOURCE" + ) + +TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_DAEMON} + ${CMAKE_THREAD_LIBS_INIT} + ${DAEMON_DEPS_LIBRARIES} + ${TARGET_TEF_SIMULATOR_LOG} + ${TARGET_TEF_SIMULATOR_OSAL} + boost_system + ) + +INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_DAEMON} DESTINATION ${BIN_DIR}) +INSTALL(PROGRAMS ${DAEMON_PATH}/src/scripts/update_uuid_list.sh DESTINATION ${SBIN_DIR} + RENAME ${TARGET_TEF_SIMULATOR}-update-uuid-list.sh) diff --git a/simulatordaemon/inc/SecurityChecker.h b/simulatordaemon/inc/SecurityChecker.h index e040afa..a030d72 100644 --- a/simulatordaemon/inc/SecurityChecker.h +++ b/simulatordaemon/inc/SecurityChecker.h @@ -26,8 +26,9 @@ using std::string; +class ConnectionSession; -class SecurityChecker{ +class SecurityChecker { private: ConnectionSession* mConnSess; @@ -38,7 +39,7 @@ public: static bool clientHasAccessToTa(ConnectionSession *ses, string taName); static bool clientHasCynaraPermission(ConnectionSession *ses, string privelege); - bool clientHasAccessToTa(string taName); + bool clientHasAccessToTa(string taName); bool clientHasCynaraPermission(string privelege); ~SecurityChecker(); diff --git a/simulatordaemon/inc/TEEContext.h b/simulatordaemon/inc/TEEContext.h index c1fc73b..79212de 100644 --- a/simulatordaemon/inc/TEEContext.h +++ b/simulatordaemon/inc/TEEContext.h @@ -53,6 +53,10 @@ public: IConnectionSession* mConnSess; // ContextID assigned to the instance uint32_t mContextID; + /* Security checker wich can tell us if client has different Tizen's policy permissions*/ + // TODO refactor SecurityChecker + //SecurityChecker mConnSecChecker; + /* For TA internal APIs support, dummy Context is created and for recognizing * the context as dummy isInternal member variable is used */ diff --git a/simulatordaemon/src/Session.cpp b/simulatordaemon/src/Session.cpp index 4939b2f..f2c71df 100644 --- a/simulatordaemon/src/Session.cpp +++ b/simulatordaemon/src/Session.cpp @@ -102,6 +102,13 @@ TEEC_Result Session::createSession(OpenSessionData data) { string TAUUID = TABin->getUUIDAsString(data.uuid); string argvPort = TABin->getPort(TAUUID); + /*string TAName(TAUUID); + std::transform(TAName.begin(), TAName.end(), TAName.begin(), ::toupper); + if(!mContext->mConnSecChecker.clientHasAccessToTa(TAUUID)){ + LOGE(SIM_DAEMON, "Client has no permission for access TA: %s ", TAName.c_str()); + return TEEC_ERROR_ACCESS_DENIED; + }*/ + if (argvPort != "") { pthread_rwlock_wrlock(&TAFact->mTAInstanceMapLock); multimap::iterator itr; diff --git a/simulatordaemon/src/SimulatorDaemonServer.cpp b/simulatordaemon/src/SimulatorDaemonServer.cpp index 7d06878..6d9e746 100644 --- a/simulatordaemon/src/SimulatorDaemonServer.cpp +++ b/simulatordaemon/src/SimulatorDaemonServer.cpp @@ -56,9 +56,17 @@ void SimulatorDaemonServer::startAccept() { * @param error error code if any occurred */ void SimulatorDaemonServer::handleAccept( - ConnectionSession::session_ptr new_session, - const boost::system::error_code& error) { + ConnectionSession::session_ptr new_session, + const boost::system::error_code& error) { + + const string privelege("http://tizen.org/privilege/account.read"); LOGD(SIM_DAEMON, "Entry"); + // TODO reenable after refactor + /*if (!SecurityChecker::clientHasCynaraPermission(new_session.get(), privelege)){ + LOGE("Client has no permission to use TEE"); + return; + }*/ + if (!error) { new_session->start(); } diff --git a/simulatordaemon/src/TABinaryManager/Debug/TABinaryManager b/simulatordaemon/src/TABinaryManager/Debug/TABinaryManager deleted file mode 100755 index 27a5b72a497abe596410fdcc343271df29a39bad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 380816 zcmeFa33!#&^)CJ;95iY)QKO>9dQe1Az<@y+qD0{+AYe2>QNa+BKq8q;P8bw4n#2-A zlqx8-XsNYMr4}nHRjOf-!BR~XEp4$zMLlVvO$C+O)ZF)7d+%?`IY|4v|Nql_pNl5z zTYIg&roHy~4Y@ru>9V-ExL%h27jN~l;&5H@!$3kh;NFqFg_3Rsts|@fR)6bE>oAm% zmRfKjaMHhr)7z=iCuU;Lq{E`9m6t|#rCtkkpjIF$&IuS*5_Vs}-{;)p%JFld8)_ElbgG-9bsuv8YDjzaT z(O8%C%co4mZ{-JN_Q4P9rr?LMBmIUGYlfYZvV7v3ljbG8KB?usMYH}mi?oUOq5rJ+ zgUcTX_RULa$AI|^HYgzXt{A0}(A2s*=*Zw0O=*pinAoR|p zl$D8N7fzV_0$4r&zI0*7;rawB(f^2lNCWjh;#VGFFv}vI@56uZyyXWnSViCoNf?6;!_w{{g3u!FhKer@iHHM4}+=yk-pBSzrv^gQNs*K{>46er%&Gs zAOBlEe5$Yh`7U}8*9(014O87vxTt@=ul|)nQNMx!gMIca_4$|Wlh6KT{!#u$U;UAX z8>;d@&qsg2C;v8wUEU!=lJReeD;j>>3hsq|6*S}`uOtem%jGj?!#C6^cTDA z58}GgC$G*$XS^Qw#b>)uUVopxRX+ZEef=fkqhICof3q(>vwe7mPu?p&dw%GXU+lB* zL|;5F^T`kU;G{{8j2Kmz;08P?I(d9Xi_j`;!ju~w3GJosx?V!pvYw$};pHxu$X=2G5Mi0{k? z9Qx0|zZ&$VpdSl*9qemy)weLlSA`4m&pnp|`~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ivnq7%`8{ z*}ahZkN}N>eQz;q^4s6!+st!L8){15rcTV%$V;wTA2+_iOx$UxM8&mA>$*-=86^Zp zg_DM-@eE!2iKl^tdOoNx`1bbKf$T_V>7Xeuik*wQP0OhO(5yn^xRzm^o+tVs^{uS- zwYAv3=TLM-K*qDn}K`{_jC5(k#(MjIB%K+&Zt55!Jp`97Z0=Qb?jk91e9;1$DJ2 z0%GE^Kc!=jKUi3L{eCBL_HbK}uwLbsQqw z&axmnU&KMcoL!r)uFXN=-0mY)tb^rk_*0T-<^@GMDZh5Xq60}>88@c;k- diff --git a/simulatordaemon/src/TABinaryManager/Debug/TABinaryManager.d b/simulatordaemon/src/TABinaryManager/Debug/TABinaryManager.d deleted file mode 100755 index 93160c3..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/TABinaryManager.d +++ /dev/null @@ -1,13 +0,0 @@ -TABinaryManager.d: ../TABinaryManager.cpp ../TABinaryManager.h \ - ../TAManifest.h ../TAUnpack.h ../Config.h \ - /home/krishna/TASDKCode/Simulator/TABinaryManager/TABinaryManager/../../include/tee_internal_api.h - -../TABinaryManager.h: - -../TAManifest.h: - -../TAUnpack.h: - -../Config.h: - -/home/krishna/TASDKCode/Simulator/TABinaryManager/TABinaryManager/../../include/tee_internal_api.h: diff --git a/simulatordaemon/src/TABinaryManager/Debug/TAManifest.d b/simulatordaemon/src/TABinaryManager/Debug/TAManifest.d deleted file mode 100755 index aed1eaa..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/TAManifest.d +++ /dev/null @@ -1,10 +0,0 @@ -TAManifest.d: ../TAManifest.cpp ../TAManifest.h ../rapidxml/rapidxml.hpp \ - ../rapidxml/rapidxml_utils.hpp ../rapidxml/rapidxml.hpp - -../TAManifest.h: - -../rapidxml/rapidxml.hpp: - -../rapidxml/rapidxml_utils.hpp: - -../rapidxml/rapidxml.hpp: diff --git a/simulatordaemon/src/TABinaryManager/Debug/TAUnpack.d b/simulatordaemon/src/TABinaryManager/Debug/TAUnpack.d deleted file mode 100755 index 3c6b7be..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/TAUnpack.d +++ /dev/null @@ -1,3 +0,0 @@ -TAUnpack.d: ../TAUnpack.cpp ../TAUnpack.h - -../TAUnpack.h: diff --git a/simulatordaemon/src/TABinaryManager/Debug/TestMain.d b/simulatordaemon/src/TABinaryManager/Debug/TestMain.d deleted file mode 100755 index 9f653a9..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/TestMain.d +++ /dev/null @@ -1,13 +0,0 @@ -TestMain.d: ../TestMain.cpp ../TABinaryManager.h ../TAManifest.h \ - ../TAUnpack.h ../Config.h \ - /home/krishna/TASDKCode/Simulator/TABinaryManager/TABinaryManager/../../include/tee_internal_api.h - -../TABinaryManager.h: - -../TAManifest.h: - -../TAUnpack.h: - -../Config.h: - -/home/krishna/TASDKCode/Simulator/TABinaryManager/TABinaryManager/../../include/tee_internal_api.h: diff --git a/simulatordaemon/src/TABinaryManager/Debug/makefile b/simulatordaemon/src/TABinaryManager/Debug/makefile deleted file mode 100755 index 70390a8..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/makefile +++ /dev/null @@ -1,58 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - --include ../makefile.init - -RM := rm -rf - -# All of the sources participating in the build are defined here --include sources.mk --include subdir.mk --include objects.mk - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(strip $(CC_DEPS)),) --include $(CC_DEPS) -endif -ifneq ($(strip $(C++_DEPS)),) --include $(C++_DEPS) -endif -ifneq ($(strip $(C_UPPER_DEPS)),) --include $(C_UPPER_DEPS) -endif -ifneq ($(strip $(CXX_DEPS)),) --include $(CXX_DEPS) -endif -ifneq ($(strip $(CPP_DEPS)),) --include $(CPP_DEPS) -endif -ifneq ($(strip $(C_DEPS)),) --include $(C_DEPS) -endif -endif - --include ../makefile.defs - -# Add inputs and outputs from these tool invocations to the build variables - -# All Target -all: TABinaryManager - -# Tool invocations -TABinaryManager: $(OBJS) $(USER_OBJS) - @echo 'Building target: $@' - @echo 'Invoking: GCC C++ Linker' - g++ -o "TABinaryManager" $(OBJS) $(USER_OBJS) $(LIBS) - @echo 'Finished building target: $@' - @echo ' ' - -# Other Targets -clean: - -$(RM) $(CC_DEPS)$(C++_DEPS)$(EXECUTABLES)$(C_UPPER_DEPS)$(CXX_DEPS)$(OBJS)$(CPP_DEPS)$(C_DEPS) TABinaryManager - -@echo ' ' - -.PHONY: all clean dependents -.SECONDARY: - --include ../makefile.targets diff --git a/simulatordaemon/src/TABinaryManager/Debug/objects.mk b/simulatordaemon/src/TABinaryManager/Debug/objects.mk deleted file mode 100644 index 742c2da..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/objects.mk +++ /dev/null @@ -1,8 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -USER_OBJS := - -LIBS := - diff --git a/simulatordaemon/src/TABinaryManager/Debug/sources.mk b/simulatordaemon/src/TABinaryManager/Debug/sources.mk deleted file mode 100644 index a7f166f..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/sources.mk +++ /dev/null @@ -1,27 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -C_UPPER_SRCS := -CXX_SRCS := -C++_SRCS := -OBJ_SRCS := -CC_SRCS := -ASM_SRCS := -CPP_SRCS := -C_SRCS := -O_SRCS := -S_UPPER_SRCS := -CC_DEPS := -C++_DEPS := -EXECUTABLES := -C_UPPER_DEPS := -CXX_DEPS := -OBJS := -CPP_DEPS := -C_DEPS := - -# Every subdirectory with source files must be described here -SUBDIRS := \ -. \ - diff --git a/simulatordaemon/src/TABinaryManager/Debug/subdir.mk b/simulatordaemon/src/TABinaryManager/Debug/subdir.mk deleted file mode 100644 index 8160197..0000000 --- a/simulatordaemon/src/TABinaryManager/Debug/subdir.mk +++ /dev/null @@ -1,33 +0,0 @@ -################################################################################ -# Automatically-generated file. Do not edit! -################################################################################ - -# Add inputs and outputs from these tool invocations to the build variables -CPP_SRCS += \ -../TABinaryManager.cpp \ -../TAManifest.cpp \ -../TAUnpack.cpp \ -../TestMain.cpp - -OBJS += \ -./TABinaryManager.o \ -./TAManifest.o \ -./TAUnpack.o \ -./TestMain.o - -CPP_DEPS += \ -./TABinaryManager.d \ -./TAManifest.d \ -./TAUnpack.d \ -./TestMain.d - - -# Each subdirectory must supply rules for building sources it contributes -%.o: ../%.cpp - @echo 'Building file: $<' - @echo 'Invoking: GCC C++ Compiler' - g++ -I"/home/krishna/TASDKCode/Simulator/TABinaryManager/TABinaryManager/../../include" -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" - @echo 'Finished building: $<' - @echo ' ' - - diff --git a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp index 7c15c5a..20056f5 100644 --- a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp +++ b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp @@ -185,14 +185,14 @@ bool TABinaryManager::readUUIDList() { getline(uuidFileStream, str); line = line + str; } - + /* int ch = fgetc(fp); while ((ch != '\n') && (ch != EOF)) { line = line + ch; ch = fgetc(fp); }*/ - + while (line != "") { line = line + "\0"; StructBinaryInfo info; @@ -232,7 +232,7 @@ bool TABinaryManager::readUUIDList() { if(uuidFileStream) { getline(uuidFileStream, str); - line = line + str; + line = line + str; } /* @@ -277,11 +277,11 @@ void TABinaryManager::decryptImage(StructBinaryInfo& info) { //cout << "line " << line << endl; myfile.close(); } - - // hash of Keydata is not required. + + // hash of Keydata is not required. string dec_command = "openssl enc " + cipher + " -d -nopad -nosalt -K " + secret - + " -in " + info.imagePath + " -out " + info.imagePath - + "_dec -iv 0000000000000000"; + + " -in " + info.imagePath + " -out " + info.imagePath + + "_dec -iv 0000000000000000"; //std::cout << dec_command << std::endl; system(dec_command.c_str()); string removeEncImage = "rm -f " + info.imagePath; diff --git a/simulatordaemon/src/TAFactory.cpp b/simulatordaemon/src/TAFactory.cpp index 2572bd8..57c863a 100644 --- a/simulatordaemon/src/TAFactory.cpp +++ b/simulatordaemon/src/TAFactory.cpp @@ -95,8 +95,8 @@ TAInstancePtr TAFactory::getTAInstance(TEEC_UUID uuid, ISession* session) { // Change to upper char. TA list has upper char. locale loc; - for (size_t i=0; i #include #include #include diff --git a/ssflib/.gitignore b/ssflib/.gitignore deleted file mode 100755 index 3df573f..0000000 --- a/ssflib/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/Debug/ diff --git a/ssflib/CMakeLists.txt b/ssflib/CMakeLists.txt new file mode 100644 index 0000000..905ad01 --- /dev/null +++ b/ssflib/CMakeLists.txt @@ -0,0 +1,107 @@ +# 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 ssflib unit +# + +SET(SSFLIB_CRYPTOCORE_SOURCES + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/CC_API.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_ANSI_x931.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_aes.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_bignum.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_des.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_ecc.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_fast_math.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_hash.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_md5.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_moo.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_pkcs1_v21.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_rc4.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_sha1.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_sha2.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/base/cc_snow2.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_cmac.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_dh.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_dsa.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_ecdh.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_ecdsa.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_hmac.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_rng.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_rsa.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_symmetric.c + ${SSFLIB_DEP_CRYPTOCORE_PATH}/source/middle/cc_tdes.c + ) + +SET(SSFLIB_SWDSS_SOURCES + ${SSFLIB_DEP_SWDSS_PATH}/source/file_op.cpp + ${SSFLIB_DEP_SWDSS_PATH}/source/secure_file.cpp + ${SSFLIB_DEP_SWDSS_PATH}/source/ss_api.cpp + ${SSFLIB_DEP_SWDSS_PATH}/source/ss_crypto.cpp + ${SSFLIB_DEP_SWDSS_PATH}/source/ss_misc.cpp + ${SSFLIB_DEP_SWDSS_PATH}/source/ss_temp_store.cpp + ) + +SET(SSFLIB_TIME_SOURCES + ${SSFLIB_DEP_TIME_PATH}/ssf_time.cpp + ) + +SET(SSFLIB_UCI_SOURCES + ${SSFLIB_DEP_UCI_PATH}/source/uci_aes_xcbc_mac.c + ${SSFLIB_DEP_UCI_PATH}/source/uci_api.c + ${SSFLIB_DEP_UCI_PATH}/source/uci_cryptocore.c + ${SSFLIB_DEP_UCI_PATH}/source/uci_hwcrypto.c + ) + +SET(SSFLIB_SOURCES + ${SSFLIB_PATH}/src/app_debug.cpp + ${SSFLIB_PATH}/src/ssf_arithmetic.cpp + ${SSFLIB_PATH}/src/ssf_client.cpp + ${SSFLIB_PATH}/src/ssf_crypto.cpp + ${SSFLIB_PATH}/src/ssf_lib.cpp + ${SSFLIB_PATH}/src/ssf_malloc.cpp + ${SSFLIB_PATH}/src/ssf_panic.cpp + ${SSFLIB_PATH}/src/ssf_permission.cpp + ${SSFLIB_PATH}/src/ssf_storage.cpp + ${SSFLIB_PATH}/src/ssf_taentrypoint.cpp + ) + + +ADD_LIBRARY(${TARGET_TEF_SIMULATOR_SSFLIB} SHARED + ${SSFLIB_SOURCES} + ${SSFLIB_CRYPTOCORE_SOURCES} + ${SSFLIB_SWDSS_SOURCES} + ${SSFLIB_TIME_SOURCES} + ${SSFLIB_UCI_SOURCES} + ) + +INCLUDE_DIRECTORIES( + ${SSFLIB_DEP_CRYPTOCORE_PATH}/include + ${SSFLIB_DEP_CRYPTOCORE_PATH}/include/base + ${SSFLIB_DEP_CRYPTOCORE_PATH}/include/middle + ${SSFLIB_DEP_SWDSS_PATH}/include + ${SSFLIB_DEP_UCI_PATH}/include + ${SSFLIB_PATH}/inc + ${LOG_PATH} + ${OSAL_PATH} + ${TEF_SIMULATOR_INCLUDE_PATH}/include + ) + +TARGET_LINK_LIBRARIES(${TARGET_TEF_SIMULATOR_SSFLIB} + ${TARGET_TEF_SIMULATOR_OSAL} + ${TARGET_TEF_SIMULATOR_LOG} + ) + +INSTALL(TARGETS ${TARGET_TEF_SIMULATOR_SSFLIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR}) diff --git a/ssflib/dep/swdss/source/secure_file.cpp b/ssflib/dep/swdss/source/secure_file.cpp index 51059b3..d004504 100644 --- a/ssflib/dep/swdss/source/secure_file.cpp +++ b/ssflib/dep/swdss/source/secure_file.cpp @@ -11,7 +11,7 @@ * 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. + * limitations under the License. */ #include "ss_crypto.h" @@ -293,12 +293,12 @@ int DecryptEx(uint8_t* dest, uint8_t* src, unsigned long data_len, } int is_valid_credential(const ss_credential_s& cred) { - // In its canonical form, a UUID consists of 32 hexadecimal digits, displayed in 5 groups separated by hyphens, + // In its canonical form, a UUID consists of 32 hexadecimal digits, displayed in 5 groups separated by hyphens, // in the form 8-4-4-4-12 for a total of 36 characters(32 digits and 4 '-'). For example: - // 550e8400-e29b-41d4-a716-446655440000 - // Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the version number as well - // as two reserved bits. All other bits are set using a random or pseudorandom data source. - // Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits x and hexadecimal + // 550e8400-e29b-41d4-a716-446655440000 + // Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the version number as well + // as two reserved bits. All other bits are set using a random or pseudorandom data source. + // Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits x and hexadecimal // digits 8, 9, A, or B for y. e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479. char tmp_uuid[SS_MAX_UUID_LEN + 1] = {0}; char tmp_mn[SS_MAX_MODULE_NAME_LEN + 1] = {0}; @@ -413,7 +413,7 @@ uint32_t secure_file::transform_name_to_id(const char* data_name) { uint64_t secure_file::transform_id_to_name(uint64_t uDataFileID) { uint64_t uDataFileName; CBT_UINT32 uDataFileName1, uDataFileName2; - // the main idea of this function is to transfor initial file id into different number which + // the main idea of this function is to transfor initial file id into different number which // hexidecimal representation will be the real file name. // first part seed_rand(uDataFileID & 0xffffffff); @@ -430,7 +430,7 @@ uint64_t secure_file::transform_id_to_name(uint64_t uDataFileID) { // hexidecimal representation of return value will be the real file name. uDataFileName = uDataFileName1 | (((uint64_t)uDataFileName2) << 32); - SLOGI("[%s][%d] uDataFileName : %llu", __FUNCTION__, __LINE__, uDataFileName); + SLOGI("[%s][%d] uDataFileName : %lu", __FUNCTION__, __LINE__, uDataFileName); return uDataFileName; } @@ -944,7 +944,7 @@ int secure_file::serialize_data(unsigned char** buffer, //SLOGE("fail to alloc memory for data."); return SS_RET_MALLOC_FAILED; } - + memcpy(*buffer, m_write_data, m_write_data_size); ret_size = m_write_data_size; return SS_RET_SUCCESS; diff --git a/ssflib/dep/uci/include/uci_api.h b/ssflib/dep/uci/include/uci_api.h index 0acb7e4..a5d6a65 100644 --- a/ssflib/dep/uci/include/uci_api.h +++ b/ssflib/dep/uci/include/uci_api.h @@ -11,14 +11,14 @@ * 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. + * limitations under the License. */ -/** - * @file UCI_API.h - * @brief UCI codec. - * @author guoxing.xu - * @version 1.0 +/** + * @file UCI_API.h + * @brief UCI codec. + * @author guoxing.xu + * @version 1.0 * @date 2013.7 **/ @@ -41,7 +41,7 @@ extern "C" { * * @param[in] algorithm, algorithm wants to use. * @config[in] config, config specified which function to call. - * @retval UCI handle if success + * @retval UCI handle if success * @retval UCI_ERROR if fail * @retval UCI_MEM_ALLOR_ERROR if allocate memory error. */ @@ -51,7 +51,7 @@ UCI_HANDLE uci_context_alloc(unsigned int algorithm, /** * @brief free allocated memory. * - * @param[in] algorithm algorithm wants to use. + * @param[in] algorithm algorithm wants to use. * @retval UCI_SUCCESS If no error occurred. * @retval UCI_INVALID_HANDLE If oh is not a invalid handle. */ @@ -70,17 +70,17 @@ int uci_md_init(UCI_HANDLE oh); * @brief process a message block * @param[in] oh UCI operator handle. * @param[in] msg message. - * @param[in] msglen byte-length of msg. + * @param[in] msglen byte-length of msg. * @retval UCI_SUCCESS If no error occurred. * @retval UCI_INVALID_HANDLE If oh is not a valid handle. * @retval UCI_ERROR if msg is NULL while msg_len is not 0 */ int uci_md_update(UCI_HANDLE oh, unsigned char *msg, unsigned int msg_len); -/** +/** * @brief get hashed message * @param[in] oh UCI operator handle - * @param[out] output hashed message. + * @param[out] output hashed message. * @retval UCI_SUCCESS If no error occurred. * @retval UCI_INVALID_HANDLE If oh is not a valid handle. * @retval UCI_ERROR If operate failed. Such as output is NULL. @@ -92,7 +92,7 @@ int uci_md_final(UCI_HANDLE oh, unsigned char * output); * @param[in] oh UCI operator handle * @param[in] msg message * @param[in] msglen byte-length of msg - * @param[out] output hashed message. + * @param[out] output hashed message. * @retval UCI_SUCCESS If no error occurred. * @retval UCI_INVALID_HANDLE If oh is not a valid handle. * @retval UCI_ERROR if output is NULL. @@ -149,7 +149,7 @@ int uci_mac_final(UCI_HANDLE oh, unsigned char *output, */ int uci_mac_get_mac(UCI_HANDLE oh, unsigned char *key, unsigned int key_len, unsigned char * msg, unsigned int msg_len, unsigned char * output, - unsigned int * output_len); + size_t *output_len); /** * @brief initialize crypt context for symmetric cryptography @@ -161,7 +161,7 @@ int uci_mac_get_mac(UCI_HANDLE oh, unsigned char *key, unsigned int key_len, * @param[in] iv initial vector * @retval UCI_SUCCESS if no error is occured. * @retval UCI_INVALID_HANDLE if oh is invalid handle. - * @retval UCI_INVALID_ARGUMENT if one or moer parameter is ininvalid. + * @retval UCI_INVALID_ARGUMENT if one or moer parameter is ininvalid. * @retval UCI_ERROR if key is null. iv is null is invalid. */ int uci_se_init(UCI_HANDLE oh, unsigned int mode, unsigned padding, @@ -225,7 +225,7 @@ int uci_se_decrypt_oneblock(UCI_HANDLE oh, unsigned char * plain_text, * @brief initialize crypt context for symmetric cryptography in whitebox aes * @param[in] oh UCI handle * @param[in] flag if flag is 1 means table was encrypted, and key is used to decrypt table. else key is set NULL. - * @param[in] key key used to decrypt table + * @param[in] key key used to decrypt table * @param[in] table_filepath the file path where table stored. * @param[in] pencoder1 encoder instance * @param[in] pencoder2 encoder instance @@ -285,7 +285,7 @@ int uci_ae_gen_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, int uci_ae_set_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, uci_param_s *param); -/** +/** * @brief RSA Encryption * @param[in] oh UCI handle * @param[in] input message to encrypt @@ -294,7 +294,7 @@ int uci_ae_set_keypair(UCI_HANDLE oh, uci_key_s* keymaterial, * @param[out] output_len byte-length of output * @retval UCI_SUCCESS if no error is occured. * @retval UCI_INVALID_HANDLE if oh is ininvalid handle. - * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. + * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. * @retval UCI_ERROR input or output is NULL.. */ int uci_ae_encrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, @@ -309,7 +309,7 @@ int uci_ae_encrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, * @param[out]output_len byte-length of output * @retval UCI_SUCCESS if no error is occured. * @retval UCI_INVALID_HANDLE if oh is invalid handle. - * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. + * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. * @retval UCI_ERROR input or output is NULL. */ int uci_ae_decrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, @@ -324,11 +324,11 @@ int uci_ae_decrypt(UCI_HANDLE oh, unsigned char * input, unsigned int input_len, * @param[out]output_len byte-length of output * @retval UCI_SUCCESS if no error is occured. * @retval UCI_INVALID_HANDLE if oh is invalid handle. - * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. + * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. * @retvla UCI_ERROR input or output is NULL. */ int uci_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input, - unsigned int input_len, unsigned char * output, unsigned int* output_len); + unsigned int input_len, unsigned char * output, size_t* output_len); /** * @brief whitebox rsa encryption @@ -367,7 +367,7 @@ int uci_wbae_decrypt(UCI_HANDLE oh, unsigned char * input, * @param[out]sign_len byte-length of signature * @retval UCI_SUCCESS if no error is occured. * @retval UCI_INVALID_HANDLE if oh is invalid handle. - * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. + * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. * @retval UCI_ERROR if hash or signature is NULL. */ int uci_ds_sign(UCI_HANDLE oh, unsigned char * hash, unsigned int hash_len, @@ -383,7 +383,7 @@ int uci_ds_sign(UCI_HANDLE oh, unsigned char * hash, unsigned int hash_len, * @param[out] result result of verifying signature * @retval UCI_SUCCESS if no error is occured. * @retval UCI_INVALID_HANDLE if oh is invalid handle. - * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. + * @retval UCI_MSG_TOO_LONG the input_len is too long. The correct usage is that input_len shorter than key length. * @retval UCI_ERROR If hash or signature is NULL. */ int uci_ds_verify(UCI_HANDLE oh, unsigned char * hash, unsigned int hash_len, diff --git a/ssflib/dep/uci/source/uci_api.c b/ssflib/dep/uci/source/uci_api.c index 15cb5fc..52ae4f8 100644 --- a/ssflib/dep/uci/source/uci_api.c +++ b/ssflib/dep/uci/source/uci_api.c @@ -11,13 +11,13 @@ * 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. + * limitations under the License. */ -/** - * @file uci_api.cpp - * @brief UCI codec. - * @author guoxing.xu - * @version 1.0 +/** + * @file uci_api.cpp + * @brief UCI codec. + * @author guoxing.xu + * @version 1.0 * @date 2013.9.6 **/ @@ -255,7 +255,7 @@ int uci_se_final(UCI_HANDLE oh, unsigned char *input, unsigned int input_len, } unsigned conf = SDRM_LOW_HALF(pctx->config); if (input != NULL && output == NULL) { - TZ_ERROR("UCI_ERROR error line = %d,%s,ret=%d\n", __LINE__, __func__); + TZ_ERROR("UCI_ERROR error line = %d,%s\n", __LINE__, __func__); return UCI_ERROR; } if (conf == UCI_SW_CRYPTOCORE) { @@ -264,7 +264,7 @@ int uci_se_final(UCI_HANDLE oh, unsigned char *input, unsigned int input_len, if (conf == UCI_HW) { return hwcrypto_se_final(oh, input, input_len, output, output_len); } - TZ_ERROR("UCI_ERROR error line = %d,%s,ret=%d\n", __LINE__, __func__); + TZ_ERROR("UCI_ERROR error line = %d,%s\n", __LINE__, __func__); return UCI_ERROR; } @@ -372,7 +372,7 @@ int uci_prng_get(UCI_HANDLE oh, unsigned int bit_len, unsigned char *data) { int uci_authcrypt_init(UCI_HANDLE oh, unsigned int mode, unsigned char *nonce, unsigned int nonce_len, unsigned int tag_len, unsigned int aad_len, unsigned int payload_len, unsigned char *key, unsigned int key_len) { -#if 0 +#if 0 uci_context_s *pctx = (uci_context_s*)oh; gcm_context *gctx = NULL; aes_ccm_context *cctx = NULL; @@ -439,7 +439,7 @@ int uci_authcrypt_update_aad(UCI_HANDLE oh, unsigned char *aad, } return UCI_SUCCESS; -#endif +#endif return UCI_ERROR; } int uci_authcrypt_update(UCI_HANDLE oh, unsigned char *src, @@ -521,7 +521,7 @@ int uci_authcrypt_encryptfinal(UCI_HANDLE oh, unsigned char *src, } return UCI_SUCCESS; -#endif +#endif return UCI_ERROR; } int uci_authcrypt_decryptfinal(UCI_HANDLE oh, unsigned char *src, -- 2.7.4 From d53f6c981976fe7839f5b2600f5eb882586c15f0 Mon Sep 17 00:00:00 2001 From: Lukasz Kostyra Date: Wed, 19 Jul 2017 14:45:14 +0200 Subject: [PATCH 16/16] Change TA store to /usr/lib, add helloworld 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 --- CMakeLists.txt | 10 ++ TEEStub/teestubmain.cpp | 3 +- helloworld/CMakeLists.txt | 70 ++++++++++++++ helloworld/host/main.c | 68 ++++++++++++++ helloworld/ta/hello_world.c | 102 +++++++++++++++++++++ helloworld/ta/hello_world.h | 33 +++++++ helloworld/ta/hello_world.xml | 49 ++++++++++ include/include/config.h | 2 +- packaging/tef-simulator.spec | 7 +- simulatordaemon/src/TABinaryManager/Config.h | 4 +- .../src/TABinaryManager/TABinaryManager.cpp | 16 +++- simulatordaemon/src/TAFactory.cpp | 1 + simulatordaemon/src/TAInstance.cpp | 2 +- simulatordaemon/src/scripts/update_uuid_list.sh | 8 +- 14 files changed, 361 insertions(+), 14 deletions(-) create mode 100644 helloworld/CMakeLists.txt create mode 100644 helloworld/host/main.c create mode 100644 helloworld/ta/hello_world.c create mode 100644 helloworld/ta/hello_world.h create mode 100644 helloworld/ta/hello_world.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index f1aa4d9..38e1910 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/TEEStub/teestubmain.cpp b/TEEStub/teestubmain.cpp index c87be23..103e391 100644 --- a/TEEStub/teestubmain.cpp +++ b/TEEStub/teestubmain.cpp @@ -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 index 0000000..5e59ea0 --- /dev/null +++ b/helloworld/CMakeLists.txt @@ -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 index 0000000..86f9e13 --- /dev/null +++ b/helloworld/host/main.c @@ -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 +#include +#include + +#include +#include + +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 index 0000000..2a6cfe2 --- /dev/null +++ b/helloworld/ta/hello_world.c @@ -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 + +#include "hello_world.h" +#include + +#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)¶ms; + (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 index 0000000..2191ff9 --- /dev/null +++ b/helloworld/ta/hello_world.h @@ -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 index 0000000..b29c7df --- /dev/null +++ b/helloworld/ta/hello_world.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "Sample Hello World application." + "Samsung Electronics" + "This sample Application is provided as is. All rights reserved." + "Copyright (c) 2017 Samsung Electronics" + + + diff --git a/include/include/config.h b/include/include/config.h index b4428d7..f327479 100644 --- a/include/include/config.h +++ b/include/include/config.h @@ -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_ */ diff --git a/packaging/tef-simulator.spec b/packaging/tef-simulator.spec index 7eaea97..cf33c83 100644 --- a/packaging/tef-simulator.spec +++ b/packaging/tef-simulator.spec @@ -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 diff --git a/simulatordaemon/src/TABinaryManager/Config.h b/simulatordaemon/src/TABinaryManager/Config.h index 110e0bd..a14e98e 100644 --- a/simulatordaemon/src/TABinaryManager/Config.h +++ b/simulatordaemon/src/TABinaryManager/Config.h @@ -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_ */ diff --git a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp index 20056f5..b035dd9 100644 --- a/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp +++ b/simulatordaemon/src/TABinaryManager/TABinaryManager.cpp @@ -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); diff --git a/simulatordaemon/src/TAFactory.cpp b/simulatordaemon/src/TAFactory.cpp index 57c863a..6379144 100644 --- a/simulatordaemon/src/TAFactory.cpp +++ b/simulatordaemon/src/TAFactory.cpp @@ -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"); diff --git a/simulatordaemon/src/TAInstance.cpp b/simulatordaemon/src/TAInstance.cpp index 2b1650f..5eec96c 100644 --- a/simulatordaemon/src/TAInstance.cpp +++ b/simulatordaemon/src/TAInstance.cpp @@ -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 diff --git a/simulatordaemon/src/scripts/update_uuid_list.sh b/simulatordaemon/src/scripts/update_uuid_list.sh index 590b3aa..2dc7815 100755 --- a/simulatordaemon/src/scripts/update_uuid_list.sh +++ b/simulatordaemon/src/scripts/update_uuid_list.sh @@ -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 -- 2.7.4