mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
rust/pv: Replace libc wherever possible
Replace all libc references to rust-std references if available. This eliminates the need to include libc in the pv crate. However, pv_base still refers to libc::ioctl and libc::ENOTTY. Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
b71279cda5
commit
02dded11a5
@@ -7,7 +7,6 @@ use crate::misc::read_crls;
|
||||
use crate::HkdVerifyErrorType::*;
|
||||
use crate::{Error, Result};
|
||||
use curl::easy::{Easy2, Handler, WriteError};
|
||||
use libc::c_int;
|
||||
use log::debug;
|
||||
use openssl::{
|
||||
asn1::{Asn1Time, Asn1TimeRef},
|
||||
@@ -26,9 +25,7 @@ use openssl_extensions::{
|
||||
akid::{AkidCheckResult, AkidExtension},
|
||||
crl::X509StoreExtension,
|
||||
};
|
||||
use std::cmp::Ordering;
|
||||
use std::time::Duration;
|
||||
use std::usize;
|
||||
use std::{cmp::Ordering, ffi::c_int, time::Duration, usize};
|
||||
|
||||
/// Minimum security level for the keys/certificates used to establish a chain of
|
||||
/// trust (see https://www.openssl.org/docs/man1.1.1/man3/X509_VERIFY_PARAM_set_auth_level.html
|
||||
|
||||
@@ -8,6 +8,7 @@ use super::{helper, helper::*, *};
|
||||
use crate::{Error, HkdVerifyErrorType::*};
|
||||
use core::slice;
|
||||
use openssl::stack::Stack;
|
||||
use std::ffi::c_int;
|
||||
|
||||
use crate::test_utils::*;
|
||||
|
||||
@@ -23,10 +24,10 @@ pub fn mock_endpt(res: &str) -> mockito::Mock {
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
fn verify_sign_error(exp_raw: libc::c_int, obs: Error) {
|
||||
fn verify_sign_error(exp_raw: c_int, obs: Error) {
|
||||
verify_sign_error_slice(&[exp_raw], obs)
|
||||
}
|
||||
fn verify_sign_error_slice(exp_raw: &[libc::c_int], obs: Error) {
|
||||
fn verify_sign_error_slice(exp_raw: &[c_int], obs: Error) {
|
||||
if exp_raw
|
||||
.iter()
|
||||
.filter(|e| match &obs {
|
||||
|
||||
Reference in New Issue
Block a user