Skip to content

Commit 2c5cc0d

Browse files
committed
chore(rust): fips feature
1 parent 45f7f15 commit 2c5cc0d

File tree

7 files changed

+59
-26
lines changed

7 files changed

+59
-26
lines changed

.github/workflows/library_rust_tests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ jobs:
9191
if: matrix.os == 'windows-latest'
9292
uses: ilammy/setup-nasm@v1
9393

94+
# Go is needed for aws-lc-FIPS
95+
- name: Install Go
96+
uses: actions/setup-go@v5
97+
with:
98+
go-version: ">=1.18"
99+
94100
- name: Install Smithy-Dafny codegen dependencies
95101
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies
96102

@@ -121,6 +127,12 @@ jobs:
121127
run: |
122128
make test_rust
123129
130+
- name: Test ${{ matrix.library }} Rust Fips
131+
shell: bash
132+
working-directory: ./${{ matrix.library }}/runtimes/rust/
133+
run: |
134+
cargo test --release --features fips -- --nocapture
135+
124136
- name: Test ${{ matrix.library }} Rust Debug
125137
if: ${{ matrix.library != 'TestVectors' }}
126138
shell: bash

DynamoDbEncryption/runtimes/rust/Cargo.toml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "aws-db-esdk"
33
version = "1.1.1"
44
edition = "2021"
5-
rust-version = "1.81.0"
5+
rust-version = "1.86.0"
66
keywords = ["cryptography", "security", "dynamodb", "encryption", "client-side"]
77
license = "ISC AND (Apache-2.0 OR ISC)"
88
description = "aws-db-esdk is a library for implementing client side encryption with DynamoDB."
@@ -16,20 +16,26 @@ readme = "README.md"
1616
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717

1818
[dependencies]
19-
aws-config = "1.6.3"
20-
aws-lc-rs = "1.13.1"
21-
aws-lc-sys = "0.29.0"
22-
aws-sdk-dynamodb = "1.73.0"
23-
aws-sdk-kms = "1.67.0"
24-
aws-smithy-runtime-api = {version = "1.8.0", features = ["client"] }
25-
aws-smithy-types = "1.3.1"
19+
aws-config = "1.8.5"
20+
aws-lc-rs = {version = "1.13.3"}
21+
aws-lc-sys = { version = "0.30", optional = true }
22+
aws-lc-fips-sys = { version = "0.13", optional = true }
23+
aws-sdk-dynamodb = "1.90.0"
24+
aws-sdk-kms = "1.84.0"
25+
aws-smithy-runtime-api = {version = "1.9.0", features = ["client"] }
26+
aws-smithy-types = "1.3.2"
2627
chrono = "0.4.41"
2728
cpu-time = "1.0.0"
2829
dafny_runtime = { path = "../../../submodules/smithy-dafny/TestModels/dafny-dependencies/dafny_runtime_rust", features = ["sync","small-int"] }
2930
dashmap = "6.1.0"
3031
pem = "3.0.5"
31-
tokio = {version = "1.45.1", features = ["full"] }
32-
uuid = { version = "1.17.0", features = ["v4"] }
32+
tokio = {version = "1.47.1", features = ["full"] }
33+
uuid = { version = "1.18.0", features = ["v4"] }
3334

3435
[[example]]
3536
name = "main"
37+
38+
[features]
39+
fips = ["aws-lc-rs/fips", "dep:aws-lc-fips-sys"]
40+
non-fips = ["aws-lc-rs/aws-lc-sys", "dep:aws-lc-sys"]
41+
default = ["non-fips"]

DynamoDbEncryption/runtimes/rust/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ pub mod operation;
8686
/// Types for the transform client. Rarely useful.
8787
pub mod types;
8888

89+
#[cfg(feature = "fips")]
90+
use aws_lc_fips_sys as aws_lc_sys_impl;
91+
92+
#[cfg(not(feature = "fips"))]
93+
use aws_lc_sys as aws_lc_sys_impl;
94+
8995
pub use client::Client;
9096
pub use types::dynamo_db_tables_encryption_config::DynamoDbTablesEncryptionConfig;
9197

TestVectors/runtimes/rust/Cargo.toml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,29 @@
22
name = "aws-db-esdk-test-vectors"
33
version = "0.1.0"
44
edition = "2021"
5-
rust-version = "1.81.0"
5+
rust-version = "1.86.0"
66

77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

9-
[features]
10-
default = ["wrapped-client"]
11-
wrapped-client = []
12-
139
[dependencies]
14-
aws-config = "1.6.3"
15-
aws-lc-rs = "1.13.1"
16-
aws-lc-sys = "0.29.0"
17-
aws-sdk-dynamodb = "1.73.0"
18-
aws-sdk-kms = "1.67.0"
19-
aws-smithy-runtime-api = {version = "1.8.0", features = ["client"] }
20-
aws-smithy-types = "1.3.1"
10+
aws-config = "1.8.5"
11+
aws-lc-rs = {version = "1.13.3"}
12+
aws-lc-sys = { version = "0.30", optional = true }
13+
aws-lc-fips-sys = { version = "0.13", optional = true }
14+
aws-sdk-dynamodb = "1.90.0"
15+
aws-sdk-kms = "1.84.0"
16+
aws-smithy-runtime-api = {version = "1.9.0", features = ["client"] }
17+
aws-smithy-types = "1.3.2"
2118
chrono = "0.4.41"
2219
cpu-time = "1.0.0"
2320
dafny_runtime = { path = "../../../submodules/smithy-dafny/TestModels/dafny-dependencies/dafny_runtime_rust", features = ["sync","small-int"] }
2421
dashmap = "6.1.0"
2522
pem = "3.0.5"
26-
tokio = {version = "1.45.1", features = ["full"] }
27-
uuid = { version = "1.17.0", features = ["v4"] }
23+
tokio = {version = "1.47.1", features = ["full"] }
24+
uuid = { version = "1.18.0", features = ["v4"] }
25+
26+
[features]
27+
wrapped-client = []
28+
fips = ["aws-lc-rs/fips", "dep:aws-lc-fips-sys"]
29+
non-fips = ["aws-lc-rs/aws-lc-sys", "dep:aws-lc-sys"]
30+
default = ["non-fips", "wrapped-client"]

TestVectors/runtimes/rust/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ pub mod intercept;
1717
#[cfg(feature = "wrapped-client")]
1818
pub mod wrapped;
1919

20+
#[cfg(feature = "fips")]
21+
use aws_lc_fips_sys as aws_lc_sys_impl;
22+
23+
#[cfg(not(feature = "fips"))]
24+
use aws_lc_sys as aws_lc_sys_impl;
25+
2026
mod standard_library_conversions;
2127
mod standard_library_externs;
2228

submodules/smithy-dafny

0 commit comments

Comments
 (0)