Oopenvela-robotRevert "optee_os: fix the aes_gcm align check error"
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
core: copy mode in cts_copy_state() Fixes cts_copy_state() by copying the "mode" element also for the state to be complete. Fixes: 96098f011f7c ("core: crypto: introduce struct crypto_cipher_ops") Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reported-by: Tony He <tony.he@armchina.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 5 年前 | |
core: crypto: remove internal_aes_gcm_encrypt_block() Replaces calls to internal_aes_gcm_encrypt_block() with calls to crypto_aes_enc_block(). Removes internal_aes_gcm_encrypt_block(). Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE Implement the renamed macro using the IS_ALIGNED definition. Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
Revert "optee_os: fix the aes_gcm align check error" This reverts commit ac2af9732d012b3e51f8064685db6ff4bee8ca6d. Reason for revert: when we build on specific product-lte cmake build version, the force check action will make the aes-gcm dec/enc operation failed Signed-off-by: guoshichao <guoshichao@xiaomi.com> | 3 个月前 | |
crypto: optimize speed of AES CBC MAC The current AES CBC MAC implementation invokes the AES CBC algorithm via crypto_cipher_update() for each 16-byte block of the input data. This can be inefficient especially with hardware accelerated implementations which may have a significant overhead (I am thinking of proprietary implementations of MBed TLS for example). This commit introduces a new config option: CFG_CRYPTO_CBC_MAC_BUNDLE_BLOCKS (default 64) which allows to bundle several 16-byte blocks of input data when calling the AES CBC function. Therefore with the default value, data are processed 1 KB at a time (assuming the caller provides enough data of course). There is a small memory overhead (malloc) of the same size at most. Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 4 年前 | |
core: crypto: fix memory leak in Ed25519 support The software implementation of ED25519 algorithm has a memory leak in the key and key pair allocation. Upon every public key allocation, a key pair is allocated (public and private components). When freeing the public key, only the public component is freed. To reproduce the issue: $ while xtest 4016; do :; done Until the following error: * regression_4016 Test TEE Internal API ED25519 sign/verify E/LD: copy_section_headers:1124 sys_copy_from_ta_bin E/TC:? 0 ldelf_init_with_ldelf:131 ldelf failed with res: 0xffff000c /usr/src/debug/optee-test/master.imx-r0/host/xtest/regression_4000.c:6062: xtest_teec_open_session(&session, &crypt_user_ta_uuid, ((void *)0), &ret_orig) has an unexpected value: 0xffff000c = TEEC_ERROR_OUT_OF_MEMORY, expected 0x0 = TEEC_SUCCESS regression_4016 FAILED To fix the memory leak, a separate public key allocation function must be defined along a ED25519 public key structure. Fixes: 0aaad418ac8b ("core: crypto: add Ed25519 support") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 | |
core: remove algo from crypto_cipher_*() Removes the algo parameters from all crypto_cipher_*() functions except crypto_cipher_alloc_ctx(). tee_aes_cbc_cts_update() is moved into aes-cts.c and renamed to cbc_cts_update(). Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 6 年前 | |
core: rng_hw: Remove __weak attribute from HW RNG functions These function are no longer overridden by platform HW RNG drivers. Drivers only need implement hw_get_random_bytes(). Signed-off-by: Andrew Davis <afd@ti.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> | 3 年前 | |
core: add fault mitigations to shdr_verify_signature*() Adds fault mitigations to shdr_verify_signature() and shdr_verify_signature2(). shdr_verify_signature() and shdr_verify_signature2() are called using the wrapper FTMN_CALL_FUNC() which verifies that the correct function was called and that the return value hasn't been tampered with. Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 | |
core: ltc: move sm2_kdf() to common core/crypto/sm2-kdf.c The key derivation function sm2_kdf() is a helper function used by SM2 KEP (Key Exchange Protocol) and PKE (Private Key Encryption). It is currently implemented in core/lib/libtomcrypt/sm2_kdf.c, next to the SM2 source code based on LibTomCrypt. In order to provide an MBed TLS implementation of SM2, the helper function shall be outside the LibTomCrypt directory. Move it to core/crypto/sm2-kdf.c. Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 5 年前 | |
core: crypto: add support for SM3 Adds support for the SM3 cryptographic hash function [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2, as well as the HMAC based on this hash. This implementation is based on code published on Gitlab [2]. See commit ade6f848e084 ("core: crypto: add support for SM4") for details. [1] https://tools.ietf.org/html/draft-sca-cfrg-sm3-02 [2] https://gitlab.com/otpfree/sm234 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 6 年前 | |
core: crypto: sm3: remove unused header Removed unused mbedtls/md.h header file to fix error: core/crypto/sm3-hmac.c:12:10: fatal error: mbedtls/md.h: No such file or directory when building with CFG_CORE_MBEDTLS_MPI=n. To prevent future similar regression, also add a test case to Shippable. Fixes: https://github.com/OP-TEE/optee_os/issues/3487 Fixes: 47645577c806 ("core: crypto: add support for SM3") Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> | 6 年前 | |
core: use SM3 crypto accelerated function Uses the recently provided accelerated SM3 function in the SM3 implementation. Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 | |
core: crypto: add support for SM3 Adds support for the SM3 cryptographic hash function [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2, as well as the HMAC based on this hash. This implementation is based on code published on Gitlab [2]. See commit ade6f848e084 ("core: crypto: add support for SM4") for details. [1] https://tools.ietf.org/html/draft-sca-cfrg-sm3-02 [2] https://gitlab.com/otpfree/sm234 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 6 年前 | |
core: crypto: add support for SM4 Adds support for the SM4 cipher [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2. ECB, CBC and CTR modes are implemented. Other modes are valid but are not included in the GP specification, so they are not considered here. This implementation is based on code published on Gitlab [2]. The project contains no licensing terms, so I contacted the author (goldboar@163.com), asking for permission to re-use the code in OP-TEE under a BSD-2-Clause license. I received the following reply: "[...] If you like you can use it [...]" I have reworked the source to better fit the OP-TEE coding style. I have also added the CTR mode of operation. I do not think we will need to merge any change from upstream in the future. [1] https://tools.ietf.org/html/draft-ribose-cfrg-sm4-10 [2] https://gitlab.com/otpfree/sm234 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 6 年前 | |
core: crypto: add support for SM4 Adds support for the SM4 cipher [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2. ECB, CBC and CTR modes are implemented. Other modes are valid but are not included in the GP specification, so they are not considered here. This implementation is based on code published on Gitlab [2]. The project contains no licensing terms, so I contacted the author (goldboar@163.com), asking for permission to re-use the code in OP-TEE under a BSD-2-Clause license. I received the following reply: "[...] If you like you can use it [...]" I have reworked the source to better fit the OP-TEE coding style. I have also added the CTR mode of operation. I do not think we will need to merge any change from upstream in the future. [1] https://tools.ietf.org/html/draft-ribose-cfrg-sm4-10 [2] https://gitlab.com/otpfree/sm234 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 6 年前 | |
core: crypto: add support for SM4 Adds support for the SM4 cipher [1] using the API defined in the GlobalPlatform TEE Internal Core API v1.2. ECB, CBC and CTR modes are implemented. Other modes are valid but are not included in the GP specification, so they are not considered here. This implementation is based on code published on Gitlab [2]. The project contains no licensing terms, so I contacted the author (goldboar@163.com), asking for permission to re-use the code in OP-TEE under a BSD-2-Clause license. I received the following reply: "[...] If you like you can use it [...]" I have reworked the source to better fit the OP-TEE coding style. I have also added the CTR mode of operation. I do not think we will need to merge any change from upstream in the future. [1] https://tools.ietf.org/html/draft-ribose-cfrg-sm4-10 [2] https://gitlab.com/otpfree/sm234 Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> | 6 年前 | |
core: crypto: implement SM4 XTS In this patch, we add software computing support for sm4-xts. Signed-off-by: Pingan Xie <xiepingan3@huawei.com> Reviewed-by: Xiaoxu Zeng <zengxiaoxu@huawei.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | 3 年前 | |
core: crypto: implement SM4 XTS In this patch, we add software computing support for sm4-xts. Signed-off-by: Pingan Xie <xiepingan3@huawei.com> Reviewed-by: Xiaoxu Zeng <zengxiaoxu@huawei.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | 3 年前 | |
core: crypto: implement SM4 XTS In this patch, we add software computing support for sm4-xts. Signed-off-by: Pingan Xie <xiepingan3@huawei.com> Reviewed-by: Xiaoxu Zeng <zengxiaoxu@huawei.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> | 3 年前 | |
core: arm64: SM4-AESE optimization for ARMv8 Enabled with CFG_CRYPTO_SM4_ARM_AESE=y, set by default if CFG_CRYPTO_WITH_CE=y. Signed-off-by: Xu Yizhou <xuyizhou1@huawei.com> Acked-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 | |
core: arm64: SM4-AESE optimization for ARMv8 Enabled with CFG_CRYPTO_SM4_ARM_AESE=y, set by default if CFG_CRYPTO_WITH_CE=y. Signed-off-by: Xu Yizhou <xuyizhou1@huawei.com> Acked-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> | 3 年前 |