QCBOR: rely on the upstream CMakeLists.txt

Change-Id: If2b6c27e89c163d6358492965e92104fc4ee8eae
Signed-off-by: David Vincze <david.vincze@arm.com>
diff --git a/lib/ext/qcbor/CMakeLists.txt b/lib/ext/qcbor/CMakeLists.txt
index 4eafd20..3dc3a3a 100644
--- a/lib/ext/qcbor/CMakeLists.txt
+++ b/lib/ext/qcbor/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -12,7 +12,13 @@
 
 # Default configuration of QCBOR repository
 set(QCBOR_PATH      "DOWNLOAD"  CACHE PATH      "Path to qcbor (or DOWNLOAD to fetch automatically")
-set(QCBOR_VERSION   "b0e70332"  CACHE STRING    "The version of qcbor to use")
+set(QCBOR_VERSION   "92d3f890"  CACHE STRING    "The version of qcbor to use")
+
+# Entirely disable the floating-point support
+# in the qcbor library to reduce code size.
+set(QCBOR_OPT_DISABLE_FLOAT_HW_USE     ON  CACHE BOOL  "Eliminate dependency on FP hardware and FP instructions" FORCE)
+set(QCBOR_OPT_DISABLE_FLOAT_PREFERRED  ON  CACHE BOOL  "Eliminate support for half-precision and CBOR preferred serialization" FORCE)
+set(QCBOR_OPT_DISABLE_FLOAT_ALL        ON  CACHE BOOL  "Eliminate floating-point support completely" FORCE)
 
 if ("${QCBOR_PATH}" STREQUAL "DOWNLOAD")
     FetchContent_Declare(qcbor
@@ -28,36 +34,16 @@
     endif()
 endif()
 
-add_library(tfm_qcbor_s STATIC EXCLUDE_FROM_ALL)
+add_subdirectory(${QCBOR_PATH} ${CMAKE_CURRENT_BINARY_DIR}/QCBOR)
 
-target_sources(tfm_qcbor_s
-    PRIVATE
-        ${QCBOR_PATH}/src/ieee754.c
-        ${QCBOR_PATH}/src/qcbor_encode.c
-        ${QCBOR_PATH}/src/qcbor_decode.c
-        ${QCBOR_PATH}/src/UsefulBuf.c
-)
+set_target_properties(qcbor PROPERTIES EXCLUDE_FROM_ALL TRUE)
 
-target_compile_definitions(tfm_qcbor_s
-    PRIVATE
-        QCBOR_DISABLE_FLOAT_HW_USE
-)
-
-target_include_directories(tfm_qcbor_s
+target_compile_options(qcbor
     PUBLIC
-        $<BUILD_INTERFACE:${QCBOR_PATH}/inc>
+        ${COMPILER_CP_FLAG}
+)
+
+target_include_directories(qcbor
     INTERFACE
         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
-        $<BUILD_INTERFACE:${QCBOR_PATH}/inc/qcbor>
-)
-
-target_link_libraries(tfm_qcbor_s
-    PRIVATE
-        tfm_attestation_defs
-        tfm_t_cose_defs
-)
-
-target_compile_options(tfm_qcbor_s
-    PRIVATE
-        ${COMPILER_CP_FLAG}
 )
diff --git a/lib/ext/t_cose/CMakeLists.txt b/lib/ext/t_cose/CMakeLists.txt
index 586e7c6..3e2420a 100644
--- a/lib/ext/t_cose/CMakeLists.txt
+++ b/lib/ext/t_cose/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -54,8 +54,8 @@
     PUBLIC
         tfm_t_cose_common
         tfm_t_cose_defs
-        tfm_qcbor_s
         psa_interface
+        qcbor
 )
 
 target_compile_options(tfm_t_cose_s
diff --git a/lib/ext/t_cose/inc/t_cose_mac0_sign.h b/lib/ext/t_cose/inc/t_cose_mac0_sign.h
index fa98210..40dfd16 100644
--- a/lib/ext/t_cose/inc/t_cose_mac0_sign.h
+++ b/lib/ext/t_cose/inc/t_cose_mac0_sign.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -9,7 +9,7 @@
 #define __T_COSE_MAC0_SIGN_H_
 
 #include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_common.h"
 
 #ifdef __cplusplus
diff --git a/lib/ext/t_cose/inc/t_cose_mac0_verify.h b/lib/ext/t_cose/inc/t_cose_mac0_verify.h
index 1b7c039..0d71e43 100644
--- a/lib/ext/t_cose/inc/t_cose_mac0_verify.h
+++ b/lib/ext/t_cose/inc/t_cose_mac0_verify.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020 Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -9,7 +9,7 @@
 #define __T_COSE_MAC0_VERIFY_H_
 
 #include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_common.h"
 
 #ifdef __cplusplus
diff --git a/lib/ext/t_cose/inc/t_cose_sign1_sign.h b/lib/ext/t_cose/inc/t_cose_sign1_sign.h
index 0dcf096..d8cbf0b 100644
--- a/lib/ext/t_cose/inc/t_cose_sign1_sign.h
+++ b/lib/ext/t_cose/inc/t_cose_sign1_sign.h
@@ -13,7 +13,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_common.h"
 
 #ifdef __cplusplus
diff --git a/lib/ext/t_cose/src/t_cose_mac0_sign.c b/lib/ext/t_cose/src/t_cose_mac0_sign.c
index 4cd30e9..fffd262 100644
--- a/lib/ext/t_cose/src/t_cose_mac0_sign.c
+++ b/lib/ext/t_cose/src/t_cose_mac0_sign.c
@@ -1,13 +1,13 @@
 /*
  * Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
  * See BSD-3-Clause license in README.md
  */
 
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_crypto.h"
 #include "t_cose_mac0_sign.h"
 #include "t_cose_util.h"
diff --git a/lib/ext/t_cose/src/t_cose_mac0_verify.c b/lib/ext/t_cose/src/t_cose_mac0_verify.c
index b75cbda..fb5f633 100644
--- a/lib/ext/t_cose/src/t_cose_mac0_verify.c
+++ b/lib/ext/t_cose/src/t_cose_mac0_verify.c
@@ -1,13 +1,13 @@
 /*
  * Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
  * See BSD-3-Clause license in README.md
  */
 
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_crypto.h"
 #include "t_cose_mac0_verify.h"
 #include "t_cose_parameters.h"
diff --git a/lib/ext/t_cose/src/t_cose_parameters.h b/lib/ext/t_cose/src/t_cose_parameters.h
index b51e861..c594923 100644
--- a/lib/ext/t_cose/src/t_cose_parameters.h
+++ b/lib/ext/t_cose/src/t_cose_parameters.h
@@ -2,7 +2,7 @@
  * t_cose_parameters.h
  *
  * Copyright 2019, Laurence Lundblade
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -16,7 +16,7 @@
 #include "q_useful_buf.h"
 #include "t_cose_common.h"
 #include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 
 
 /**
diff --git a/lib/ext/t_cose/src/t_cose_sign1_sign.c b/lib/ext/t_cose/src/t_cose_sign1_sign.c
index 0169c83..de11a9a 100644
--- a/lib/ext/t_cose/src/t_cose_sign1_sign.c
+++ b/lib/ext/t_cose/src/t_cose_sign1_sign.c
@@ -9,7 +9,7 @@
  */
 
 #include "t_cose_sign1_sign.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_standard_constants.h"
 #include "t_cose_crypto.h"
 #include "t_cose_util.h"
@@ -464,4 +464,3 @@
 Done:
     return return_value;
 }
-
diff --git a/lib/ext/t_cose/src/t_cose_sign1_verify.c b/lib/ext/t_cose/src/t_cose_sign1_verify.c
index 260aede..fb9d260 100644
--- a/lib/ext/t_cose/src/t_cose_sign1_verify.c
+++ b/lib/ext/t_cose/src/t_cose_sign1_verify.c
@@ -10,7 +10,7 @@
 
 
 #include "t_cose_sign1_verify.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_crypto.h"
 #include "q_useful_buf.h"
 #include "t_cose_util.h"
diff --git a/lib/ext/t_cose/src/t_cose_util.c b/lib/ext/t_cose/src/t_cose_util.c
index b6c9f11..f6dacee 100644
--- a/lib/ext/t_cose/src/t_cose_util.c
+++ b/lib/ext/t_cose/src/t_cose_util.c
@@ -2,7 +2,7 @@
  *  t_cose_util.c
  *
  * Copyright 2019, Laurence Lundblade
- * Copyright (c) 2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -10,7 +10,7 @@
  */
 
 #include "t_cose_util.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_standard_constants.h"
 #include "t_cose_common.h"
 #include "t_cose_crypto.h"
diff --git a/lib/ext/t_cose/test/t_cose_make_test_messages.c b/lib/ext/t_cose/test/t_cose_make_test_messages.c
index 9293b63..89bb784 100644
--- a/lib/ext/t_cose/test/t_cose_make_test_messages.c
+++ b/lib/ext/t_cose/test/t_cose_make_test_messages.c
@@ -9,7 +9,7 @@
  */
 
 #include "t_cose_make_test_messages.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_crypto.h"
 #include "t_cose_util.h"
 
@@ -605,4 +605,3 @@
 Done:
     return return_value;
 }
-
diff --git a/lib/ext/t_cose/test/t_cose_make_test_messages.h b/lib/ext/t_cose/test/t_cose_make_test_messages.h
index d1babce..f959ca9 100644
--- a/lib/ext/t_cose/test/t_cose_make_test_messages.h
+++ b/lib/ext/t_cose/test/t_cose_make_test_messages.h
@@ -14,7 +14,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "t_cose_common.h"
 #include "t_cose_sign1_sign.h"
 
diff --git a/lib/ext/tf-m-tests/repo_config_default.cmake b/lib/ext/tf-m-tests/repo_config_default.cmake
index 418ea12..7110be9 100644
--- a/lib/ext/tf-m-tests/repo_config_default.cmake
+++ b/lib/ext/tf-m-tests/repo_config_default.cmake
@@ -10,5 +10,5 @@
 # Default configs of tf-m-tests repo
 
 set(TFM_TEST_REPO_PATH                  "DOWNLOAD"  CACHE PATH      "Path to TFM-TEST repo (or DOWNLOAD to fetch automatically")
-set(TFM_TEST_REPO_VERSION               "5e0027d7"  CACHE STRING    "The version of tf-m-tests to use")
+set(TFM_TEST_REPO_VERSION               "66e119aa"  CACHE STRING    "The version of tf-m-tests to use")
 set(CMSIS_5_PATH                        "DOWNLOAD"  CACHE PATH      "Path to CMSIS_5 (or DOWNLOAD to fetch automatically")
diff --git a/platform/ext/target/arm/rss/common/config.cmake b/platform/ext/target/arm/rss/common/config.cmake
index 36fc871..a17e7f9 100644
--- a/platform/ext/target/arm/rss/common/config.cmake
+++ b/platform/ext/target/arm/rss/common/config.cmake
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2022, Arm Limited. All rights reserved.
+# Copyright (c) 2022-2023, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -44,7 +44,7 @@
 set(TFM_MBEDCRYPTO_PLATFORM_EXTRA_CONFIG_PATH ${CMAKE_CURRENT_LIST_DIR}/mbedtls_extra_config.h CACHE PATH "Config to append to standard Mbed Crypto config, used by platforms to cnfigure feature support")
 
 set(TFM_EXTRAS_REPO_PATH                "DOWNLOAD" CACHE PATH    "Path to tf-m-extras repo (or DOWNLOAD to fetch automatically")
-set(TFM_EXTRAS_REPO_VERSION             "f5f67d9"  CACHE STRING  "The version of tf-m-extras to use")
+set(TFM_EXTRAS_REPO_VERSION             "d337ed7"  CACHE STRING  "The version of tf-m-extras to use")
 set(TFM_EXTRAS_REPO_EXTRA_PARTITIONS    "measured_boot;delegated_attestation" CACHE STRING "List of extra secure partition directory name(s)")
 # Below TFM_EXTRAS_REPO_EXTRA_MANIFEST_LIST path is relative to tf-m-extras repo
 set(TFM_EXTRAS_REPO_EXTRA_MANIFEST_LIST "partitions/measured_boot/measured_boot_manifest_list.yaml;partitions/delegated_attestation/delegated_attestation_manifest_list.yaml" CACHE STRING "List of extra secure partition manifests")
diff --git a/secure_fw/partitions/initial_attestation/CMakeLists.txt b/secure_fw/partitions/initial_attestation/CMakeLists.txt
index ffdf1e1..c368562 100644
--- a/secure_fw/partitions/initial_attestation/CMakeLists.txt
+++ b/secure_fw/partitions/initial_attestation/CMakeLists.txt
@@ -1,5 +1,5 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2020-2022, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2023, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -50,10 +50,10 @@
     PRIVATE
         platform_s
         tfm_config
-        tfm_qcbor_s
         tfm_t_cose_s
         tfm_sprt
         tfm_boot_status
+        qcbor
 )
 
 target_compile_definitions(tfm_psa_rot_partition_attestation
diff --git a/secure_fw/partitions/initial_attestation/attest_asymmetric_key.c b/secure_fw/partitions/initial_attestation/attest_asymmetric_key.c
index 1a8b773..5b47c64 100644
--- a/secure_fw/partitions/initial_attestation/attest_asymmetric_key.c
+++ b/secure_fw/partitions/initial_attestation/attest_asymmetric_key.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019-2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2023, Arm Limited. All rights reserved.
  * Copyright (c) 2018-2019, Laurence Lundblade.
  *
  * SPDX-License-Identifier: BSD-3-Clause
@@ -14,7 +14,7 @@
 #include "tfm_plat_device_id.h"
 #include "t_cose_standard_constants.h"
 #include "q_useful_buf.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #include "tfm_crypto_defs.h"
 
 #define ATTEST_ECC_PUBLIC_KEY_SIZE \
diff --git a/secure_fw/partitions/initial_attestation/attest_boot_data.h b/secure_fw/partitions/initial_attestation/attest_boot_data.h
index c794cac..0ca92c1 100644
--- a/secure_fw/partitions/initial_attestation/attest_boot_data.h
+++ b/secure_fw/partitions/initial_attestation/attest_boot_data.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022, Arm Limited. All rights reserved.
+ * Copyright (c) 2022-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -11,7 +11,7 @@
 #include <stdint.h>
 #include "attest.h"
 #include "psa/initial_attestation.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/secure_fw/partitions/initial_attestation/attest_token.h b/secure_fw/partitions/initial_attestation/attest_token.h
index e121855..e3abf62 100644
--- a/secure_fw/partitions/initial_attestation/attest_token.h
+++ b/secure_fw/partitions/initial_attestation/attest_token.h
@@ -2,7 +2,7 @@
  * attest_token.h
  *
  * Copyright (c) 2018-2019, Laurence Lundblade.
- * Copyright (c) 2020-2022, Arm Limited.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -13,7 +13,7 @@
 #define __ATTEST_TOKEN_H__
 
 #include <stdint.h>
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #ifdef SYMMETRIC_INITIAL_ATTESTATION
 #include "t_cose_mac0_sign.h"
 #else
diff --git a/secure_fw/partitions/initial_attestation/attest_token_encode.c b/secure_fw/partitions/initial_attestation/attest_token_encode.c
index c4239d6..a02480d 100644
--- a/secure_fw/partitions/initial_attestation/attest_token_encode.c
+++ b/secure_fw/partitions/initial_attestation/attest_token_encode.c
@@ -2,7 +2,7 @@
  * attest_token_encode.c
  *
  * Copyright (c) 2018-2019, Laurence Lundblade. All rights reserved.
- * Copyright (c) 2020-2022, Arm Limited.
+ * Copyright (c) 2020-2023, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -11,7 +11,7 @@
 
 #include "attest_token.h"
 #include "config_attest.h"
-#include "qcbor.h"
+#include "qcbor/qcbor.h"
 #ifdef SYMMETRIC_INITIAL_ATTESTATION
 #include "t_cose_mac0_sign.h"
 #else