| 8ac3cb37 | 22-Feb-2023 |
Anton Antonov <Anton.Antonov@arm.com> |
core: drivers: crypto: caam: Check PKCS_V1_5 decryption buffer size
Check if original buffer is large enough for a result of RSA PKCS_V1_5 decryption operation. With this change PKCS11 variable leng
core: drivers: crypto: caam: Check PKCS_V1_5 decryption buffer size
Check if original buffer is large enough for a result of RSA PKCS_V1_5 decryption operation. With this change PKCS11 variable length buffers are supported for all RSA operations: - Crypto API checks it for PKCS_V1_5 and OAEP encryptions. - OAEP decryption already supports it.
This fixes: https://github.com/OP-TEE/optee_os/issues/5841
Acked-by: Clement Faure <clement.faure@nxp.com> Signed-off-by: Anton Antonov <Anton.Antonov@arm.com>
show more ...
|
| 2234f3c9 | 26-Jan-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
versal: enable the crypto driver
The crypto driver API provides an extra indirection level to enable different ciphers.
Since Versal ACAP supports acipher and authenc, enable them.
Falling-back to
versal: enable the crypto driver
The crypto driver API provides an extra indirection level to enable different ciphers.
Since Versal ACAP supports acipher and authenc, enable them.
Falling-back to software operations (RSA sign/verify) triggers a fault detection; we will disable this config while a solution is found.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 2b83a595 | 01-Feb-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: versal: rsa: only support sign/verify operations
RSA encryption/decryption is not supported (the PLM does not return the size of the encrypted/decrypted buffers).
Signed-off-by: Jorge Ramir
crypto: versal: rsa: only support sign/verify operations
RSA encryption/decryption is not supported (the PLM does not return the size of the encrypted/decrypted buffers).
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e8bbd0e0 | 30-Jan-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: versal: ecc: sign/verify fix
Both the message (hash) and the generated signatures must be swapped.
The following custom tests were executed for P384 (prime384v1) and P521 (nistp521) curves.
crypto: versal: ecc: sign/verify fix
Both the message (hash) and the generated signatures must be swapped.
The following custom tests were executed for P384 (prime384v1) and P521 (nistp521) curves.
Signing and verifying using pkcs#11 alone (ie like done in xtest) was not sufficient to capture this bug.
PTOOL='pkcs11-tool --module /usr/lib/libckteec.so.0.1.0' SO_PIN=55555555 PIN=44444444 FILE=hello
printf "OP-TEE: create key pair" $PTOOL --id 01 --label ldts --token-label fio --pin $PIN \ --keypairgen \ --key-type EC:prime384v1
printf "OP-TEE: read the public key" $PTOOL -l --pin $PIN --id 01 \ --read-object --type pubkey --output-file pubkey.spki
printf "Openssl: export key to PEM" openssl ec -inform DER -outform PEM -in pubkey.spki -pubin > pubkey.pub
printf "Create file to sign" echo "hello world" > $FILE
printf "OpenSSL: create the file sha384" openssl dgst -binary -sha384 $FILE > $FILE.hash
printf "OP-TEE: generate signature " $PTOOL --pin $PIN --id 01 --label ldts --token-label fio \ --sign --input-file $FILE.hash --output-file $FILE.sig --mechanism ECDSA -f openssl
printf "OpenSSL: verify signature" openssl dgst -sha384 -verify pubkey.pub -signature "$FILE".sig "$FILE"
printf "OP-TEE: verify signature" $PTOOL --pin $PIN --id 01 --label ldts --token-label fio \ --verify \ --input-file $FILE.hash \ --signature-format openssl \ --signature-file $FILE.sig \ --mechanism ECDSA
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e7b17391 | 24-Jan-2023 |
Clement Faure <clement.faure@nxp.com> |
core: crypto_api: remove unused includes
Remove unused includes from the crypto API.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
core: crypto_api: remove unused includes
Remove unused includes from the crypto API.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1bd5ecaf | 24-Jan-2023 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: remove unused includes
Remove unused includes from the CAAM driver.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acke
drivers: caam: remove unused includes
Remove unused includes from the CAAM driver.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 3cd271a4 | 24-Jan-2023 |
Clement Faure <clement.faure@nxp.com> |
core: crypto_api: fix malloc() allocation check
Coverity reports a CERT-C ERR33-C coding violation on EM.data pointer for not being checked right after malloc() call. This is a false positive error
core: crypto_api: fix malloc() allocation check
Coverity reports a CERT-C ERR33-C coding violation on EM.data pointer for not being checked right after malloc() call. This is a false positive error since EM.data value is checked along EM_gen.data value later. Check EM.data and EM_gen.data values separately to make Coverity happy.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 530f76bb | 24-Jan-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
drivers: crypto: se050: increase DER signature buffer
In order to support P-521 (132 byte {r,s} pairs), the buffer storing the DER signature must be large enough.
Signed-off-by: Jorge Ramirez-Ortiz
drivers: crypto: se050: increase DER signature buffer
In order to support P-521 (132 byte {r,s} pairs), the buffer storing the DER signature must be large enough.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 5abb46e2 | 23-Jan-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: fix generation of oid values
Converting the OID watermarked value (8 bytes) to a bignum removes the first byte if this is different than zero.
The failing case observed the
crypto: drivers: se050: fix generation of oid values
Converting the OID watermarked value (8 bytes) to a bignum removes the first byte if this is different than zero.
The failing case observed the value 0x57.72.15.66.1a.f2.9d.00 being retrieved as 0x57.72.15.66.1a.f2.9d after having been transformed into a bignum and back to its original binary value.
This will cause cryptographic operations to fail as the secured keys and objects become not addressable.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| c36f205e | 17-Jan-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: update policies
Certain devices (depending on the applet) will use the common policies for the object's read/write permissions.
This commit makes sure both are supported.
Signed-off
crypto: se050: update policies
Certain devices (depending on the applet) will use the common policies for the object's read/write permissions.
This commit makes sure both are supported.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 00b7e9c7 | 03-Jan-2023 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: fix typo in information message
The SCP03 "built-in" keys were incorrectly being reported to the console as a nonsensical "build-int".
Signed-off-by: Jorge Ramirez-Ortiz <jorge@found
crypto: se050: fix typo in information message
The SCP03 "built-in" keys were incorrectly being reported to the console as a nonsensical "build-int".
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 39100dea | 12-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: fix build warning
When the configured logging level does not output IMSG, the static function get_scp03_ksrc_name() is not called.
This causes a function unused warning which might l
crypto: se050: fix build warning
When the configured logging level does not output IMSG, the static function get_scp03_ksrc_name() is not called.
This causes a function unused warning which might lead to a build error.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 6cc77cdd | 08-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050-f: ecc: can fallback to softw-ops
The SE050-F device can select to fallback to specific unsupported operations.
This allows xtests to run to completion without errors.
Signe
crypto: drivers: se050-f: ecc: can fallback to softw-ops
The SE050-F device can select to fallback to specific unsupported operations.
This allows xtests to run to completion without errors.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 58986cdf | 12-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050-f: rsa: can fallback to softw-ops
The SE050-F device can select to fallback to specific unsupported operations.
This allows xtests to run to completion without errors.
Signe
crypto: drivers: se050-f: rsa: can fallback to softw-ops
The SE050-F device can select to fallback to specific unsupported operations.
This allows xtests to run to completion without errors.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| d8eed0c1 | 08-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: ecc: fallback to softw-ops
Operations that require a public key might fallback to a software based implementation.
Operations that require a private key might fallback to a
crypto: drivers: se050: ecc: fallback to softw-ops
Operations that require a public key might fallback to a software based implementation.
Operations that require a private key might fallback to a software based implementation as long as the private key is not in the secure element.
Use CFG_NXP_SE05X_ECC_DRV_FALLBACK to enable this feature.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| a40be7eb | 08-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: rsa: fallback to softw-ops
Operations that require a public key might fallback to a software based implementation.
Operations that require a private key might fallback to a
crypto: drivers: se050: rsa: fallback to softw-ops
Operations that require a public key might fallback to a software based implementation.
Operations that require a private key might fallback to a software based implementation as long as the private key is not in the secure element.
Use CFG_NXP_SE05X_RSA_DRV_FALLBACK to enable this feature.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f8dc3669 | 08-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050-f: rsa: fix support
The NXP SE050-F does not support raw RSA keys, only CRT types.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.
crypto: drivers: se050-f: rsa: fix support
The NXP SE050-F does not support raw RSA keys, only CRT types.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 73bc4c59 | 08-Dec-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: adaptor: provide the oefid interface
Not all the NXP SE05X secure elements provide the same level of cryptographic support. This interface allows runtime identification of th
crypto: drivers: se050: adaptor: provide the oefid interface
Not all the NXP SE05X secure elements provide the same level of cryptographic support. This interface allows runtime identification of the device under control
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4502832d | 30-Nov-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
drivers: versal: SHA3-384 engine support
Enable the PLM controlled SHA3-384 cryptographic engine for TEE core usage.
Since the engine does not have the concept of "context", it can't provide the le
drivers: versal: SHA3-384 engine support
Enable the PLM controlled SHA3-384 cryptographic engine for TEE core usage.
Since the engine does not have the concept of "context", it can't provide the level support required by user-space (multiple parallel contexts) hence why it is being provided just to the core.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Nathan Menhorn <nathan.menhorn@amd.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cef8ce12 | 11-Nov-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: versal: RSA driver
This driver uses the PLM xilsecure service to deliver RSA encryption/decryption functionality.
https://github.com/Xilinx/embeddedsw
Signed-off-by: Jorge Ramirez-Ortiz <j
crypto: versal: RSA driver
This driver uses the PLM xilsecure service to deliver RSA encryption/decryption functionality.
https://github.com/Xilinx/embeddedsw
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 49b0febc | 04-Jul-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: versal: elliptic curve cryptography driver
This driver uses the PLM xilsecure service to deliver ECC sign/verify functionality.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked
crypto: versal: elliptic curve cryptography driver
This driver uses the PLM xilsecure service to deliver ECC sign/verify functionality.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b303be92 | 01-Apr-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
drivers: crypto: add stubbed fault mitigation in crypto_acipher_rsassa_verify()
Adds a stubbed fault mitigation for the drivers version of crypto_acipher_rsassa_verify). End the function with FTMN_C
drivers: crypto: add stubbed fault mitigation in crypto_acipher_rsassa_verify()
Adds a stubbed fault mitigation for the drivers version of crypto_acipher_rsassa_verify). End the function with FTMN_CALLEE_DONE() to record that the function was indeed called and a redundant copy of the return value.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| dc23c448 | 20-Oct-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: versal: authentication driver
This driver uses the PLM xilsecure service to deliver authentication functionality using AES-GCM.
The driver currently does not handle unaligned data and lengt
crypto: versal: authentication driver
This driver uses the PLM xilsecure service to deliver authentication functionality using AES-GCM.
The driver currently does not handle unaligned data and lengths; due to this the corresponding xtest regression test will not pass (xtest -t regression 4005 will fail).
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 614bc034 | 04-Jul-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: versal: interprocessor communication
Interface to the PLM xilsecure service.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
crypto: versal: interprocessor communication
Interface to the PLM xilsecure service.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e41e74a8 | 10-Nov-2022 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: provision SCP03 keys on SCP03 enablement.
Rotate the SCP03 keys as soon as the SCP03 communication channel is established.
This can happen during boot or at a later time via normal w
crypto: se050: provision SCP03 keys on SCP03 enablement.
Rotate the SCP03 keys as soon as the SCP03 communication channel is established.
This can happen during boot or at a later time via normal world request [1].
The rotation configuration that can be built-in in the driver allows the algorithm to rotate to a HUK based secret key or back to the factory based keys.
[1] https://u-boot.readthedocs.io/en/latest/usage/cmd/scp03.html
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|