mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
Replace version-specific flag enums (PcfV1, ScfV1) with a unified SeHdrFlag enum and generic ControlFlagsModel. This refactoring provides: - Single SeHdrFlag enum for all control flags across SE header versions - Generic SeHdrControlFlagsModel with version-specific configurations - EffectiveControlFlags type replacing PlaintextControlFlagsV1/SecretControlFlagsV1 - FlagsOverride mechanism for customizing flag configurations - Enhanced FromStr implementation for flag parsing - Comprehensive test coverage for flag operations and conversions The new design improves maintainability by eliminating code duplication and provides a more flexible API for working with SE header control flags. Assisted-by: IBM Bob:1.0.4 Signed-off-by: Marc Hartmayer <marc@linux.ibm.com> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
56 lines
1.6 KiB
Rust
56 lines
1.6 KiB
Rust
// SPDX-License-Identifier: MIT
|
|
//
|
|
// Copyright IBM Corp. 2024
|
|
|
|
//! # Library for Secure Execution headers
|
|
//!
|
|
//! This crate provides functionalities for creating and inspecting Secure
|
|
//! Execution headers. It also provides support for preparing arbitrary
|
|
//! components as secured components and calculating the PLD, ALD, and TLD of
|
|
//! them.
|
|
//!
|
|
//! ## Secure Execution headers
|
|
//! ### Creation
|
|
//!
|
|
//! [`uvdata::SeHdrBuilder`]
|
|
//!
|
|
//! ### Serialization and Deserialization
|
|
//!
|
|
//! [`uvdata::SeHdr`]
|
|
//!
|
|
//! ## Secured components
|
|
//!
|
|
//! [`secured_comp::SecuredComponentBuilder`] and
|
|
//! [`secured_comp::SecuredComponent`].
|
|
|
|
#![allow(missing_docs)]
|
|
|
|
mod pv_utils;
|
|
|
|
pub mod misc {
|
|
pub const PAGESIZE: usize = 4096;
|
|
pub use crate::pv_utils::{
|
|
bytesize, round_up, serialize_to_bytes, ShortPsw, PSW, PSW_MASK_BA, PSW_MASK_EA,
|
|
};
|
|
}
|
|
|
|
pub mod uvdata {
|
|
pub use crate::pv_utils::{
|
|
AeadPlainDataTrait, BuilderTrait, ComponentMetadataV1, ControlFlagTrait,
|
|
EffectiveControlFlags, EnvelopeSeHdrV1, FlagData, FlagState, FlagsOverride,
|
|
IntoEnumIterator, KeyExchangeTrait, SeH, SeHdr, SeHdrAadV1, SeHdrBinV1, SeHdrBuilder,
|
|
SeHdrControlFlags, SeHdrControlFlagsModel, SeHdrData, SeHdrDataV1, SeHdrFlag, SeHdrPlain,
|
|
SeHdrVersion, SeHdrVersioned, SeTarget, UvDataPlainTrait, UvDataTrait, UvKeyHashesV1,
|
|
};
|
|
}
|
|
|
|
pub mod secured_comp {
|
|
pub use crate::pv_utils::{
|
|
ComponentTrait, Interval, Layout, SecuredComponent, SecuredComponentBuilder,
|
|
};
|
|
}
|
|
|
|
pub mod error {
|
|
pub use crate::pv_utils::{Error, OwnExitCode, PvError, Result};
|
|
}
|