From 2b275439f4b7e68276457bd3844ac8003a971943 Mon Sep 17 00:00:00 2001 From: Daniel Alley Date: Fri, 27 Oct 2023 10:45:14 -0400 Subject: [PATCH] Fixup changelog and other small things --- CHANGELOG.md | 10 ++++++---- src/rpm/headers/header.rs | 2 ++ tests/parsing.rs | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e49faebc..0d710fbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bumped MSRV to 1.67 +### Removed + +- Removed `Package::get_file_checksums`, `Package::get_file_ima_signatures` and `Package::get_file_digest_algorithm` functions, the same information is now retrievable using `Package::get_file_entries`. + ### Added - Support for symbolic link in file mode. @@ -24,10 +28,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add method `is_no_replace` to `FileOptionsBuilder`, used to set the `%config(noreplace)` flag on a file. - Added the `FileEntry.linkto` field that is a target of a symbolic link. -- Removed `get_file_checksums`, `get_file_ima_signatures` and `get_file_digest_algorithm` - function and the information is accessible via `FileEntry` struct - (`FileEntry::digest_string` and `FileEntry::ima_signature`). -- Function `get_file_entries` returned empty vector for an RPM file without any file. +- Function `Package::get_file_entries` returns an empty vector for an RPM package without any files. +- `FileEntry` structs returned by (`Package::get_file_entries`) now include IMA signature information as well as digests for file entries. ## 0.12.1 diff --git a/src/rpm/headers/header.rs b/src/rpm/headers/header.rs index a0d19c28..63fbd33d 100644 --- a/src/rpm/headers/header.rs +++ b/src/rpm/headers/header.rs @@ -430,6 +430,8 @@ pub struct FileEntry { pub flags: FileFlags, // @todo SELinux context? how is that done? pub digest: Option, + /// A string representation of the digest + // @todo: we should be able to fetch this trivially from `digest` without needing to store a separate copy pub digest_string: String, /// Defines any capabilities on the file. pub caps: Option, diff --git a/tests/parsing.rs b/tests/parsing.rs index fa2b2526..6d2292dd 100644 --- a/tests/parsing.rs +++ b/tests/parsing.rs @@ -89,9 +89,9 @@ fn test_rpm_file_signatures() -> Result<(), Box> { assert_eq!( signatures, [ - Some(String::from("0302041adfaa0e004630440220162785458f5d81d1393cc72afc642c86167c15891ea39213e28907b1c4e8dc6c02202fa86ad2f5e474d36c59300f736f52cb5ed24abb55759a71ec224184a7035a78")), - Some(String::from("0302041adfaa0e00483046022100bd940093777b75650980afb656507f2729a05c9b1bc9986993106de9f301a172022100b3384f6ba200a5a80647a0f0727c5b8f3ab01f74996a1550db605b44af3d10bf")), - Some(String::from("0302041adfaa0e00473045022068953626d7a5b65aa4b1f1e79a2223f2d3500ddcb3d75a7050477db0480a13e10221008637cefe8c570044e11ff95fa933c1454fd6aa8793bbf3e87edab2a2624df460")), + Some("0302041adfaa0e004630440220162785458f5d81d1393cc72afc642c86167c15891ea39213e28907b1c4e8dc6c02202fa86ad2f5e474d36c59300f736f52cb5ed24abb55759a71ec224184a7035a78".to_string()), + Some("0302041adfaa0e00483046022100bd940093777b75650980afb656507f2729a05c9b1bc9986993106de9f301a172022100b3384f6ba200a5a80647a0f0727c5b8f3ab01f74996a1550db605b44af3d10bf".to_string()), + Some("0302041adfaa0e00473045022068953626d7a5b65aa4b1f1e79a2223f2d3500ddcb3d75a7050477db0480a13e10221008637cefe8c570044e11ff95fa933c1454fd6aa8793bbf3e87edab2a2624df460".to_string()), ], );