[mbedtls] add support for version 3.0.0 (#7001)

This commit adds forward compatibility with mbedTLS 3.0.

Changes that affected OpenThread implementation:

- Rename mbedtls_*_ret() cryptography functions whose deprecated
  variants have been removed (migration guide)

- Replace MBEDTLS_SSL_MAX_CONTENT_LEN with MBEDTLS_SSL_IN_CONTENT_LEN
  and MBEDTLS_SSL_OUT_CONTENT_LEN options (migration guide)

- Signature functions now require the hash length to match the
  expected value (migration guide)

- SSL key export interface change (migration guide) - this change
  affected us a little bit more, since Key Block for KEK generation is
  not part of mbedTLS callback anymore. I was able, however, to
  retrieve it from Master secret (did successfully commissioning
  between 2.2x vs 3.0). By the way, I clean up the code for KEK
  generation - I don't know why we also executed it for application
  CoAP secure?

- Separated MBEDTLS_SHA224_C and MBEDTLS_SHA256_C (migration guide)

- Most structure fields are now private (migration guide) - we use
  private fields just in two files in dtls.cpp and ecdsa.cpp. For now,
  I used a workaround by defining MBEDTLS_PRIVATE macro but we should
  request the mbedTLS team to provide us support for public
  getters.
This commit is contained in:
Łukasz Duda
2021-09-20 13:19:07 -07:00
committed by GitHub
parent 097aa4f65d
commit 00da94e20d
12 changed files with 194 additions and 44 deletions
+19
View File
@@ -121,6 +121,25 @@ jobs:
run: |
script/check-scan-build
mbedtls3-build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Bootstrap
run: |
sudo apt-get --no-install-recommends install -y ninja-build libreadline-dev libncurses-dev
rm -rf third_party/mbedtls/repo
- uses: actions/checkout@v2
with:
repository: ARMmbed/mbedtls
ref: v3.0.0
path: third_party/mbedtls/repo
- name: Build
run: |
./script/test build
arm-gcc:
name: arm-gcc-${{ matrix.gcc_ver }}
runs-on: ubuntu-18.04