From wk at gnupg.org Mon Feb 3 14:18:25 2025 From: wk at gnupg.org (Werner Koch) Date: Mon, 03 Feb 2025 14:18:25 +0100 Subject: [gnupg] Update to po/pt.po In-Reply-To: <874j1btkr7.fsf@lispclub.com> (Daniel Cerqueira's message of "Mon, 03 Feb 2025 09:55:56 +0000") References: <874j1btkr7.fsf@lispclub.com> Message-ID: <87seovkvz2.fsf@jacob.g10code.de> Hi! Thanks for the update. Salam-Shalom, Werner -- The pioneers of a warless world are the youth that refuse military service. - A. Einstein -------------- next part -------------- A non-text attachment was scrubbed... Name: openpgp-digital-signature.asc Type: application/pgp-signature Size: 247 bytes Desc: not available URL: From dkg at fifthhorseman.net Tue Feb 4 04:56:21 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Mon, 3 Feb 2025 22:56:21 -0500 Subject: [PATCH GnuPG] options: drop opt.flags.rfc4880bis (no longer in use) Message-ID: <20250204035621.896845-1-dkg@fifthhorseman.net> g10/options.h (opt): remove unused flags member rfc4880bis (not used). -- Signed-off-by: Daniel Kahn Gillmor --- g10/options.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/g10/options.h b/g10/options.h index 6f5017196..2f73a9cf4 100644 --- a/g10/options.h +++ b/g10/options.h @@ -285,8 +285,6 @@ struct unsigned int disable_signer_uid:1; unsigned int include_key_block:1; unsigned int auto_key_import:1; - /* Flag to enable experimental features from RFC4880bis. */ - unsigned int rfc4880bis:1; /* Hack: --output is not given but OUTFILE was temporary set to "-". */ unsigned int dummy_outfile:1; /* Force the use of the OpenPGP card and do not allow the use of -- 2.47.2 From dkg at fifthhorseman.net Tue Feb 4 05:52:59 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Mon, 3 Feb 2025 23:52:59 -0500 Subject: [PATCH GnuPG STABLE-BRANCH-2-4] gpg: Sync compliance mode cleanup with master Message-ID: <20250204045259.950267-1-dkg@fifthhorseman.net> * g10/gpg.c (set_compliance_option): Clean up option settings for compliance modes. * doc/gpg.texi: note that --allow-old-cipher-algos must come after any compliance setting. -- This makes it possible to reset all options affected by any non-gnupg compliance mode to their default values by using --compliance=gnupg. This synchronizes the compliance mode behaviors with the master branch, including commits: - 54a8770aeb20eb9e18b5e95e51c376ec7820f8f6 - 0bdf5859935e3db15baaf5d0d96b723ddbd2acd5 - 04d58ff8475575f22a5ee1fb8c4f2c2dca0b5522 - aa46ba28ba75fc479b407c572c723b51b22d4a73 - 4b2729b983bf3c6c1186ebdf1962f64d8cb1b3a1 - c2ff47d5bcd2953fc2095ef2242af2c7e9cd4420 GnuPG-Bug-id: 7501 Signed-off-by: Daniel Kahn Gillmor --- doc/gpg.texi | 4 +++- g10/gpg.c | 51 +++++++++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/doc/gpg.texi b/doc/gpg.texi index 7e80a293a..474ed66ac 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3691,7 +3691,9 @@ blocks of 64 bits; modern algorithms use blocks of 128 bit instead. To avoid certain attack on these old algorithms it is suggested not to encrypt more than 150 MiByte using the same key. For this reason gpg does not allow the use of 64 bit block size algorithms for encryption -unless this option is specified. +unless this option is specified. Some compliance modes already set or +clear this flag and thus this flag should be used after a compliance +mode setting. @item --allow-weak-digest-algos @opindex allow-weak-digest-algos diff --git a/g10/gpg.c b/g10/gpg.c index 1a96db989..d9daade72 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -2265,17 +2265,14 @@ set_compliance_option (enum cmd_and_opt_values option) { switch (option) { - case oOpenPGP: - case oRFC4880: - /* This is effectively the same as RFC2440, but with - "--enable-dsa2 --no-rfc2440-text --escape-from-lines - --require-cross-certification". */ - opt.compliance = CO_RFC4880; - opt.flags.dsa2 = 1; + case oGnuPG: + /* set up default options affected by policy compliance: */ + opt.compliance = CO_GNUPG; + opt.flags.dsa2 = 0; opt.flags.require_cross_cert = 1; opt.rfc2440_text = 0; - opt.allow_non_selfsigned_uid = 1; - opt.allow_freeform_uid = 1; + opt.allow_non_selfsigned_uid = 0; + opt.allow_freeform_uid = 0; opt.escape_from = 1; opt.not_dash_escaped = 0; opt.def_cipher_algo = 0; @@ -2283,35 +2280,45 @@ set_compliance_option (enum cmd_and_opt_values option) opt.cert_digest_algo = 0; opt.compress_algo = -1; opt.s2k_mode = 3; /* iterated+salted */ + opt.s2k_digest_algo = 0; + opt.s2k_cipher_algo = DEFAULT_CIPHER_ALGO; + break; + case oOpenPGP: + case oRFC4880: + set_compliance_option (oGnuPG); + /* This is effectively the same as RFC2440, but with + "--enable-dsa2 --no-rfc2440-text --escape-from-lines + --require-cross-certification". */ + opt.compliance = CO_RFC4880; + opt.flags.dsa2 = 1; + opt.allow_non_selfsigned_uid = 1; + opt.allow_freeform_uid = 1; opt.s2k_digest_algo = DIGEST_ALGO_SHA1; opt.s2k_cipher_algo = CIPHER_ALGO_3DES; opt.flags.allow_old_cipher_algos = 1; break; case oRFC2440: + set_compliance_option (oGnuPG); opt.compliance = CO_RFC2440; - opt.flags.dsa2 = 0; + opt.flags.require_cross_cert = 0; opt.rfc2440_text = 1; opt.allow_non_selfsigned_uid = 1; opt.allow_freeform_uid = 1; opt.escape_from = 0; - opt.not_dash_escaped = 0; - opt.def_cipher_algo = 0; - opt.def_digest_algo = 0; - opt.cert_digest_algo = 0; - opt.compress_algo = -1; - opt.s2k_mode = 3; /* iterated+salted */ opt.s2k_digest_algo = DIGEST_ALGO_SHA1; opt.s2k_cipher_algo = CIPHER_ALGO_3DES; opt.flags.allow_old_cipher_algos = 1; break; - case oPGP7: opt.compliance = CO_PGP7; break; - case oPGP8: opt.compliance = CO_PGP8; break; - case oGnuPG: - opt.compliance = CO_GNUPG; + case oPGP7: + set_compliance_option (oGnuPG); + opt.compliance = CO_PGP7; + break; + case oPGP8: + set_compliance_option (oGnuPG); + opt.compliance = CO_PGP8; break; - case oDE_VS: - set_compliance_option (oOpenPGP); + set_compliance_option (oGnuPG); opt.compliance = CO_DE_VS; /* We divert here from the backward compatible rfc4880 algos. */ opt.s2k_digest_algo = DIGEST_ALGO_SHA256; -- 2.47.2 From dkg at fifthhorseman.net Wed Feb 5 00:46:07 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 4 Feb 2025 18:46:07 -0500 Subject: [PATCH GnuPG 4/5] compliance: add gnupg_compliance_label In-Reply-To: <20250204234906.1713904-1-dkg@fifthhorseman.net> References: <20250204234906.1713904-1-dkg@fifthhorseman.net> Message-ID: <20250204234906.1713904-5-dkg@fifthhorseman.net> * common/compliance.c (gnupg_compliance_label) new function, prototyped... * common/compliance.h: ...here. --- This will be useful when we need to display the current compliance mode to the user. Signed-off-by: Daniel Kahn Gillmor --- common/compliance.c | 7 +++++++ common/compliance.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/common/compliance.c b/common/compliance.c index 6c271c199..9707f3a20 100644 --- a/common/compliance.c +++ b/common/compliance.c @@ -782,6 +782,13 @@ gnupg_parse_compliance_option (const char *string, return -1; } +/* Return label for the given COMPLIANCE mode. */ +const char * +gnupg_compliance_label (enum gnupg_compliance_mode compliance) +{ + /* just offset by strlen("--compliance=") */ + return gnupg_compliance_option_string (compliance) + 13; +} /* Return the command line option for the given COMPLIANCE mode. */ const char * diff --git a/common/compliance.h b/common/compliance.h index 111fdc74b..2ddf38f83 100644 --- a/common/compliance.h +++ b/common/compliance.h @@ -91,6 +91,8 @@ int gnupg_parse_compliance_option (const char *string, int quiet); const char *gnupg_compliance_option_string (enum gnupg_compliance_mode compliance); +const char *gnupg_compliance_label (enum gnupg_compliance_mode + compliance); void gnupg_set_compliance_extra_info (unsigned int min_rsa); -- 2.47.2 From dkg at fifthhorseman.net Wed Feb 5 00:46:06 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 4 Feb 2025 18:46:06 -0500 Subject: [PATCH GnuPG 3/5] gpg: use rsa3072 for legacy compliance modes In-Reply-To: <20250204234906.1713904-1-dkg@fifthhorseman.net> References: <20250204234906.1713904-1-dkg@fifthhorseman.net> Message-ID: <20250204234906.1713904-4-dkg@fifthhorseman.net> * doc/gpg.texi (default-new-key-algo): Remind the user that this should come after any compliance modes, like --allow-old-cipher-algos. -- GnuPG-bug-id: 7511 Signed-off-by: Daniel Kahn Gillmor --- doc/gpg.texi | 3 ++- g10/gpg.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/gpg.texi b/doc/gpg.texi index 7a709d170..5572cba7d 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3848,7 +3848,8 @@ generation. The @var{string} is similar to the arguments required for the command @option{--quick-add-key} but slightly different. You need to consult the source code to learn the details. Note that the advanced key generation commands can always be used to specify a key -algorithm directly. +algorithm directly. Setting a compliance mode will set or clear this +flag, so it should only be used after a compliance mode setting. @item --no-auto-trust-new-key @opindex no-auto-trust-new-key diff --git a/g10/gpg.c b/g10/gpg.c index 994b83b94..e16c92373 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -2295,6 +2295,7 @@ set_compliance_option (enum cmd_and_opt_values option) opt.s2k_digest_algo = 0; opt.s2k_cipher_algo = DEFAULT_CIPHER_ALGO; opt.flags.allow_old_cipher_algos = 0; + opt.def_new_key_algo = NULL; break; case oOpenPGP: @@ -2310,6 +2311,7 @@ set_compliance_option (enum cmd_and_opt_values option) opt.s2k_digest_algo = DIGEST_ALGO_SHA1; opt.s2k_cipher_algo = CIPHER_ALGO_3DES; opt.flags.allow_old_cipher_algos = 1; + opt.def_new_key_algo = "rsa3072/cert,sign+rsa3072/encr"; break; case oRFC2440: @@ -2323,6 +2325,7 @@ set_compliance_option (enum cmd_and_opt_values option) opt.s2k_digest_algo = DIGEST_ALGO_SHA1; opt.s2k_cipher_algo = CIPHER_ALGO_3DES; opt.flags.allow_old_cipher_algos = 1; + opt.def_new_key_algo = "rsa3072/cert,sign+rsa3072/encr"; break; case oPGP7: -- 2.47.2 From dkg at fifthhorseman.net Wed Feb 5 00:46:08 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 4 Feb 2025 18:46:08 -0500 Subject: [PATCH GnuPG 5/5] gpg: Emit only RSA, DSA, and ElGamal with legacy compliance modes In-Reply-To: <20250204234906.1713904-1-dkg@fifthhorseman.net> References: <20250204234906.1713904-1-dkg@fifthhorseman.net> Message-ID: <20250204234906.1713904-6-dkg@fifthhorseman.net> * g10/keygen.c (parse_key_parameter_part): when using a legacy compliance mode, ensure that new keys are only algorithms known by the corresponding tools. -- GnuPG-bug-id: 7511 Signed-off-by: Daniel Kahn Gillmor --- g10/keygen.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/g10/keygen.c b/g10/keygen.c index 185585e3f..10a2eb9a1 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -3998,6 +3998,15 @@ parse_key_parameter_part (ctrl_t ctrl, else return gpg_error (GPG_ERR_UNKNOWN_CURVE); + if ((RFC4880||RFC2440||PGP8||PGP7) && + (algo != PUBKEY_ALGO_RSA) && + (algo != PUBKEY_ALGO_DSA) && + (algo != PUBKEY_ALGO_ELGAMAL_E)) { + log_error (_("Cannot generate pubkey algorithm \"%s\" in compliance mode: %s\n"), + string, gnupg_compliance_label (opt.compliance)); + return gpg_error (GPG_ERR_UNKNOWN_ALGORITHM); + } + /* Parse the flags. */ keyuse = 0; if (flags) -- 2.47.2 From dkg at fifthhorseman.net Wed Feb 5 00:46:03 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 4 Feb 2025 18:46:03 -0500 Subject: Generate compatible keys in legacy compliance modes (T7511) Message-ID: <20250204234906.1713904-1-dkg@fifthhorseman.net> The following series of 5 patches attempt to ensure that using gpg with --compliance=rfc4880 (or earlier compliance modes), the OpenPGP keys produced will be readable by clients that only implement the particular legacy standard. This is intended to address https://dev.gnupg.org/T7511 Happy to hear feedback on it! Regards, --dkg From dkg at fifthhorseman.net Wed Feb 5 00:46:04 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 4 Feb 2025 18:46:04 -0500 Subject: [PATCH GnuPG 1/5] doc: Update documentation of compliance modes In-Reply-To: <20250204234906.1713904-1-dkg@fifthhorseman.net> References: <20250204234906.1713904-1-dkg@fifthhorseman.net> Message-ID: <20250204234906.1713904-2-dkg@fifthhorseman.net> * doc/gpg.texi (Compliance Options): --gnupg offers LibrePGP behavior, and prefers LibrePGP where it diverges from OpenPGP; --rfc4880bis is an alias for --gnupg; Explain that --rfc2440 is ancient; correct punctuation. -- Signed-off-by: Daniel Kahn Gillmor --- doc/gpg.texi | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/doc/gpg.texi b/doc/gpg.texi index 9a621c89b..ab475c085 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3078,12 +3078,11 @@ options. @item --gnupg @opindex gnupg -Use standard GnuPG behavior. This is essentially OpenPGP behavior (see - at option{--openpgp}), but with extension from the proposed update to -OpenPGP and with some additional workarounds for common compatibility -problems in different versions of PGP. This is the default option, so -it is not generally needed, but it may be useful to override a -different compliance option in the gpg.conf file. +Use standard GnuPG behavior. This is now LibrePGP behavior, which is a +different draft protocol that overlaps in some cases with +OpenPGP. This is the default option, so it is not generally needed, +but it may be useful to override a different compliance option in the +gpg.conf file. @item --openpgp @opindex openpgp @@ -3102,21 +3101,20 @@ Note that this is currently the same thing as @option{--openpgp}. @item --rfc4880bis @opindex rfc4880bis -Reset all packet, cipher and digest options to strict according to the -proposed updates of RFC-4880. +This option is obsolete; it is handled as an alias for @option{--gnupg}. @item --rfc2440 @opindex rfc2440 -Reset all packet, cipher and digest options to strict RFC-2440 -behavior. Note that by using this option encryption packets are -created in a legacy mode without MDC protection. This is dangerous -and should thus only be used for experiments. This option implies - at option{--allow-old-cipher-algos}. See also option - at option{--ignore-mdc-error}. +Set all packet, cipher and digest options to strict RFC-2440 behavior. +RFC-2440 is a very old version of OpenPGP. Note that by using this +option encryption packets are created in a legacy mode without MDC +protection. This is dangerous and should thus only be used for +experiments. This option implies @option{--allow-old-cipher-algos}. +See also option @option{--ignore-mdc-error}. @item --pgp6 @opindex pgp6 -This option is obsolete; it is handled as an alias for @option{--pgp7} +This option is obsolete; it is handled as an alias for @option{--pgp7}. @item --pgp7 @opindex pgp7 -- 2.47.2 From dkg at fifthhorseman.net Wed Feb 5 00:46:05 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Tue, 4 Feb 2025 18:46:05 -0500 Subject: [PATCH GnuPG 2/5] doc: drop incorrect information about --default-new-key-algo In-Reply-To: <20250204234906.1713904-1-dkg@fifthhorseman.net> References: <20250204234906.1713904-1-dkg@fifthhorseman.net> Message-ID: <20250204234906.1713904-3-dkg@fifthhorseman.net> * doc/gpg.texi (default-new-key-algo): drop incorrect information about defaults. -- The claimed default (rsa2048) is not set in the codebase at all. Signed-off-by: Daniel Kahn Gillmor --- doc/gpg.texi | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/gpg.texi b/doc/gpg.texi index ab475c085..7a709d170 100644 --- a/doc/gpg.texi +++ b/doc/gpg.texi @@ -3845,13 +3845,10 @@ absolute date in the form YYYY-MM-DD. Defaults to "0". @opindex default-new-key-algo @var{string} This option can be used to change the default algorithms for key generation. The @var{string} is similar to the arguments required for -the command @option{--quick-add-key} but slightly different. For -example the current default of @code{"rsa2048/cert,sign+rsa2048/encr"} -(or @code{"rsa3072"}) can be changed to the value of what we currently -call future default, which is @code{"ed25519/cert,sign+cv25519/encr"}. -You need to consult the source code to learn the details. Note that -the advanced key generation commands can always be used to specify a -key algorithm directly. +the command @option{--quick-add-key} but slightly different. You need +to consult the source code to learn the details. Note that the +advanced key generation commands can always be used to specify a key +algorithm directly. @item --no-auto-trust-new-key @opindex no-auto-trust-new-key -- 2.47.2 From dkg at fifthhorseman.net Wed Feb 5 20:53:38 2025 From: dkg at fifthhorseman.net (Daniel Kahn Gillmor) Date: Wed, 5 Feb 2025 14:53:38 -0500 Subject: [PATCH GnuPG] gpg: default digest should be SHA1 only in --rfc2440 or --pgp7 Message-ID: <20250205195338.2472273-1-dkg@fifthhorseman.net> * g10/main.h (DEFAULT_DIGEST_ALGO): default to SHA256 except for archaic compliance modes. -- RFC 4880 specifies the 256-bit variant of SHA2, and any compatible client in the last 10 years. According to doc/gpg.texi, PGP 8 also supports SHA 256. There's no clear reason to default to SHA1 for compatibility with those clients. (RFC 2440 and PGP7 don't support SHA256, so leave that alone. GnuPG-bug-id: 7516 Signed-off-by: Daniel Kahn Gillmor --- g10/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g10/main.h b/g10/main.h index 546a0b5b8..ffed41613 100644 --- a/g10/main.h +++ b/g10/main.h @@ -41,7 +41,7 @@ # define DEFAULT_CIPHER_ALGO CIPHER_ALGO_3DES #endif -#define DEFAULT_DIGEST_ALGO ((GNUPG)? DIGEST_ALGO_SHA256:DIGEST_ALGO_SHA1) +#define DEFAULT_DIGEST_ALGO ((PGP7||RFC2440)? DIGEST_ALGO_SHA1:DIGEST_ALGO_SHA256) #define DEFAULT_S2K_DIGEST_ALGO DEFAULT_DIGEST_ALGO #ifdef HAVE_ZIP # define DEFAULT_COMPRESS_ALGO COMPRESS_ALGO_ZIP -- 2.47.2 From ametzler at bebt.de Thu Feb 6 18:01:58 2025 From: ametzler at bebt.de (Andreas Metzler) Date: Thu, 6 Feb 2025 18:01:58 +0100 Subject: split-off gpgmepp - testsuite Message-ID: Hello, I have taken a first look at https://dev.gnupg.org/source/gpgmepp.git (Thanks, BTW for splitting bindingigs from the library.) Some test binaries are built ... (sid)ametzler at argenau:/tmp/GPGMEPP/gpgmepp$ ls build/tests/ CMakeFiles Makefile run-getkey run-verify CTestTestfile.cmake cmake_install.cmake run-keylist run-wkdlookup .. however "make test" is no-op. - Is there something non-obvious I missing here? cu Andreas -- `What a good friend you are to him, Dr. Maturin. His other friends are so grateful to you.' `I sew his ears on from time to time, sure' From gpg at samoverton.dev Sun Feb 9 03:09:16 2025 From: gpg at samoverton.dev (Sam Overton) Date: Sun, 9 Feb 2025 03:09:16 +0100 Subject: [PATCH GnuPG] agent: add pinentry-ignored-env configuration parameter In-Reply-To: <> References: <> Message-ID: <62a5164a-ef76-4a12-8232-f24f71799e6c@samoverton.dev> * The pinentry-ignored-env parameter takes a CSV of environment variables that should not be passed from the client to the pinentry environment. * This allows users running Flatpak applications to resolve the issue where an invalid DBUS_SESSION_BUS_ADDRESS is unavoidably passed from gpg (running inside the Flatpak) to pinentry (running on the host system). Addresses T7522 Signed-off-by: Sam Overton --- agent/agent.h | 4 ++++ agent/call-pinentry.c | 39 +++++++++++++++++++++++++++++++++++++-- agent/gpg-agent.c | 8 ++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/agent/agent.h b/agent/agent.h index 42b167726..ff9a79269 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -175,6 +175,10 @@ struct allow-emacs-prompt is allowed. */ int allow_emacs_pinentry; + /* Comma separated list of environment variables which must not be + passed from the client to pinentry */ + const char *pinentry_ignored_env; + int keep_tty; /* Don't switch the TTY (for pinentry) on request */ int keep_display; /* Don't switch the DISPLAY (for pinentry) on request */ diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index ba37a775e..86897ce29 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -203,6 +203,40 @@ unlock_pinentry (ctrl_t ctrl, gpg_error_t rc) return rc; } +/* Allow configuration of which environment variables from the client to ignore + * when passing to pinentry. This helps to solve problems where the client has + * incorrect settings relative to the environment that the agent is running in, + * in particular DBUS_SESSION_BUS_ADDRESS passed from inside a container. */ +static int +is_ignored_env_var(const char* name) +{ + const char* p = opt.pinentry_ignored_env; + const char* q = NULL; + size_t csv_len = 0; + size_t name_len = 0; + + if (!name || !*name) + return 1; + + if (!opt.pinentry_ignored_env || !*opt.pinentry_ignored_env) + return 0; + + csv_len = strlen(opt.pinentry_ignored_env); + name_len = strlen(name); + + while (p - opt.pinentry_ignored_env < csv_len) + { + /* q points at the NULL terminator if the separator is not found */ + q = strchrnul(p, ','); + + if ((q - p) == name_len && (0 == strncmp(name, p, q - p))) + return 1; + + p = q + 1; + } + + return 0; +} /* Helper for at_fork_cb which can also be called by the parent to * show which envvars will be set. */ @@ -224,10 +258,11 @@ atfork_core (ctrl_t ctrl, int debug_mode) * envvar like "QT_QPA_PLATFORMTHEME=qt5ct" which for example is * useful when using the Qt pinentry under GNOME or XFCE. */ - if (!assname + if ( !is_ignored_env_var(name) && + (!assname || (!opt.keep_display && !strcmp (name, "DISPLAY")) || !strcmp (name, "XAUTHORITY") - || !strcmp (name, "PINENTRY_USER_DATA")) + || !strcmp (name, "PINENTRY_USER_DATA"))) { value = session_env_getenv (ctrl->session_env, name); if (value) diff --git a/agent/gpg-agent.c b/agent/gpg-agent.c index 758824144..58b2b452b 100644 --- a/agent/gpg-agent.c +++ b/agent/gpg-agent.c @@ -133,6 +133,7 @@ enum cmd_and_opt_values oNoAllowLoopbackPinentry, oNoAllowExternalCache, oAllowEmacsPinentry, + oPinentryIgnoredEnv, oKeepTTY, oKeepDISPLAY, oSSHSupport, @@ -303,6 +304,8 @@ static gpgrt_opt_t opts[] = { "@"), ARGPARSE_s_n (oAllowEmacsPinentry, "allow-emacs-pinentry", N_("allow passphrase to be prompted through Emacs")), + ARGPARSE_s_s (oPinentryIgnoredEnv, "pinentry-ignored-env", + N_("Comma-separated list of environment variables to ignore")), /* Dummy options for backward compatibility. */ @@ -904,6 +907,7 @@ parse_rereadable_options (gpgrt_argparse_t *pargs, int reread) opt.allow_external_cache = 1; opt.allow_loopback_pinentry = 1; opt.allow_emacs_pinentry = 0; + opt.pinentry_ignored_env = NULL; memset (opt.disable_daemon, 0, sizeof opt.disable_daemon); disable_check_own_socket = 0; /* Note: When changing the next line, change also gpgconf_list. */ @@ -1007,6 +1011,10 @@ parse_rereadable_options (gpgrt_argparse_t *pargs, int reread) case oAllowEmacsPinentry: opt.allow_emacs_pinentry = 1; break; + case oPinentryIgnoredEnv: + opt.pinentry_ignored_env = pargs->r.ret_str; + break; + case oSSHFingerprintDigest: i = gcry_md_map_name (pargs->r.ret_str); if (!i) -- 2.47.2 From ramon.garcia.f at gmail.com Mon Feb 10 00:40:28 2025 From: ramon.garcia.f at gmail.com (ramon.garcia.f at gmail.com) Date: Sun, 9 Feb 2025 15:40:28 -0800 Subject: Submission of GnuPG Developer's Certificate of Origin Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hello, In order to contribute to GnuPG I am sending this signed Developer's Certificate of Origin GnuPG Developer's Certificate of Origin. Version 1.0 ===================================================== By making a contribution to the GnuPG project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the free software license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate free software license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same free software license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the free software license(s) involved. Signed-off-by: Ram?n Garc?a Fern?ndez ramon.garcia.f at gmail.com -----BEGIN PGP SIGNATURE----- Version: Mailvelope v6.0.1 Comment: https://mailvelope.com wnUEARYKACcFgmepPOwJkG0O0IW8i48PFiEEZrJ8+nOavSn3AweWbQ7QhbyL jw8AACo0AQDq0+HbmlF/AovDJsm0U+5MAL0VbxhmRgntltzitixX7gD/YfFR fy1r7tRYfwBzt9O8ViThxBUzac3GpXtN7fUY3w4= =jYLl -----END PGP SIGNATURE-----