Skip to content

Commit

Permalink
aws_lc_rs_algs: Expose FIPS status
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Feb 2, 2024
1 parent add8fd7 commit 95065a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ std = ["alloc", "pki-types/std"]

[dependencies]
aws-lc-rs = { version = "1", optional = true, default-features = false, features = ["aws-lc-sys"] }
pki-types = { package = "rustls-pki-types", version = "1", default-features = false }
pki-types = { package = "rustls-pki-types", version = "1.2", default-features = false }
ring = { version = "0.17", default-features = false, optional = true }
untrusted = "0.9"

Expand Down
6 changes: 5 additions & 1 deletion src/aws_lc_rs_algs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use aws_lc_rs::signature;
use aws_lc_rs::{signature, try_fips_mode};
use pki_types::{AlgorithmIdentifier, InvalidSignature, SignatureVerificationAlgorithm};

use crate::signed_data::alg_id;
Expand Down Expand Up @@ -33,6 +33,10 @@ impl SignatureVerificationAlgorithm for AwsLcRsAlgorithm {
.verify(message, signature)
.map_err(|_| InvalidSignature)
}

fn fips(&self) -> bool {
try_fips_mode().is_ok()
}
}

/// ECDSA signatures using the P-256 curve and SHA-256.
Expand Down

0 comments on commit 95065a6

Please sign in to comment.