Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rsign2 for openSUSE:Factory checked in at 2023-06-26 18:16:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rsign2 (Old) and /work/SRC/openSUSE:Factory/.rsign2.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rsign2" Mon Jun 26 18:16:06 2023 rev:4 rq:1095292 version:0.6.3+0 Changes: -------- --- /work/SRC/openSUSE:Factory/rsign2/rsign2.changes 2022-03-23 20:20:04.546520378 +0100 +++ /work/SRC/openSUSE:Factory/.rsign2.new.15902/rsign2.changes 2023-06-26 18:16:21.538541030 +0200 @@ -1,0 +2,9 @@ +Fri Jun 23 12:00:00 UTC 2023 - cu...@mail.de + +- Update to 0.6.3 + * support passwordless secret keys + * dependencies updated + +- Bump minimum Rust version to 1.64 + +------------------------------------------------------------------- Old: ---- rsign2-0.6.1+0.tar.xz New: ---- rsign2-0.6.3+0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rsign2.spec ++++++ --- /var/tmp/diff_new_pack.VZCemt/_old 2023-06-26 18:16:22.586545686 +0200 +++ /var/tmp/diff_new_pack.VZCemt/_new 2023-06-26 18:16:22.590545703 +0200 @@ -25,7 +25,7 @@ # Name: %{short_name}2 -Version: 0.6.1+0 +Version: 0.6.3+0 Release: 0 Summary: Command-line tool to sign files and verify signatures License: MIT @@ -34,8 +34,8 @@ Source0: %{name}-%{version}.tar.xz Source1: vendor.tar.xz Source2: cargo_config -# on 20220115 at least crate bitflags had this minimum version requirement -BuildRequires: cargo >= 1.46 +# on 20230623 at least crate "clap" had this minimum version requirement +BuildRequires: cargo >= 1.64 BuildRequires: vendored_licenses_packager Provides: %{short_name} = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ _service ++++++ --- /var/tmp/diff_new_pack.VZCemt/_old 2023-06-26 18:16:22.634545899 +0200 +++ /var/tmp/diff_new_pack.VZCemt/_new 2023-06-26 18:16:22.638545916 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/jedisct1/rsign2.git</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="scm">git</param> - <param name="revision">0.6.1</param> + <param name="revision">0.6.3</param> <param name="match-tag">*</param> <param name="versionrewrite-pattern">(\d+\.\d+\.\d+)</param> <param name="versionrewrite-replacement">\1</param> ++++++ rsign2-0.6.1+0.tar.xz -> rsign2-0.6.3+0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/.travis.yml new/rsign2-0.6.3+0/.travis.yml --- old/rsign2-0.6.1+0/.travis.yml 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -language: rust -rust: - - nightly - - stable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/Cargo.lock new/rsign2-0.6.3+0/Cargo.lock --- old/rsign2-0.6.1+0/Cargo.lock 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/Cargo.lock 1970-01-01 01:00:00.000000000 +0100 @@ -1,333 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" -dependencies = [ - "generic-array", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "cpufeatures" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" -dependencies = [ - "block-buffer", - "crypto-common", - "generic-array", - "subtle", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hmac" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddca131f3e7f2ce2df364b57949a9d47915cfbd35e46cfee355ccebbf794d6a2" -dependencies = [ - "digest", -] - -[[package]] -name = "libc" -version = "0.2.112" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" - -[[package]] -name = "minisign" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43935b78ea0886357ab9259bd227879a54b12a83de261c3270aad584500cba2f" -dependencies = [ - "getrandom", - "rpassword", - "scrypt", -] - -[[package]] -name = "pbkdf2" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4628cc3cf953b82edcd3c1388c5715401420ce5524fedbab426bd5aba017434" -dependencies = [ - "digest", -] - -[[package]] -name = "redox_syscall" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom", - "redox_syscall", -] - -[[package]] -name = "rpassword" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "rsign2" -version = "0.6.1" -dependencies = [ - "base64", - "clap", - "dirs", - "minisign", -] - -[[package]] -name = "salsa20" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" -dependencies = [ - "cipher", -] - -[[package]] -name = "scrypt" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73d6d7c6311ebdbd9184ad6c4447b2f36337e327bda107d3ba9e3c374f9d325" -dependencies = [ - "hmac", - "pbkdf2", - "salsa20", - "sha2", -] - -[[package]] -name = "sha2" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c3bd8169c58782adad9290a9af5939994036b76187f7b4f0e6de91dbbfc0ec" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/Cargo.toml new/rsign2-0.6.3+0/Cargo.toml --- old/rsign2-0.6.1+0/Cargo.toml 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/Cargo.toml 2023-06-23 12:00:00.000000000 +0200 @@ -1,7 +1,10 @@ [package] name = "rsign2" -version = "0.6.1" -authors = ["Frank Denis <git...@pureftpd.org>", "Daniel Rangel <dan...@rangel.in>"] +version = "0.6.3" +authors = [ + "Frank Denis <git...@pureftpd.org>", + "Daniel Rangel <dan...@rangel.in>", +] description = "A command-line tool to sign files and verify signatures." license = "MIT" readme = "README.md" @@ -10,12 +13,11 @@ repository = "https://github.com/jedisct1/rsign2" [dependencies] -base64 = "0.13" -clap = "2.33" -minisign = "0.7" +clap = { version = "4", features = ["std", "cargo", "wrap_help", "string"] } +minisign = "0.7.5" [target.'cfg(any(windows, unix))'.dependencies] -dirs = "4.0" +dirs = "5.0.1" [profile.release] lto = true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/LICENSE new/rsign2-0.6.3+0/LICENSE --- old/rsign2-0.6.1+0/LICENSE 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/LICENSE 2023-06-23 12:00:00.000000000 +0200 @@ -1,4 +1,4 @@ -Copyright (c) 2019-2021 Frank Denis +Copyright (c) 2019-2023 Frank Denis Copyright (c) 2017 Daniel Rangel Permission is hereby granted, free of charge, to any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/src/bin/rsign/helpers.rs new/rsign2-0.6.3+0/src/bin/rsign/helpers.rs --- old/rsign2-0.6.1+0/src/bin/rsign/helpers.rs 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/src/bin/rsign/helpers.rs 2023-06-23 12:00:00.000000000 +0200 @@ -1,4 +1,3 @@ -use minisign::*; use std::fs::{DirBuilder, File, OpenOptions}; use std::io::{BufReader, BufWriter}; #[cfg(unix)] @@ -6,6 +5,8 @@ use std::path::Path; use std::time::{SystemTime, UNIX_EPOCH}; +use minisign::*; + pub fn open_data_file<P>(data_path: P) -> Result<BufReader<File>> where P: AsRef<Path>, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/src/bin/rsign/main.rs new/rsign2-0.6.3+0/src/bin/rsign/main.rs --- old/rsign2-0.6.1+0/src/bin/rsign/main.rs 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/src/bin/rsign/main.rs 2023-06-23 12:00:00.000000000 +0200 @@ -7,14 +7,15 @@ mod helpers; mod parse_args; -use crate::helpers::*; -use crate::parse_args::*; -use minisign::*; use std::io::Write; use std::path::{Path, PathBuf}; #[cfg(any(windows, unix))] use dirs::home_dir; +use minisign::*; + +use crate::helpers::*; +use crate::parse_args::*; #[cfg(not(any(windows, unix)))] fn home_dir() -> Option<PathBuf> { @@ -26,6 +27,7 @@ pk_path: P, sk_path: Q, comment: Option<&str>, + passwordless: bool, ) -> Result<KeyPair> where P: AsRef<Path>, @@ -46,16 +48,20 @@ ), )); } else { - std::fs::remove_file(&pk_path)?; + std::fs::remove_file(pk_path)?; } } - let mut pk_writer = create_file(&pk_path, 0o644)?; - let mut sk_writer = create_file(&sk_path, 0o600)?; + let mut pk_writer = create_file(pk_path, 0o644)?; + let mut sk_writer = create_file(sk_path, 0o600)?; let kp = KeyPair::generate_and_write_encrypted_keypair( &mut pk_writer, &mut sk_writer, comment, - None, + if passwordless { + Some(Default::default()) + } else { + None + }, )?; pk_writer.flush()?; sk_writer.flush()?; @@ -69,6 +75,7 @@ data_path: R, trusted_comment: Option<&str>, untrusted_comment: Option<&str>, + passwordless: bool, ) -> Result<()> where P: AsRef<Path>, @@ -85,7 +92,14 @@ )); } let mut signature_box_writer = create_sig_file(&signature_path)?; - let sk = SecretKey::from_file(sk_path, None)?; + let sk = SecretKey::from_file( + sk_path, + if passwordless { + Some(Default::default()) + } else { + None + }, + )?; let trusted_comment = if let Some(trusted_comment) = trusted_comment { trusted_comment.to_string() } else { @@ -164,12 +178,14 @@ let mut complete_path = PathBuf::from(env_path); if !complete_path.exists() { return Err(PError::new( - ErrorKind::Io, - format!( - "folder {} referenced by {} doesn't exists, you'll have to create yourself", - complete_path.display(), SIG_DEFAULT_CONFIG_DIR_ENV_VAR - ), - )); + ErrorKind::Io, + format!( + "folder {} referenced by {} doesn't exists, you'll have to create \ + yourself", + complete_path.display(), + SIG_DEFAULT_CONFIG_DIR_ENV_VAR + ), + )); } complete_path.push(SIG_DEFAULT_SKFILE); complete_path @@ -233,14 +249,25 @@ } } -fn run(args: clap::ArgMatches) -> Result<()> { +fn run(args: clap::ArgMatches, help_usage: &str) -> Result<()> { if let Some(generate_action) = args.subcommand_matches("generate") { - let force = generate_action.is_present("force"); - let pk_path = get_pk_path(generate_action.value_of("pk_path"))?; - let sk_path_str = generate_action.value_of("sk_path"); - let sk_path = create_sk_path_or_default(sk_path_str, force)?; - let comment = generate_action.value_of("comment"); - let KeyPair { pk, .. } = cmd_generate(force, &pk_path, &sk_path, comment)?; + let force = generate_action.get_flag("force"); + let pk_path = get_pk_path( + generate_action + .get_one::<String>("pk_path") + .map(|s| s.as_str()), + )?; + let sk_path_str = generate_action.get_one::<String>("sk_path"); + let sk_path = create_sk_path_or_default(sk_path_str.map(|s| s.as_str()), force)?; + let comment = generate_action.get_one::<String>("comment"); + let passwordless = generate_action.get_flag("passwordless"); + let KeyPair { pk, .. } = cmd_generate( + force, + &pk_path, + &sk_path, + comment.map(|s| s.as_str()), + passwordless, + )?; println!( "\nThe secret key was saved as {} - Keep it secret!", sk_path.display() @@ -253,54 +280,62 @@ println!("rsign verify <file> -P {}", pk.to_base64()); Ok(()) } else if let Some(sign_action) = args.subcommand_matches("sign") { - let sk_path = get_sk_path(sign_action.value_of("sk_path"))?; - let pk = if let Some(pk_inline) = sign_action.value_of("public_key") { + let sk_path = get_sk_path(sign_action.get_one::<String>("sk_path").map(|s| s.as_str()))?; + let pk = if let Some(pk_inline) = sign_action.get_one::<String>("public_key") { Some(PublicKey::from_base64(pk_inline)?) - } else if let Some(pk_path) = sign_action.value_of("pk_path") { + } else if let Some(pk_path) = sign_action.get_one::<String>("pk_path") { Some(PublicKey::from_file(get_pk_path(Some(pk_path))?)?) } else { None }; - let data_path = PathBuf::from(sign_action.value_of("data").unwrap()); // safe to unwrap - let signature_path = if let Some(file) = sign_action.value_of("sig_file") { + let data_path = PathBuf::from(sign_action.get_one::<String>("data").unwrap()); // safe to unwrap + let signature_path = if let Some(file) = sign_action.get_one::<String>("sig_file") { PathBuf::from(file) } else { PathBuf::from(format!("{}{}", data_path.display(), SIG_SUFFIX)) }; - let trusted_comment = sign_action.value_of("trusted-comment"); - let untrusted_comment = sign_action.value_of("untrusted-comment"); + let trusted_comment = sign_action.get_one::<String>("trusted-comment"); + let trusted_comment = trusted_comment.map(|s| s.as_str()); + let untrusted_comment = sign_action.get_one::<String>("untrusted-comment"); + let untrusted_comment = untrusted_comment.map(|s| s.as_str()); + let passwordless = sign_action.get_flag("passwordless"); cmd_sign( pk, - &sk_path, - &signature_path, + sk_path, + signature_path, &data_path, trusted_comment, untrusted_comment, + passwordless, ) } else if let Some(verify_action) = args.subcommand_matches("verify") { - let pk = if let Some(pk_inline) = verify_action.value_of("public_key") { + let pk = if let Some(pk_inline) = verify_action.get_one::<String>("public_key") { PublicKey::from_base64(pk_inline)? } else { - PublicKey::from_file(get_pk_path(verify_action.value_of("pk_path"))?)? + PublicKey::from_file(get_pk_path( + verify_action + .get_one::<String>("pk_path") + .map(|s| s.as_str()), + )?)? }; - let data_path = verify_action.value_of("file").unwrap(); - let signature_path = if let Some(path) = verify_action.value_of("sig_file") { + let data_path = verify_action.get_one::<String>("file").unwrap(); + let signature_path = if let Some(path) = verify_action.get_one::<String>("sig_file") { PathBuf::from(path) } else { - PathBuf::from(format!("{}{}", data_path, SIG_SUFFIX)) + PathBuf::from(format!("{data_path}{SIG_SUFFIX}")) }; - let quiet = verify_action.is_present("quiet"); - let output = verify_action.is_present("output"); - let allow_legacy = verify_action.is_present("allow-legacy"); - cmd_verify(pk, &data_path, &signature_path, quiet, output, allow_legacy) + let quiet = verify_action.get_flag("quiet"); + let output = verify_action.get_flag("output"); + let allow_legacy = verify_action.get_flag("allow-legacy"); + cmd_verify(pk, data_path, signature_path, quiet, output, allow_legacy) } else { - println!("{}\n", args.usage()); + println!("{help_usage}\n"); std::process::exit(1); } } fn main() { - let args = parse_args(); - run(args).map_err(|e| e.exit()).unwrap(); + let (args, help_usage) = parse_args(); + run(args, &help_usage).map_err(|e| e.exit()).unwrap(); std::process::exit(0); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rsign2-0.6.1+0/src/bin/rsign/parse_args.rs new/rsign2-0.6.3+0/src/bin/rsign/parse_args.rs --- old/rsign2-0.6.1+0/src/bin/rsign/parse_args.rs 2021-10-09 14:53:16.000000000 +0200 +++ new/rsign2-0.6.3+0/src/bin/rsign/parse_args.rs 2023-06-23 12:00:00.000000000 +0200 @@ -1,167 +1,184 @@ -use clap::{Arg, SubCommand}; +use clap::{Arg, ArgAction::SetTrue, Command}; -pub fn parse_args<'a>() -> clap::ArgMatches<'a> { - app_from_crate!() +pub fn parse_args() -> (clap::ArgMatches, String) { + let mut app = command!() .subcommand( - SubCommand::with_name("generate") + Command::new("generate") .about("Generate public and private keys") .arg( - Arg::with_name("pk_path") - .short("p") + Arg::new("pk_path") + .short('p') .long("public-key-path") - .takes_value(true) + .num_args(1) .value_name("PUBLIC_KEY_PATH") .help("path to the new public key"), ) .arg( - Arg::with_name("sk_path") - .short("s") + Arg::new("sk_path") + .short('s') .long("secret-key-path") - .takes_value(true) + .num_args(1) .value_name("SECRET_KEY_PATH") .help("path to the new secret key"), ) .arg( - Arg::with_name("force") - .short("f") + Arg::new("force") + .short('f') .long("force") + .action(SetTrue) .help("force generate a new keypair"), ) .arg( - Arg::with_name("comment") - .takes_value(true) - .help("add a one-line untrusted comment") + Arg::new("comment") + .short('c') + .long("comment") + .num_args(1) .value_name("COMMENT") - .short("c") - .long("comment"), + .help("add a one-line untrusted comment"), + ) + .arg( + Arg::new("passwordless") + .short('W') + .long("passwordless") + .action(SetTrue) + .help("don't use a password for the secret key"), ), ) .subcommand( - SubCommand::with_name("verify") + Command::new("verify") .about("Verify a signed file with a given public key") .arg( - Arg::with_name("public_key") - .short("P") + Arg::new("public_key") + .short('P') .long("public-key-string") - .takes_value(true) + .num_args(1) + .value_name("PUBLIC_KEY_STRING") .conflicts_with("pk_path") - .help("public key string") - .value_name("PUBLIC_KEY_STRING"), + .help("public key string"), ) .arg( - Arg::with_name("pk_path") - .short("p") + Arg::new("pk_path") + .short('p') .long("public-key-path") - .takes_value(true) + .num_args(1) .value_name("PUBLIC_KEY_PATH") .help("path to public key file"), ) .arg( - Arg::with_name("sig_file") - .takes_value(true) - .help("signature file to be verified") + Arg::new("sig_file") + .short('x') + .long("sig-file") + .num_args(1) .value_name("SIG_FILE") - .short("x") - .long("sig-file"), + .help("signature file to be verified"), ) .arg( - Arg::with_name("quiet") - .help("quiet mode, supress output") - .takes_value(false) - .short("q") - .long("quiet"), + Arg::new("quiet") + .short('q') + .long("quiet") + .action(SetTrue) + .help("quiet mode, supress output"), ) .arg( - Arg::with_name("allow-legacy") - .short("l") + Arg::new("allow-legacy") + .short('l') .long("allow-legacy") + .action(SetTrue) .help("accept legacy signatures"), ) .arg( - Arg::with_name("output") - .help("output the file content after verification") - .takes_value(false) - .short("o") - .long("output"), + Arg::new("output") + .short('o') + .long("output") + .action(SetTrue) + .help("output the file content after verification"), ) .arg( - Arg::with_name("file") + Arg::new("file") .index(1) - .takes_value(true) + .num_args(1) .required(true) - .help("file to be verified") .value_name("FILE") - .short("m") - .long("file-name"), + .help("file to be verified"), ), ) .subcommand( - SubCommand::with_name("sign") + Command::new("sign") .about("Sign a file with a given private key") .arg( - Arg::with_name("public_key") - .short("P") + Arg::new("public_key") + .short('P') .long("public-key-string") - .takes_value(true) + .num_args(1) + .value_name("PUBLIC_KEY_STRING") .conflicts_with("pk_path") - .help("public key string") - .value_name("PUBLIC_KEY_STRING"), + .help("public key string"), ) .arg( - Arg::with_name("pk_path") - .short("p") + Arg::new("pk_path") + .short('p') .long("public-key-file") - .takes_value(true) + .num_args(1) .value_name("PUBLIC_KEY_FILE") .help("path to public key file"), ) .arg( - Arg::with_name("sk_path") - .short("s") + Arg::new("sk_path") + .short('s') .long("secret-key-file") - .takes_value(true) + .num_args(1) .value_name("SECRET_KEY_FILE") .help("secret key to be used to sign"), ) .arg( - Arg::with_name("sig_file") - .takes_value(true) - .help("signature file") + Arg::new("sig_file") + .short('x') + .long("sig-file") + .num_args(1) .value_name("SIG_FILE") - .short("x") - .long("sig-file"), + .help("signature file"), ) .arg( - Arg::with_name("data") + Arg::new("data") .index(1) - .takes_value(true) - .required(true) - .help("file to sign") + .num_args(1) .value_name("FILE") - .short("m") - .long("message-file"), + .required(true) + .help("file to sign"), ) .arg( - Arg::with_name("trusted-comment") - .help("add a one-line trusted comment") + Arg::new("trusted-comment") + .short('t') + .long("trusted-comment") + .num_args(1) .value_name("TRUSTED_COMMENT") - .short("t") - .long("trusted-comment"), + .help("add a one-line trusted comment"), ) .arg( - Arg::with_name("untrusted-comment") - .help("add a one-line untrusted comment") + Arg::new("untrusted-comment") + .short('c') + .long("untrusted-comment") + .num_args(1) .value_name("UNTRUSTED_COMMENT") - .short("c") - .long("untrusted-comment"), + .help("add a one-line untrusted comment"), ) .arg( - Arg::with_name("hash") - .required(false) - .short("H") + Arg::new("hash") + .short('H') .long("hash") + .required(false) + .action(SetTrue) .help("ignored (for backwards compatibility only"), + ) + .arg( + Arg::new("passwordless") + .short('W') + .long("passwordless") + .action(SetTrue) + .help("don't use a password for the secret key"), ), - ) - .get_matches() + ); + let help_usage = app.render_usage().to_string(); + let matches = app.get_matches(); + (matches, help_usage) } ++++++ vendor.tar.xz ++++++ /work/SRC/openSUSE:Factory/rsign2/vendor.tar.xz /work/SRC/openSUSE:Factory/.rsign2.new.15902/vendor.tar.xz differ: char 25, line 1