1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-04-08 21:40:10 +02:00

10776 Commits

Author SHA1 Message Date
Werner Koch
5420c4ebde
gpgconf: Fix reload and kill of keyboxd.
* tools/gpgconf-comp.c (keyboxd_runtime_change): Fix order of args.
--

Fixes-commit: acaeba2dbdb9bbd68a823c671d5c3577fef5d26d
GnuPG-bug-id: 7569
2025-03-17 10:06:54 +01:00
Werner Koch
a7ec3792c5
scd,w32: Fix posssible lockup due to lost select results.
* scd/scdaemon.c (handle_connections) [W32]: Do not continue the loop
when an event was encountered.
--

Here the event handle is passed to npth_eselect so that this function
can detect the event and reset the event.  There is no need to consume
this information here.  However, npth_select might also got a ready
file descriptor along with the event and by doing a "continue" we
would miss the ready state of the file descriptor.  The fix is to do
nothing here, similar to what we do in gpg-agent.

Fixes-commit: f9acc7d18bb90f47dafe7e32ae92f567756d6b12
GnuPG-bug-id: 2982
2025-03-14 14:04:36 +01:00
Werner Koch
95a11baaa2
doc: Minor updates
--
2025-03-14 13:24:44 +01:00
Werner Koch
c1b965cd92
gpg: Fix double free of internal data.
* g10/sig-check.c (check_signature_over_key_or_uid): Do not free in
no-sig-cache mode if allocated by caller.
--

GnuPG-bug-id: 7547
Fixes-commit: 44cdb9d73f1a0b7d2c8483a119b9c4d6caabc1ec
2025-03-13 11:36:52 +01:00
Werner Koch
c12b7d047e
common: Add a flag for left anchored substring match to recsel.
* common/recsel.c (struct recsel_expr_s): Add field lefta.
(recsel_parse_expr): Parse it.
(recsel_select): Implement selection.
--

This flags makes it for example easy to select keys last updated from
an ldap server:

  gpg --list-filter 'select=origin=ks && -^ url =~ ldap' \
       -k --with-key-origin
2025-03-12 11:09:52 +01:00
Werner Koch
e5555a40e6
Update autogen.sh from upstream to version 2025-03-10
--
2025-03-10 15:03:05 +01:00
Werner Koch
d6ee7adebe
card: Add command "ll"
* tools/gpg-card.c (cmd_list): Add optional ar use_opt_cards.
(enum cmdids): Add cmdLISTCARDS.
(cmds): New command "ll".
(interactive_loop): Ditto.
--

Using "l --cards" is a command required very often thus it makes sense
to have an alias for it.  ll also allows to switch the card without
showing the long listing.
2025-03-10 13:57:50 +01:00
Werner Koch
865adcaa70
Post release updates
--
2025-03-07 15:02:06 +01:00
Werner Koch
5b8c5f7190
Release 2.5.5 gnupg-2.5.5 2025-03-07 13:52:38 +01:00
Werner Koch
abcefe3a8c
po: msgmerge
--
2025-03-07 13:52:20 +01:00
Werner Koch
8cfd261100
po: Update German translation
--
2025-03-07 13:51:41 +01:00
Werner Koch
f29c8dba74
Typo fix and add missing prototype.
--
2025-03-07 13:49:00 +01:00
Werner Koch
0f0e0a732c
build: Update Libassuan M4 macros
--
GnuPG-bug-id: 7541
2025-03-07 09:06:06 +01:00
Werner Koch
d3d7713c17
gpg: Fix regression for the recent malicious subkey DoS fix.
* g10/packet.h (PUBKEY_USAGE_VERIFY): New.
* g10/getkey.c (get_pubkey_for_sig): Pass new flag also to requested
usage.
(finish_lookup): Introduce a verify_mode.
--

Fixes-commit: 48978ccb4e20866472ef18436a32744350a65158
GnuPG-bug-id: 7547
2025-03-06 17:17:17 +01:00
Werner Koch
25d48663f9
dirmngr: Use the same thread init strategy as gpg-agent et al.
* dirmngr/dirmngr.c (initialize_modules): New.
(thread_init): Run npth_init only once.  Re-init Libassuan and
Libgcrypt syscall clamps.  Replace all calls by calls to
initialize_modules.
--

GnuPG-bug-id: 6606
2025-03-06 10:51:59 +01:00
Werner Koch
73f6c2dd4d
w32: On socket nonce mismatch close the socket.
* agent/gpg-agent.c (start_connection_thread_std): Close socket on
nonce mismatch.
(start_connection_thread_extra): Ditto.
(start_connection_thread_browser): Ditto.
(start_connection_thread_ssh): Ditto.
* dirmngr/dirmngr.c (start_connection_thread): Ditto.
* kbx/keyboxd.c (start_connection_thread): Ditto.
--

Usually Libassuan takes care of closing the socket but because we do
the nonce check before setting up Assuan we need to explicit close
it.

GnuPG-bug-id: 7434
2025-03-05 15:32:31 +01:00
Werner Koch
41cf76b8c1
Log the Windows system error code at more places.
* common/asshelp.c (log_libassuan_system_error): New.
* agent/gpg-agent.c (create_server_socket): Use new log function.
(handle_connections): Log system error code for a failed accept.
* dirmngr/dirmngr.c (handle_connections): Ditto.
* kbx/keyboxd.c (handle_connections): Ditto.
* scd/scdaemon.c (handle_connections): Ditto.
* tpm2d/tpm2daemon.c (handle_connections): Ditto.

* dirmngr/dirmngr.c (main): Log system error code for a failed bin.
* kbx/keyboxd.c (create_server_socket): Ditto.
* scd/scdaemon.c (create_server_socket): Ditto.
* tpm2d/tpm2daemon.c (create_server_socket): Ditto.
2025-03-05 10:24:50 +01:00
Werner Koch
c68eca6363
tools: Add envvar GPG_AUTHCODE_SIGN_MODE to disable signing.
* tools/gpg-authcode-sign.sh: Check envvar for value "disable".
2025-02-24 10:52:39 +01:00
Werner Koch
fdcc69c29d
dirmngr: Prepare for new command KS_DEL.
* dirmngr/server.c (cmd_ks_del): New.
* dirmngr/ks-action.c (ks_action_del): New.
* dirmngr/ks-engine-ldap.c (ks_ldap_del): New stub.
--

GnuPG-bug-id: 5447
2025-02-21 14:45:15 +01:00
Werner Koch
db7141d462
dirmngr: Factor a common command parsing code out.
* dirmngr/server.c (percentplus_line_to_strlist): New.  Code taken
from cmd_ks_get.
(cmd_ks_search, cmd_ks_get): Use it here.
2025-02-21 14:36:58 +01:00
Werner Koch
75667050dc
build: Update autogen.sh to the current version.
--

This is a general maintenance update
2025-02-21 13:01:47 +01:00
Werner Koch
bec71fdbe5
speedo: Do not build gpgme anymore.
* build-aux/speedo.mk: Remove support gpgme.
* build-aux/speedo/w32/inst.nsi: Ditto.
* build-aux/speedo/w32/wixlib.wxs: Remove the gpgme components.
--

GPGME is either already availabale on Unix platforms or can be
installed on Widnows with gpg4win.  GnuPG itself does not require
gpgme.
2025-02-21 12:58:39 +01:00
Werner Koch
48978ccb4e
gpg: Fix a verification DoS due to a malicious subkey in the keyring.
* g10/getkey.c (get_pubkey): Factor code out to ...
(get_pubkey_bykid): new.  Add feature to return the keyblock.
(get_pubkey_for_sig): Add arg r_keyblock to return the used keyblock.
Request a signing usage.
(get_pubkeyblock_for_sig): Remove.
(finish_lookup): Improve debug output.
* g10/sig-check.c (check_signature): Add arg r_keyblock and pass it
down.
* g10/mainproc.c (do_check_sig): Ditto.
(check_sig_and_print): Use the keyblock returned by do_check_sig to
show further information instead of looking it up again with
get_pubkeyblock_for_sig.  Also re-check the signature after the import
of an included keyblock.
--

The problem here is that it is possible to import a key from someone
who added a signature subkey from another public key and thus inhibits
that a good signature good be verified.

Such a malicious key signature subkey must have been created w/o the
mandatory backsig which bind a signature subkey to its primary key.
For encryption subkeys this is not an issue because the existence of a
decryption private key is all you need to decrypt something and then
it does not matter if the public subkey or its binding signature has
been put below another primary key; in fact we do the latter for
ADSKs.

GnuPG-bug-id: 7527
2025-02-21 12:17:46 +01:00
Werner Koch
5e87e452e4
gpg: Remove a signature check function wrapper.
* g10/sig-check.c (check_signature2): Rename to
(check_signature): this and remove the old wrapper. Adjust all
callers.
2025-02-20 14:50:20 +01:00
Werner Koch
4c11359aec
doc: Declare --disable-http as legacy.
--
2025-02-19 11:56:46 +01:00
Werner Koch
feeceed970
agent: Improve diagnostics for a bind call failure.
* agent/gpg-agent.c (create_server_socket): Fix translation.  Add
diagnostic for bind retry.  Print windows error code after bind
failure.
--

GnuPG-bug-id: 7434
2025-02-18 12:19:49 +01:00
Werner Koch
3239a41dde
doc: Add some notes
--
2025-02-18 09:21:15 +01:00
Werner Koch
80491dd91a
Post release updates
--
2025-02-12 11:59:51 +01:00
Werner Koch
ec6c2e38f1
Release 2.5.4 gnupg-2.5.4 2025-02-12 11:42:00 +01:00
Werner Koch
f2297f1952
po: msgmerge
--
2025-02-12 11:41:53 +01:00
Emir SARI
fc8619fce2
Update Turkish translations 2025-02-12 11:37:39 +01:00
Werner Koch
7a47252516
agent: New option --change-std-env-name.
* common/session-env.c (stdenvnames): Add field "disabled".
(INITIAL_ARRAYSIZE): Increase size a bit.
(session_env_mod_stdenvnames): New.
(session_env_list_stdenvnames): Handle the disabled flag.
* agent/gpg-agent.c (oChangeStdEnvName): New.
(opts): Add --change-std-env-name.
(main): Implement option.
--

GnuPG-bug-id: 7522
2025-02-12 11:15:21 +01:00
Werner Koch
8c753cb7c9
gpgsm: Remove unused function.
* sm/misc.c (setup_pinentry_env): Remove.
2025-02-12 10:31:06 +01:00
Daniel Kahn Gillmor
503c9e3451
doc: Do not install gnupg.7.html into usr/share/man/manh/
* doc/Makefile.am: Ship gnupg.7.html with other html, not with
manpages.

--

Without this change, gnupg.7.html gets placed in /usr/share/manh/
Since it can't be correctly rendered by groff, this is undesirable.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2025-02-12 09:55:45 +01:00
Werner Koch
70049e5f16
gpg: Lookup key for merging/inserting only beu primary key.
* g10/getkey.c (get_keyblock_byfpr_fast): Add arg primary_only and
implement.
* g10/import.c (import_one_real): Simplify filling the fpr buffer with
zeroes.
(import_one_real): Find key only by primary fingerprint.
--

This should have been done early: When looking up the original
keyblock we want to update, we need to lookup it up only using the
primary key.  This avoids to find a key which has the primary key also
has a subkey.

GnuPG-bug-id: 7527
2025-02-11 14:46:19 +01:00
Werner Koch
ef4acfd77b
Update NEWS
--
2025-02-07 11:56:27 +01:00
Werner Koch
3738b0a99a
gpg: Store Link attributes for composite keys.
* g10/call-agent.c (agent_crosslink_keys): New.
* g10/keygen.c (common_gen): Store the Link attribute.
--

The Link attribute may be useful to quickly find the other part of a
composite private key.

GnuPG-bug-id: 6638
2025-02-07 11:10:09 +01:00
Werner Koch
00c31f8b04
gpg: New option --disable-pqc-encryption.
* g10/options.h (flags): Add field disable_pqc_encryption.
* g10/gpg.c (oDisablePQCEncryption): New.
(opts): Add --option.
(main): Set option.
* g10/getkey.c (finish_lookup): Skip subkeys if option is set.
--

This option can be used to avoid the use of Kyber encryption subkeys
if this does not make sense (i.e. protection of local files).
2025-02-06 17:45:23 +01:00
Werner Koch
da9fb6bd16
kbx: Fix for building without keyboxd.
* kbx/keybox-fwddecl.h: New.
* kbx/keybox.h: Replace typedef for KEYBOX_HANDLE by including the new
file.
* g10/keydb-private.h: Ditto.
--

The duplicated typedef was a bit ugly and will fail, depending on
compiler, iof for example building without keyboxd.  Fix only tested
in the standard case but the fix is obvious.
2025-02-06 15:46:15 +01:00
Werner Koch
3a523b43d4
gpgscm: Fix possible segv in the process functions.
* tests/gpgscm/ffi.c (do_process_spawn_io): Fix use of FD_ISSET.
--

This bug was detected on an i686 with gcc 4.1 and Linux 2.6.18

Fixes-commit: 1b0ce9918c321a5060fb7c59a234ab683187e8c1
2025-02-06 15:35:49 +01:00
Werner Koch
0ec989ee3f
gpgscm: Fix for gcc < 4.5
* tests/gpgscm/scheme.c (MY_GCC_VERSION): New.
(type_to_string): Use gcc build in only when supported.
--

Note that we do not wnat to use the GPGRT macro to keep this file as
close to upstream as possible.
2025-02-06 14:40:46 +01:00
Werner Koch
9dba5ab403
gpg: Fix --quick-add-key for Weierstrass ECC with usage given.
* g10/keygen.c (adjust_algo_for_ecdh_ecdsa): New.
(parse_algo_usage_expire): Adjust key algo.
--

GnuPG-bug-id: 7506
2025-02-05 11:03:30 +01:00
Daniel Cerqueira
8ae8f12e53
po: Update to po/pt.po
--

Signed-off-by: Daniel Cerqueira <dan.git@lispclub.com>
2025-02-03 14:11:43 +01:00
Werner Koch
c2ff47d5bc
gpg: Base compliance "de-vs" now on "gnupg" and not on "openpgp".
* g10/gpg.c (set_compliance_option) <oDE_VS>: Change.
--

This version has not yet been evaluated and thus we are able to
change it to a more useful default.
2025-02-03 11:49:54 +01:00
Werner Koch
4b2729b983
gpg: Simplify the compliance settings.
* g10/gpg.c (set_compliance_option): Base most settings on oGnuPG.
For oGnuPG explictly clear the allow_old_cipher_algos flag.
--

Note that --allow-old-cipher-algos must now come after a compliance
settings.  This avoids a bug when first setting oRFC2440 and then
oGnuPG which would not clear the flag.

GnuPG-bug-id: T7501
2025-02-03 11:46:57 +01:00
Daniel Kahn Gillmor via Gnupg-devel
aa46ba28ba
doc: Record that gpg policy compliance options are last-one-wins
* doc/gpg.texi (Compliance options): Explain that when multiple
--compliance options are given, the final one supersedes any previous
option.

--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2025-02-03 11:22:09 +01:00
Daniel Kahn Gillmor via Gnupg-devel
04d58ff847
gpg: --compliance={pgp7, pgp8} also now restore default options
* g10/gpg.c (set_compliance_option): oPGP7 and oPGP8 both restore
policy-relevant default options before setting the compliance flag.

--

With this change, any ordering of --compliance options will always
result in the options selected from the last option given.

GnuPG-bug-id: 7501
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2025-02-03 11:21:36 +01:00
Daniel Kahn Gillmor via Gnupg-devel
0bdf585993
gpg: --compliance=gnupg restores default for policy-affected options
* g10/gpg.c (set_compliance_option): oGnuPG restores default
policy-affected options, moved from...
(main): ...here.  Invoke set_compliance_option(oGnuPG) directly
instead of just setting opt.compliance.

--

Some of these default option values (flags.dsa2, rfc2440_text,
allow_non_selfsigned_uid, allow_freeform_uid) had to be inferrerd from
the fact that the opt struct is static and therefore initialized to
zero by the compiler.

With this change, --compliance=gnupg now completely reverts to the
defaults that were changed from other --compliance= options.

GnuPG-bug-id: T7501
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2025-02-03 11:21:16 +01:00
Daniel Kahn Gillmor via Gnupg-devel
54a8770aeb
gpg: --compliance=rfc2440 does not require cross-certification
* g10/gpg.c (set_compliance_option): clear
opt.flags.require_cross_cert with oRFC2440

--
This aligns with the expectations in RFC 2440, which doesn't specify
any cross-certifications.  As doc/gpg.texi says: "This is dangerous",
but it aligns with the specification.

The comment above says that 4880 is the same as 2440, "but with [...]
--require-cross-certification", so we align the code with the intent
from the comment.  It looks like opt.require_cross_cert was turned on
by default after that comment (and the oRFC2440 section) was written,
but the oRFC2440 section was never updated to turn it off.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2025-02-03 11:20:17 +01:00
Werner Koch
159e801043
gpgsm: Allow unattended PKCS#12 export without passphrase.
* sm/gpgsm.c (oNoProtection): New.
(opts): Add "--no-protection".
(main): PArse it.
* sm/gpgsm.h (struct server_control_s): Add field no_protection.
* sm/server.c (option_handler): Add option "no-protection".
(reset_notify): Clear option.
* sm/export.c (export_p12): Use empty passphrase if option is set.
2025-01-29 18:06:15 +01:00