Skip to content

Commit

Permalink
replace aws_lc_rs feat with aws-lc-rs
Browse files Browse the repository at this point in the history
We made a mistake using underscores in the original Rustls and Webpki
features. We patched over this in Rustls with an alias. Since we're
making semver incompat changes, let's fix it here properly.
  • Loading branch information
cpu committed Dec 31, 2024
1 parent ec8d9c1 commit 9f5ca71
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 69 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- --features=alloc
- --all-features
- --no-default-features
- --no-default-features --features alloc,std,aws_lc_rs
- --no-default-features --features alloc,std,aws-lc-rs

mode:
- # debug
Expand All @@ -127,7 +127,7 @@ jobs:
- features: --features=alloc
- features: --no-default-features
- features: --no-default-features --features alloc,std
- features: --no-default-features --features alloc,std,aws_lc_rs
- features: --no-default-features --features alloc,std,aws-lc-rs
- features: --all-features
mode: --release
- features: --all-features
Expand Down Expand Up @@ -189,17 +189,17 @@ jobs:
host_os: ubuntu-latest

# check aws-lc-rs alone
- features: --no-default-features --features alloc,std,aws_lc_rs
- features: --no-default-features --features alloc,std,aws-lc-rs
mode: # debug
rust_channel: stable
host_os: macos-latest

- features: --no-default-features --features alloc,std,aws_lc_rs
- features: --no-default-features --features alloc,std,aws-lc-rs
mode: # debug
rust_channel: stable
host_os: windows-latest

- features: --no-default-features --features alloc,std,aws_lc_rs
- features: --no-default-features --features alloc,std,aws-lc-rs
mode: # debug
rust_channel: stable
host_os: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ name = "webpki"
[features]
default = ["std", "ring"]
alloc = ["ring?/alloc", "pki-types/alloc"]
aws_lc_rs = ["dep:aws-lc-rs"]
aws-lc-rs = ["dep:aws-lc-rs"]
ring = ["dep:ring"]
std = ["alloc", "pki-types/std"]

Expand Down
38 changes: 19 additions & 19 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//! | `alloc` | Enable features that require use of the heap. Currently all RSA signature algorithms require this feature. |
//! | `std` | Enable features that require libstd. Implies `alloc`. |
//! | `ring` | Enable use of the *ring* crate for cryptography. |
//! | `aws_lc_rs` | Enable use of the aws-lc-rs crate for cryptography. |
//! | `aws-lc-rs` | Enable use of the aws-lc-rs crate for cryptography. Previously this feature was named `aws_lc_rs`. |
#![no_std]
#![warn(elided_lifetimes_in_paths, unreachable_pub, clippy::use_self)]
Expand All @@ -51,7 +51,7 @@ extern crate alloc;
#[macro_use]
mod der;

#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
mod aws_lc_rs_algs;
mod cert;
mod end_entity;
Expand Down Expand Up @@ -107,7 +107,7 @@ pub mod ring {
};
}

#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
/// Signature verification algorithm implementations using the aws-lc-rs crypto library.
pub mod aws_lc_rs {
pub use super::aws_lc_rs_algs::{
Expand All @@ -121,7 +121,7 @@ pub mod aws_lc_rs {

/// An array of all the verification algorithms exported by this crate.
///
/// This will be empty if the crate is built without the `ring` and `aws_lc_rs` features.
/// This will be empty if the crate is built without the `ring` and `aws-lc-rs` features.
pub static ALL_VERIFICATION_ALGS: &[&dyn types::SignatureVerificationAlgorithm] = &[
#[cfg(feature = "ring")]
ring::ECDSA_P256_SHA256,
Expand All @@ -147,35 +147,35 @@ pub static ALL_VERIFICATION_ALGS: &[&dyn types::SignatureVerificationAlgorithm]
ring::RSA_PSS_2048_8192_SHA384_LEGACY_KEY,
#[cfg(all(feature = "ring", feature = "alloc"))]
ring::RSA_PSS_2048_8192_SHA512_LEGACY_KEY,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P256_SHA256,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P256_SHA384,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P384_SHA256,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P384_SHA384,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P521_SHA256,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P521_SHA384,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ECDSA_P521_SHA512,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::ED25519,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PKCS1_2048_8192_SHA256,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PKCS1_2048_8192_SHA384,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PKCS1_2048_8192_SHA512,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PKCS1_3072_8192_SHA384,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PSS_2048_8192_SHA256_LEGACY_KEY,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PSS_2048_8192_SHA384_LEGACY_KEY,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
aws_lc_rs::RSA_PSS_2048_8192_SHA512_LEGACY_KEY,
];

Expand Down
2 changes: 1 addition & 1 deletion src/verify_cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ pub(crate) enum Role {
EndEntity,
}

#[cfg(all(test, feature = "alloc", any(feature = "ring", feature = "aws_lc_rs")))]
#[cfg(all(test, feature = "alloc", any(feature = "ring", feature = "aws-lc-rs")))]
mod tests {
use super::*;
use crate::test_utils;
Expand Down
4 changes: 2 additions & 2 deletions tests/better_tls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(any(feature = "ring", feature = "aws_lc_rs"))]
#![cfg(any(feature = "ring", feature = "aws-lc-rs"))]

use core::time::Duration;
use std::collections::HashMap;
Expand All @@ -16,7 +16,7 @@ use webpki::{anchor_from_trusted_cert, KeyUsage};
static ALGS: &[&dyn SignatureVerificationAlgorithm] = &[
#[cfg(feature = "ring")]
webpki::ring::ECDSA_P256_SHA256,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
webpki::aws_lc_rs::ECDSA_P256_SHA256,
];

Expand Down
2 changes: 1 addition & 1 deletion tests/client_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

#![cfg(all(feature = "alloc", any(feature = "ring", feature = "aws_lc_rs")))]
#![cfg(all(feature = "alloc", any(feature = "ring", feature = "aws-lc-rs")))]

use core::time::Duration;
use pki_types::{CertificateDer, UnixTime};
Expand Down
4 changes: 2 additions & 2 deletions tests/client_auth_revocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

#![cfg(any(feature = "ring", feature = "aws_lc_rs"))]
#![cfg(any(feature = "ring", feature = "aws-lc-rs"))]

use core::time::Duration;

Expand All @@ -25,7 +25,7 @@ use webpki::{
static ALGS: &[&dyn SignatureVerificationAlgorithm] = &[
#[cfg(feature = "ring")]
webpki::ring::ECDSA_P256_SHA256,
#[cfg(feature = "aws_lc_rs")]
#[cfg(feature = "aws-lc-rs")]
webpki::aws_lc_rs::ECDSA_P256_SHA256,
];

Expand Down
2 changes: 1 addition & 1 deletion tests/custom_ekus.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(all(feature = "alloc", any(feature = "ring", feature = "aws_lc_rs")))]
#![cfg(all(feature = "alloc", any(feature = "ring", feature = "aws-lc-rs")))]

use core::time::Duration;

Expand Down
6 changes: 3 additions & 3 deletions tests/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,9 @@ def signatures(force: bool) -> None:
}

feature_gates = {
"ECDSA_P521_SHA256": 'all(not(feature = "ring"), feature = "aws_lc_rs")',
"ECDSA_P521_SHA384": 'all(not(feature = "ring"), feature = "aws_lc_rs")',
"ECDSA_P521_SHA512": 'all(not(feature = "ring"), feature = "aws_lc_rs")',
"ECDSA_P521_SHA256": 'all(not(feature = "ring"), feature = "aws-lc-rs")',
"ECDSA_P521_SHA384": 'all(not(feature = "ring"), feature = "aws-lc-rs")',
"ECDSA_P521_SHA512": 'all(not(feature = "ring"), feature = "aws-lc-rs")',
}

rsa_types: list[str] = [
Expand Down
2 changes: 1 addition & 1 deletion tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

#![cfg(any(feature = "ring", feature = "aws_lc_rs"))]
#![cfg(any(feature = "ring", feature = "aws-lc-rs"))]

use core::time::Duration;

Expand Down
Loading

0 comments on commit 9f5ca71

Please sign in to comment.