Commit graph

13 commits

Author SHA1 Message Date
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Robert Lubos 2c2771970e modules: mbedtls: Update mbedTLS commit and apply fixes
Update mbedTLS commit along with the following fixes:

* Fix naming inconsistencies in some cipher modes, to match core mbedTLS
  configs
* Add Kconfig to enable CTR cipher mode

Fixes #22421

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 23:46:08 -05:00
Flavio Ceolin 86087f202a drivers: crypto: mbedtls: Remove dead code
mtls_session_setup checks early if the given mode is valid and return
an error if not. CRYPTO_CIPHER_MODE_CTR is not a valid one so there is
no needed to have it in the switch.

CID: 20600

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-03-10 14:51:33 +02:00
Markus Fuchs ad8f011dcf drivers: crypto: crypto_mtls_shim: Add AES-GCM support
Add support for AES Galois/Counter Mode (GCM) of operation to the
mbed TLS shim driver.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2020-02-08 13:40:33 +02:00
Siddharth Chandrasekaran 1ab39e7c52 drivers/crypto: mbedTLS_shim add support for CAP_NO_IV_PREFIX
Add support for `CAP_NO_IV_PREFIX` in mbedTLS_shim and advertise this as
one of its capabilities. When this flag is active, the IV passed is
preserved to allow applications to reuse the IV buffer.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-01-16 18:34:20 +01:00
Siddharth Chandrasekaran 850f355be1 drivers/crypto: Add macro to simplify access to ctx->drv_sessn_state
The conversion of struct cipher_ctx * to mtls_aes_context * happens in
a bunch of places. Add a macro MTLS_GET_CTX() to simplify this.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran 5fbaf9f0e5 drivers/crypto: Add support for AES ECB mode in mbedTLS shim
Add support for AES ECB mode of operation in mbedTLS shim driver.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran 30f0b3a37c drivers/crypto: Add support for AES CBC mode in mbedTLS shim
Add support for AES CBC mode of operation in mbedTLS shim driver.
Refactor mtls_session_setup() to allow multiple cipher modes to
co-exist.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Anas Nashif 3da714193f drivers: crypto: move to new logger
Move to new logger subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Leandro Pereira ab16853b26 drivers: crypto: crypto_mtls_shim: Set output length for all operations
The out_len member in struct cipher_pkt was not set.

Fixes #4684.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-05-16 23:30:11 +03:00
Ramakrishna Pallala bb5a2985d1 drivers: crypto: Fix mbedtls Kconfig dependencies
Fix mbedtls shim driver Kconfig dependencies.

Limit the scope of crypto_driver_api functions to driver file only.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-11-03 14:27:41 -04:00
Tomasz Bursztyka 7abf3c5307 drivers/crypto: Add mbedTLS shim crypto driver
This exposes the CCM operations through generic Crypto API.

Change-Id: I09346e77bf8821c208305a7aa2805cf49cb42d71
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00