143 lines
5.7 KiB
Diff
143 lines
5.7 KiB
Diff
From c91fba3382867737d194dfedf85cae7ee133c9e3 Mon Sep 17 00:00:00 2001
|
|
From: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
Date: Wed, 8 May 2024 14:13:47 +0200
|
|
Subject: [PATCH] Fix 'unnecessary qualification' warnings
|
|
|
|
Newer versions of the rust compiler generates warnings when symbols are
|
|
over-specified.
|
|
|
|
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
---
|
|
keylime-agent/src/payloads.rs | 2 +-
|
|
keylime-agent/src/revocation.rs | 8 ++++----
|
|
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/keylime-agent/src/payloads.rs b/keylime-agent/src/payloads.rs
|
|
index 5c40125f..d42918c8 100644
|
|
--- a/keylime-agent/src/payloads.rs
|
|
+++ b/keylime-agent/src/payloads.rs
|
|
@@ -222,7 +222,7 @@ async fn run_encrypted_payload(
|
|
let action_file = unzipped.join("action_list");
|
|
|
|
if action_file.exists() {
|
|
- let action_data = std::fs::read_to_string(&action_file)
|
|
+ let action_data = fs::read_to_string(&action_file)
|
|
.expect("unable to read action_list");
|
|
|
|
action_data
|
|
diff --git a/keylime-agent/src/revocation.rs b/keylime-agent/src/revocation.rs
|
|
index e5ffaade..c48116b1 100644
|
|
--- a/keylime-agent/src/revocation.rs
|
|
+++ b/keylime-agent/src/revocation.rs
|
|
@@ -203,7 +203,7 @@ fn run_revocation_actions(
|
|
let action_file = unzipped.join("action_list");
|
|
|
|
if action_file.exists() {
|
|
- action_data = std::fs::read_to_string(&action_file)
|
|
+ action_data = fs::read_to_string(&action_file)
|
|
.expect("unable to read action_list");
|
|
|
|
let file_actions = parse_list(&action_data)?;
|
|
@@ -528,7 +528,7 @@ mod tests {
|
|
env!("CARGO_MANIFEST_DIR"),
|
|
"/tests/unzipped/test_ok.json"
|
|
);
|
|
- let json_str = std::fs::read_to_string(json_file).unwrap(); //#[allow_ci]
|
|
+ let json_str = fs::read_to_string(json_file).unwrap(); //#[allow_ci]
|
|
let json = serde_json::from_str(&json_str).unwrap(); //#[allow_ci]
|
|
let actions_dir =
|
|
&Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/actions/");
|
|
@@ -567,7 +567,7 @@ mod tests {
|
|
env!("CARGO_MANIFEST_DIR"),
|
|
"/tests/unzipped/test_err.json"
|
|
);
|
|
- let json_str = std::fs::read_to_string(json_file).unwrap(); //#[allow_ci]
|
|
+ let json_str = fs::read_to_string(json_file).unwrap(); //#[allow_ci]
|
|
let json = serde_json::from_str(&json_str).unwrap(); //#[allow_ci]
|
|
let actions_dir =
|
|
&Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/actions/");
|
|
@@ -602,7 +602,7 @@ mod tests {
|
|
let revocation_actions = "local_action_stand_alone.py, local_action_rev_script1.py";
|
|
}
|
|
}
|
|
- let json_str = std::fs::read_to_string(json_file).unwrap(); //#[allow_ci]
|
|
+ let json_str = fs::read_to_string(json_file).unwrap(); //#[allow_ci]
|
|
let json = serde_json::from_str(&json_str).unwrap(); //#[allow_ci]
|
|
let actions_dir =
|
|
&Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/actions/");
|
|
From 96d4bd4349518f173ede77cc5986e5e425f621ba Mon Sep 17 00:00:00 2001
|
|
From: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
Date: Tue, 21 May 2024 15:55:36 +0200
|
|
Subject: [PATCH] Fix leftover 'unnecessary qualification' warnings on tests
|
|
|
|
Fix leftover 'unnecessary qualification' warnings generated when running
|
|
the tests ('cargo test --features=testing') with newer rust compilers.
|
|
|
|
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
---
|
|
keylime-agent/src/errors_handler.rs | 4 ++--
|
|
keylime-agent/src/keys_handler.rs | 5 +----
|
|
keylime-agent/src/main.rs | 4 ++--
|
|
3 files changed, 5 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/keylime-agent/src/errors_handler.rs b/keylime-agent/src/errors_handler.rs
|
|
index b0fa4c24..48ea2ffb 100644
|
|
--- a/keylime-agent/src/errors_handler.rs
|
|
+++ b/keylime-agent/src/errors_handler.rs
|
|
@@ -266,7 +266,7 @@ pub(crate) fn wrap_404<B>(
|
|
#[cfg(test)]
|
|
mod tests {
|
|
use super::*;
|
|
- use actix_web::{middleware, test, App, Resource};
|
|
+ use actix_web::{test, App, Resource};
|
|
use core::future::Future;
|
|
use serde::{Deserialize, Serialize};
|
|
use serde_json::{json, Value};
|
|
@@ -379,7 +379,7 @@ mod tests {
|
|
let mut app = test::init_service(
|
|
App::new()
|
|
.wrap(
|
|
- middleware::ErrorHandlers::new()
|
|
+ ErrorHandlers::new()
|
|
.handler(http::StatusCode::NOT_FOUND, wrap_404),
|
|
)
|
|
.app_data(
|
|
diff --git a/keylime-agent/src/keys_handler.rs b/keylime-agent/src/keys_handler.rs
|
|
index 6f4489d3..3407deeb 100644
|
|
--- a/keylime-agent/src/keys_handler.rs
|
|
+++ b/keylime-agent/src/keys_handler.rs
|
|
@@ -970,10 +970,7 @@ mod tests {
|
|
|
|
// Send Shutdown message to the workers for a graceful shutdown
|
|
keys_tx.send((KeyMessage::Shutdown, None)).await.unwrap(); //#[allow_ci]
|
|
- payload_tx
|
|
- .send(payloads::PayloadMessage::Shutdown)
|
|
- .await
|
|
- .unwrap(); //#[allow_ci]
|
|
+ payload_tx.send(PayloadMessage::Shutdown).await.unwrap(); //#[allow_ci]
|
|
arbiter.join();
|
|
}
|
|
|
|
diff --git a/keylime-agent/src/main.rs b/keylime-agent/src/main.rs
|
|
index f0713f9b..77f84cd3 100644
|
|
--- a/keylime-agent/src/main.rs
|
|
+++ b/keylime-agent/src/main.rs
|
|
@@ -1066,7 +1066,7 @@ mod testing {
|
|
|
|
/// CryptoTest error
|
|
#[error("CryptoTestError")]
|
|
- CryptoTestError(#[from] crate::crypto::testing::CryptoTestError),
|
|
+ CryptoTestError(#[from] crypto::testing::CryptoTestError),
|
|
|
|
/// IO error
|
|
#[error("IOError")]
|
|
@@ -1078,7 +1078,7 @@ mod testing {
|
|
|
|
/// TPM error
|
|
#[error("TPMError")]
|
|
- TPMError(#[from] keylime::tpm::TpmError),
|
|
+ TPMError(#[from] tpm::TpmError),
|
|
|
|
/// TSS esapi error
|
|
#[error("TSSError")]
|