| 3ddd5cd7 | 16-Jun-2021 |
liushiwei <liushiwei@eswin.com> |
lib: mbedtls: return TEE_ERROR_BAD_PARAMETERS on input data error
This change fixes Keymaster VTS if cryptolib uses libmedtls EncryptionOperationsTest, RsaPkcs1Success and EncryptionOperationsTest,
lib: mbedtls: return TEE_ERROR_BAD_PARAMETERS on input data error
This change fixes Keymaster VTS if cryptolib uses libmedtls EncryptionOperationsTest, RsaPkcs1Success and EncryptionOperationsTest, RsaOaepSuccess probabilistic failure. We should change error code from libmedtls to TEE_AsymmetricDecrypt. In the same scenario, the tomcrypt return value is eventually Converted to TEE_ERROR_BAD_PARAMETERS,and then pass the test. But mbedtls converted to TEE_ERROR_BAD_STATE, This causes TEE_AsymmetricDecrypt() to panic.
Signed-off-by: Liu Shiwei <liushiwei@eswin.com> Tested-by: Liu Shiwei <liushiwei@eswin.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Victor Chong <victor.chong@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 53154de7 | 03-Jun-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: fix range check in gen_malloc_add_pool()
Prior to this patch was the length of supplied buffer not checked accurately for very small buffer. This could result in an unexpected assert(): E/
libutils: fix range check in gen_malloc_add_pool()
Prior to this patch was the length of supplied buffer not checked accurately for very small buffer. This could result in an unexpected assert(): E/TC:0 0 assertion 'start < end' failed at lib/libutils/isoc/bget_malloc.c:775 <gen_malloc_add_pool> E/TC:0 0 Panic at core/kernel/assert.c:28 <_assert_break>
So fix this with a proper test.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b2ac1d0f | 21-May-2021 |
Sergiy Kibrik <Sergiy_Kibrik@epam.com> |
synquacer: rng-pta: move rng_pta_client.h to common path
Header is platform independent and can be used by generic RNG PTA.
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com> Reviewed-by: Jerome
synquacer: rng-pta: move rng_pta_client.h to common path
Header is platform independent and can be used by generic RNG PTA.
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c04a96a4 | 13-May-2021 |
lubing <lubing@eswin.com> |
core: Fix memory leaks in sm2 of Mbedtls lib
When enable mbedtls in optee-os , xtest run twice will be fail. Memory leakage exists in three functions. 1. grp and mpi in sm2_mbedtls_pke_encrypt 2. gr
core: Fix memory leaks in sm2 of Mbedtls lib
When enable mbedtls in optee-os , xtest run twice will be fail. Memory leakage exists in three functions. 1. grp and mpi in sm2_mbedtls_pke_encrypt 2. grp in sm2_mbedtls_dsa_sign 3. grp in sm2_mbedtls_dsa_verify
Fixes: c84eee6397bb ("core: add support for SM2 using MBed TLS") Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: lubing <lubing@eswin.com>
show more ...
|
| b5fed9f7 | 03-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: sys/queue.h: add SLIST_FOREACH_SAFE()
Import macro SLIST_FOREACH_SAFE from FreeBSD.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissie
libutils: sys/queue.h: add SLIST_FOREACH_SAFE()
Import macro SLIST_FOREACH_SAFE from FreeBSD.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| fb19e98e | 25-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: enable FF-A with SPM Core at S-EL2
This enables support for FF-A with SPM Core at S-EL2 in a secure hypervisor while OP-TEE is running at S-EL1 as a SP. This configuration is also know as "S-E
core: enable FF-A with SPM Core at S-EL2
This enables support for FF-A with SPM Core at S-EL2 in a secure hypervisor while OP-TEE is running at S-EL1 as a SP. This configuration is also know as "S-EL2 SPMC" in the FFA specification.
Compile with CFG_CORE_SEL2_SPMC=y
Note that this is an experimental feature, ABIs etc may have incompatible changes.
This depends on using the FF-A v4 patchset in the Linux kernel.
Reviewed-by: Jelle Sels <jelle.sels@arm.com> Co-developed-by: Marc Bonnici <marc.bonnici@arm.com> Signed-off-by: Marc Bonnici <marc.bonnici@arm.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 568fc276 | 25-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
arm64: add read_cntvct()
Adds read_cntvct() to read Counter-timer Virtual Count register.
Note that arm32 already have this function.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-of
arm64: add read_cntvct()
Adds read_cntvct() to read Counter-timer Virtual Count register.
Note that arm32 already have this function.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c6e827c0 | 25-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
Rename to barrier_read_counter_timer()
Renames barrier_read_cntpct() to barrier_read_counter_timer() to use a neutral name for the counter.
With SPMC at S-EL2 OP-TEE will be virtualized and must us
Rename to barrier_read_counter_timer()
Renames barrier_read_cntpct() to barrier_read_counter_timer() to use a neutral name for the counter.
With SPMC at S-EL2 OP-TEE will be virtualized and must use CNTVCT instead of CNTPCT while the old physical OP-TEE must continue to use CNTPCT.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b0a1c250 | 05-Apr-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: pta: scmi: new interface to REE SCMI agent
Adds a PTA interface to REE SCMI agents to get SCMI message communication channel for processing in OP-TEE SCMI server.
Currently implement supports
core: pta: scmi: new interface to REE SCMI agent
Adds a PTA interface to REE SCMI agents to get SCMI message communication channel for processing in OP-TEE SCMI server.
Currently implement supports for a SCMI server built with CFG_SCMI_MSG_SMT=y. The implementation is made so that an alternate SCMI server implementation can added.
Client gets SCMI channel capabilities with PTA_SCMI_CMD_CAPABILITIES. Client gets a handle for an SCMI channel with command PTA_SCMI_CMD_GET_CHANNEL_HANDLE. Client pushes SCMI messages with command PTA_SCMI_CMD_PROCESS_SMT_CHANNEL or PTA_SCMI_CMD_PROCESS_SMT_CHANNEL_MESSAGE.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c31a368d | 26-Mar-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
libutee: include: fix typo in pta_invoke_tests.h
In PTA "invoke test", the AES performance test command takes as argument key size value as bits instead of bytes. Fix typo in comment.
Signed-off-by
libutee: include: fix typo in pta_invoke_tests.h
In PTA "invoke test", the AES performance test command takes as argument key size value as bits instead of bytes. Fix typo in comment.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 36905f94 | 22-Apr-2021 |
Guido Vranken <guidovranken@gmail.com> |
libmbedtls: Use single-line string literals.
Signed-off-by: Guido Vranken <guidovranken@gmail.com> [Cherry-pick upstream commit 962e4ee4a6b3, add libmbedtls: prefix] Signed-off-by: Jerome Forissier
libmbedtls: Use single-line string literals.
Signed-off-by: Guido Vranken <guidovranken@gmail.com> [Cherry-pick upstream commit 962e4ee4a6b3, add libmbedtls: prefix] Signed-off-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 77bdbf67 | 22-Apr-2021 |
Guido Vranken <guidovranken@gmail.com> |
libmbedtls: Prevent triggering Clang 12 -Wstring-concatenation warning
Wrap multi-line string literals in parentheses to prevent a Clang 12 -Wstring-concatenation warning (activated by -Wall), which
libmbedtls: Prevent triggering Clang 12 -Wstring-concatenation warning
Wrap multi-line string literals in parentheses to prevent a Clang 12 -Wstring-concatenation warning (activated by -Wall), which caused the build to fail.
Fixes https://github.com/ARMmbed/mbedtls/issues/3586
Signed-off-by: Guido Vranken <guidovranken@gmail.com> [Cherry-pick upstream commit 027fe00d2e32, add libmbedtls: prefix] Signed-off-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 44a8a0cf | 22-Apr-2021 |
Jerome Forissier <jerome@forissier.org> |
libutils: asm.S: introduce WEAK_FUNC
Adds a WEAK_FUNC macro which does the same as FUNC but defines a weak symbol rather than a global one.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Re
libutils: asm.S: introduce WEAK_FUNC
Adds a WEAK_FUNC macro which does the same as FUNC but defines a weak symbol rather than a global one.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 914103c1 | 22-Apr-2021 |
Jerome Forissier <jerome@forissier.org> |
libutils: asm.S: reorder macro definitions
Define function macros first, then data macros. No functional change.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere
libutils: asm.S: reorder macro definitions
Define function macros first, then data macros. No functional change.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bbfe5da7 | 24-Mar-2021 |
Jerome Forissier <jerome@forissier.org> |
core: libmbedtls: build only necessary files
When building MBed TLS source files for use in the TEE core, some files are currently compiled which are not used in the final link. This wastes some res
core: libmbedtls: build only necessary files
When building MBed TLS source files for use in the TEE core, some files are currently compiled which are not used in the final link. This wastes some resources (build time and disk space), although not much; but it also makes it less clear what is actually used by the core.
Introduce a reduced source file list in lib/libmbedtls/sub.mk when the library is built for the core.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 13218059 | 01-Mar-2021 |
Matthieu BERTIN <matthieu.bertin@viaccess-orca.com> |
libutee: fix memory leak in bigint_binary_mod()
The modulus variable (mpi_n) in bigint_binary_mod() is never released, causing a memory leak in TEE_BigIntAddMod(), TEE_BigIntSubMod(), TEE_BigIntMulM
libutee: fix memory leak in bigint_binary_mod()
The modulus variable (mpi_n) in bigint_binary_mod() is never released, causing a memory leak in TEE_BigIntAddMod(), TEE_BigIntSubMod(), TEE_BigIntMulMod() and TEE_BigIntSquareMod(). Add the missing call.
Signed-off-by: Matthieu BERTIN <matthieu.bertin@viaccess-orca.com> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 2138a6f8 | 03-Mar-2021 |
Stefan Schmidt <snst@meek.de> |
libutee: add NULL pointer check in TEE_OpenPersistentObject()
Fix missing test on user object handle output reference in TEE_OpenPersistentObject().
Signed-off-by: Stefan Schmidt <snst@meek.de> Rev
libutee: add NULL pointer check in TEE_OpenPersistentObject()
Fix missing test on user object handle output reference in TEE_OpenPersistentObject().
Signed-off-by: Stefan Schmidt <snst@meek.de> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| dea9063e | 19-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: check srcLen in TEE_CipherDoFinal()
Adds another check of srcLen in TEE_CipherDoFinal() before calling tee_buffer_update() to make sure that we don't dereference destLen when it's NULL.
Th
libutee: check srcLen in TEE_CipherDoFinal()
Adds another check of srcLen in TEE_CipherDoFinal() before calling tee_buffer_update() to make sure that we don't dereference destLen when it's NULL.
This fixes coverity scan: CID 1501811 (#1 of 1): Dereference after null check (FORWARD_NULL)
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b6fa905f | 19-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: remove redundant NULL check in TEE_BigIntComputeExtendedGcd()
The gcd parameter passed to TEE_BigIntComputeExtendedGcd() must not be NULL so skip the unnecessary NULL check.
This fixes cov
libutee: remove redundant NULL check in TEE_BigIntComputeExtendedGcd()
The gcd parameter passed to TEE_BigIntComputeExtendedGcd() must not be NULL so skip the unnecessary NULL check.
This fixes coverity scan: CID 1501842 (#1 of 1): Dereference after null check (FORWARD_NULL)
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b68bcfeb | 19-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: add coverity note to TEE_Panic()
Coverity scans emits false positive "Dereference after null check" errors because it doesn't understand that TEE_Panic() doesn't return. Fix this by adding
libutee: add coverity note to TEE_Panic()
Coverity scans emits false positive "Dereference after null check" errors because it doesn't understand that TEE_Panic() doesn't return. Fix this by adding a __coverity_panic__() at the end of the function.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 90135cea | 11-Feb-2021 |
Alexander Zakharov <uglym8@gmail.com> |
core: libmbedtls: CMAC: remove code duplication
Use common code for AES CMAC and 3DES CMAC
Signed-off-by: Alexander Zakharov <uglym8@gmail.com> Reviewed-by: Jerome Forissier <jerome@forissier.org>
core: libmbedtls: CMAC: remove code duplication
Use common code for AES CMAC and 3DES CMAC
Signed-off-by: Alexander Zakharov <uglym8@gmail.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| eee637e7 | 10-Feb-2021 |
Alexander Zakharov <uglym8@gmail.com> |
Add 3DES CMAC implementation
CMAC is a Cipher-Based MAC that improves some of the security deficiencies found in CBC-MAC. It is described in NIST SP800-38B as a mode of operation for approved symmet
Add 3DES CMAC implementation
CMAC is a Cipher-Based MAC that improves some of the security deficiencies found in CBC-MAC. It is described in NIST SP800-38B as a mode of operation for approved symmetric block chipers, namely AES and TDEA.
CMAC has similar use cases and security guarantees as HMAC, with the difference that it uses a different primitive (symmetric cipher instead of hash function). CMAC may be appropriate for information systems in which an approved block cipher is more readily available than an approved hash function.
Commonly it is used for symmetric key diversification (ASC X9 TR 31-2018), data integrity assurance (ICV).
CMAC is public domain.
OP-TEE core already supports for AES CMAC, but not TDEA CMAC. This commit adds TDEA CMAC support.
Signed-off-by: Alexander Zakharov <uglym8@gmail.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> [jf: wrap commit description at 75 characters] Signed-off-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| b6ca7e5d | 10-Feb-2021 |
Alexander Zakharov <uglym8@gmail.com> |
core: libmbedtls: add 3DES CMAC implementation
Add 3DES CMAC (NIST SP800-38B).
Signed-off-by: Alexander Zakharov <uglym8@gmail.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Et
core: libmbedtls: add 3DES CMAC implementation
Add 3DES CMAC (NIST SP800-38B).
Signed-off-by: Alexander Zakharov <uglym8@gmail.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> [jf: add commit description] Signed-off-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| c84eee63 | 27-Jan-2021 |
Jerome Forissier <jerome@forissier.org> |
core: add support for SM2 using MBed TLS
The SM2 algorithms (PKE, KEP and DSA) are currently implemented using LibTomCrypt. They are automatically disabled when MBed TLS is selected as the core cryp
core: add support for SM2 using MBed TLS
The SM2 algorithms (PKE, KEP and DSA) are currently implemented using LibTomCrypt. They are automatically disabled when MBed TLS is selected as the core crypto library (that is, when CFG_CRYPTOLIB_NAME=mbedtls CFG_CRYPTOLIB_DIR=lib/libmbedtls).
This commit removes this restriction by porting the relevant files (core/lib/libtomcrypt/sm2-{dsa,kep,pke}.c) over to the MBed TLS API in lib/libmbedtls/core.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 9fc2442c | 22-Jan-2021 |
Jerome Forissier <jerome@forissier.org> |
libmbedtls: add SM2 curve
When MBEDTLS_ECP_DP_SM2_ENABLED is set, adds support for the ECC curve defined for the Chinese SM2 algorithm (G/MT 0003 Part 5, [1]).
Link: [1] http://www.gmbz.org.cn/uplo
libmbedtls: add SM2 curve
When MBEDTLS_ECP_DP_SM2_ENABLED is set, adds support for the ECC curve defined for the Chinese SM2 algorithm (G/MT 0003 Part 5, [1]).
Link: [1] http://www.gmbz.org.cn/upload/2018-07-24/1532401863206085511.pdf Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|