Skip to content

Commit acec387

Browse files
authored
Add support for aws_lc_rs as crypto backend (#201)
Starting from [0.22.0, `rustls`](https://github.com/rustls/rustls/releases/tag/v%2F0.22.0), ecosystem has started supporting [`aws-lc-rs`](https://github.com/aws/aws-lc-rs) as crypto back-end. This latter replaces crypto functionalities provided by `ring`. The main reason behind this is to provide [FIPS](https://en.wikipedia.org/wiki/FIPS_140-2) compliance in the future via `aws-lc`: > Optional support for cryptography from [aws-lc-rs](https://github.com/aws/aws-lc-rs). Once the certification process completes , we will support FIPS mode using aws-lc-rs. --- This PR is implementing the [same](https://github.com/rustls/rustls/blob/4d1b762b5328a1714862ba73ec72d5522fe0c049/rustls/Cargo.toml#L19) supporting mechanism. In short: * if cfg(feature = "ring") -> ring (this will be the default) * if cfg(feature = "aws-lc-rc") -> aws-lc-rs * if both -> ~compile_error!~ EDIT: ring * if none -> compile_error!
1 parent 53a5232 commit acec387

File tree

8 files changed

+493
-122
lines changed

8 files changed

+493
-122
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
components: clippy
4141
- run: cargo clippy --all-features --all-targets
42-
- run: cargo clippy --no-default-features --all-targets
42+
- run: cargo clippy --no-default-features --features aws_lc_rs,pem --all-targets
4343

4444
rustdoc:
4545
name: Documentation
@@ -117,6 +117,8 @@ jobs:
117117
arch: amd64
118118
- name: Install Rust
119119
uses: dtolnay/rust-toolchain@stable
120+
- name: Install NASM for aws-lc-rs on Windows
121+
uses: ilammy/setup-nasm@v1
120122
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
121123
- run: vcpkg install openssl:x64-windows-static-md
122124
- name: Run cargo check
@@ -125,8 +127,8 @@ jobs:
125127
run: cargo test --all-targets
126128
- name: Run the tests with x509-parser enabled
127129
run: cargo test --verbose --features x509-parser --all-targets
128-
- name: Run the tests with no default features enabled
129-
run: cargo test --verbose --no-default-features --all-targets
130+
- name: Run the tests with aws_lc_rs backend enabled
131+
run: cargo test --verbose --no-default-features --features aws_lc_rs,pem --all-targets
130132

131133
build:
132134
strategy:
@@ -164,8 +166,8 @@ jobs:
164166
run: cargo test --all-targets
165167
- name: Run the tests with x509-parser enabled
166168
run: cargo test --verbose --features x509-parser --all-targets
167-
- name: Run the tests with no default features enabled
168-
run: cargo test --verbose --no-default-features --all-targets
169+
- name: Run the tests with aws_lc_rs backend enabled
170+
run: cargo test --verbose --no-default-features --features aws_lc_rs,pem --all-targets
169171

170172
coverage:
171173
name: Measure coverage

0 commit comments

Comments
 (0)