From d34a91cace5ea1b10d9a5af9c1d4055255074ca9 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 25 Jul 2022 11:56:18 +0530 Subject: [PATCH 1/5] esp-cryptoautlib: remove submodule and use from IDF component manager --- .gitmodules | 4 ---- components/mbedtls/CMakeLists.txt | 3 +-- .../atecc608_ecdsa/components/esp-cryptoauthlib | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 160000 examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib diff --git a/.gitmodules b/.gitmodules index 23c0bc2d55..c440cdcc39 100644 --- a/.gitmodules +++ b/.gitmodules @@ -51,10 +51,6 @@ path = components/tinyusb/tinyusb url = ../../espressif/tinyusb.git -[submodule "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib"] - path = examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib - url = ../../espressif/esp-cryptoauthlib.git - [submodule "components/cmock/CMock"] path = components/cmock/CMock url = ../../ThrowTheSwitch/CMock.git diff --git a/components/mbedtls/CMakeLists.txt b/components/mbedtls/CMakeLists.txt index 51d6331978..eb2ac55173 100644 --- a/components/mbedtls/CMakeLists.txt +++ b/components/mbedtls/CMakeLists.txt @@ -268,6 +268,5 @@ endif() # Link esp-cryptoauthlib to mbedtls if(CONFIG_ATCA_MBEDTLS_ECDSA) - idf_component_get_property(cryptoauthlib esp-cryptoauthlib COMPONENT_LIB) - target_link_libraries(${COMPONENT_LIB} ${linkage_type} ${cryptoauthlib}) + idf_component_optional_requires(PRIVATE espressif__esp-cryptoauthlib esp-cryptoauthlib) endif() diff --git a/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib b/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib deleted file mode 160000 index 985ea960f8..0000000000 --- a/examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 985ea960f83f67f66881e2dae57097e2a07b92a0 From 6db74398fe1922ae825b3a491e14027f408a167c Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 25 Jul 2022 12:00:28 +0530 Subject: [PATCH 2/5] examples/secure_element: add component manifest file for cryptoauthlib --- .../secure_element/atecc608_ecdsa/main/idf_component.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 examples/peripherals/secure_element/atecc608_ecdsa/main/idf_component.yml diff --git a/examples/peripherals/secure_element/atecc608_ecdsa/main/idf_component.yml b/examples/peripherals/secure_element/atecc608_ecdsa/main/idf_component.yml new file mode 100644 index 0000000000..6eb177a228 --- /dev/null +++ b/examples/peripherals/secure_element/atecc608_ecdsa/main/idf_component.yml @@ -0,0 +1,3 @@ +## IDF Component Manager Manifest File +dependencies: + espressif/esp-cryptoauthlib: "^3.3.1" From 481c295bc248b4b4e5601f7ae8ceccba0b07b64c Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 25 Jul 2022 13:51:52 +0530 Subject: [PATCH 3/5] cleanup remaining references for esp-cryptoauthlib --- .flake8 | 1 - .gitlab/ci/rules.yml | 1 - docs/en/COPYRIGHT.rst | 3 --- tools/ci/check_readme_links.py | 6 ------ tools/ci/static-analysis-rules.yml | 1 - 5 files changed, 12 deletions(-) diff --git a/.flake8 b/.flake8 index 0a4be0a0f7..7fe9791683 100644 --- a/.flake8 +++ b/.flake8 @@ -149,7 +149,6 @@ exclude = components/tinyusb, components/unity/unity, components/spiffs/spiffs, - examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib, # autogenerated scripts components/protocomm/python/constants_pb2.py, components/protocomm/python/sec0_pb2.py, diff --git a/.gitlab/ci/rules.yml b/.gitlab/ci/rules.yml index c356292c50..b4eea93164 100644 --- a/.gitlab/ci/rules.yml +++ b/.gitlab/ci/rules.yml @@ -173,7 +173,6 @@ - "components/tinyusb/tinyusb" - "components/unity/unity" - "components/heap/tlsf" - - "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib" - ".gitmodules" # for jobs: example_test*flash_encryption_wifi_high_traffic diff --git a/docs/en/COPYRIGHT.rst b/docs/en/COPYRIGHT.rst index 1ce90ddd22..f36b7fda61 100644 --- a/docs/en/COPYRIGHT.rst +++ b/docs/en/COPYRIGHT.rst @@ -55,8 +55,6 @@ These third party libraries can be included into the application (firmware) prod * `mynewt-nimble`_ Apache Mynewt NimBLE, Copyright 2015-2018, The Apache Software Foundation, is licensed under Apache License 2.0 as described in :component_file:`LICENSE file`. -* `cryptoauthlib`_ Microchip CryptoAuthentication Library - Copyright (c) 2015 - 2018 Microchip Technology Inc, is licensed under common Microchip software License as described in :example_file:`LICENSE file ` - * `TLSF allocator ` Two Level Segregated Fit memory allocator, Copyright (c) 2006-2016, Matthew Conte, and licensed under the BSD 3-clause license. * `qrcode`_ QR Code generator library Copyright (c) Project Nayuki, is licensed under MIT license. @@ -167,7 +165,6 @@ Copyright (C) 2011, ChaN, all right reserved. .. _ESP-IDF Programming Guide: https://docs.espressif.com/projects/esp-idf/en/latest/ .. _sphinx_idf_theme: https://github.com/espressif/sphinx_idf_theme .. _sphinx_rtd_theme: https://github.com/readthedocs/sphinx_rtd_theme -.. _cryptoauthlib: https://github.com/MicrochipTech/cryptoauthlib .. _qrcode: https://github.com/nayuki/QR-Code-generator .. _freemodbus: https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32 .. _SEGGER SystemView: https://www.segger.com/downloads/systemview/ diff --git a/tools/ci/check_readme_links.py b/tools/ci/check_readme_links.py index 80ed216d54..bf33b4a06f 100755 --- a/tools/ci/check_readme_links.py +++ b/tools/ci/check_readme_links.py @@ -18,8 +18,6 @@ from collections import defaultdict, namedtuple from pathlib import Path from typing import List -EXCLUDE_DOCS_LIST = ['examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib/cryptoauthlib/**'] - # The apple apps links are not accessible from the company network for some reason EXCLUDE_URL_LIST = ['https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141', 'https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630'] @@ -98,10 +96,6 @@ def get_md_links(folder: str) -> List: links = [] for path in (idf_path / folder).rglob('*.md'): - if any([path.relative_to(idf_path).match(exclude_doc) for exclude_doc in EXCLUDE_DOCS_LIST]): - print('{} - excluded'.format(path)) - continue - with path.open(encoding='utf8') as f: content = f.read() diff --git a/tools/ci/static-analysis-rules.yml b/tools/ci/static-analysis-rules.yml index f729329f02..d67022c636 100644 --- a/tools/ci/static-analysis-rules.yml +++ b/tools/ci/static-analysis-rules.yml @@ -30,7 +30,6 @@ skip: - "components/tinyusb/tinyusb" - "components/unity/unity" - "components/heap/tlsf" - - "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib" # disabled temporarily to pass the CI - "components/bt/common/btc/core/btc_task.c" From 047eac2f25bbe60c96d9ab7365cfd1c8db08e60f Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Mon, 25 Jul 2022 13:54:06 +0530 Subject: [PATCH 4/5] Add entry for cryptoauthlib component manager migration --- docs/en/migration-guides/release-5.x/removed-components.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/migration-guides/release-5.x/removed-components.rst b/docs/en/migration-guides/release-5.x/removed-components.rst index 9a3289dcb2..5b84229fd3 100644 --- a/docs/en/migration-guides/release-5.x/removed-components.rst +++ b/docs/en/migration-guides/release-5.x/removed-components.rst @@ -18,6 +18,7 @@ Following components are removed from ESP-IDF and moved to `IDF Component Regist * `sh2lib `_ * `expat `_ * `coap `_ +* `esp-cryptoauthlib `_ .. note:: Please note that http parser functionality which was previously part of ``nghttp`` component is now part of :component:`http_parser ` component. From 3c6fcb2b60c1639ff7325bf27e16d337a34aa27b Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Tue, 26 Jul 2022 12:02:36 +0530 Subject: [PATCH 5/5] tools: add hint for using esp-cryptoauthlib from manager --- tools/idf_py_actions/hints.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/idf_py_actions/hints.yml b/tools/idf_py_actions/hints.yml index 3643657534..541e5d6eb6 100644 --- a/tools/idf_py_actions/hints.yml +++ b/tools/idf_py_actions/hints.yml @@ -119,6 +119,10 @@ re: "fatal error: esp_adc_cal.h: No such file or directory" hint: "``esp_adc_cal`` component is no longer supported. New adc calibration driver is in ``esp_adc``. Legacy adc calibration driver has been moved into ``esp_adc`` component. To use legacy ``esp_adc_cal`` driver APIs, you should add ``esp_adc`` component to the list of component requirements in CMakeLists.txt. For more information run 'idf.py docs -sp migration-guides/release-5.x/peripherals.html'." +- + re: "fatal error: .*atca_mbedtls_wrap\\.h: No such file or directory" + hint: "To use CONFIG_ESP_TLS_USE_SECURE_ELEMENT option, please install `esp-cryptoauthlib` using 'idf.py add-dependency espressif/esp-cryptoauthlib'" + - re: "fatal error: [\\w/]+\\.h: No such file or directory" hint: "Please make sure that the header name is correct. Also please check if you've specified all component dependencies with 'idf_component_register(REQUIRES ...)'. If the component is not present then it should be added by the IDF Component Manager. For more information run 'idf.py docs -sp api-guides/build-system.html'.\nAlso, please check if the header file has been removed, renamed or relocated - refer to the migration guide for more information."