aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2019-03-21 12:15:01 +0100
committerJérôme Forissier <jerome.forissier@linaro.org>2019-04-01 09:34:25 +0200
commitef21404ea5a3843dd1f72ff00647083625052bc6 (patch)
tree8f4be6978504e7b22d78f2efb079c1a1c47190b8
parenta4ae1ebe608edaf9f21e782eebbf93a9908640ce (diff)
mbedtls: Support AES-CCM algorithm
Use AES-CCM implementation from libtomcrypt instead of mbedtls version due to limitations in the mbedtls API. Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r--core/crypto.mk3
-rw-r--r--lib/libmbedtls/core/stubbed.c31
-rw-r--r--lib/libmbedtls/core/sub.mk1
3 files changed, 2 insertions, 33 deletions
diff --git a/core/crypto.mk b/core/crypto.mk
index 10ee2f4b..918d4713 100644
--- a/core/crypto.mk
+++ b/core/crypto.mk
@@ -171,7 +171,8 @@ _CFG_CORE_LTC_SHA256_DESC := $(CFG_CRYPTO_DSA)
_CFG_CORE_LTC_SHA384_DESC := $(CFG_CRYPTO_DSA)
_CFG_CORE_LTC_SHA512_DESC := $(CFG_CRYPTO_DSA)
_CFG_CORE_LTC_XTS := $(CFG_CRYPTO_XTS)
-_CFG_CORE_LTC_AES_DESC := $(call cfg-one-enabled, CFG_CRYPTO_XTS)
+_CFG_CORE_LTC_CCM := $(CFG_CRYPTO_CCM)
+_CFG_CORE_LTC_AES_DESC := $(call cfg-one-enabled, CFG_CRYPTO_XTS CFG_CRYPTO_CCM)
endif
###############################################################
diff --git a/lib/libmbedtls/core/stubbed.c b/lib/libmbedtls/core/stubbed.c
deleted file mode 100644
index 30ff8f2f..00000000
--- a/lib/libmbedtls/core/stubbed.c
+++ /dev/null
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: BSD-2-Clause
-/*
- * Copyright (C) 2018, ARM Limited
- * Copyright (C) 2019, Linaro Limited
- */
-
-#include <assert.h>
-#include <compiler.h>
-#include <crypto/crypto.h>
-#include <crypto/crypto_impl.h>
-#include <kernel/panic.h>
-#include <stdlib.h>
-
-/******************************************************************************
- * Asymmetric algorithms
- ******************************************************************************/
-
-
-
-
-/* Stubs for the crypto alloc ctx functions matching crypto_impl.h */
-#undef CRYPTO_ALLOC_CTX_NOT_IMPLEMENTED
-
-#define CRYPTO_ALLOC_CTX_NOT_IMPLEMENTED(name, type) \
- TEE_Result \
- crypto_##name##_alloc_ctx(struct crypto_##type##_ctx **ctx __unused) \
- { return TEE_ERROR_NOT_IMPLEMENTED; }
-
-#if defined(CFG_CRYPTO_CCM)
-CRYPTO_ALLOC_CTX_NOT_IMPLEMENTED(aes_ccm, authenc)
-#endif
diff --git a/lib/libmbedtls/core/sub.mk b/lib/libmbedtls/core/sub.mk
index 614d04cc..634e55cb 100644
--- a/lib/libmbedtls/core/sub.mk
+++ b/lib/libmbedtls/core/sub.mk
@@ -1,6 +1,5 @@
cflags-lib-$(CFG_CRYPTO_SIZE_OPTIMIZATION) += -Os
-srcs-y += stubbed.c
srcs-y += tomcrypt.c
srcs-$(call cfg-one-enabled, CFG_CRYPTO_MD5 CFG_CRYPTO_SHA1 CFG_CRYPTO_SHA224 \
CFG_CRYPTO_SHA256 CFG_CRYPTO_SHA384 \