Skip to content

Conversation

@jadamcrain
Copy link
Member

Adds support for AWS-LC as an alternative cryptographic provider for TLS, alongside the existing Ring implementation. This allows users to choose the crypto provider that best suits their platform and performance requirements.

New Features

  • tls-aws-lc feature: Enables TLS with AWS-LC crypto provider
  • enable-tls feature: Internal feature flag that gates all TLS code, enabled by both tls and tls-aws-lc

Updated Features

  • tls feature: Now explicitly uses Ring crypto provider via sfio-rustls-config/crypto-ring

CI Updates

FFI binaries now use the optimal crypto provider for each platform:

  • AWS-LC (tls-aws-lc): Windows, macOS, x86_64-linux-gnu, aarch64-linux-gnu)
  • Ring (tls): musl targets and 32-bit ARM Linux platforms

Motivation

AWS-LC is maintained by a (MUCH) larger team and the long term prospects for its support are superior. Secondarily
it provides better performance on modern 64-bit platforms (x86_64 and ARM64), while Ring offers superior compatibility with musl libc and 32-bit ARM architectures.

Breaking Changes

None. The default feature set remains unchanged (tls and serial), continuing to use Ring as the crypto provider.

Usage

Users can now choose their crypto provider when building:

# Use Ring (default) - `tls,serial` features enabled by default
cargo build
# Use AWS-LC
cargo build --no-default-features --features tls-aws-lc,serial

@gemini-code-assist
Copy link

Summary of Changes

Hello @jadamcrain, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the flexibility of TLS cryptographic providers by integrating AWS-LC as an alternative to the existing Ring implementation. It allows users to choose the optimal crypto backend based on their platform and performance requirements, leveraging AWS-LC for modern 64-bit systems and retaining Ring for broader compatibility with musl and 32-bit ARM. The changes are implemented through new and updated feature flags, ensuring that the default behavior remains consistent while offering powerful new options for advanced configurations.

Highlights

  • Dual TLS Cryptographic Providers: Introduces support for AWS-LC as an alternative TLS cryptographic provider, alongside the existing Ring implementation, offering users more choice.
  • New Feature Flags: A new tls-aws-lc feature enables AWS-LC, while the existing tls feature is updated to explicitly use Ring. An internal enable-tls feature now gates all TLS code.
  • Optimized CI Binaries: CI configurations are updated to build FFI binaries using AWS-LC for Windows, macOS, and 64-bit Linux, and Ring for musl targets and 32-bit ARM Linux.
  • Performance and Compatibility: AWS-LC is highlighted for better long-term support and performance on modern 64-bit platforms, while Ring offers superior compatibility with musl libc and 32-bit ARM architectures.
  • No Breaking Changes: The default feature set (tls and serial) remains unchanged, continuing to use Ring as the crypto provider, ensuring backward compatibility.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist
Copy link

Summary of Changes

Hello @jadamcrain, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the flexibility of the system's TLS capabilities by integrating AWS-LC as an alternative cryptographic backend. This strategic addition provides users with a choice of crypto providers, enabling them to optimize for either superior long-term support and performance on modern 64-bit systems with AWS-LC, or broader compatibility with musl libc and 32-bit ARM architectures offered by the existing Ring implementation. The changes are implemented through new feature flags and conditional compilation, ensuring that the default behavior remains unchanged while offering powerful new options for advanced configurations.

Highlights

  • New TLS Cryptographic Provider: Introduced support for AWS-LC as an alternative cryptographic provider for TLS, allowing users to choose between AWS-LC and the existing Ring implementation based on platform and performance needs.
  • New Feature Flags: Added a new tls-aws-lc feature to enable TLS with the AWS-LC crypto provider and an internal enable-tls feature flag that gates all TLS code, activated by both tls and tls-aws-lc.
  • Explicit Ring Crypto Provider: The existing tls feature now explicitly uses the Ring crypto provider via sfio-rustls-config/crypto-ring.
  • CI Optimization: Updated CI configurations to use AWS-LC for FFI binaries on Windows, macOS, x86_64-linux-gnu, and aarch64-linux-gnu, while retaining Ring for musl targets and 32-bit ARM Linux platforms.
  • Dependency Updates: Numerous new dependencies related to AWS-LC and its build process (e.g., aws-lc-rs, aws-lc-sys, bindgen, cmake) were added to Cargo.lock, and existing TLS-related dependencies like sfio-rustls-config and tokio-rustls were updated.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/ci.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for AWS-LC as an alternative cryptographic provider for TLS, which is a valuable addition for users seeking better performance and long-term support on modern platforms. The implementation is well-structured, particularly the use of the enable-tls feature flag to gate all TLS-related code, which simplifies conditional compilation across different crypto providers. The changes to Cargo.toml files are consistent and correctly define the new feature flags. The codebase is updated cleanly to use the new enable-tls feature. Making the crc dependency optional and part of the serial feature is also a good improvement. Overall, this is a high-quality pull request with well-thought-out changes.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for AWS-LC as an alternative cryptographic provider for TLS, which is a great addition for performance and long-term support. The changes are well-structured, particularly the introduction of the enable-tls feature flag to gate all TLS-related code, and the clear separation of ring and aws-lc providers into distinct features. I also appreciate the improvement of making the crc dependency optional and part of the serial feature, which slims down the dependency tree for users not requiring serial communication.

I have one suggestion to further improve the maintainability of the feature flags in rodbus/Cargo.toml by reducing some duplication. Overall, this is a high-quality contribution.

Comment on lines 44 to 46
enable-tls = []
tls = ["enable-tls", "rx509", "sfio-rustls-config/crypto-ring", "tokio-rustls"]
tls-aws-lc = ["enable-tls", "rx509", "sfio-rustls-config/crypto-aws-lc", "tokio-rustls"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and reduce duplication, you could move the common TLS dependencies into the enable-tls feature itself. This makes the definitions for tls and tls-aws-lc cleaner and ensures that all necessary TLS dependencies are enabled whenever any TLS feature is active.

Suggested change
enable-tls = []
tls = ["enable-tls", "rx509", "sfio-rustls-config/crypto-ring", "tokio-rustls"]
tls-aws-lc = ["enable-tls", "rx509", "sfio-rustls-config/crypto-aws-lc", "tokio-rustls"]
enable-tls = ["rx509", "tokio-rustls"]
tls = ["enable-tls", "sfio-rustls-config/crypto-ring"]
tls-aws-lc = ["enable-tls", "sfio-rustls-config/crypto-aws-lc"]

@jadamcrain jadamcrain merged commit a06cb27 into main Oct 15, 2025
26 checks passed
@jadamcrain jadamcrain deleted the aws-lc-rs branch October 15, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants