platform/core/security/tef-simulator.git
5 months agoFix TEE_CreatePersistentObject failure 33/316733/2 tizen
Jakub Wlostowski [Tue, 17 Dec 2024 15:26:38 +0000 (16:26 +0100)]
Fix TEE_CreatePersistentObject failure

Running UPDATE_API_BENCHMARKS from key-manager multiple times resulted in
crashes and tests fails. To fix this we need to check whether a persistent object
already exists, if it does we need to free it and only then create a new one.

Change-Id: I9d6de16194e034bc1d65d0e95b193cf9a2a717cb

6 months agoFix ECDH key object populate for x86_64 build 14/315614/1
Jakub Wlostowski [Tue, 3 Dec 2024 14:10:28 +0000 (15:10 +0100)]
Fix ECDH key object populate for x86_64 build

Some security tests were crashing and some failing
as we tried to change objectSize also for value attribute.

Change-Id: Ia4fd6c08352491660ac61fab8a0fed8e82325815

7 months agoUse only one TAPackageMaker binary 10/319210/3
Jakub Wlostowski [Thu, 17 Oct 2024 10:40:52 +0000 (12:40 +0200)]
Use only one TAPackageMaker binary

Change-Id: I840b5e7b5cbb12850b2d2f61051f4b21e189087b

8 months agoFix builbreak on 64-bit 31/318731/1
Krzysztof Jackiewicz [Mon, 7 Oct 2024 13:19:15 +0000 (15:19 +0200)]
Fix builbreak on 64-bit

Change-Id: Ic3c4688e445c44ef3b94683020a8fad22b97b1f7

8 months agoLimit public exponent length for RSA4096 76/317776/1
Jakub Wlostowski [Tue, 17 Sep 2024 08:53:53 +0000 (10:53 +0200)]
Limit public exponent length for RSA4096

Change-Id: I6637fb95adc3d3dd8b808de05630e3a03a8b9adb

11 months agoAdd format conversions to DSA sign and verify 48/313148/6
Jan Wojtkowski [Wed, 19 Jun 2024 09:52:41 +0000 (11:52 +0200)]
Add format conversions to DSA sign and verify

Change-Id: I94ebf9fe821d580c76449921b1e6d88584fce203

12 months agoRemove leading zero truncation in EC public key generation 45/311345/2
Filip Skrzeczkowski [Fri, 17 May 2024 15:28:17 +0000 (17:28 +0200)]
Remove leading zero truncation in EC public key generation

Change-Id: Ie8d212b3ff67db4ad7b9183efe1978a84aeca03c

14 months agoMigrate to OpenSSL3 92/303292/9
Filip Skrzeczkowski [Fri, 22 Dec 2023 14:09:00 +0000 (15:09 +0100)]
Migrate to OpenSSL3

As the low level elliptic curve OpenSSL API is deprecated by now,
EC-related functions had to be rewritten using the high level
EVP API.

Change-Id: I5c16f45d44153dda4e102ca06c03d62db645517f

18 months agoMigrate 32-bit TAPackageMaker to OpenSSL3 75/301675/3
Filip Skrzeczkowski [Tue, 21 Nov 2023 10:54:11 +0000 (11:54 +0100)]
Migrate 32-bit TAPackageMaker to OpenSSL3

Change-Id: Ia14cf23418f15b203d7dc7de2b5134aa3b23c4ca

21 months agoUse GP 1.1.0 EDCH algorithm names 46/297246/2
Dongsun Lee [Wed, 16 Aug 2023 00:57:43 +0000 (09:57 +0900)]
Use GP 1.1.0 EDCH algorithm names

- Use TEE_ALG_ECDH_PXXX(1.1.0) instead of TEE_ALG_ECDH_DERIVE_SHARED_SECRET(v1.1.1)

Change-Id: Iea77df5984248873f52949a2f04034c2ca47a8d0

22 months agoReturn attr size in TEE_GetObjectBufferAttribute() when buffer is NULL 31/297231/3
Dongsun Lee [Mon, 14 Aug 2023 09:31:26 +0000 (18:31 +0900)]
Return attr size in TEE_GetObjectBufferAttribute() when buffer is NULL

Change-Id: Ifa3b3a305acafa43c5f21ba94f62a1e05ac54dce

22 months agodisallow copy attributes between ECDSA and ECDH keys 15/297215/2
Dongsun Lee [Mon, 14 Aug 2023 03:05:55 +0000 (12:05 +0900)]
disallow copy attributes between ECDSA and ECDH keys

- The GP Internal API handles ECDSA key and ECDH key as different ones.

Change-Id: Id2436eb60fb93d8c5f0797b2bd63fc4e0e042b21

22 months agoProperly handle signature verification error 34/297134/3
Krzysztof Jackiewicz [Thu, 10 Aug 2023 19:08:47 +0000 (21:08 +0200)]
Properly handle signature verification error

Change-Id: I10279732cf32ddba00670c226dc2da868419a072

22 months agochange format of TEE_ATTR_ECC_PRIVATE_VALUE 02/297102/5
Dongsun Lee [Thu, 10 Aug 2023 07:44:20 +0000 (16:44 +0900)]
change format of TEE_ATTR_ECC_PRIVATE_VALUE

- from DER to binary

Change-Id: I7e6ebc27069416fd23f3735c13b700beed9db95b

22 months agoUse argument a to return/read TEE_ATTR_ECC_CURVE 86/297086/5
Dongsun Lee [Thu, 10 Aug 2023 05:11:12 +0000 (14:11 +0900)]
Use argument a to return/read TEE_ATTR_ECC_CURVE

Change-Id: I585fa6750dcf6852bb565177a59d329f1f1cb19d

22 months agoLog po filenames instead of ids 23/296723/5
Krzysztof Jackiewicz [Thu, 3 Aug 2023 10:07:45 +0000 (12:07 +0200)]
Log po filenames instead of ids

Persistent object ids are binary and thus unreadable. Use their hex
representation from the filename instead.

Change-Id: I03a780ee7ddccfd96eaae249a5e7c1d6e2ae4a81

22 months agoRemove pi file when last po info is deleted 52/296652/5
Krzysztof Jackiewicz [Wed, 2 Aug 2023 15:18:08 +0000 (17:18 +0200)]
Remove pi file when last po info is deleted

Writing 0 bytes to pi file led to a failure, making removal of the last
object impossible.

Change-Id: I0cd1beda44434e44802e491ea825cfa0da8f8ec8

22 months agoFix the fread() usage 51/296651/5
Krzysztof Jackiewicz [Wed, 2 Aug 2023 14:38:18 +0000 (16:38 +0200)]
Fix the fread() usage

Change-Id: Ic319e50ce51f84163baba6a98bf1f74947016a20

22 months agosupport ECDH 74/296074/12
Dongsun Lee [Wed, 19 Jul 2023 08:23:39 +0000 (17:23 +0900)]
support ECDH

Change-Id: If4c21dc15dcafa3ee883881e23c8fbddab6fff83

22 months agoadd support for ECDSA key generation, sign/verify 06/294806/9
Dongsun Lee [Tue, 27 Jun 2023 01:47:58 +0000 (10:47 +0900)]
add support for ECDSA key generation, sign/verify

Change-Id: Ib85c5d8079e6539c37d9dd92e67e57d53d6a0638

23 months agosuppress warnings due to the deprecated TEF APIs 05/294805/2
Dongsun Lee [Mon, 26 Jun 2023 02:14:31 +0000 (11:14 +0900)]
suppress warnings due to the deprecated TEF APIs

Change-Id: I093e9cb5acb8c9498cf516d6dc8d9196ae2a64f4

23 months agoFix build break for boost version upgrade 04/294804/2
Dongsun Lee [Tue, 20 Jun 2023 05:42:32 +0000 (14:42 +0900)]
Fix build break for boost version upgrade

- change: boost/bind.hpp -> boost/bind/bind.hpp
- change: boost::asio::executor -> boost::asio::any_io_executor
- add for _1 placeholder: using namespace std::placeholders;

Change-Id: I45abbc60daf7bc9a318ff0a60c1e8c0e51bd5543

23 months agofix build break by changing libsystemd-daemon to libsystemd 03/294803/1
Dongsun Lee [Tue, 20 Jun 2023 03:47:15 +0000 (12:47 +0900)]
fix build break by changing libsystemd-daemon to libsystemd

Change-Id: I7444404417b8b6a959045f894893c1544738a88f

3 years agoAllow to overwrite entries, remove deprecated flag. 47/260347/2
Michał Szaknis [Mon, 21 Jun 2021 13:57:13 +0000 (15:57 +0200)]
Allow to overwrite entries, remove deprecated flag.

Entries were not overwritten correctly, because they were opened
instead of being recreated. The TEE_DATA_FLAG_EXCLUSIVE flag was
removed and replaced with the non-deprecated TEE_DATA_FLAG_OVERWRITE.

Change-Id: Idf1b0fd00949f7371c70ef35012c9ba0513e7ef3

4 years agoAllow installation of TA before tef-simulator 37/245037/2
Krzysztof Jackiewicz [Tue, 29 Sep 2020 10:59:46 +0000 (12:59 +0200)]
Allow installation of TA before tef-simulator

Until now the TA directory with all existing TA's was being removed on first
tef-simulator installation. As a result the sesion to installed TA's could not
be opened.

To avoid potential problems resulting from incorrect installation order, save
existing TA's before recreating the TA store link.

Change-Id: I5707a547fa384f9eaab0a5b4ddc40afe53bf7161

5 years agoFix build for boost 1.71 and new glibc-devel 62/230062/8
Krzysztof Jackiewicz [Tue, 7 Apr 2020 09:04:56 +0000 (11:04 +0200)]
Fix build for boost 1.71 and new glibc-devel

- Boost::asio needs pthreads.
- Replace deprecated boost::signals with signals2.
- Replace deprecated boost::asio::io_service with
  boost::asio::executor/boost::asio::io_context.
- Silence compiler warnings
- Replace boost socket's native() with native_handle()
- Update socket paths

Change-Id: Ie4fde5239b42b3ba7bcadd40b46fe6b9b84ca66b

5 years agoDon't strip TA binaries in debug mode 97/226797/2
Krzysztof Jackiewicz [Thu, 5 Mar 2020 10:16:11 +0000 (11:16 +0100)]
Don't strip TA binaries in debug mode

This allows TA debugging

Change-Id: I68df2a53608a2868d6e9bc0c6167e8c8f2992fdb

5 years agochange the name and location of license files 35/217635/1 accepted/tizen_unified accepted/tizen/unified/20191114.042615 submit/tizen/20191113.060832
Dongsun Lee [Wed, 13 Nov 2019 05:36:00 +0000 (14:36 +0900)]
change the name and location of license files

Change-Id: I2e555fb1d60725867f95114bc5af9f3b61372aee
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
5 years agoProperly handle TEE_ObjectHandle output argument 54/212954/2
Krzysztof Jackiewicz [Wed, 28 Aug 2019 12:44:13 +0000 (14:44 +0200)]
Properly handle TEE_ObjectHandle output argument

According to GP spec v1.1 and v1.2 TEE_CreatePersistentObject
and TEE_OpenPersistentObject should set 'object' argument to
TEE_HANDLE_NULL in case of failure.

Change-Id: I23c0a7b631482eb863f0d09232a5a8f9e47c0593

5 years agoStore errno in a variable to avoid overwriting 82/210882/1
Krzysztof Jackiewicz [Thu, 25 Jul 2019 14:25:06 +0000 (16:25 +0200)]
Store errno in a variable to avoid overwriting

Errno code from connect() was overwritten by the result of close(). As
a result the EACCES condition was not triggered.

Change-Id: I95478d28ce72b5535f98d4b045d3f8e0eec92306

5 years agoTEEC_RegisterSharedMemory: do not copy output-only memory 45/208445/3
Konrad Lipinski [Mon, 24 Jun 2019 08:59:57 +0000 (10:59 +0200)]
TEEC_RegisterSharedMemory: do not copy output-only memory

Change-Id: I5efa6f43c2f695144343ac45858c05bf8817a520

5 years agoMigrate to openssl 1.1 85/206985/2 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix tizen_5.5 tizen_5.5_mobile_hotfix accepted/tizen/5.5/unified/20191031.021848 accepted/tizen/5.5/unified/mobile/hotfix/20201027.085903 accepted/tizen/unified/20190709.071106 submit/tizen/20190704.131235 submit/tizen/20190708.094956 submit/tizen_5.5/20191031.000004 submit/tizen_5.5_mobile_hotfix/20201026.185104 tizen_5.5.m2_release
Konrad Lipinski [Wed, 29 May 2019 16:35:09 +0000 (18:35 +0200)]
Migrate to openssl 1.1

Change-Id: Ibe0c3fad1f908b1a495daf677750963d77b71d6f

5 years agoFix SVACE defects: fallthrough, strerror, usleep 44/206144/2
Konrad Lipinski [Tue, 14 May 2019 14:58:33 +0000 (16:58 +0200)]
Fix SVACE defects: fallthrough, strerror, usleep

Change-Id: I1bbac2fd5614ad9c79adf90aa02eb7c760ae498c

6 years agoFix tef-simulator dependency to openssl 83/207983/2 accepted/tizen/unified/20190617.112005 submit/tizen/20190614.141700
Dariusz Michaluk [Fri, 14 Jun 2019 11:37:53 +0000 (13:37 +0200)]
Fix tef-simulator dependency to openssl

tef-simulator-devkit has TA_PackageBuilder.sh which requires openssl binary
tef-simulator-devkit doesn't require openssl-devel

Change-Id: If5ad50d7dbd83b25963794ff104dbef49611b74e

6 years agoMake spec compliant with gbs --incremental 86/206986/1
Konrad Lipinski [Wed, 29 May 2019 16:08:32 +0000 (18:08 +0200)]
Make spec compliant with gbs --incremental

According to [1], %prep section of the spec file should contain a single
%setup macro, nothing else. According to [2], manifest %files are best
copied to %{buildroot}%{_datadir} in the %install section.

Moved manifest copy operations from %prep to %install accordingly.

References
[1] https://source.tizen.org/documentation/reference/git-build-system/usage/gbs-build
[2] https://wiki.tizen.org/Security/Application_installation_and_Manifest

Change-Id: Ie9b683d8bee96528407aefc04b6bf1981166f559

6 years agoDon't pass public key for RSA decryption 19/206419/1 accepted/tizen/unified/20190602.221903 submit/tizen/20190520.091210 submit/tizen/20190522.051353 submit/tizen/20190529.045654
Krzysztof Jackiewicz [Fri, 17 May 2019 12:23:00 +0000 (14:23 +0200)]
Don't pass public key for RSA decryption

Change-Id: Id90f67c03fb1f3f83d06e66bf86e48b3f50cc98c

6 years agoEnable support for DSA and RSA 4096 92/203092/3
Krzysztof Jackiewicz [Fri, 5 Apr 2019 15:15:17 +0000 (17:15 +0200)]
Enable support for DSA and RSA 4096

- Allow creation of DSA operation (sw_crypto_open)
- Extract DSA attributes from TEE object and transfer them to crypto
  core (TEE_AsymmetricSignDigest, TEE_AsymmetricVerifyDigest) reusing
  RSA key representation (crypto_internal_keystruct). To be
  refactored.
- Properly initialize DSA operation using DSA key
  parameters (sw_crypto_ioctl_init)
- In case of RSA 4096 the buffer size for key attributes is too
  small. Take attribute size from key size due to lack of length
  probing in TEE_GetObjectBufferAttribute().

Change-Id: If2b536ea3b5a5cee6d347e36c2be2febcc9db622

6 years agoImplement CTR using openssl 77/202177/3
Krzysztof Jackiewicz [Mon, 25 Mar 2019 09:15:06 +0000 (10:15 +0100)]
Implement CTR using openssl

Crypto core implementation of CTR requires the output buffer to be a
multiplicity of the block size. CTR is a stream cipher and as such it should
produce the output of the length equal to the input.

Switch to openssl implementation.

Change-Id: I15471aaaf887c08020c4e472e8b28df7937bd898

6 years agoDon't panic when padding is wrong in asymmetric decryption 91/201991/2
Krzysztof Jackiewicz [Thu, 21 Mar 2019 10:36:28 +0000 (11:36 +0100)]
Don't panic when padding is wrong in asymmetric decryption

According to GP Internal API 1.1.2 TEE_AsymmetricDecrypt() should not panic but
return TEE_BAD_PARAMETERS in case of incorrect ciphertext padding.

Return TEE_BAD_PARAMETERS if crypto_internal_final() fails with
CRYPTO_INVALID_ARGUMENT instead of panicking.

Update related code.

Change-Id: I576c1699cf284d501e13d7367f936c708d924ec5

6 years agossf_crypto: Assign proper key object type in AllocateOperation 09/200309/2
Lukasz Kostyra [Mon, 18 Feb 2019 08:56:46 +0000 (09:56 +0100)]
ssf_crypto: Assign proper key object type in AllocateOperation

Change-Id: I3229f0d5922804ce0c0d56aa2c44b61f3f679fd4

6 years agossf_storage: Add missing objectSize copy in TEE_CopyObjectAttributes 08/200308/2
Lukasz Kostyra [Thu, 14 Feb 2019 11:30:12 +0000 (12:30 +0100)]
ssf_storage: Add missing objectSize copy in TEE_CopyObjectAttributes

Change-Id: Ibe2e33a3c6386b41bcb3ee0e483d1bc309fa9a7f

6 years agoFix c++test defects (strncpy usage) 94/205194/2
Konrad Lipinski [Tue, 30 Apr 2019 06:34:35 +0000 (08:34 +0200)]
Fix c++test defects (strncpy usage)

Change-Id: I1b8ded2654b0e7ef76669479783459acaf084421

6 years agoFix setting of identity property 60/199460/1 submit/tizen/20190212.131323
Krzysztof Dynowski [Mon, 11 Feb 2019 15:28:41 +0000 (16:28 +0100)]
Fix setting of identity property

Change-Id: If72f72a7122f9405ecb83e35f8c1f4d9ea27961b

6 years agoRework some ternaries for readability 18/193918/2
Igor Kotrasinski [Tue, 27 Nov 2018 10:56:59 +0000 (11:56 +0100)]
Rework some ternaries for readability

Change-Id: I4916a11b2500a41858a1011ce54676b9a4286435
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoSplit up prechecks for readability 17/193917/2
Igor Kotrasinski [Tue, 27 Nov 2018 10:48:30 +0000 (11:48 +0100)]
Split up prechecks for readability

Change-Id: I19d400d3d8db3915c12b5f9f93bdb767a8c5dc0c
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoAdd some necessary virtual destructors 16/193916/2
Igor Kotrasinski [Tue, 27 Nov 2018 10:37:53 +0000 (11:37 +0100)]
Add some necessary virtual destructors

Change-Id: I647fc1c8183b8479667de832a73ab3e5ec05eaf2
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoRewrite some read/write loops for readability 15/193915/2
Igor Kotrasinski [Tue, 27 Nov 2018 10:28:28 +0000 (11:28 +0100)]
Rewrite some read/write loops for readability

Change-Id: I2f26120a82c51f0a285f96cb16b0f9f2499c2c77
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoRemove failure check for function promised not to fail 14/193914/2
Igor Kotrasinski [Tue, 27 Nov 2018 10:13:04 +0000 (11:13 +0100)]
Remove failure check for function promised not to fail

Change-Id: Ib4a0d56c59c913f5fb2b707f435d7fef5b0cb422
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoPrettify a strncpy 13/193913/2
Igor Kotrasinski [Tue, 27 Nov 2018 09:11:38 +0000 (10:11 +0100)]
Prettify a strncpy

Change-Id: Ieb75766f5412ed620ff169f14a0a2e8c0baa8690
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoCatch leftover boost exceptions in simdaemonctl 12/193912/2
Igor Kotrasinski [Tue, 27 Nov 2018 08:57:26 +0000 (09:57 +0100)]
Catch leftover boost exceptions in simdaemonctl

Change-Id: Ife030baba09cee90f7bfe1e9648c02f55aaf98a3
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoDisable boost coroutine deprecation warning 23/192723/1 accepted/tizen/unified/20181109.062841 submit/tizen/20181109.001420
Konrad Lipinski [Thu, 8 Nov 2018 14:44:28 +0000 (15:44 +0100)]
Disable boost coroutine deprecation warning

Boost coroutines is now deprecated and replace by coroutines2 which is
not in the repo yet.

Change-Id: I6096d1129fd7e8aaedbbadf6f1e7f5ad347b2ae4

6 years agoSet custom IV length in AES GCM 35/190635/2
Krzysztof Jackiewicz [Thu, 4 Oct 2018 08:53:52 +0000 (10:53 +0200)]
Set custom IV length in AES GCM

Current implementation assumed the default IV length (12B) silently ignoring
longer IVs. As a result the encryption output did not match the expected one.

This commit modifies the implementation to always set the actual IV length in
the encryption context.

Change-Id: I82f9bc916f108563a4a940d340945279c661bbaa

6 years agoRevert "Revert "Modifying cmake TA devkit to be more similar to other TEF backends."" accepted/tizen_5.0_unified tizen_5.0 accepted/tizen/5.0/unified/20181102.020722 accepted/tizen/unified/20180918.062918 submit/tizen/20180917.075450 submit/tizen_5.0/20181101.000004
Tomasz Swierczek [Mon, 17 Sep 2018 07:39:06 +0000 (09:39 +0200)]
Revert "Revert "Modifying cmake TA devkit to be more similar to other TEF backends.""

This reverts commit a5c8ea2d4c5fd04a1ae02995724e5b0d79a19c21.

6 years agoRevert "Modifying cmake TA devkit to be more similar to other TEF backends." 23/189123/1
Tomasz Swierczek [Thu, 13 Sep 2018 12:54:12 +0000 (14:54 +0200)]
Revert "Modifying cmake TA devkit to be more similar to other TEF backends."

This reverts commit 49a434ec5a77aafcf84b085e8bb19709085ae6dd.

Change-Id: I73fb8e59fd6e6c6755914919804b6129e08582eb

6 years agoModifying cmake TA devkit to be more similar to other TEF backends. 73/175473/4 submit/tizen/20180913.120725
r.tyminski [Mon, 9 Apr 2018 12:59:14 +0000 (14:59 +0200)]
Modifying cmake TA devkit to be more similar to other TEF backends.

Change-Id: If6930c90e575345c80f7f7a3f5201dfd5e7955f5

6 years agoRelease 0.0.3 76/187676/1 submit/tizen/20180828.110226
Igor Kotrasinski [Mon, 27 Aug 2018 12:16:49 +0000 (14:16 +0200)]
Release 0.0.3

* New version of TA Package Manager
* tee_internal_api.h fixes to bring it back in line with existing code
* Fixes to logging system
* Turn tef-simulator-log to a shared library
* Split TEEStub to a static stub and a shared implementation
* Fixes to TEE::System label usage, add a debug proxy daemon for TA debugging
* Bugfixes

Change-Id: I6cb5d252541ce70223961907284cb4216a3aa4fd
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoRework port listening timeout 13/185913/3
Igor Kotrasinski [Thu, 2 Aug 2018 10:25:26 +0000 (12:25 +0200)]
Rework port listening timeout

Apparently passing in lambda with automatic storage duration to boost::spawn
causes UB. Use a static method instead and make sure to cancel it properly
after we're done listening.

Change-Id: Ia3817a82fba6150690879d6839b8466e4072a3bb
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoImprove logging for socket forwarding 12/185912/3
Igor Kotrasinski [Thu, 2 Aug 2018 08:19:49 +0000 (10:19 +0200)]
Improve logging for socket forwarding

Change-Id: I993d089b924ef71b91c604ff730d2621fbc31c32
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoAdd shell env var to gdbserver invocation 93/185693/3
Igor Kotrasinski [Thu, 21 Jun 2018 09:21:03 +0000 (11:21 +0200)]
Add shell env var to gdbserver invocation

Change-Id: I5506244a2c3e77561fa5a26d3c92d79d75191ee1
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoAdd status to TA exit log 92/185692/3
Igor Kotrasinski [Wed, 20 Jun 2018 10:47:00 +0000 (12:47 +0200)]
Add status to TA exit log

Change-Id: I67dad3dec4aed2ab6038c4e85cab891216df706c
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoImprove debug logging at debug TA launch 91/185691/3
Igor Kotrasinski [Wed, 1 Aug 2018 10:02:34 +0000 (12:02 +0200)]
Improve debug logging at debug TA launch

Change-Id: Idd0ea10a0e795c56c93fe4cc3139c6e340ede2e2
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoMake simdaemon use the new debugproxy 90/185690/3
Igor Kotrasinski [Wed, 1 Aug 2018 07:38:53 +0000 (09:38 +0200)]
Make simdaemon use the new debugproxy

Instead of running gdbserver to listen on a port, we run it in stdin/out mode
and replace the descriptor with the debugproxy socket fd.

Change-Id: Ifa06dd42d008a1efb4628061a0dee05cbc51ada9
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoTake local debugproxy socket from systemd 89/185689/2
Igor Kotrasinski [Fri, 20 Jul 2018 13:49:46 +0000 (15:49 +0200)]
Take local debugproxy socket from systemd

Change-Id: I468c80dcecd977afd762f103a27cedd00cec7621
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoGracefully shutdown debugproxy when sent SIGTERM 88/185688/2
Igor Kotrasinski [Fri, 20 Jul 2018 12:30:26 +0000 (14:30 +0200)]
Gracefully shutdown debugproxy when sent SIGTERM

Change-Id: Idfb58076028d9c78e2ac297927d99c2da75217b2
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoAdd boost runtime deps to spec 87/185687/2
Igor Kotrasinski [Fri, 20 Jul 2018 07:59:58 +0000 (09:59 +0200)]
Add boost runtime deps to spec

Change-Id: I132571ae35c0afba3b982c8ffebcc36647523a29
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoMove launching gdbserver to separate function 86/185686/2
Igor Kotrasinski [Thu, 19 Jul 2018 12:48:24 +0000 (14:48 +0200)]
Move launching gdbserver to separate function

Change-Id: Ic8adfc816b895ffbffb86eebe960fc80c73deb96
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoAdd logging to debugproxy 85/185685/1
Igor Kotrasinski [Fri, 20 Jul 2018 09:05:28 +0000 (11:05 +0200)]
Add logging to debugproxy

Change-Id: I2086948c9784c18d452c281372c221ee119ab2c4
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoInitial debugproxy version 84/185684/1
Igor Kotrasinski [Tue, 17 Jul 2018 11:53:47 +0000 (13:53 +0200)]
Initial debugproxy version

Change-Id: I0f426de44f5856fd082ea9685bdad17bd11a1d52
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoPut debugproxy in a systemd service 83/185683/1
Igor Kotrasinski [Tue, 10 Jul 2018 09:50:11 +0000 (11:50 +0200)]
Put debugproxy in a systemd service

Change-Id: I3813e9a2727333d3d7f8bd8f025bf262f1eda28f
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoAdd debugproxy stub 82/185682/1
Igor Kotrasinski [Tue, 10 Jul 2018 08:29:58 +0000 (10:29 +0200)]
Add debugproxy stub

Change-Id: Ifb3f5b0cee73f9d19cbdd08b8436de9c5d2e4bb1
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
6 years agoMove tef-simulator-helloworld to "System" domain 91/182091/1
Igor Kotrasinski [Tue, 19 Jun 2018 13:15:55 +0000 (15:15 +0200)]
Move tef-simulator-helloworld to "System" domain

As shared memory is still allocated client-side, CAs should be in System domain
so that the TA can read it.

Change-Id: Ie869082afe439fb7f2dd695a9644a649e72c0dac
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoFix BSD license name 42/177142/3
Zofia Grzelewska [Wed, 25 Apr 2018 16:58:24 +0000 (18:58 +0200)]
Fix BSD license name

Change BSD to BSD-3-Clause

Change-Id: If9f3ac03a8b367ba9d48596daf3d02f36ab67d49

7 years agoUse correct enum types in log.h 50/181150/1
Igor Kotrasinski [Fri, 8 Jun 2018 13:28:31 +0000 (15:28 +0200)]
Use correct enum types in log.h

Change-Id: If14013829c7ce55fc53e669b11475e977aef6be3
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRewrite conversion from UUID to string 46/180946/1
Igor Kotrasinski [Wed, 6 Jun 2018 11:44:48 +0000 (13:44 +0200)]
Rewrite conversion from UUID to string

Fixes an issue with strtol not specifying base and makes all conversions use
std functions.

Change-Id: I3e525f3a58ab40d768357ebb6cca77224885cdab
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoFix copying read commands via cast to string 45/180945/1
Igor Kotrasinski [Wed, 6 Jun 2018 08:09:41 +0000 (10:09 +0200)]
Fix copying read commands via cast to string

Change-Id: Ie4dff5affd95bcd59694924922d1b01f3123a3de
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoGive helloworld TA a System::TEF label 17/180517/2
Igor Kotrasinski [Wed, 30 May 2018 07:47:53 +0000 (09:47 +0200)]
Give helloworld TA a System::TEF label

Fixes tef-simulator not able to run the helloworld TA after assigning it a
System::TEF label.

Change-Id: Ib87d6bb4a8c77e48d19a08826d212e9d46d477f2
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoSplit TEEStub into a stub and an implementation 09/179609/3
Igor Kotrasinski [Thu, 10 May 2018 08:41:33 +0000 (10:41 +0200)]
Split TEEStub into a stub and an implementation

In order to avoid tying a TA to specific client versions, split TEEStub into a
minimal stub with an entry point and a shared implementation.

Change-Id: Iefa4b91fc72df07abe117271d75d56a76df49b11
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoChange tef-simulator-log to shared library 08/179608/3
Igor Kotrasinski [Thu, 10 May 2018 07:59:19 +0000 (09:59 +0200)]
Change tef-simulator-log to shared library

Change-Id: Iac5753b956d8498d28db492a7a721c008ba5c0dd
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRemove unused log macros 07/179607/3
Igor Kotrasinski [Wed, 9 May 2018 08:46:39 +0000 (10:46 +0200)]
Remove unused log macros

Change-Id: I78eb5905670033eff493cc300570cc085443393a
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoReturn logged length in TA logger function 06/179606/3
Igor Kotrasinski [Tue, 8 May 2018 12:43:16 +0000 (14:43 +0200)]
Return logged length in TA logger function

Change-Id: I93f93761298adc2791d9ac3c3cf6bd41040e8e26
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRestore support for TA logging and debug.h header 05/179605/3
Igor Kotrasinski [Tue, 8 May 2018 12:01:43 +0000 (14:01 +0200)]
Restore support for TA logging and debug.h header

Change-Id: I796839c17203b4898a9f82595d656b573916b715
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoAdd tag argument to PrintLog 04/179604/3
Igor Kotrasinski [Tue, 8 May 2018 11:48:38 +0000 (13:48 +0200)]
Add tag argument to PrintLog

Change-Id: Iaeb628d2457a1e54a7636c7b7527de39a6eadf57
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRename module enum elements to avoid conflicts 03/179603/3
Igor Kotrasinski [Tue, 8 May 2018 10:17:35 +0000 (12:17 +0200)]
Rename module enum elements to avoid conflicts

Change-Id: Ie65e88f0956ce133e3cfcf6ac9d6fde65fcae628
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoClean up simulator logging levels 02/179602/3
Igor Kotrasinski [Tue, 8 May 2018 08:23:35 +0000 (10:23 +0200)]
Clean up simulator logging levels

Share log levels with log_level.h, refactor logging function.

Change-Id: I5b05b6e37bb631609794ed05082aac13a4707a39
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoUnconditionally compile main log function 00/179600/3
Igor Kotrasinski [Mon, 30 Apr 2018 09:42:17 +0000 (11:42 +0200)]
Unconditionally compile main log function

The log function will be used by TAs as well, so we want to conditionally
compile only the part for simulator logging. Add a proxy method to logging that
evaluates depending on _LOGGING macro and always compile the logging function
underneath.

Change-Id: I468c932b697fc2a4064928ca2518992c9ab4e298
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoPort padding sanity checks from suprem 08/176808/4
Igor Kotrasinski [Mon, 23 Apr 2018 09:51:29 +0000 (11:51 +0200)]
Port padding sanity checks from suprem

Change-Id: Icee3e0f1e04ee874fd931ec0079a28f606ad9638
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRemove test printing code in CC_API.c 06/176806/3
Igor Kotrasinski [Mon, 23 Apr 2018 08:34:09 +0000 (10:34 +0200)]
Remove test printing code in CC_API.c

Change-Id: Ib97d136c6dae0803cb3de91587d1322024a1ee68
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoConsistently check for null TAFactory 05/176805/3
Igor Kotrasinski [Wed, 18 Apr 2018 13:13:39 +0000 (15:13 +0200)]
Consistently check for null TAFactory

Change-Id: Iffd615ba77c2291b553153273dce57198347e370
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRestore GPD_TEE_PROP file 04/176804/3
Igor Kotrasinski [Tue, 17 Apr 2018 11:58:53 +0000 (13:58 +0200)]
Restore GPD_TEE_PROP file

Change-Id: I2d1dea281d417f3e4ac474c88deaf445d37cb01f
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoFix hardcoded group name 03/176803/3
Igor Kotrasinski [Tue, 17 Apr 2018 09:55:05 +0000 (11:55 +0200)]
Fix hardcoded group name

Change-Id: I840f350c82ecc29623e69fbbeddd4e132a23754e
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoRestore tee_internal_api.h constness 02/176802/3
Igor Kotrasinski [Tue, 17 Apr 2018 09:46:11 +0000 (11:46 +0200)]
Restore tee_internal_api.h constness

The specification uses a [ctx] specifier, which should, but is not required to
use const. Revert to using const to match existing code use cases.

Change-Id: Ied65fb18e0e5f7fd32cd5a5219fb5ccaf2895e21
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoFix test to use (and cleanup at) single exit 01/176801/3
Igor Kotrasinski [Mon, 16 Apr 2018 13:29:30 +0000 (15:29 +0200)]
Fix test to use (and cleanup at) single exit

Change-Id: I9d49f17879c744c5d99a219d6825ef081b3f0e36
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoFix order of linked libraries 01/179601/3
Igor Kotrasinski [Mon, 7 May 2018 12:05:39 +0000 (14:05 +0200)]
Fix order of linked libraries

Fixes broken build when debug is enabled.

Change-Id: Ibb84ae714a49d91baa2317d56c8a18e1f6649ea1
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>
7 years agoMerge "Upload new version of TAPackageManager" into tizen accepted/tizen/unified/20180430.172406 submit/tizen/20180417.132437 submit/tizen/20180417.133115 submit/tizen/20180424.062711 submit/tizen/20180427.080428
r.tyminski [Tue, 17 Apr 2018 06:39:38 +0000 (06:39 +0000)]
Merge "Upload new version of TAPackageManager" into tizen

7 years agoUpload new version of TAPackageManager 87/175787/1
r.tyminski [Thu, 12 Apr 2018 08:22:34 +0000 (10:22 +0200)]
Upload new version of TAPackageManager

Change-Id: Idb92f039a132dca75e0ef9ef161f27c1e1cf2d56

7 years agoRelease 0.0.2 73/175773/2 accepted/tizen/unified/20180413.073549 submit/tizen/20180412.092951
Tomasz Swierczek [Thu, 12 Apr 2018 07:58:36 +0000 (09:58 +0200)]
Release 0.0.2

* access control change: use DAC (priv_tee_client) & System::TEF Smack domain for daemon
* make tef-simulator cynara-/security-manager- independent
* fixes to socket activation
* refactoring of big parts of the code, bug fixes

Change-Id: I2b36ce395dd82c02b61b2c33a3c47cffc6bd55e4

7 years agoReturn access denied when connect to socket fails with EACCES 40/174040/6
Zofia Grzelewska [Tue, 27 Mar 2018 11:54:18 +0000 (13:54 +0200)]
Return access denied when connect to socket fails with EACCES

When client cannot connect to simulator socket with error EACCES,
propagate this error to client using TEEC_ACCESS_DENIED.

Change-Id: I62d678a451f2d099ce314d6a059f8ec91f20d4af

7 years agoMake tef-simulator independent from Tizen : remove cynara 34/171834/10
Zofia Grzelewska [Tue, 6 Mar 2018 16:50:23 +0000 (17:50 +0100)]
Make tef-simulator independent from Tizen : remove cynara

Remove cynara usage and dependencies. As access control will
be done by outside DAC group and Smack label, there is no
more need of SecurityContext structure.

Change-Id: I6cc47903d4c844a880bf6786f245b2811fc9e946

7 years agoChange group and Smack label on socket and service 49/171849/6
Zofia Grzelewska [Wed, 7 Mar 2018 15:02:58 +0000 (16:02 +0100)]
Change group and Smack label on socket and service

Tef-simulator socket should have group connected with
tee.client privilege : priv_tee_client.
Also service process needs assigned additional label
System::TEF with socket using System IPIn label.

Change-Id: Ia5c85aaabdc221a84a8c47f8c5629b7491c7438c

7 years agoSet LibTEEC shm file group to the TEE group 53/173453/5
Igor Kotrasinski [Fri, 16 Mar 2018 10:16:57 +0000 (11:16 +0100)]
Set LibTEEC shm file group to the TEE group

Change-Id: Ic7ff46edb8662e955aa032c0a3a9d96fc88eca82
Signed-off-by: Igor Kotrasinski <i.kotrasinsk@partner.samsung.com>