diff --git a/Makefile b/Makefile index 385dd97bc..56ec410b1 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,12 @@ test-wasm: test-wasm-web: cd sdk && wasm-pack test --chrome --headless -- --features="serialize_thumbnails" -# WASI testing requires the WASI SDK https://github.com/WebAssembly/wasi-sdk installed in /opt, -# wasmtime, and the target wasm32-wasip2 on the nightly toolchain +# WASI testing requires upstream llvm clang (not XCode), wasmtime, and the target wasm32-wasip2 on the nightly toolchain test-wasi: - CC=/opt/wasi-sdk/bin/clang CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime -S cli -S http --dir ." cargo +nightly test --target wasm32-wasip2 -p c2pa -p c2pa-crypto --all-features +ifeq ($(PLATFORM),mac) + $(eval CC := /opt/homebrew/opt/llvm/bin/clang) +endif + CC=$(CC) CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime -S cli -S http --dir ." cargo +nightly test --target wasm32-wasip2 -p c2pa -p c2pa-crypto --all-features rm -r sdk/Users # Full local validation, build and test all features including wasm diff --git a/cawg_identity/Cargo.toml b/cawg_identity/Cargo.toml index e3834908f..c2f31ee94 100644 --- a/cawg_identity/Cargo.toml +++ b/cawg_identity/Cargo.toml @@ -30,7 +30,7 @@ v1_api = ["c2pa/v1_api"] [dependencies] async-trait = "0.1.78" base64 = "0.22.1" -c2pa = { path = "../sdk", version = "0.46.0", features = ["openssl"] } +c2pa = { path = "../sdk", version = "0.46.0" } c2pa-crypto = { path = "../internal/crypto", version = "0.6.2" } c2pa-status-tracker = { path = "../internal/status-tracker", version = "0.5.0" } chrono = { version = "0.4.38", features = ["serde"] } diff --git a/make_test_images/Cargo.toml b/make_test_images/Cargo.toml index 72d290463..967631c61 100644 --- a/make_test_images/Cargo.toml +++ b/make_test_images/Cargo.toml @@ -32,4 +32,4 @@ tempfile = "3.15.0" [features] # prevents these features from being always enabled in the workspace -default = ["c2pa/openssl_sign", "c2pa/file_io"] +default = ["c2pa/file_io"] diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 2dbd30236..20b9bbcd8 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -27,12 +27,10 @@ rustdoc-args = ["--cfg", "docsrs"] [features] add_thumbnails = ["image"] -file_io = ["openssl_sign"] +file_io = [] serialize_thumbnails = [] no_interleaved_io = ["file_io"] fetch_remote_manifests = ["dep:wasi"] -openssl = [] -openssl_sign = ["openssl"] json_schema = ["dep:schemars", "c2pa-crypto/json_schema"] pdf = ["dep:lopdf"] v1_api = [] diff --git a/sdk/examples/client/main.rs b/sdk/examples/client/main.rs index 87eb85bbd..e24419757 100644 --- a/sdk/examples/client/main.rs +++ b/sdk/examples/client/main.rs @@ -15,10 +15,8 @@ use anyhow::Result; // This example is not designed to work with a wasm build // so we provide this shell to avoid testing errors -#[cfg(feature = "openssl")] mod client; fn main() -> Result<()> { - #[cfg(feature = "openssl")] client::main()?; Ok(()) } diff --git a/sdk/examples/data_hash.rs b/sdk/examples/data_hash.rs index 75b1f5d8e..b0b2b3bc1 100644 --- a/sdk/examples/data_hash.rs +++ b/sdk/examples/data_hash.rs @@ -14,13 +14,13 @@ // Example code (in unit test) for how you might use client DataHash values. This allows clients // to perform the manifest embedding and optionally the hashing -#[cfg(any(feature = "openssl_sign", feature = "file_io"))] +#[cfg(feature = "file_io")] use std::{ io::{Cursor, Read, Seek, Write}, path::{Path, PathBuf}, }; -#[cfg(any(feature = "openssl_sign", feature = "file_io"))] +#[cfg(feature = "file_io")] use c2pa::{ assertions::{ c2pa_action, labels::*, Action, Actions, CreativeWork, DataHash, Exif, SchemaDotOrgPerson, @@ -28,16 +28,16 @@ use c2pa::{ create_signer, hash_stream_by_alg, Builder, ClaimGeneratorInfo, HashRange, Ingredient, Reader, Relationship, Result, }; -#[cfg(any(feature = "openssl_sign", feature = "file_io"))] +#[cfg(feature = "file_io")] use c2pa_crypto::raw_signature::SigningAlg; fn main() -> std::result::Result<(), Box> { println!("DataHash demo"); - #[cfg(all(feature = "openssl_sign", feature = "file_io"))] + #[cfg(feature = "file_io")] user_data_hash_with_sdk_hashing()?; println!("Done with SDK hashing1"); - #[cfg(all(feature = "openssl_sign", feature = "file_io"))] + #[cfg(feature = "file_io")] user_data_hash_with_user_hashing()?; println!("Done with SDK hashing2"); Ok(()) @@ -86,7 +86,7 @@ fn builder_from_source>(source: S) -> Result { Ok(builder) } -#[cfg(all(feature = "openssl_sign", feature = "file_io"))] +#[cfg(feature = "file_io")] fn user_data_hash_with_sdk_hashing() -> Result<()> { // You will often implement your own Signer trait to perform on device signing let signcert_path = "sdk/tests/fixtures/certs/es256.pub"; @@ -146,7 +146,7 @@ fn user_data_hash_with_sdk_hashing() -> Result<()> { Ok(()) } -#[cfg(all(feature = "openssl_sign", feature = "file_io"))] +#[cfg(feature = "file_io")] fn user_data_hash_with_user_hashing() -> Result<()> { // You will often implement your own Signer trait to perform on device signing let signcert_path = "sdk/tests/fixtures/certs/es256.pub"; diff --git a/sdk/examples/show.rs b/sdk/examples/show.rs index 600c24c4c..9c760e33a 100644 --- a/sdk/examples/show.rs +++ b/sdk/examples/show.rs @@ -15,7 +15,6 @@ use anyhow::Result; use c2pa::Reader; -#[cfg(feature = "openssl")] fn main() -> Result<()> { let args: Vec = std::env::args().collect(); if args.len() > 1 { diff --git a/sdk/examples/v2api.rs b/sdk/examples/v2api.rs index 544fa8715..43f7ebd00 100644 --- a/sdk/examples/v2api.rs +++ b/sdk/examples/v2api.rs @@ -160,7 +160,6 @@ fn main() -> Result<()> { Ok(()) } -// #[cfg(feature = "openssl")] // use openssl::{error::ErrorStack, pkey::PKey}; // #[cfg(feature = "openssl")] // fn ed_sign(data: &[u8], pkey: &[u8]) -> std::result::Result, ErrorStack> { @@ -171,14 +170,14 @@ fn main() -> Result<()> { #[cfg(test)] mod tests { - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] use wasm_bindgen_test::*; use super::*; #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] + #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_v2_api() -> Result<()> { main() } diff --git a/sdk/examples/v2show.rs b/sdk/examples/v2show.rs index 06620fda9..62c2fb909 100644 --- a/sdk/examples/v2show.rs +++ b/sdk/examples/v2show.rs @@ -14,12 +14,12 @@ //! Example App that generates a manifest store listing for a given file use anyhow::Result; -#[cfg(any(not(feature = "openssl"), target_arch = "wasm32"))] +#[cfg(target_arch = "wasm32")] fn main() -> Result<()> { Ok(()) } -#[cfg(all(feature = "openssl", not(target_arch = "wasm32")))] +#[cfg(not(target_arch = "wasm32"))] fn main() -> Result<()> { use std::io::Read; diff --git a/sdk/src/assertions/bmff_hash.rs b/sdk/src/assertions/bmff_hash.rs index ce23c23a6..aa70cf6d3 100644 --- a/sdk/src/assertions/bmff_hash.rs +++ b/sdk/src/assertions/bmff_hash.rs @@ -1259,7 +1259,6 @@ pub mod tests { //use super::*; use crate::utils::test::fixture_path; - #[cfg(feature = "openssl")] #[test] fn test_fragemented_mp4() { use crate::{ diff --git a/sdk/src/asset_handlers/bmff_io.rs b/sdk/src/asset_handlers/bmff_io.rs index b5851f498..bc57316fb 100644 --- a/sdk/src/asset_handlers/bmff_io.rs +++ b/sdk/src/asset_handlers/bmff_io.rs @@ -1847,7 +1847,7 @@ pub mod tests { io_utils::tempdirectory, test::{fixture_path, temp_dir_path}, }; - #[cfg(all(feature = "openssl", feature = "file_io"))] + #[cfg(all(feature = "v1_api", feature = "file_io"))] #[test] fn test_read_mp4() { use c2pa_status_tracker::DetailedStatusTracker; diff --git a/sdk/src/builder.rs b/sdk/src/builder.rs index 881fd5ddc..386bfc84a 100644 --- a/sdk/src/builder.rs +++ b/sdk/src/builder.rs @@ -1116,9 +1116,9 @@ mod tests { use wasm_bindgen_test::*; use super::*; - #[cfg(any(feature = "openssl_sign", target_arch = "wasm32"))] - use crate::{assertions::BoxHash, asset_handlers::jpeg_io::JpegIO}; use crate::{ + assertions::BoxHash, + asset_handlers::jpeg_io::JpegIO, hash_stream_by_alg, utils::{test::write_jpeg_placeholder_stream, test_signer::test_signer}, validation_results::ValidationState, @@ -1190,7 +1190,7 @@ mod tests { .to_string() } - #[cfg(any(feature = "file_io", feature = "openssl_sign"))] + #[cfg(feature = "file_io")] const TEST_IMAGE_CLEAN: &[u8] = include_bytes!("../tests/fixtures/IMG_0003.jpg"); const TEST_IMAGE: &[u8] = include_bytes!("../tests/fixtures/CA.jpg"); const TEST_THUMBNAIL: &[u8] = include_bytes!("../tests/fixtures/thumbnail.jpg"); @@ -1290,7 +1290,6 @@ mod tests { } #[test] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] fn test_builder_sign() { #[derive(Serialize, Deserialize)] struct TestAssertion { @@ -1459,7 +1458,6 @@ mod tests { all(target_arch = "wasm32", not(target_os = "wasi")), wasm_bindgen_test )] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_builder_remote_sign() { let format = "image/jpeg"; @@ -1498,7 +1496,7 @@ mod tests { } #[test] - #[cfg(feature = "openssl_sign")] + #[cfg(feature = "file_io")] fn test_builder_remote_url() { let mut source = Cursor::new(TEST_IMAGE_CLEAN); let mut dest = Cursor::new(Vec::new()); @@ -1531,7 +1529,6 @@ mod tests { } #[test] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] fn test_builder_data_hashed_embeddable() { const CLOUD_IMAGE: &[u8] = include_bytes!("../tests/fixtures/cloud.jpg"); let mut input_stream = Cursor::new(CLOUD_IMAGE); @@ -1596,10 +1593,7 @@ mod tests { wasm_bindgen_test )] #[cfg_attr(target_os = "wasi", wstd::test)] - #[cfg(any( - target_arch = "wasm32", - all(feature = "openssl_sign", feature = "file_io") - ))] + #[cfg(any(target_arch = "wasm32", feature = "file_io"))] async fn test_builder_box_hashed_embeddable() { use crate::asset_io::{CAIWriter, HashBlockObjectType}; const BOX_HASH_IMAGE: &[u8] = include_bytes!("../tests/fixtures/boxhash.jpg"); @@ -1704,7 +1698,6 @@ mod tests { ); } - #[cfg(feature = "openssl_sign")] const MANIFEST_JSON: &str = r#"{ "claim_generator": "test", "claim_generator_info": [ @@ -1835,7 +1828,6 @@ mod tests { }"#; #[test] - #[cfg(feature = "openssl_sign")] /// tests and illustrates how to add assets to a non-file based manifest by using a stream fn from_json_with_stream_full_resources() { use crate::assertions::Relationship; diff --git a/sdk/src/claim.rs b/sdk/src/claim.rs index 0659734f3..02fc436f5 100644 --- a/sdk/src/claim.rs +++ b/sdk/src/claim.rs @@ -2845,7 +2845,6 @@ pub(crate) fn check_ocsp_status( } } -#[cfg(feature = "openssl")] #[cfg(test)] pub mod tests { #![allow(clippy::expect_used)] diff --git a/sdk/src/cose_sign.rs b/sdk/src/cose_sign.rs index 3cc757250..a39a0ed51 100644 --- a/sdk/src/cose_sign.rs +++ b/sdk/src/cose_sign.rs @@ -268,12 +268,11 @@ mod tests { use c2pa_crypto::raw_signature::SigningAlg; use super::sign_claim; - #[cfg(all(any(feature = "openssl_sign", target_os = "wasi"), feature = "file_io"))] + #[cfg(feature = "file_io")] use crate::utils::test_signer::async_test_signer; use crate::{claim::Claim, utils::test_signer::test_signer, Result, Signer}; #[test] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] fn test_sign_claim() { let mut claim = Claim::new("extern_sign_test", Some("contentauth"), 1); claim.build().unwrap(); @@ -288,7 +287,7 @@ mod tests { assert_eq!(cose_sign1.len(), box_size); } - #[cfg(all(any(feature = "openssl_sign", target_os = "wasi"), feature = "file_io"))] + #[cfg(feature = "file_io")] #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_sign_claim_async() { @@ -357,7 +356,6 @@ mod tests { let _cose_sign1 = sign_claim(&claim_bytes, &signer, box_size); - #[cfg(any(feature = "openssl", target_os = "wasi"))] // there is no verify on sign when openssl is disabled assert!(_cose_sign1.is_err()); } } diff --git a/sdk/src/cose_validator.rs b/sdk/src/cose_validator.rs index 5a433270f..d12066601 100644 --- a/sdk/src/cose_validator.rs +++ b/sdk/src/cose_validator.rs @@ -178,7 +178,6 @@ pub(crate) fn get_signing_info( #[allow(unused_imports)] #[allow(clippy::unwrap_used)] -#[cfg(feature = "openssl_sign")] #[cfg(test)] pub mod tests { use c2pa_crypto::raw_signature::SigningAlg; @@ -214,7 +213,6 @@ pub mod tests { assert_eq!(signing_time, None); } #[test] - #[cfg(feature = "openssl_sign")] fn test_stapled_ocsp() { use c2pa_crypto::{ raw_signature::{signer_from_cert_chain_and_private_key, RawSigner, RawSignerError}, diff --git a/sdk/src/ingredient.rs b/sdk/src/ingredient.rs index 3e34488d3..6c5cd2027 100644 --- a/sdk/src/ingredient.rs +++ b/sdk/src/ingredient.rs @@ -1491,20 +1491,23 @@ impl IngredientOptions for DefaultOptions { } } -#[cfg(all(test, not(target_os = "wasi")))] +#[cfg(test)] mod tests { #![allow(clippy::expect_used)] #![allow(clippy::unwrap_used)] - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] use wasm_bindgen_test::*; use super::*; - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); - #[cfg_attr(not(target_arch = "wasm32"), test)] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] + #[test] + #[cfg_attr( + all(target_arch = "wasm32", not(target_os = "wasi")), + wasm_bindgen_test + )] fn test_ingredient_api() { let mut ingredient = Ingredient::new("title", "format", "instance_id"); ingredient @@ -1560,8 +1563,11 @@ mod tests { } #[cfg_attr(not(target_arch = "wasm32"), actix::test)] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] + #[cfg_attr( + all(target_arch = "wasm32", not(target_os = "wasi")), + wasm_bindgen_test + )] + #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_stream_async_jpg() { let image_bytes = include_bytes!("../tests/fixtures/CA.jpg"); let title = "Test Image"; @@ -1576,7 +1582,7 @@ mod tests { assert_eq!(ingredient.format(), Some(format)); assert!(ingredient.manifest_data().is_some()); assert_eq!(ingredient.metadata(), None); - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] web_sys::console::debug_2( &"ingredient_from_memory_async:".into(), &ingredient.to_string().into(), @@ -1585,8 +1591,6 @@ mod tests { } #[test] - #[cfg_attr(any(target_arch = "wasm32", not(feature = "openssl")), ignore)] - // Note this does not work from wasm32, due to validation issues fn test_stream_jpg() { let image_bytes = include_bytes!("../tests/fixtures/CA.jpg"); let title = "Test Image"; @@ -1603,8 +1607,11 @@ mod tests { } #[cfg_attr(not(target_arch = "wasm32"), actix::test)] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] + #[cfg_attr( + all(target_arch = "wasm32", not(target_os = "wasi")), + wasm_bindgen_test + )] + #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_stream_ogp() { let image_bytes = include_bytes!("../tests/fixtures/XCA.jpg"); let title = "XCA.jpg"; @@ -1630,10 +1637,8 @@ mod tests { #[allow(dead_code)] #[cfg_attr(not(target_arch = "wasm32"), actix::test)] - #[cfg_attr( - not(all(feature = "openssl", feature = "fetch_remote_manifests")), - ignore - )] + #[cfg_attr(target_os = "wasi", wstd::test)] + #[cfg(feature = "fetch_remote_manifests")] async fn test_jpg_cloud_from_memory() { let image_bytes = include_bytes!("../tests/fixtures/cloud.jpg"); let format = "image/jpeg"; @@ -1651,14 +1656,17 @@ mod tests { #[allow(dead_code)] #[cfg_attr(not(any(target_arch = "wasm32", feature = "file_io")), actix::test)] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] + #[cfg_attr( + all(target_arch = "wasm32", not(target_os = "wasi")), + wasm_bindgen_test + )] + #[cfg_attr(all(target_os = "wasi", not(feature = "file_io")), wstd::test)] async fn test_jpg_cloud_from_memory_no_file_io() { let image_bytes = include_bytes!("../tests/fixtures/cloud.jpg"); let format = "image/jpeg"; let ingredient = Ingredient::from_memory_async(format, image_bytes) .await .expect("from_memory_async"); - // println!("ingredient = {ingredient}"); assert!(ingredient.validation_status().is_some()); assert_eq!( ingredient.validation_status().unwrap()[0].code(), @@ -1672,8 +1680,11 @@ mod tests { } #[cfg_attr(not(target_arch = "wasm32"), actix::test)] - #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] + #[cfg_attr( + all(target_arch = "wasm32", not(target_os = "wasi")), + wasm_bindgen_test + )] + #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_jpg_cloud_from_memory_and_manifest() { let asset_bytes = include_bytes!("../tests/fixtures/cloud.jpg"); let manifest_bytes = include_bytes!("../tests/fixtures/cloud_manifest.c2pa"); @@ -1685,7 +1696,7 @@ mod tests { ) .await .unwrap(); - #[cfg(target_arch = "wasm32")] + #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] web_sys::console::debug_2( &"ingredient_from_memory_async:".into(), &ingredient.to_string().into(), diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 432b3aad1..1d64f73e3 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -92,7 +92,6 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION"); // Public modules pub mod assertions; pub mod cose_sign; -#[cfg(feature = "openssl_sign")] pub mod create_signer; pub mod jumbf_io; pub mod settings; diff --git a/sdk/src/manifest.rs b/sdk/src/manifest.rs index 9b1c03934..b72cf6460 100644 --- a/sdk/src/manifest.rs +++ b/sdk/src/manifest.rs @@ -1936,7 +1936,7 @@ pub(crate) mod tests { assert_eq!(action2.unwrap().actions()[0].action(), c2pa_action::EDITED); } - #[cfg(all(feature = "file_io", feature = "openssl_sign"))] + #[cfg(feature = "file_io")] #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr(target_os = "wasi", wstd::test)] #[allow(deprecated)] @@ -1958,7 +1958,7 @@ pub(crate) mod tests { ); } - #[cfg(all(feature = "file_io", feature = "openssl_sign"))] + #[cfg(feature = "file_io")] #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr(target_os = "wasi", wstd::test)] #[allow(deprecated)] @@ -2035,7 +2035,6 @@ pub(crate) mod tests { wasm_bindgen_test )] #[allow(deprecated)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_embed_jpeg_stream_wasm() { use crate::assertions::User; @@ -2080,7 +2079,6 @@ pub(crate) mod tests { wasm_bindgen_test )] #[allow(deprecated)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_embed_png_stream_wasm() { use crate::assertions::User; @@ -2118,7 +2116,6 @@ pub(crate) mod tests { wasm_bindgen_test )] #[allow(deprecated)] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] #[cfg_attr(target_os = "wasi", wstd::test)] async fn test_embed_webp_stream_wasm() { use crate::assertions::User; @@ -2151,7 +2148,6 @@ pub(crate) mod tests { } #[test] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl_sign")), ignore)] fn test_embed_stream() { use crate::assertions::User; let image = include_bytes!("../tests/fixtures/earth_apollo17.jpg"); @@ -2188,19 +2184,13 @@ pub(crate) mod tests { //println!("{manifest_store}");main } - #[cfg_attr( - all(not(target_arch = "wasm32"), feature = "openssl_sign"), - actix::test - )] + #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr( all(target_arch = "wasm32", not(target_os = "wasi")), wasm_bindgen_test )] #[cfg_attr(target_os = "wasi", wstd::test)] - #[cfg(any( - target_arch = "wasm32", - all(feature = "openssl_sign", feature = "file_io") - ))] + #[cfg(any(target_arch = "wasm32", feature = "file_io"))] async fn test_embed_from_memory_async() { use crate::assertions::User; let image = include_bytes!("../tests/fixtures/earth_apollo17.jpg"); @@ -2330,7 +2320,6 @@ pub(crate) mod tests { assert_eq!(image.into_owned(), thumb_data); } - #[cfg(feature = "openssl_sign")] const MANIFEST_JSON: &str = r#"{ "claim_generator": "test", "claim_generator_info": [ @@ -2447,7 +2436,6 @@ pub(crate) mod tests { }"#; #[test] - #[cfg(feature = "openssl_sign")] /// tests and illustrates how to add assets to a non-file based manifest by using a stream fn from_json_with_stream() { use crate::assertions::Relationship; @@ -2516,7 +2504,6 @@ pub(crate) mod tests { } #[test] - #[cfg(feature = "openssl_sign")] #[allow(deprecated)] /// tests and illustrates how to add assets to a non-file based manifest by using a memory buffer fn from_json_with_memory() { @@ -2816,7 +2803,7 @@ pub(crate) mod tests { assert_eq!(manifest_store.validation_status(), None); } - #[cfg(all(feature = "file_io", feature = "openssl_sign"))] + #[cfg(feature = "file_io")] #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr(target_os = "wasi", wstd::test)] #[allow(deprecated)] diff --git a/sdk/src/manifest_store.rs b/sdk/src/manifest_store.rs index ffcc25353..ed6c6108a 100644 --- a/sdk/src/manifest_store.rs +++ b/sdk/src/manifest_store.rs @@ -590,7 +590,7 @@ impl std::fmt::Display for ManifestStore { } } -#[cfg(all(test, any(target_arch = "wasm32", feature = "openssl")))] +#[cfg(test)] mod tests { #![allow(clippy::expect_used)] #![allow(clippy::unwrap_used)] @@ -605,8 +605,6 @@ mod tests { #[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))] wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); - // #[cfg_attr(not(target_arch = "wasm32"), test)] - // #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] #[cfg_attr( all(target_arch = "wasm32", not(target_os = "wasi")), wasm_bindgen_test diff --git a/sdk/src/resource_store.rs b/sdk/src/resource_store.rs index 1aa0304ae..08c16e311 100644 --- a/sdk/src/resource_store.rs +++ b/sdk/src/resource_store.rs @@ -397,7 +397,6 @@ pub fn mime_from_uri(uri: &str) -> String { } #[cfg(test)] -#[cfg(feature = "openssl_sign")] mod tests { #![allow(clippy::expect_used)] #![allow(clippy::unwrap_used)] @@ -410,7 +409,6 @@ mod tests { use crate::{utils::test_signer::test_signer, Builder, Reader}; #[test] - #[cfg(feature = "openssl_sign")] fn resource_store() { let mut c = ResourceStore::new(); let value = b"my value"; diff --git a/sdk/src/store.rs b/sdk/src/store.rs index 73fcf32a4..9b56dabdc 100644 --- a/sdk/src/store.rs +++ b/sdk/src/store.rs @@ -6272,7 +6272,6 @@ pub mod tests { } #[test] - #[cfg(feature = "openssl_sign")] fn test_dynamic_assertions() { #[derive(Serialize)] struct TestAssertion { @@ -6402,7 +6401,6 @@ pub mod tests { #[cfg_attr(not(target_arch = "wasm32"), actix::test)] #[cfg_attr(target_os = "wasi", wstd::test)] - #[cfg(feature = "openssl_sign")] async fn test_async_dynamic_assertions() { use async_trait::async_trait; diff --git a/sdk/tests/test_builder.rs b/sdk/tests/test_builder.rs index 68ba77b67..9c3dcd434 100644 --- a/sdk/tests/test_builder.rs +++ b/sdk/tests/test_builder.rs @@ -47,7 +47,6 @@ fn test_builder_ca_jpg() -> Result<()> { // Source: https://github.com/contentauth/c2pa-rs/issues/530 #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_builder_riff() -> Result<()> { let manifest_def = include_str!("fixtures/simple_manifest.json"); let mut source = Cursor::new(include_bytes!("fixtures/sample1.wav")); @@ -125,7 +124,6 @@ fn test_builder_fragmented() -> Result<()> { } #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_builder_remote_url_no_embed() -> Result<()> { let manifest_def = std::fs::read_to_string(fixtures_path("simple_manifest.json"))?; let mut builder = Builder::from_json(&manifest_def)?; @@ -157,7 +155,6 @@ fn test_builder_remote_url_no_embed() -> Result<()> { } #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_builder_embedded_v1_otgp() -> Result<()> { let manifest_def = include_str!("fixtures/simple_manifest.json"); let mut source = Cursor::new(include_bytes!("fixtures/XCA.jpg")); @@ -186,7 +183,6 @@ fn test_builder_embedded_v1_otgp() -> Result<()> { } #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_dynamic_assertions_builder() -> Result<()> { use c2pa::{ // assertions::{CreativeWork, SchemaDotOrgPerson}, diff --git a/sdk/tests/test_reader.rs b/sdk/tests/test_reader.rs index 449d4ea37..b1eb29898 100644 --- a/sdk/tests/test_reader.rs +++ b/sdk/tests/test_reader.rs @@ -32,7 +32,6 @@ fn test_reader_no_jumbf() -> Result<()> { } #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_reader_ca_jpg() -> Result<()> { let (format, mut stream) = fixture_stream("CA.jpg")?; let reader = Reader::from_stream(&format, &mut stream)?; @@ -40,7 +39,6 @@ fn test_reader_ca_jpg() -> Result<()> { } #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_reader_c_jpg() -> Result<()> { let (format, mut stream) = fixture_stream("C.jpg")?; let reader = Reader::from_stream(&format, &mut stream)?; @@ -48,7 +46,6 @@ fn test_reader_c_jpg() -> Result<()> { } #[test] -#[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_reader_xca_jpg() -> Result<()> { let (format, mut stream) = fixture_stream("XCA.jpg")?; let reader = Reader::from_stream(&format, &mut stream)?; diff --git a/sdk/tests/v2_api_integration.rs b/sdk/tests/v2_api_integration.rs index 1b0cbff49..55a260003 100644 --- a/sdk/tests/v2_api_integration.rs +++ b/sdk/tests/v2_api_integration.rs @@ -106,7 +106,6 @@ mod integration_v2 { } #[test] - #[cfg_attr(not(any(target_arch = "wasm32", feature = "openssl")), ignore)] fn test_v2_integration() -> Result<()> { let title = "CA.jpg"; let format = "image/jpeg";