pv: req: Improve documentation and fix typos

Improve documentation and fix typos.

Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2026-06-18 12:21:28 +02:00
committed by Jan Höppner
parent e93bd7e61c
commit f04e46baf0
5 changed files with 14 additions and 5 deletions

View File

@@ -2,6 +2,8 @@
//
// Copyright IBM Corp.
//! Request encryption context for managing UV request encryption.
use std::mem::size_of;
use openssl::nid::Nid;
@@ -34,7 +36,7 @@ impl ReqEncrCtx {
/// * `priv_key` - Private key to wrap [`Keyslot`](super::Keyslot)
/// * `prot_key` - Symmetric key for request encryption. Part of [`Keyslot`](super::Keyslot)
///
/// If an argument is set to `None` a ranom is generated
/// If an argument is set to `None` a random is generated
///
/// # Errors
///
@@ -62,8 +64,8 @@ impl ReqEncrCtx {
/// # Errors
///
/// This function will return an error if OpenSSL could not generate a random value.
pub fn random(ket_tp: SymKeyType) -> Result<Self> {
match ket_tp {
pub fn random(key_tp: SymKeyType) -> Result<Self> {
match key_tp {
SymKeyType::Aes256Gcm => Self::new_aes_256(None, None, None),
SymKeyType::Aes256Xts => Err(Error::NoAeadKey),
}

View File

@@ -2,6 +2,8 @@
//
// Copyright IBM Corp.
//! EC public key coordinate utilities and conversions.
use openssl::bn::{BigNum, BigNumContext};
use openssl::ec::{EcGroup, EcGroupRef, EcKey, EcPointRef};
use openssl::error::ErrorStack;

View File

@@ -2,9 +2,11 @@
//
// Copyright IBM Corp.
//! Encryption trait and authenticated data types for UV requests.
use openssl::pkey::{PKeyRef, Private};
use super::keyslot::Keyslot;
use crate::req::Keyslot;
use crate::Result;
/// Encrypt a _secret_ using self and a given private key.

View File

@@ -2,12 +2,13 @@
//
// Copyright IBM Corp.
//! Request header structure for UV requests.
use zerocopy::{BigEndian, FromBytes, Immutable, IntoBytes, U32};
use crate::assert_size;
/// Representation of the shared parts of the request header.
/// Used by [`ReqEncrCtx`]
/// Used by [`ReqEncrCtx`](super::ReqEncrCtx)
#[repr(C)]
#[derive(Debug, Copy, Clone, IntoBytes, FromBytes, Immutable)]
pub struct RequestHdr {

View File

@@ -2,6 +2,8 @@
//
// Copyright IBM Corp.
//! IBM Z Host key-slot implementations.
use openssl::hash::MessageDigest;
use openssl::pkey::{PKey, PKeyRef, Private, Public};