Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Move validation_codes from c2pa-crypto to c2pa-status-tracker #695

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/crypto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ pub mod raw_signature;
mod signing_alg;
pub use signing_alg::{SigningAlg, UnknownAlgorithmError};

pub mod validation_codes;

#[cfg(all(target_arch = "wasm32", not(target_os = "wasi")))]
pub mod webcrypto;

Expand Down
4 changes: 2 additions & 2 deletions internal/crypto/src/ocsp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

//! Tools for working with OCSP responses.

use c2pa_status_tracker::{log_item, DetailedStatusTracker, StatusTracker};
use c2pa_status_tracker::{log_item, validation_codes, DetailedStatusTracker, StatusTracker};
use chrono::{DateTime, NaiveDateTime, Utc};
use rasn_ocsp::{BasicOcspResponse, CertStatus, OcspResponseStatus};
use rasn_pkix::CrlReason;
use thiserror::Error;

use crate::{internal::time, validation_codes};
use crate::internal::time;

/// OcspResponse - struct to contain the OCSPResponse DER and the time
/// for the next OCSP check
Expand Down
2 changes: 2 additions & 0 deletions internal/status-tracker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ pub use status_tracker::{
detailed::DetailedStatusTracker, one_shot::OneShotStatusTracker, StatusTracker,
};

pub mod validation_codes;

#[cfg(test)]
pub(crate) mod tests;
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub const GENERAL_ERROR: &str = "general.error";
/// # Examples
///
/// ```
/// use c2pa_crypto::validation_codes::*;
/// use c2pa_status_tracker::validation_codes::*;
///
/// assert!(is_success(CLAIM_SIGNATURE_VALIDATED));
/// assert!(!is_success(SIGNING_CREDENTIAL_REVOKED));
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/assertions/box_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use std::{fs::File, io::Cursor, path::*};

use c2pa_status_tracker::validation_codes::ASSERTION_BOXHASH_UNKNOWN;
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;

Expand All @@ -22,7 +23,6 @@ use crate::{
asset_io::{AssetBoxHash, CAIRead},
error::{Error, Result},
utils::hash_utils::{hash_stream_by_alg, verify_stream_by_alg, HashRange},
validation_status::ASSERTION_BOXHASH_UNKNOWN,
};

const ASSERTION_CREATION_VERSION: usize = 1;
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/validation_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#![deny(missing_docs)]

pub use c2pa_crypto::validation_codes::*;
pub use c2pa_status_tracker::validation_codes::*;
use c2pa_status_tracker::{LogItem, StatusTracker};
use log::debug;
#[cfg(feature = "json_schema")]
Expand Down
Loading