| 33790cc1 | 10-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct bignum_ops with function interface
Adds crypto_bignum_*() replacing struct bignum_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Car
Replace struct bignum_ops with function interface
Adds crypto_bignum_*() replacing struct bignum_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8875ce46 | 10-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct authenc_ops with function interface
Adds crypto_authenc_*() replacing struct authenc_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne
Replace struct authenc_ops with function interface
Adds crypto_authenc_*() replacing struct authenc_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e9eaba5c | 09-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct mac_ops with function interface
Adds mac_cipher_get_ctx_size(), mac_cipher_init(), mac_cipher_update() and mac_cipher_final() replacing struct mac_ops in crypto_ops.
Acked-by: Jerom
Replace struct mac_ops with function interface
Adds mac_cipher_get_ctx_size(), mac_cipher_init(), mac_cipher_update() and mac_cipher_final() replacing struct mac_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 82d91db1 | 09-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct cipher_ops with function interface
Adds crypto_cipher_get_ctx_size(), crypto_cipher_init(), crypto_cipher_update(), crypto_cipher_final() and crypto_cipher_get_block_size() replacing
Replace struct cipher_ops with function interface
Adds crypto_cipher_get_ctx_size(), crypto_cipher_init(), crypto_cipher_update(), crypto_cipher_final() and crypto_cipher_get_block_size() replacing struct cipher_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b887bd8f | 09-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct hash_ops with function interface
Adds crypto_hash_get_ctx_size(), crypto_hash_init(), crypto_hash_update() and crypto_hash_final() replacing struct hash_ops in crypto_ops.
Acked-by:
Replace struct hash_ops with function interface
Adds crypto_hash_get_ctx_size(), crypto_hash_init(), crypto_hash_update() and crypto_hash_final() replacing struct hash_ops in crypto_ops.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8e81e2f5 | 10-Nov-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
ltc: fix ccm_process() bug when input buffer is longer than 256 bytes
Upstream commit 08dee2735956 ("fixes #323 ccm_process fails to process input buffer longer than 256").
Link: https://github.com
ltc: fix ccm_process() bug when input buffer is longer than 256 bytes
Upstream commit 08dee2735956 ("fixes #323 ccm_process fails to process input buffer longer than 256").
Link: https://github.com/libtom/libtomcrypt/pull/326 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 36a063ef | 03-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Replace struct prng_ops with function interface
Adds crypto_rng_add_entropy() and crypto_rng_read() replacing struct prng_ops in crypto_ops.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.o
Replace struct prng_ops with function interface
Adds crypto_rng_add_entropy() and crypto_rng_read() replacing struct prng_ops in crypto_ops.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 93d3c451 | 08-Sep-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: pager: ltc: prng: add entropy to the AE key for paged TAs
This commit fixes a vulnerability (OP-TEE-2017-0001) that affects platforms built with CFG_WITH_SOFTWARE_PRNG=y. Note however that pla
core: pager: ltc: prng: add entropy to the AE key for paged TAs
This commit fixes a vulnerability (OP-TEE-2017-0001) that affects platforms built with CFG_WITH_SOFTWARE_PRNG=y. Note however that platforms that also set CFG_SECURE_TIME_SOURCE_REE=y are still vulnerable, unless they provide an implementation of plat_prng_add_jitter_entropy_norpc().
Adds some entropy to the PRNG used to generate the AE key for paged user TAs.
Link: https://op-tee.org/security-advisories/ Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 12af5db6 | 01-Sep-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: ltc: prng: make sure some entropy is used immediately
This commit fixes a vulnerability (OP-TEE-2017-0001) that affects platforms built with CFG_WITH_SOFTWARE_PRNG=y. Note however that platfor
core: ltc: prng: make sure some entropy is used immediately
This commit fixes a vulnerability (OP-TEE-2017-0001) that affects platforms built with CFG_WITH_SOFTWARE_PRNG=y. Note however that platforms that also set CFG_SECURE_TIME_SOURCE_REE=y are still vulnerable, unless they provide an implementation of plat_prng_add_jitter_entropy_norpc().
The LibTomCrypt API is not used properly in the current PRNG initialization code (tee_ltc_prng_init()). We have:
prng->start(); prng->ready(); plat_prng_add_jitter_entropy_norpc();
...and at this point, the PRNG is assumed to be ready to provide random data through rng->read().
That is broken, because there is no guarantee that the added entropy will have an immediate effect on the output of rng->read(). In fact, it usually will NOT. For instance, the default software PRNG used in OP-TEE (Fortuna) re-seeds its PRNG generator from the entropy pools only once every ten reads. So we're effectively using an un-seeded generator for the first ten calls to prng->read(). Practically it means that the same byte sequences are generated after each boot and, for the Fortuna PRNG, until the 11th call to the PRNG read function. At the Internal Core API level, this affects TEE_GenerateRandom() and TEE_GenerateKey().
The fix is simple: prng->ready() seeds the generator from the pools, so by moving plat_prng_add_jitter_entropy_norpc() before prng->ready(), we can ensure that some amount of entropy is used immediately.
Fixes: https://github.com/OP-TEE/optee_os/issues/1730 Link: https://op-tee.org/security-advisories Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 93b0a701 | 21-Mar-2017 |
Joakim Bech <joakim.bech@linaro.org> |
ltc: Enable RSA_CRT_HARDENING and RSA_CRT_BLINDING
Enable the hardening flags by default. This should make it robust to the Bellcore attack when using RSA with CRT.
Fixes: OP-TEE-2016-0003 which wa
ltc: Enable RSA_CRT_HARDENING and RSA_CRT_BLINDING
Enable the hardening flags by default. This should make it robust to the Bellcore attack when using RSA with CRT.
Fixes: OP-TEE-2016-0003 which was reported by Applus+ Laboratories.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey, GP) Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260, GP)
show more ...
|
| 13c9b831 | 13-Feb-2017 |
Joakim Bech <joakim.bech@linaro.org> |
ltc: Implement mp_rand for mpa_desc
When enabling the flag LTC_RSA_BLINDING the code uses the mp_rand() function, which isn't implemented for the mpa_desc descriptor. Implement it as rand() in mpa_d
ltc: Implement mp_rand for mpa_desc
When enabling the flag LTC_RSA_BLINDING the code uses the mp_rand() function, which isn't implemented for the mpa_desc descriptor. Implement it as rand() in mpa_desc and mpa_get_random_digits() in libmpa.
Fixes: OP-TEE-2016-0003 which was reported by Applus+ Laboratories.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey, GP) Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260, GP)
show more ...
|
| a4036e16 | 22-Mar-2017 |
Joakim Bech <joakim.bech@linaro.org> |
ltc: fix formatting related to exptmod
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@lin
ltc: fix formatting related to exptmod
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey, GP) Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260, GP)
show more ...
|
| 0014a941 | 13-Feb-2017 |
Joakim Bech <joakim.bech@linaro.org> |
ltc: remove LTC_LINARO_FIX_RSAWITHOUTCRT
LTC_LINARO_FIX_RSAWITHOUTCRT is used to handle the case where the CRT optimized algorithm cannot be used because the optimized parameters are missing. In the
ltc: remove LTC_LINARO_FIX_RSAWITHOUTCRT
LTC_LINARO_FIX_RSAWITHOUTCRT is used to handle the case where the CRT optimized algorithm cannot be used because the optimized parameters are missing. In the official LibTomCrypt tree, there is an official fix for this.
Please see commits (official LibTomCrypt tree): 01f184540232 ("harden RSA CRT by implementing the proposed countermeasure from ch. 1.3 of [1]") a6e89d58d4fb ("RSA in CRT optimization parameters are empty") 2bb3f0246f65 ("RSA in case CRT optimization parameters are not populated")
Those patches were brought into OP-TEE with this patch a50cb361d9e5 ("ltc: sync from official develop branch")
And therefore there is no need to keep the LTC_LINARO_FIX_RSAWITHOUTCRT any longer, hence this patch removes the flag and the code related to that particular flag.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey, GP) Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260, GP)
show more ...
|
| 43d269aa | 01-Jun-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
ltc: fix 64-bit warning
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 455856d4 | 19-Apr-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Remove SQL-FS
With recent developments in REE-FS SQL-FS has become redundant. This patch removes SQL-FS.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jerome Forissier <jerome.forissi
Remove SQL-FS
With recent developments in REE-FS SQL-FS has become redundant. This patch removes SQL-FS.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b72716ce | 01-Mar-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: prng: Don't try to read REE time when it's not possible
The commit referenced below extends entropy gathering to two locations where it is unfortunately not OK to invoke Normal World through R
core: prng: Don't try to read REE time when it's not possible
The commit referenced below extends entropy gathering to two locations where it is unfortunately not OK to invoke Normal World through RPC:
1. tee_ltc_prng_init(), because at this point the RPC subsystem has not yet been initialized, 2. rpc_cmd_nolock(), because doing so would cause recursion and would be inefficient (doubling the number of RPC calls).
The problem is: if CFG_SECURE_TIME_SOURCE_REE=y and if the platform does not override plat_prng_add_jitter_entropy(), the function will end up calling the RPC service where it's not permitted and the TEE will crash.
This commit introduces plat_prng_add_jitter_entropy_norpc() and provides a default implementation which does nothing if the time source is the REE, thus fixing the issue while still allowing platform code to implement a specific behavior.
Fixes: 82f97f19fe2d ("prng: call plat_prng_add_jitter_entropy() at PRNG init and before NW RPC") Reported-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
[Review] core: prng: Don't try to read REE time when it's not possible
Remove useless return.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 82f97f19 | 26-Jan-2017 |
Andy Green <andy@warmcat.com> |
prng: call plat_prng_add_jitter_entropy() at PRNG init and before NW RPC
This patch adds the new platform jitter collection API to be called first at PRNG init, and subsequently on every RPC.
Signe
prng: call plat_prng_add_jitter_entropy() at PRNG init and before NW RPC
This patch adds the new platform jitter collection API to be called first at PRNG init, and subsequently on every RPC.
Signed-off-by: Andy Green <andy@warmcat.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 6dfe9e12 | 31-Jan-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ltc: fix undefined left shift
Fixes left shift out of bounds (undefined behavior) in twoexpt().
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens
core: ltc: fix undefined left shift
Fixes left shift out of bounds (undefined behavior) in twoexpt().
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ef4bc451 | 09-Dec-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ltc: fix gcc6 warnings
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 09fc0424 | 09-Nov-2016 |
Emmanuel MICHEL <emmanuel.michel@st.com> |
ltc: Fix clear big number in TEE wrapper
Reset a transient object clear datas of this object. For big numbers, the corresponding method bn_clear reset the underlying struct mpa_numbase_struct by fil
ltc: Fix clear big number in TEE wrapper
Reset a transient object clear datas of this object. For big numbers, the corresponding method bn_clear reset the underlying struct mpa_numbase_struct by filling of zeros its data. However this struct has metadata, and the call of memset is done on the begin on the structure, so on the metadata + part of the data, instead of being done only of the datas. Fix by zero only datas.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Emmanuel MICHEL <emmanuel.michel@st.com> (STM platform) Signed-off-by: Emmanuel MICHEL <emmanuel.michel@st.com>
show more ...
|
| 8dceff9b | 21-Sep-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove CFG_ENC_FS
Removes CFG_ENC_FS, encryption is always enabled in the file systems from now on.
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64 GP) Tested-by: Etien
core: remove CFG_ENC_FS
Removes CFG_ENC_FS, encryption is always enabled in the file systems from now on.
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64 GP) Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (qemu_v8/b2260, reefs/sqlfs, gp testsuite) Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| caabd5fe | 17-Oct-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
crypto: ltc: add missing CBC_MAC algorithms to cipher_final()
Make sure that all the code paths leading to cipher_final() are properly handled. Then, the 'default:' case cannot occur; add an assert(
crypto: ltc: add missing CBC_MAC algorithms to cipher_final()
Make sure that all the code paths leading to cipher_final() are properly handled. Then, the 'default:' case cannot occur; add an assert() there. Fixes an assertion failure with xtest 4002 when CFG_TEE_CORE_DEBUG=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Zeng Tao <prime.zeng@hisilicon.com> Fixes: 287359f44187 ("crypto: fix incorrect algo passed to cipher.final()") Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Zeng Tao <prime.zeng@hisilicon.com>
show more ...
|
| 287359f4 | 22-Sep-2016 |
lackan <liang.guanchao@linaro.org> |
crypto: fix incorrect algo passed to cipher.final()
Fix an error in function tee_svc_cipher_update_helper, and add assert in function cipher_final to prevent it being called by an algorithm that is
crypto: fix incorrect algo passed to cipher.final()
Fix an error in function tee_svc_cipher_update_helper, and add assert in function cipher_final to prevent it being called by an algorithm that is not a symmetric cipher.
Signed-off-by: lackan <liang.guanchao@linaro.org> [Reword commit subject] Signed-off-by: Jerome Forissier <jerome.forissier@.linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 983d0211 | 14-Sep-2016 |
Matt Ma <matt.ma@linaro.org> |
ltc: remove test related source files
Test related source files have not been built into OP-TEE image all the time, so we remove them permanently.
Signed-off-by: Matt Ma <matt.ma@linaro.org> Review
ltc: remove test related source files
Test related source files have not been built into OP-TEE image all the time, so we remove them permanently.
Signed-off-by: Matt Ma <matt.ma@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| a50cb361 | 28-Jul-2016 |
Matt Ma <matt.ma@linaro.org> |
ltc: sync from official develop branch
All source files under src directory and header files under include directory have been synced, but have not added all macros newly added in official develop b
ltc: sync from official develop branch
All source files under src directory and header files under include directory have been synced, but have not added all macros newly added in official develop branch and the last synced SHA1 in official develop branch is 6ad52252688bb34f90b5e79da4830a927e87b81f
Signed-off-by: Matt Ma <matt.ma@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Reviewed-by: David Brown <david.brown@linaro.org>
show more ...
|