| 1c025012 | 26-Oct-2022 |
Simon Ott <simon.ott@aisec.fraunhofer.de> |
libmbedtls: mbedtls_config_uta.h: enable chacha20 and chachapoly support
Extend the mbedtls UTA configuration to support the ciphers chacha20 and chachapoly for usage in custom TAs, as they are supp
libmbedtls: mbedtls_config_uta.h: enable chacha20 and chachapoly support
Extend the mbedtls UTA configuration to support the ciphers chacha20 and chachapoly for usage in custom TAs, as they are supported by common protocols, such as TLS1.3, IPsec or WireGuard
Signed-off-by: Simon Ott <simon.ott@aisec.fraunhofer.de> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 23ef3871 | 26-Oct-2022 |
Simon Ott <simon.ott@aisec.fraunhofer.de> |
libmbedtls: fix cipher_wrap.c for chacha20 and chachapoly
For chacha20 and chachapoly, the *_ctx_clone() function is missing and therefore the wrong function pointers are assigned to .ctx_clone_func
libmbedtls: fix cipher_wrap.c for chacha20 and chachapoly
For chacha20 and chachapoly, the *_ctx_clone() function is missing and therefore the wrong function pointers are assigned to .ctx_clone_func and .ctx_free_func when MBEDTLS_CHACHA20_C or MBEDTLS_CHACHAPOLY_C is enabled.
Signed-off-by: Simon Ott <simon.ott@aisec.fraunhofer.de> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 4ddaad52 | 12-Aug-2022 |
Lars Persson <larper@axis.com> |
core: mbedtls: Add ECC signature size check
The ECC signature implementation must check that the output buffer has sufficient space to store the signature. This check was missing in the mbedtls vers
core: mbedtls: Add ECC signature size check
The ECC signature implementation must check that the output buffer has sufficient space to store the signature. This check was missing in the mbedtls version of ecc_sign.
Fixes: ad6cfae7c0 ("libmbedtls: support mbedtls ECC function") Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Lars Persson <lars.persson@axis.com>
show more ...
|
| 613122b1 | 09-Mar-2022 |
Jerome Forissier <jerome@forissier.org> |
core: mbedtls: sm2: fix SM2 key generation
ecc_get_keysize() lacks a case for TEE_ECC_CURVE_SM2, which prevents the generation of a SM2 key pair. Fix this.
Signed-off-by: Jerome Forissier <jerome@f
core: mbedtls: sm2: fix SM2 key generation
ecc_get_keysize() lacks a case for TEE_ECC_CURVE_SM2, which prevents the generation of a SM2 key pair. Fix this.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5e5dcaf2 | 09-Mar-2022 |
Jerome Forissier <jerome@forissier.org> |
core: mbedtls: add curve type to domain parameter group ID conversion
MBedTLS functions mbedtls_ecp_group_load() and mbedtls_ecdsa_genkey() take a group ID parameter of type mbedtls_ecp_group_id whi
core: mbedtls: add curve type to domain parameter group ID conversion
MBedTLS functions mbedtls_ecp_group_load() and mbedtls_ecdsa_genkey() take a group ID parameter of type mbedtls_ecp_group_id which is an enum (MBEDTLS_ECP_DP_SECP192R1, etc.). The code in lib/libmbedtls/core/ecc.c incorrectly passes a uint32_t TEE curve ID instead (TEE_ECC_CURVE_NIST_P192, etc.). By chance the values happen to be the same for all the NIST curves, but not for SM2. Fix that by introducing a conversion function.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@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 ...
|
| 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 ...
|
| 9c525fe4 | 03-Feb-2021 |
Jerome Forissier <jerome@forissier.org> |
libmbedtls: core: fix copy of AES context
The mbedtls_aes_context type cannot generally be copied with a simple assignment (dst = src) because it contains a pointer field ('rk') which needs to point
libmbedtls: core: fix copy of AES context
The mbedtls_aes_context type cannot generally be copied with a simple assignment (dst = src) because it contains a pointer field ('rk') which needs to point to the 'buf' field. The current code is incorrect and causes errors in xtest 4003 on all platforms that do not have CFG_CRYPTO_WITH_CE=y. When CE is enabled, a different structure mbedtls_aes_context from aes_alt.h is used and the copy is correct.
Introduce a helper function: mbed_copy_mbedtls_aes_context() to perform the copy operation and use it when copying AES ECB, CBC and CTR contexts.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|