commit | 7e35937aae6d65507bab36f10bd46249de6a835c | [log] [tgz] |
---|---|---|
author | Jerome Forissier <jerome@forissier.org> | Mon Jan 25 16:03:52 2021 +0100 |
committer | Jérôme Forissier <jerome@forissier.org> | Thu Feb 04 18:17:08 2021 +0100 |
tree | 555166280a3843060ce20a81dc87b102c7929faf | |
parent | 9fc2442cc66c279cb962c90c4375746fc9b28bb9 [diff] |
core: crypto: sm2: do not panic core if key allocation fails During SM2 key derivation via syscall_cryp_derive_key(), if crypto_acipher_alloc_ecc_public_key() fails for whatever reason in get_sm2_kep_params(), peer_key and/or peer_eph_key are left in an invalid state and it is incorrect to call crypto_acipher_free_ecc_public_key() in this case. Doing so causes a core panic: E/TC:? 0 assertion 'key->ops && key->ops->free' failed at core/crypto/crypto.c:702 <crypto_acipher_free_ecc_public_key> E/TC:1 0 Panic at core/kernel/assert.c:28 <_assert_break> Fix the get_sm2_kep_params() cleanup code to avoid this situation. Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
This git contains source code for the secure side implementation of OP-TEE project.
All official OP-TEE documentation has moved to http://optee.readthedocs.io.
// OP-TEE core maintainers