diff --git a/.gitignore b/.gitignore index ce8c935..f459a67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/rust-keylime-0.1.0~20220805git0186093-vendor.tar.xz -SOURCES/rust-keylime-0.1.0~20220805git0186093.tar.gz +SOURCES/rust-keylime-0.1.0-vendor.tar.xz +SOURCES/v0.1.0.tar.gz diff --git a/.keylime-agent-rust.metadata b/.keylime-agent-rust.metadata index 404c5ba..2c69618 100644 --- a/.keylime-agent-rust.metadata +++ b/.keylime-agent-rust.metadata @@ -1,2 +1,2 @@ -3bf026abefc8a27da7f63c28b97895152099606e SOURCES/rust-keylime-0.1.0~20220805git0186093-vendor.tar.xz -f903f1da3ccdd1da4f58b4cefe9c64f502b0c117 SOURCES/rust-keylime-0.1.0~20220805git0186093.tar.gz +d9639c1eef97ad859f57bcf0d736e96ce8d79a25 SOURCES/rust-keylime-0.1.0-vendor.tar.xz +343ebd9afbe17e215414309a1acb29bdb501ebc0 SOURCES/v0.1.0.tar.gz diff --git a/SOURCES/rust-keylime-adjust-features.patch b/SOURCES/rust-keylime-adjust-features.patch index 46f8566..8b402ff 100644 --- a/SOURCES/rust-keylime-adjust-features.patch +++ b/SOURCES/rust-keylime-adjust-features.patch @@ -1,11 +1,11 @@ ---- a/Cargo.toml 2022-08-25 12:16:51.789234342 +0200 -+++ b/Cargo.toml 2022-08-25 12:21:45.451435220 +0200 -@@ -39,28 +39,13 @@ - static_assertions = "1" +--- a/Cargo.toml 2022-09-20 19:02:10.657493126 +0200 ++++ b/Cargo.toml 2022-09-20 19:04:34.125273430 +0200 +@@ -42,28 +42,13 @@ tempfile = "3.0.4" tokio = {version = "1.13.1", features = ["full"]} + toml = "0.5" -tss-esapi = "7.1.0" -+tss-esapi = {version="7.1.0", features = ["generate-bindings"]} ++tss-esapi = {version = "7.1.0", features = ["generate-bindings"]} thiserror = "1.0" uuid = {version = "0.8", features = ["v4"]} -zmq = {version = "0.9.2", optional = true} diff --git a/SPECS/keylime-agent-rust.spec b/SPECS/keylime-agent-rust.spec index 1383471..233c354 100644 --- a/SPECS/keylime-agent-rust.spec +++ b/SPECS/keylime-agent-rust.spec @@ -4,17 +4,12 @@ %bcond_without check %global crate keylime_agent -%global crate_version 0.1.0 - -%global commit 01860934f7308bc5ea1e68c8d858aea056620ce8 -%global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global commitdate 20220805 # RHEL: Use bundled deps as it doesn't ship Rust libraries %global bundled_rust_deps 1 Name: keylime-agent-rust -Version: %{crate_version}~%{commitdate}git%{shortcommit} +Version: 0.1.0 Release: 1%{?dist} Summary: Rust agent for Keylime @@ -39,7 +34,7 @@ License: ASL 2.0 and BSD and MIT URL: https://github.com/keylime/rust-keylime/ # The source tarball is downloaded using the following commands: # spectool -g keylime-agent-rust.spec -Source0: %{url}/archive/%{commit}/rust-keylime-%{version}.tar.gz +Source0: %{url}/archive/refs/tags/v%{version}.tar.gz # The vendor tarball is created using cargo-vendor-filterer to remove Windows # related files (https://github.com/cgwalters/cargo-vendor-filterer) # tar xf rust-keylime-%%{version}.tar.gz @@ -93,6 +88,7 @@ Provides: bundled(crate(aho-corasick)) = 0.7.18 Provides: bundled(crate(alloc-no-stdlib)) = 2.0.3 Provides: bundled(crate(alloc-stdlib)) = 0.2.1 Provides: bundled(crate(ansi_term)) = 0.12.1 +Provides: bundled(crate(async-trait)) = 0.1.56 Provides: bundled(crate(atty)) = 0.2.14 Provides: bundled(crate(autocfg)) = 1.1.0 Provides: bundled(crate(base64)) = 0.13.0 @@ -113,15 +109,17 @@ Provides: bundled(crate(clap)) = 3.1.18 Provides: bundled(crate(clap_derive)) = 3.1.18 Provides: bundled(crate(clap_lex)) = 0.2.0 Provides: bundled(crate(compress-tools)) = 0.12.2 +Provides: bundled(crate(config)) = 0.13.2 Provides: bundled(crate(convert_case)) = 0.4.0 Provides: bundled(crate(cookie)) = 0.16.0 Provides: bundled(crate(cpufeatures)) = 0.2.2 Provides: bundled(crate(crc32fast)) = 1.3.2 Provides: bundled(crate(crypto-common)) = 0.1.3 Provides: bundled(crate(derive_more)) = 0.99.17 -Provides: bundled(crate(digest)) = 0.10.3 +Provides: bundled(crate(digest)) = 0.10.5 Provides: bundled(crate(dlv-list)) = 0.2.3 -Provides: bundled(crate(either)) = 1.7.0 +Provides: bundled(crate(dlv-list)) = 0.3.0 +Provides: bundled(crate(either)) = 1.8.0 Provides: bundled(crate(encoding_rs)) = 0.8.31 Provides: bundled(crate(enumflags2)) = 0.7.5 Provides: bundled(crate(enumflags2_derive)) = 0.7.4 @@ -149,6 +147,7 @@ Provides: bundled(crate(glob)) = 0.3.0 Provides: bundled(crate(h2)) = 0.3.13 Provides: bundled(crate(hashbrown)) = 0.9.1 Provides: bundled(crate(hashbrown)) = 0.11.2 +Provides: bundled(crate(hashbrown)) = 0.12.3 Provides: bundled(crate(heck)) = 0.4.0 Provides: bundled(crate(hex)) = 0.4.3 Provides: bundled(crate(hostname-validator)) = 1.1.1 @@ -165,12 +164,14 @@ Provides: bundled(crate(indexmap)) = 1.8.2 Provides: bundled(crate(ipnet)) = 2.5.0 Provides: bundled(crate(itoa)) = 1.0.2 Provides: bundled(crate(jobserver)) = 0.1.24 +Provides: bundled(crate(json5)) = 0.4.1 Provides: bundled(crate(keylime_agent)) = 0.1.0 Provides: bundled(crate(language-tags)) = 0.3.2 Provides: bundled(crate(lazy_static)) = 1.4.0 Provides: bundled(crate(lazycell)) = 1.3.0 Provides: bundled(crate(libc)) = 0.2.126 Provides: bundled(crate(libloading)) = 0.7.3 +Provides: bundled(crate(linked-hash-map)) = 0.5.6 Provides: bundled(crate(local-channel)) = 0.1.3 Provides: bundled(crate(local-waker)) = 0.1.3 Provides: bundled(crate(lock_api)) = 0.4.7 @@ -195,13 +196,18 @@ Provides: bundled(crate(openssl-macros)) = 0.1.0 Provides: bundled(crate(openssl-probe)) = 0.1.5 Provides: bundled(crate(openssl-sys)) = 0.9.74 Provides: bundled(crate(ordered-multimap)) = 0.3.1 +Provides: bundled(crate(ordered-multimap)) = 0.4.3 Provides: bundled(crate(os_str_bytes)) = 6.1.0 Provides: bundled(crate(parking_lot)) = 0.12.1 Provides: bundled(crate(parking_lot_core)) = 0.9.3 Provides: bundled(crate(paste)) = 1.0.7 +Provides: bundled(crate(pathdiff)) = 0.2.1 Provides: bundled(crate(peeking_take_while)) = 0.1.2 Provides: bundled(crate(percent-encoding)) = 2.1.0 -Provides: bundled(crate(pest)) = 2.1.3 +Provides: bundled(crate(pest)) = 2.3.1 +Provides: bundled(crate(pest_derive)) = 2.3.1 +Provides: bundled(crate(pest_generator)) = 2.3.1 +Provides: bundled(crate(pest_meta)) = 2.3.1 Provides: bundled(crate(picky-asn1)) = 0.3.3 Provides: bundled(crate(picky-asn1)) = 0.5.0 Provides: bundled(crate(picky-asn1-der)) = 0.2.5 @@ -224,7 +230,9 @@ Provides: bundled(crate(regex)) = 1.5.6 Provides: bundled(crate(regex-syntax)) = 0.6.26 Provides: bundled(crate(remove_dir_all)) = 0.5.3 Provides: bundled(crate(reqwest)) = 0.11.10 +Provides: bundled(crate(ron)) = 0.7.1 Provides: bundled(crate(rust-ini)) = 0.17.0 +Provides: bundled(crate(rust-ini)) = 0.18.0 Provides: bundled(crate(rustc-hash)) = 1.1.0 Provides: bundled(crate(rustc_version)) = 0.3.3 Provides: bundled(crate(rustc_version)) = 0.4.0 @@ -239,6 +247,7 @@ Provides: bundled(crate(serde_derive)) = 1.0.137 Provides: bundled(crate(serde_json)) = 1.0.81 Provides: bundled(crate(serde_urlencoded)) = 0.7.1 Provides: bundled(crate(sha-1)) = 0.10.0 +Provides: bundled(crate(sha1)) = 0.10.5 Provides: bundled(crate(shlex)) = 1.1.0 Provides: bundled(crate(signal-hook-registry)) = 1.4.0 Provides: bundled(crate(slab)) = 0.4.6 @@ -266,6 +275,7 @@ Provides: bundled(crate(tokio-macros)) = 1.8.0 Provides: bundled(crate(tokio-native-tls)) = 0.3.0 Provides: bundled(crate(tokio-openssl)) = 0.6.3 Provides: bundled(crate(tokio-util)) = 0.7.3 +Provides: bundled(crate(toml)) = 0.5.9 Provides: bundled(crate(tower-service)) = 0.3.1 Provides: bundled(crate(tracing)) = 0.1.35 Provides: bundled(crate(tracing-core)) = 0.1.27 @@ -277,25 +287,26 @@ Provides: bundled(crate(ucd-trie)) = 0.1.3 Provides: bundled(crate(unicode-bidi)) = 0.3.8 Provides: bundled(crate(unicode-ident)) = 1.0.0 Provides: bundled(crate(unicode-normalization)) = 0.1.19 -Provides: bundled(crate(unicode-width)) = 0.1.9 +Provides: bundled(crate(unicode-width)) = 0.1.10 Provides: bundled(crate(unicode-xid)) = 0.2.3 Provides: bundled(crate(url)) = 2.2.2 Provides: bundled(crate(uuid)) = 0.8.2 Provides: bundled(crate(vec_map)) = 0.8.2 Provides: bundled(crate(version_check)) = 0.9.4 Provides: bundled(crate(want)) = 0.3.0 -Provides: bundled(crate(which)) = 4.2.5 +Provides: bundled(crate(which)) = 4.3.0 +Provides: bundled(crate(yaml-rust)) = 0.4.5 Provides: bundled(crate(zeroize)) = 1.5.5 Provides: bundled(crate(zeroize_derive)) = 1.3.2 -Provides: bundled(crate(zstd)) = 0.10.2 -Provides: bundled(crate(zstd-safe)) = 4.1.6 -Provides: bundled(crate(zstd-sys)) = 1.6.3 +Provides: bundled(crate(zstd)) = 0.10.2+zstd.1.5.2 +Provides: bundled(crate(zstd-safe)) = 4.1.6+zstd.1.5.2 +Provides: bundled(crate(zstd-sys)) = 1.6.3+zstd.1.5.2 %description Rust agent for Keylime %prep -%autosetup -N -n rust-keylime-%{commit} +%autosetup -N -n rust-keylime-%{version} %cargo_prep -V 1 %autopatch -p1 @@ -312,6 +323,11 @@ mkdir -p %{buildroot}/%{_sharedstatedir}/keylime mkdir -p --mode=0700 %{buildroot}/%{_rundir}/keylime mkdir -p --mode=0700 %{buildroot}/%{_localstatedir}/log/keylime mkdir -p --mode=0700 %{buildroot}/%{_libexecdir}/keylime +mkdir -p --mode=0700 %{buildroot}/%{_sysconfdir}/keylime +mkdir -p --mode=0700 %{buildroot}/%{_sysconfdir}/keylime/agent.conf.d + +install -Dpm 400 keylime-agent.conf \ + %{buildroot}%{_sysconfdir}/keylime/agent.conf install -Dpm 644 ./dist/systemd/system/keylime_agent.service \ %{buildroot}%{_unitdir}/keylime_agent.service @@ -320,13 +336,16 @@ install -Dpm 644 ./dist/systemd/system/var-lib-keylime-secure.mount \ %{buildroot}%{_unitdir}/var-lib-keylime-secure.mount # Setting up the agent to use keylime:keylime user/group after dropping privileges. -sed -e 's/^run_as[[:space:]]*=.*/run_as = keylime:keylime/g' -i keylime-agent.conf +cat > %{buildroot}/%{_sysconfdir}/keylime/agent.conf.d/001-run_as.conf << EOF +[agent] +run_as = "keylime:keylime" +EOF -# Using sha256 for tpm_hash_alg. -sed -e 's/^tpm_hash_alg[[:space:]]*=.*/tpm_hash_alg = sha256/g' -i keylime-agent.conf - -install -Dpm 600 keylime-agent.conf \ - %{buildroot}%{_sysconfdir}/keylime-agent.conf +%posttrans +chmod 500 %{_sysconfdir}/keylime/agent.conf.d +chmod 400 %{_sysconfdir}/keylime/agent.conf.d/*.conf +chmod 500 %{_sysconfdir}/keylime +chown -R keylime:keylime %{_sysconfdir}/keylime %preun %systemd_preun keylime_agent.service @@ -339,13 +358,16 @@ install -Dpm 600 keylime-agent.conf \ %files %license LICENSE %doc README.md -%config(noreplace) %attr(600,keylime,keylime) %{_sysconfdir}/keylime-agent.conf +%attr(500,keylime,keylime) %dir %{_sysconfdir}/keylime +%attr(500,keylime,keylime) %dir %{_sysconfdir}/keylime/agent.conf.d +%config(noreplace) %attr(400,keylime,keylime) %{_sysconfdir}/keylime/agent.conf.d/001-run_as.conf +%config(noreplace) %attr(400,keylime,keylime) %{_sysconfdir}/keylime/agent.conf %{_unitdir}/keylime_agent.service %{_unitdir}/var-lib-keylime-secure.mount %attr(700,keylime,keylime) %dir %{_rundir}/keylime %attr(700,keylime,keylime) %dir %{_localstatedir}/log/keylime %attr(700,keylime,keylime) %{_sharedstatedir}/keylime -%attr(700,keylime,keylime) %{_libexecdir}/keylime +%attr(500,keylime,keylime) %{_libexecdir}/keylime %{_bindir}/keylime_agent %{_bindir}/keylime_ima_emulator @@ -355,6 +377,9 @@ install -Dpm 600 keylime-agent.conf \ %endif %changelog +* Wed Sep 21 2022 Anderson Toshiyuki Sasaki - 0.1.0-1 +- Update to upstream release 0.1.0 + * Thu Aug 25 2022 Anderson Toshiyuki Sasaki - 0.1.0~20220805git0185093-1 - Update to upstream commit 0186093