Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade rust-mbedtls to use 3.X mbedtls #215

Closed
Taowyoo opened this issue Nov 7, 2022 · 1 comment · Fixed by #213
Closed

Upgrade rust-mbedtls to use 3.X mbedtls #215

Taowyoo opened this issue Nov 7, 2022 · 1 comment · Fixed by #213
Assignees

Comments

@Taowyoo
Copy link
Collaborator

Taowyoo commented Nov 7, 2022

Upgrade is required to enable TLS 1.3 support.

Here is the change list when upgrading mbedtls from 2.X to 3.X:

Change list

Changes in mbedtls-sys

Cargo.toml change

  • features
    • zlib: support for TLS record-level compression is removed in mbedtls 3.X

      • Related options removed: MBEDTLS_ZLIB_SUPPORT
    • legacy_protocols: all protocal early than TLS 1.2 is removed in mbedtls 3.X

      • Related options removed: MBEDTLS_SSL_PROTO_SSL3, MBEDTLS_SSL_PROTO_TLS1, MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING
    • pkcs11: wrapper for libpkcs11-helper is removed in mbedtls 3.X

    • mpi_force_c_code: just removed, seems something specific to our usage

  • dependencies
    • A lot of version upgrade

Config/defines change

According to 3.0-migration-guide.md:

  • Output config file name changed from config.h to mbedtls_config.h

  • Do not define MBEDTLS_CONFIG_H in mbedtls_config.h

  • Do not #include <mbedtls/check_config.h>

Changes unchecked

  • MBEDTLS_CUSTOM_HAS_AESNI and MBEDTLS_CUSTOM_HAS_PADLOCK removed in mbedtls 3.X code base

Changes in mbedtls

Cargo.toml change

  • features
    • mpi_force_c_code, zlib, legacy_protocols removed to sync with changes in mbedtls-sys
  • dependencies
    • A lot of version upgrade

Code changes

  • Add prefix private_ to a lot of fields of mbedtls types
  • Removed and added some options in Error, self_tests, CipherType, CipherMode and CipherSuite to sync with changes in mbedtls 3.X
  • Provide random number generator for fn EcPoint::mul
  • Removed Md2 and Md4 since they are no longer supported in mbedtls 3.X
  • Remove CustomPk
  • Add TLS1_3SignatureAlgorithms, since TLS 1.3 need to explicitly config Signature Algorithms when building with both TLS1.2 and TLS 1.3 flags
  • Update tests accordingly
@Taowyoo Taowyoo self-assigned this Nov 7, 2022
@Taowyoo Taowyoo linked a pull request Nov 7, 2022 that will close this issue
@Taowyoo
Copy link
Collaborator Author

Taowyoo commented May 10, 2023

Moved to the new issue: #261

@Taowyoo Taowyoo closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant