diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 68a49a3d..9227493c 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -398,47 +398,16 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "pv" -version = "1.0.0" -dependencies = [ - "byteorder", - "curl", - "foreign-types", - "log", - "openssl", - "openssl-sys", - "pv_core", - "serde", - "serde_test", - "thiserror", - "zerocopy", -] - -[[package]] -name = "pv_core" -version = "1.0.0" -dependencies = [ - "byteorder", - "lazy_static", - "libc", - "log", - "serde", - "serde_test", - "thiserror", - "zerocopy", -] - [[package]] name = "pvapconfig" -version = "0.9.0" +version = "0.10.0" dependencies = [ "clap", "lazy_static", "openssl", - "pv_core", "rand", "regex", + "s390_pv_core", "serde", "serde_yaml", "utils", @@ -446,12 +415,12 @@ dependencies = [ [[package]] name = "pvsecret" -version = "0.9.0" +version = "0.10.0" dependencies = [ "anyhow", "clap", "log", - "pv", + "s390_pv", "serde_yaml", "utils", ] @@ -544,6 +513,37 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +[[package]] +name = "s390_pv" +version = "0.10.0" +dependencies = [ + "byteorder", + "curl", + "foreign-types", + "log", + "openssl", + "openssl-sys", + "s390_pv_core", + "serde", + "serde_test", + "thiserror", + "zerocopy", +] + +[[package]] +name = "s390_pv_core" +version = "0.10.0" +dependencies = [ + "byteorder", + "lazy_static", + "libc", + "log", + "serde", + "serde_test", + "thiserror", + "zerocopy", +] + [[package]] name = "schannel" version = "0.1.21" @@ -672,12 +672,12 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "utils" -version = "0.1.0" +version = "0.10.0" dependencies = [ "clap", "libc", "log", - "pv", + "s390_pv", "serde", ] diff --git a/rust/pv/Cargo.toml b/rust/pv/Cargo.toml index 79831f31..52c1f7f0 100644 --- a/rust/pv/Cargo.toml +++ b/rust/pv/Cargo.toml @@ -1,8 +1,13 @@ [package] -name = "pv" -version = "1.0.0" +name = "s390_pv" +version = "0.10.0" edition.workspace = true license.workspace = true +description = "s390-tools IBM Secure Execution utilities" +keywords = ["s390", "s390x", "IBM_Secure_Execution"] +repository = "https://github.com/ibm-s390-linux/s390-tools/tree/master/rust" +categories = ["hardware-support"] +readme = "README.md" [dependencies] byteorder = "1.3" @@ -15,7 +20,7 @@ serde = { version = "1.0.139", features = ["derive"] } thiserror = "1.0.33" zerocopy = { version="0.7", features = ["derive"] } -pv_core = { path = "../pv_core" } +pv_core = { path = "../pv_core", package = "s390_pv_core", version = "0.10.0" } [dev-dependencies] serde_test = "1.0.139" diff --git a/rust/pv/src/confidential.rs b/rust/pv/src/confidential.rs index 31993d60..d582a870 100644 --- a/rust/pv/src/confidential.rs +++ b/rust/pv/src/confidential.rs @@ -48,7 +48,7 @@ impl Zeroize for Vec { /// Will never leak its wrapped value during [`Debug`] /// /// ```rust -/// use pv::request::Confidential; +/// use s390_pv::request::Confidential; /// fn foo(value: Confidential<[u8; 2]>) { /// println!("value: {value:?}"); /// } diff --git a/rust/pv/src/uvattest/arcb.rs b/rust/pv/src/uvattest/arcb.rs index a5a5a645..bad610de 100644 --- a/rust/pv/src/uvattest/arcb.rs +++ b/rust/pv/src/uvattest/arcb.rs @@ -52,14 +52,14 @@ use crate::{ /// Create an Attestation request with default flags (= use a nonce) /// /// ```rust,no_run -/// use pv::attest::{AttestationFlags, AttestationMeasAlg, AttestationRequest, AttestationVersion}; -/// use pv::request::{SymKeyType, Request, ReqEncrCtx}; -/// # fn main() -> pv::Result<()> { +/// # use s390_pv::attest::{AttestationFlags, AttestationMeasAlg, AttestationRequest, AttestationVersion}; +/// # use s390_pv::request::{SymKeyType, Request, ReqEncrCtx}; +/// # fn main() -> s390_pv::Result<()> { /// let att_version = AttestationVersion::One; /// let meas_alg = AttestationMeasAlg::HmacSha512; /// let mut arcb = AttestationRequest::new(att_version, meas_alg, AttestationFlags::default())?; /// // read-in hostkey document(s). Not verified for brevity. -/// let hkd = pv::misc::read_certs(&std::fs::read("host-key-document.crt")?)?; +/// let hkd = s390_pv::misc::read_certs(&std::fs::read("host-key-document.crt")?)?; /// // IBM issued HKD certificates typically have one X509 /// let hkd = hkd.first().unwrap().public_key()?; /// arcb.add_hostkey(hkd); diff --git a/rust/pv/tests/add_secret_request.rs b/rust/pv/tests/add_secret_request.rs index 3d783082..257a3e5c 100644 --- a/rust/pv/tests/add_secret_request.rs +++ b/rust/pv/tests/add_secret_request.rs @@ -6,7 +6,7 @@ use openssl::{ nid::Nid, pkey::Private, }; -use pv::{ +use s390_pv::{ get_test_asset, request::{ openssl::pkey::{PKey, Public}, diff --git a/rust/pv/tests/cert_verifier.rs b/rust/pv/tests/cert_verifier.rs index c99c128b..dac3fe80 100644 --- a/rust/pv/tests/cert_verifier.rs +++ b/rust/pv/tests/cert_verifier.rs @@ -2,9 +2,9 @@ // // Copyright IBM Corp. 2023 -use pv::request::CertVerifier; -use pv::test_utils::*; -use pv::{Error, HkdVerifyErrorType::*}; +use s390_pv::request::CertVerifier; +use s390_pv::test_utils::*; +use s390_pv::{Error, HkdVerifyErrorType::*}; use std::ffi::c_int; #[track_caller] diff --git a/rust/pv_core/Cargo.toml b/rust/pv_core/Cargo.toml index 743767d6..4a357dea 100644 --- a/rust/pv_core/Cargo.toml +++ b/rust/pv_core/Cargo.toml @@ -1,8 +1,13 @@ [package] -name = "pv_core" -version = "1.0.0" +name = "s390_pv_core" +version = "0.10.0" edition.workspace = true license.workspace = true +description = "s390-tools IBM Secure Execution core utilities" +keywords = ["s390", "s390x", "IBM_Secure_Execution"] +repository = "https://github.com/ibm-s390-linux/s390-tools/tree/master/rust" +categories = ["hardware-support"] +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/pv_core/src/macros.rs b/rust/pv_core/src/macros.rs index 2c211a9a..05cfa9fe 100644 --- a/rust/pv_core/src/macros.rs +++ b/rust/pv_core/src/macros.rs @@ -38,7 +38,7 @@ macro_rules! static_assert { /// /// # Example /// ```rust -/// # use pv_core::assert_size; +/// # use s390_pv_core::assert_size; /// # fn main() {} /// #[repr(C)] /// struct c_struct { diff --git a/rust/pv_core/src/utils.rs b/rust/pv_core/src/utils.rs index b22166ca..28eb3740 100644 --- a/rust/pv_core/src/utils.rs +++ b/rust/pv_core/src/utils.rs @@ -119,7 +119,7 @@ impl From<&u64> for Lsb0Flags64 { /// * `ctx` - Error context string in case of an error /// ```rust /// # use std::error::Error; -/// # use pv_core::misc::try_parse_u128; +/// # use s390_pv_core::misc::try_parse_u128; /// # fn main() -> Result<(), Box> { /// let hex = "11223344556677889900aabbccddeeff"; /// try_parse_u128(&hex, "The test")?; @@ -155,7 +155,7 @@ pub fn try_parse_u128(hex_str: &str, ctx: &str) -> Result<[u8; 16]> { /// * `ctx` - Error context string in case of an error /// ```rust /// # use std::error::Error; -/// # use pv_core::misc::try_parse_u64; +/// # use s390_pv_core::misc::try_parse_u64; /// # fn main() -> Result<(), Box> { /// let hex = "1234567890abcdef"; /// try_parse_u64(&hex, "The test")?; diff --git a/rust/pv_core/src/uvattest.rs b/rust/pv_core/src/uvattest.rs index f48bdf33..eb575448 100644 --- a/rust/pv_core/src/uvattest.rs +++ b/rust/pv_core/src/uvattest.rs @@ -10,8 +10,8 @@ use zerocopy::U32; /// /// The magic value is ASCII: /// ```rust -/// # use pv_core::attest::AttestationMagic; -/// # use pv_core::request::MagicValue; +/// # use s390_pv_core::attest::AttestationMagic; +/// # use s390_pv_core::request::MagicValue; /// # fn main() { /// # let magic = & /// [0u8; 8] diff --git a/rust/pv_core/src/uvdevice.rs b/rust/pv_core/src/uvdevice.rs index c3520531..1b93a12c 100644 --- a/rust/pv_core/src/uvdevice.rs +++ b/rust/pv_core/src/uvdevice.rs @@ -173,10 +173,10 @@ pub enum UvcSuccess { /// forward to Firmware. /// /// ```rust,no_run -/// # use pv_core::uv::UvDevice; -/// # use pv_core::uv::AddCmd; +/// # use s390_pv_core::uv::UvDevice; +/// # use s390_pv_core::uv::AddCmd; /// # use std::fs::File; -/// # fn main() -> pv_core::Result<()> { +/// # fn main() -> s390_pv_core::Result<()> { /// let mut file = File::open("request")?; /// let uv = UvDevice::open()?; /// let mut cmd = AddCmd::new(&mut file)?; diff --git a/rust/pv_core/src/uvdevice/attest.rs b/rust/pv_core/src/uvdevice/attest.rs index 06933dfc..0821d60b 100644 --- a/rust/pv_core/src/uvdevice/attest.rs +++ b/rust/pv_core/src/uvdevice/attest.rs @@ -27,9 +27,9 @@ use zerocopy::{AsBytes, FromZeroes}; /// # Example /// /// ```rust,no_run -/// # use pv_core::uv::UvDevice; -/// # use pv_core::uv::AttestationCmd; -/// # fn main() -> pv_core::Result<()> { +/// # use s390_pv_core::uv::UvDevice; +/// # use s390_pv_core::uv::AttestationCmd; +/// # fn main() -> s390_pv_core::Result<()> { /// let arcb = std::fs::read("arcb")?.into(); /// let user_data = vec![0, 1, 2, 3]; /// // Hard-coded example diff --git a/rust/pv_core/src/uvdevice/secret_list.rs b/rust/pv_core/src/uvdevice/secret_list.rs index 5729fd0f..ad15435c 100644 --- a/rust/pv_core/src/uvdevice/secret_list.rs +++ b/rust/pv_core/src/uvdevice/secret_list.rs @@ -119,7 +119,7 @@ impl SecretEntry { /// /// The slice is guaranteed to be 32 bytes long. /// ```rust - /// # use pv_core::uv::SecretEntry; + /// # use s390_pv_core::uv::SecretEntry; /// # use zerocopy::FromZeroes; /// # let secr = SecretEntry::new_zeroed(); /// # assert_eq!(secr.id().len(), 32); diff --git a/rust/pv_core/src/uvsecret.rs b/rust/pv_core/src/uvsecret.rs index c475dace..bfa1e3e8 100644 --- a/rust/pv_core/src/uvsecret.rs +++ b/rust/pv_core/src/uvsecret.rs @@ -15,8 +15,8 @@ use zerocopy::{AsBytes, U16}; /// /// The magic value is ASCII: /// ```rust -/// # use pv_core::secret::AddSecretMagic; -/// # use pv_core::request::MagicValue; +/// # use s390_pv_core::secret::AddSecretMagic; +/// # use s390_pv_core::request::MagicValue; /// # fn main() { /// # let magic = /// b"asrcbM" diff --git a/rust/pvapconfig/Cargo.toml b/rust/pvapconfig/Cargo.toml index 1c244852..345f4059 100644 --- a/rust/pvapconfig/Cargo.toml +++ b/rust/pvapconfig/Cargo.toml @@ -2,7 +2,7 @@ name = "pvapconfig" description = "A tool to configure the AP resources inside a SE guest based on UV secrets and an AP config file." authors = ["Harald Freudenberger "] -version = "0.9.0" +version = "0.10.0" edition.workspace = true license.workspace = true @@ -10,7 +10,7 @@ license.workspace = true clap = { version ="4.1", features = ["derive", "wrap_help"]} lazy_static = "1.1" openssl = { version = "0.10" } -pv_core = { path = "../pv_core"} +pv_core = { path = "../pv_core", package = "s390_pv_core"} rand = "0.8" regex = "1.7" serde = { version = "1.0.139", features = ["derive"] } diff --git a/rust/pvsecret/Cargo.toml b/rust/pvsecret/Cargo.toml index 43934d16..d1093147 100644 --- a/rust/pvsecret/Cargo.toml +++ b/rust/pvsecret/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pvsecret" -version = "0.9.0" +version = "0.10.0" edition.workspace = true license.workspace = true @@ -10,5 +10,5 @@ clap = { version ="4.1", features = ["derive", "wrap_help"]} log = { version = "0.4.6", features = ["std", "release_max_level_debug"] } serde_yaml = "0.9" -pv = { path = "../pv" } -utils = { path = "../utils" } +pv = { path = "../pv" , package = "s390_pv" } +utils = { path = "../utils"} diff --git a/rust/utils/Cargo.toml b/rust/utils/Cargo.toml index 216f63a4..15182edf 100644 --- a/rust/utils/Cargo.toml +++ b/rust/utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "utils" -version = "0.1.0" +version = "0.10.0" edition.workspace = true license.workspace = true @@ -8,5 +8,5 @@ license.workspace = true clap = { version ="4.1", features = ["derive", "wrap_help"] } libc = "0.2.49" log = { version = "0.4.6", features = ["std", "release_max_level_debug"] } -pv = { path = "../pv" } +pv = { path = "../pv", package = "s390_pv" } serde = { version = "1.0.139"}