| 2d46762c | 11-Dec-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: ecc sign
The crypto API validates the size of the buffer that will hold the resulting signature. This means that the SE05X driver can not use the variable length buffer mecha
crypto: drivers: se050: ecc sign
The crypto API validates the size of the buffer that will hold the resulting signature. This means that the SE05X driver can not use the variable length buffer mechanism to request extra bytes to handle the DER format.
To address this situation, this patch allocates a temporary buffer to get the signature from the Plug-and-Trust subsystem; then, upon doing the DER to binary conversion, copies the resulting data to the output buffer.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 8b63b7dd | 25-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: acipher: initialize driver with the JR base address
Instead of systematically using the job ring 0 registers to initialize the CAAM acipher drivers, use the job ring allocated to OPTE
drivers: caam: acipher: initialize driver with the JR base address
Instead of systematically using the job ring 0 registers to initialize the CAAM acipher drivers, use the job ring allocated to OPTEE OS.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| efcdff18 | 25-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: hash: initialize driver with the JR base address
Instead of systematically using the job ring 0 registers to initialize the CAAM hash driver, use the job ring allocated to OPTEE OS.
drivers: caam: hash: initialize driver with the JR base address
Instead of systematically using the job ring 0 registers to initialize the CAAM hash driver, use the job ring allocated to OPTEE OS.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| d1a9c68b | 03-Dec-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers: stm32_cryp: prevent error trace when disabled
Changes stm32_crypt initialization function to not report an error when the device is not defined or disabled in the embedded DT.
Prevents err
drivers: stm32_cryp: prevent error trace when disabled
Changes stm32_crypt initialization function to not report an error when the device is not defined or disabled in the embedded DT.
Prevents error trace message seen at boot time: E/TC:0 0 call_initcalls:43 Initcall __text_start + 0x0002b958 failed
Fixes: 5c3bcc386415 ("dts: stm32mp1: disable CRYP1 device") Acked-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4793519c | 01-Dec-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: object identifier range
With the introduction of the se050 APDU driver, external clients can create persistent objects on the secure element non-volatile memory.
The unique
crypto: drivers: se050: object identifier range
With the introduction of the se050 APDU driver, external clients can create persistent objects on the secure element non-volatile memory.
The unique identifiers for these objects do not necessarily need to fall within the range defined for objects created using the cyptographic operation interfaces (keypair_gen).
This commit fixes the use case where a key stored in the SE05x device (for example via a cloud service communicating to the optee-client's libseteec) is imported into the pkcs#11 database and then used for authentication (ie, EC sign)
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| bb04f4b9 | 02-Dec-2021 |
Sahil Malhotra <sahil.malhotra@nxp.com> |
core: drivers: caam: disable jobring in DT only in case of external DTB
On LX2160 board, Embedded DTB is enabled. While booting with CAAM enabled, a crash comes in OP-TEE because it tries to disable
core: drivers: caam: disable jobring in DT only in case of external DTB
On LX2160 board, Embedded DTB is enabled. While booting with CAAM enabled, a crash comes in OP-TEE because it tries to disable the Job Ring in Embedded DTB, which is read only. So disable Job ring only when using External DTB.
Signed-off-by: Sahil Malhotra <sahil.malhotra@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5dac4bd1 | 30-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
drivers: crypto: stm32_cryp: register secure peripheral
Adds registering of CRYP1 device as a secure peripheral when it is registered as a crypto driver.
Fixes: 95134dac4b22 ("plat-stm32mp1: enable
drivers: crypto: stm32_cryp: register secure peripheral
Adds registering of CRYP1 device as a secure peripheral when it is registered as a crypto driver.
Fixes: 95134dac4b22 ("plat-stm32mp1: enable CRYPTO HW if available") Reviewed-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 289611b8 | 24-Nov-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: drivers: se050: object identifier persistence property
The persistence of the object identifiers can be obtained by interrogating the device. Since objects can now be created by external act
crypto: drivers: se050: object identifier persistence property
The persistence of the object identifiers can be obtained by interrogating the device. Since objects can now be created by external actors using the APDU PTA, we will drop the current implementation which flags the object transient property using a bit on the object identifier itself.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 32ddbffb | 13-Nov-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: APDU driver
This driver allows trusted applications to send raw APDU frames to the SE050 device. The Plug-and-Trust subsystem will route the frames back to OP-TEE for SCP03 encryption
crypto: se050: APDU driver
This driver allows trusted applications to send raw APDU frames to the SE050 device. The Plug-and-Trust subsystem will route the frames back to OP-TEE for SCP03 encryption and I2C transmission to the bus.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ff0c5d42 | 13-Nov-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
core: crypto: Secure Element cryptographic interface
Extract cryptographic operations specific to Secure Elements from the more generic cryptographic interface.
Also, the Secure Channel Protocol03
core: crypto: Secure Element cryptographic interface
Extract cryptographic operations specific to Secure Elements from the more generic cryptographic interface.
Also, the Secure Channel Protocol03 is a global protocol supported by most SEs and not NXP SE05X specific. Use this commit to reflect this fact.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5411b322 | 11-Nov-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: rename huk driver to die_id
The current HUK driver is not providing the platform Hardware Unique Key but the DIE_ID.
This can logically be a source of confusion (and bugs) for many u
crypto: se050: rename huk driver to die_id
The current HUK driver is not providing the platform Hardware Unique Key but the DIE_ID.
This can logically be a source of confusion (and bugs) for many users not enabling this option.
This commit renames the huk.c file to die_id.c and replaces the previous configuration option with another one that is semantically accurate.
CFG_NXP_SE05X_HUK_DRV --> CFG_NXP_SE05X_DIEID_DRV
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| add5ac80 | 20-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
crypto: se050: Foundries Plug-and-Trust release 0.0.4
Notice that rebasing the Plug-and-Trust stack to pick up the NXP Plug-and-Trust 3.03.00 release broke backwards compatibility with previous OP-T
crypto: se050: Foundries Plug-and-Trust release 0.0.4
Notice that rebasing the Plug-and-Trust stack to pick up the NXP Plug-and-Trust 3.03.00 release broke backwards compatibility with previous OP-TEE versions. This is why this commit includes the necessary update to adaptors/apdu.c
https://github.com/foundriesio/plug-and-trust/releases/tag/v0.0.3
Also the v.0.0.4 release includes support for APDU raw frame transmission to the secure element (a new interface). The OP-TEE PTA that makes use of that functionality shall be merged after this commit.
https://github.com/foundriesio/plug-and-trust/releases/tag/v0.0.4
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| fd140f7e | 06-Oct-2021 |
Gerard Koskamp <gerard.koskamp@nedap.com> |
drivers: crypto: se05x: SCP03 keys for SE051A2 and SE051C2
Add SCP03 keys for SE051A2 and SE051C2 to support OEFID 0xA565 and 0xA564
Signed-off-by: Robert Krikke <robert.krikke@gmail.com> Signed-of
drivers: crypto: se05x: SCP03 keys for SE051A2 and SE051C2
Add SCP03 keys for SE051A2 and SE051C2 to support OEFID 0xA565 and 0xA564
Signed-off-by: Robert Krikke <robert.krikke@gmail.com> Signed-off-by: Gerard Koskamp <gerard.koskamp@nedap.com> Acked-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
show more ...
|
| 502e23ad | 02-Nov-2021 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: pm: add a name to registered pm_callback_handle
Adds an argument to register a name (string debug identifier) for PM handlers registered to PM framework.
Caller can provide a NULL reference o
core: pm: add a name to registered pm_callback_handle
Adds an argument to register a name (string debug identifier) for PM handlers registered to PM framework.
Caller can provide a NULL reference or a valid string pointer. When pager is enabled, the registration ensures the name lies in an unpaged section, possibly allocating heap for that purpose.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Gatien Chevallier <gatien.chevallier@st.com>
show more ...
|
| fa8cb7a8 | 03-Nov-2021 |
Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> |
crypto: stm32: use CRYP IP for authenc algorithm
Add STM32 CRYP as an Authenticated Encryption provider for GCM and CCM.
Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Reviewed-
crypto: stm32: use CRYP IP for authenc algorithm
Add STM32 CRYP as an Authenticated Encryption provider for GCM and CCM.
Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e3e4ce47 | 26-Apr-2021 |
Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> |
drivers: crypto: implement crypto driver - AUTHENC
Add a generic cryptographic Authenticated Encryption driver interface connecting TEE Crypto generic APIs to HW driver interface.
Signed-off-by: Ni
drivers: crypto: implement crypto driver - AUTHENC
Add a generic cryptographic Authenticated Encryption driver interface connecting TEE Crypto generic APIs to HW driver interface.
Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Acked-by: Cedric Neveux <cedric.neveux@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 5e64ae67 | 26-Jul-2021 |
Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> |
crypto: stm32: use CRYP IP for CIPHER algorithms
Add CRYP IP drivers, and add STM32 CRYP as a drvcrypt cipher provider.
Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Reviewed-b
crypto: stm32: use CRYP IP for CIPHER algorithms
Add CRYP IP drivers, and add STM32 CRYP as a drvcrypt cipher provider.
Signed-off-by: Nicolas Toromanoff <nicolas.toromanoff@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| df7cecc0 | 03-Nov-2021 |
Lionel Debieve <lionel.debieve@foss.st.com> |
core: kernel: use size_t instead of ssize_t for _fdt_reg_size()
Size is read from the reg device tree property as an unsigned value coming from fdt32_to_cpu(). Use a size_t with associated error cod
core: kernel: use size_t instead of ssize_t for _fdt_reg_size()
Size is read from the reg device tree property as an unsigned value coming from fdt32_to_cpu(). Use a size_t with associated error code DT_INFO_INVALID_REG_SIZE as return in prototype. Update the current users according to this change.
Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 8bddeb85 | 22-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
drivers: crypto: rsa/ecc/dsa: input parameter validation
To comply with the PKCS#11 convention for functions returning output in a variable-length buffer, prefer to check the required size of the ou
drivers: crypto: rsa/ecc/dsa: input parameter validation
To comply with the PKCS#11 convention for functions returning output in a variable-length buffer, prefer to check the required size of the output buffer before the existence of the output buffer itself.
This will save callers from having to allocate a buffer that might not be used.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Clement Faure <clement.faure@nxp.com> Acked-by: Cedric Neveux <cedric.neveux@nxp.com>
show more ...
|
| e08643a4 | 05-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: fix RSAES-OAEP encryption length check
According to PKCS#1 v2.2: RSA Cryptography Standard, for RSAES-OAEP Encryption operation function, the following length check must be done pri
drivers: crypto: fix RSAES-OAEP encryption length check
According to PKCS#1 v2.2: RSA Cryptography Standard, for RSAES-OAEP Encryption operation function, the following length check must be done prior the encryptioon operation [1]:
Return error if mLen > k - 2*hlen - 2
Because (k - 2*hlen - 2) must be superior or equal to zero, return an error also if 2*hlen >= k - 2
Links: [1] https://datatracker.ietf.org/doc/html/rfc8017 Fixes: f5a70e3efb ("drivers: crypto: generic resources for crypto device driver - RSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 5d49c2f4 | 01-Oct-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: check destination buffer size before copying message
At the end of the RSA-OAEP decryption operation, check if the destination message buffer is big enough to hold the output of the d
drivers: caam: check destination buffer size before copying message
At the end of the RSA-OAEP decryption operation, check if the destination message buffer is big enough to hold the output of the decryption operation. If the buffer is too small, return TEE_ERROR_SHORT_BUFFER error code along the expected buffer size.
Fixes: 796ea6d867 ("drivers: caam: implement NXP CAAM Driver - RSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 0d7e03a9 | 01-Sep-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: fix ECC key size bytes to bits conversion
Convert the ECC key size from bytes to bits. By adding the new key_size variable, it also fixes the crypto driver traces bellow printing th
drivers: crypto: fix ECC key size bytes to bits conversion
Convert the ECC key size from bytes to bits. By adding the new key_size variable, it also fixes the crypto driver traces bellow printing the ECC key size from the variable that was missing.
Fixes: d29cd2e ("core: driver: generic resources for crypto device driver - ECC") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 2391d619 | 31-Aug-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: crypto: acipher: fix traces compilation
Cast key pointers to uintptr_t to avoid compilation warnings when crypto driver traces are enabled (CFG_CRYPTO_DRIVER_DEBUG=0x1)
Fixes: 62590f0 ("dr
drivers: crypto: acipher: fix traces compilation
Cast key pointers to uintptr_t to avoid compilation warnings when crypto driver traces are enabled (CFG_CRYPTO_DRIVER_DEBUG=0x1)
Fixes: 62590f0 ("drivers: crypto: implement crypto device driver - DSA") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4278ad18 | 25-Aug-2021 |
Clement Faure <clement.faure@nxp.com> |
drivers: caam: dma: fix copy data size
After each crypto operation that involves a DMA output, the content of the SGT buffer is copied to the actual output buffer. Fix the DMA copy function where th
drivers: caam: dma: fix copy data size
After each crypto operation that involves a DMA output, the content of the SGT buffer is copied to the actual output buffer. Fix the DMA copy function where the size of the data to be copied is either the full size of the data processed by the CAAM (obj->sgtbuf.length) or the size of the output buffer.
In some cases, the output buffer is smaller than the CAAM output. The size of data to be copied is the smallest size between the CAAM output data size and the output buffer size.
Fixes: 38923d4 ("drivers: caam: implement CAAM DMA Object") Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| ea6ed343 | 25-Aug-2020 |
Cedric Neveux <cedric.neveux@nxp.com> |
drivers: caam: add RNG data check error code
Check if the CAAM RNG driver returns DATA_FAILURE error code. If the data check returns DATA_FAILURE, the function returns CAAM_FAILURE.
Fixes: 2d7a896
drivers: caam: add RNG data check error code
Check if the CAAM RNG driver returns DATA_FAILURE error code. If the data check returns DATA_FAILURE, the function returns CAAM_FAILURE.
Fixes: 2d7a896 ("driver: implement CAAM driver") Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Jerome Forissier <jerome@forissier.org> Acked-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|