Skip to content

Commit

Permalink
tests: simplify compile guards in custom_ekus module
Browse files Browse the repository at this point in the history
  • Loading branch information
djc authored and ctz committed Jul 26, 2023
1 parent 1191c98 commit 3814c03
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/custom_ekus.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(feature = "alloc")]
#![cfg(feature = "alloc")]

use webpki::ExtendedKeyUsage::{Required, RequiredIfPresent};

#[cfg(feature = "alloc")]
fn check_cert(
ee: &[u8],
ca: &[u8],
Expand All @@ -24,22 +24,18 @@ fn check_cert(
);
}

#[cfg(feature = "alloc")]
#[allow(clippy::identity_op)]
static EKU_CLIENT_AUTH: webpki::KeyPurposeId =
webpki::KeyPurposeId::new(&[(40 * 1) + 3, 6, 1, 5, 5, 7, 3, 2]);

#[cfg(feature = "alloc")]
#[allow(clippy::identity_op)]
static EKU_SERVER_AUTH: webpki::KeyPurposeId =
webpki::KeyPurposeId::new(&[(40 * 1) + 3, 6, 1, 5, 5, 7, 3, 1]);

#[cfg(feature = "alloc")]
#[allow(clippy::identity_op)]
static EKU_MDOC_ISSUER_AUTH: webpki::KeyPurposeId =
webpki::KeyPurposeId::new(&[(40 * 1) + 0, 129, 140, 93, 5, 1, 2]);

#[cfg(feature = "alloc")]
#[test]
pub fn verify_custom_eku_mdoc() {
let err = Err(webpki::Error::RequiredEkuNotFound);
Expand All @@ -59,7 +55,6 @@ pub fn verify_custom_eku_mdoc() {
check_cert(ee, ca, RequiredIfPresent(EKU_SERVER_AUTH), time, err);
}

#[cfg(feature = "alloc")]
#[test]
pub fn verify_custom_eku_client() {
let err = Err(webpki::Error::RequiredEkuNotFound);
Expand Down

0 comments on commit 3814c03

Please sign in to comment.