1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-18 00:49:50 +02:00
Commit Graph

10016 Commits

Author SHA1 Message Date
NIIBE Yutaka
cf4154a3dd
dirmngr: Remove casting which is not needed any more.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-08 11:59:06 +09:00
NIIBE Yutaka
768d365b0f
w32: Fix spawn functions to support Windows Xp.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-03 09:18:56 +09:00
NIIBE Yutaka
b9e65faa5d
w32: Fix inheriting HANDLEs.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-02 22:21:53 +09:00
NIIBE Yutaka
b674a704e9
Rename the enum constant to GNUPG_PROCESS_GET_PROC_ID.
And use GetProcessId on Windows in the implementation.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-02 14:53:44 +09:00
NIIBE Yutaka
7cadbf4e18
Merge branch 'master' into gniibe/t6275 2023-05-01 12:04:18 +09:00
NIIBE Yutaka
0fe99d69f0
dirmngr: Fix API of functions wrt their error type.
* dirmngr/crlcache.h (fakecrl_isvalid): Fix return type.
* dirmngr/http.c (parse_response): Fix return type to gpg_error_t,
modifying the function implementation.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-01 11:39:24 +09:00
NIIBE Yutaka
698caf30b9
common: Fix parsing ECC key.
* common/sexputil.c (get_ecc_q_from_canon_sexp): Initialize ECC_Q_LEN.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-01 11:38:20 +09:00
NIIBE Yutaka
3cf5fc2e2f
scd: Fix cmd_apdu on error.
* scd/command.c (cmd_apdu): Fix the code path on error.

--

GnuPG-bug-id: 6476
Reported-by: Robin Krahl
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-05-01 11:36:36 +09:00
Werner Koch
625bd92410
Post release updates
--
2023-04-28 14:16:52 +02:00
Werner Koch
b331ae1c3f
Release 2.4.1 2023-04-28 11:16:29 +02:00
Werner Koch
51975712e9
po: msgmerge done
--
2023-04-28 10:50:50 +02:00
Werner Koch
2b8109d102
po: Update German translation
--
2023-04-28 10:44:41 +02:00
NIIBE Yutaka
23c5634485
regexp: Update UnicodeData for Unicode 15.0.0.
* regexp/UnicodeData.txt: Update from upstream.

--

https://www.unicode.org/Public/15.0.0/ucd/UnicodeData.txt

See: https://www.unicode.org/versions/Unicode15.0.0/
     https://www.unicode.org/reports/tr44/

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-27 09:10:39 +09:00
Werner Koch
7e1f36b242
speedo,w32: Adjustments for the new Unicode NSIS plugins.
* build-aux/speedo/w32/inst.nsi: Convert to UTF-8.  Add Unicode
statement.
* build-aux/speedo.mk (installer): Remove -INPUTCHARSET.
--

GnuPG-bug-id: 6448
2023-04-26 09:10:39 +02:00
Werner Koch
7359665add
speedo: Update NSIS helper DLL from Gpg4win
* build-aux/speedo/w32/inst.nsi: Re-enable run-once check.
* build-aux/speedo/w32/exdll.c: New.
* build-aux/speedo.mk (g4wihelp.dll): Change build commands.
--

GnuPG-bug-id: 6448
2023-04-26 09:10:39 +02:00
NIIBE Yutaka
c4a456e5ff
po: Update Japanese Translation.
--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-26 13:37:39 +09:00
NIIBE Yutaka
0ec10fbd0d
gpg: Fix for overridden key import.
* g10/import.c (do_transfer): Force the overridden key import
even when smartcard is available.

--

Fixes-commit: 2c12970550
GnuPG-bug-id: 3456
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-25 13:47:49 +09:00
Werner Koch
c03ba92576
gpg: Fix writing ECDH keys to OpenPGP smartcards.
* agent/command.c (cmd_keytocard): Add new arg for ECDH params.
* scd/app-openpgp.c (ecc_writekey): Use provided ECDH params to
compute the fingerprint.
* g10/call-agent.c (agent_keytocard): Add arg ecdh_param_str.
* g10/keyid.c (ecdh_param_str_from_pk): New.
* g10/card-util.c (card_store_subkey): Pass ECDH params to writekey.
* g10/keygen.c (card_store_key_with_backup): Ditto.

* scd/app-openpgp.c (store_fpr): Add arg update.
(rsa_read_pubkey, ecc_read_pubkey): Add arg meta_update and avoid
writing the fingerprint back to the card if not set.
(read_public_key): Also add arg meta_update.
(get_public_key): Do not pass it as true here...
(do_genkey): ... but here.
(rsa_write_key, ecc_writekey): Force string the fingerprint.
--

The problem showed up because in 2.4 we changed the standard ECDH
parameter some years ago.  Now when trying to write an ECDH key
created by 2.2 with 2.4 to an openpgp card, scdaemon computes a wrong
fingerprint and thus gpg was not able to find the key again by
fingerprint.

The patch also avoids updating the stored fingerprint in certain
situations.

This fix is somewhat related to
GnuPG-bug-id: 6378
2023-04-21 15:23:29 +02:00
NIIBE Yutaka
762b7d07ea
common: Incorporate upstream changes of regexp.
* regexp/jimregexp.c (regatom): Raise REG_ERR_UNMATCHED_BRACKET when
no matching end bracket.
(regmatch): Fix the end of word check.

--

Original changes:
	Signed-off-by: Steve Bennett <steveb@workware.net.au>

GnuPG-bug-id: 6455
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-21 11:51:47 +09:00
Werner Koch
af3724d383
scd,p15: Enforce a min. PIN length for certain cards.
* scd/app-p15.c (verify_pin): Enforce 6 for RSCS cards.
2023-04-20 12:41:08 +02:00
Werner Koch
a82e6f310a
common: Fix minor bug in the jimregexp code.
* regexp/jimregexp.c (regatom): Make error checking for stray
backslash at end of the string work.  Check that the pattern class is
closed by a bracket.
--

GnuPG-bug-id: 6455
Co-authored-by: Guldrelokk
2023-04-20 12:26:40 +02:00
Werner Koch
e1663c0450
gpg: New command "openpgp" for --card-edit.
* g10/card-util.c (current_card_status): Print a hint for fishy
outputs.
(enum cmdids): Add cmdOPENPGP.
(cmds): Add "openpgp".
(card_edit): Implement that command.
--

If a Yubikey has been used in PIV mode the initial listing does not
look correct.  Although we explicitly switch to the OpenPGP app when
needed, we don't want to do this in listing mode.  Instead we offer a
new command "openpgp" to force the openpgp mode.  The ultimate goal
will be to enhance the gpg-card tool to completely take over the
--card-edit features.  But we are not yet there.

GnuPG-bug-id: 6462
2023-04-20 12:10:54 +02:00
NIIBE Yutaka
4459d759fd
spawn: Introduce *_KEEP, removing *_NULL.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-20 14:36:08 +09:00
NIIBE Yutaka
5d4c3b79ee
exechelp: Clean up macros.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-20 13:54:34 +09:00
Werner Koch
80d4ae1215
Use keyboxd on a fresh install also on Windows.
* common/homedir.c (gnupg_maybe_make_homedir): Factor some code out to
...
(create_common_conf): new.
(standard_homedir): Call it also from here.
--

Fixes-commit: d9e7488b17
2023-04-19 11:05:42 +02:00
Werner Koch
fa4f716917
gpg: Make sure that we are not accidently working with the PIV app.
* g10/call-agent.c (agent_scd_switchapp): New.
* g10/card-util.c (get_info_for_key_operation): Call it.
--

It may happen that the active card was last used for PIV and in that
case certain commands will fail because they assume the OpenPGP app.
Fortunately we have a pretty central place to assure that the right
app has been selected.

The bug can be easily noticed on Windows.

GnuPG-bug-id: 6378
2023-04-18 17:07:04 +02:00
Werner Koch
f7e00dc73d
scd: On a Yubikey re-select the last app after the use of APDU.
* scd/app-common.h (struct card_ctx_s): Add maybe_check_aid flag.
* scd/command.c (cmd_apdu): Set it.
* scd/app.c (check_external_interference): Consult this flag.
(maybe_switch_app): Do a re-select if this flag is set.
--

After the gpg-card tool has issued a Yubikey specific command the
current application is not anymore correctly selected.  This then
results in all kind of errors.  We detect this now and try to
re-select the last app.
2023-04-18 12:04:15 +02:00
Werner Koch
98b8c518fa
ssh: Allow to prefer on-disk keys over active card keys.
* agent/command-ssh.c (ssh_send_available_keys): Redefine the order of
keys.
--

GnuPG-bug-id: 6212
2023-04-18 09:04:27 +02:00
Werner Koch
ba67fea5b9
gpgtar: Read common.conf for the log-file option.
* common/util.h (GNUPG_MODULE_NAME_GPGTAR): New.
* common/homedir.c (gnupg_module_name): Add it.
* tools/gpgtar.c: Include comopt.h.
(enum cmd_and_opt_values): Add oDebug.
(opts): Add --debug.
(any_debug): New.
(main): Parse common.conf.
--

Having a way to see the output of gpgtar is often useful for
debugging.  The only effect of the debug option is to show whether
common.conf was read.
2023-04-18 08:04:48 +02:00
NIIBE Yutaka
2c12970550
gpg: Allow overridden key import when stub exists.
* g10/import.c (do_transfer): Force importing when it's card
reference.

--

GnuPG-bug-id: 3456
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-18 09:53:24 +09:00
NIIBE Yutaka
5717d9ec1e
Remove old API implementation for spawn functions.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-17 14:14:16 +09:00
NIIBE Yutaka
df357a0335
Fix use of GNUPG_PROCESS_DETACHED.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-17 14:10:00 +09:00
NIIBE Yutaka
5d8648e12d
w32: Fix asshelp.c for Windows use case.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-17 11:44:42 +09:00
NIIBE Yutaka
cd13428a22
Fix requirement for _WIN32_WINNT to use process related functions.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-13 14:34:57 +09:00
NIIBE Yutaka
8dcfb5e4d0
Merge branch 'master' into gniibe/t6275 2023-04-13 14:08:27 +09:00
Werner Koch
d965ee8d65
gpg: Curvenames may now compared case insensitive.
* common/openpgp-oid.c (openpgp_curve_to_oid): Repalce strmcp by
ascii_strcasecmp.
(openpgp_oid_or_name_to_curve): Ditto.
(openpgp_is_curve_supported): Ditto.
(get_keyalgo_string): Ditto.
--

It was just to hard to remember the correct capitalization of
names like brainpoolP512r1.
2023-04-12 17:10:08 +02:00
Eva Bolten
3013137f74
po: Fix in German translation
--
2023-04-06 10:30:56 +02:00
NIIBE Yutaka
cb055ecb91
gpg: Fix handling of importing cv25519 secret key.
* g10/import.c (transfer_secret_keys): Only emit a warning when secret
key is not encrypted.

--

Fixing-commit: dbfb7f809b
GnuPG-bug-id: 6322
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-06 11:32:52 +09:00
Werner Koch
c9e95b8dee
gpg: New option --assert-signer.
* g10/gpg.c (enum cmd_and_opt_values): Add oAssertSigner.
(opts): Add "assert-signer".
(main): Set option.
(assert_signer_true): New var.
(g10_exit): Evaluate new var.
* g10/main.h (assert_signer_true): Declare new var.
* common/status.h (STATUS_ASSERT_SIGNER): New.
* g10/options.h (opt): Add field assert_signer_list.
* g10/verify.c (is_fingerprint): New.
(check_assert_signer_list): New.
* g10/mainproc.c (check_sig_and_print): Call that function.  Clear
assert_signer_true on a warning.

* g10/gpgv.c: Add dummy function and vars.
* g10/t-keydb-get-keyblock.c: Ditto.
* g10/t-keydb.c: Ditto.
* g10/t-stutter.c: Ditto.
--
2023-04-05 21:32:23 +02:00
Werner Koch
42ccbd6c78
speedo,w32: Remove removed profiles and temporary disable runonce.
--
2023-04-05 15:01:18 +02:00
NIIBE Yutaka
946a851d17
build: Update gpg-error.m4.
* m4/gpg-error.m4: Update from libgpg-error master.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2023-04-05 15:56:05 +09:00
Werner Koch
d261f5e5d0
common: Change allocation of the comopt symbol.
* common/comopt.h (struct gnupg_comopt_s): New.
* common/comopt.c (struct gnupg_comopt_s): Define here in the data
segment.
2023-04-04 16:51:58 +02:00
Werner Koch
d9e7488b17
Use the keyboxd for a fresh install
* common/homedir.c (gnupg_maybe_make_homedir): Also create a
common.conf.
* g10/keydb.c: Include comopt.h.
(maybe_create_keyring_or_box): Detect the creation of a common.conf.
* g10/gpg.c (main): Avoid adding more resources in this case.
* sm/keydb.c:  Include comopt.h.
(maybe_create_keybox): Detect the creation of a common.conf.

* common/comopt.h (comopt): Remove the conditional "extern".
2023-04-04 16:39:59 +02:00
Werner Koch
db6ae6f6f8
speedo: Remove deleted prf files from the Windows installer
--
2023-04-04 13:10:48 +02:00
Werner Koch
fcbb849c26
speedo: Fix regression due to switching from gcc 8.3 to 10.2
* build-aux/speedo.mk (speedo_pkg_zlib_make_args): Use -static-libgcc.

(cherry picked from commit 04f1d9649c)
2023-04-04 10:20:17 +02:00
Werner Koch
7bf57a794b
gpg: Set the default digest algo for S2K to SHA256.
* g10/main.h (DEFAULT_S2K_DIGEST_ALGO): Alias to DEFAULT_DIGEST_ALGO.
--

GnuPG-bug-id: 6367
2023-04-04 09:20:26 +02:00
Werner Koch
56d309133f
dirmngr: Return modifyTimestamp and add server option --newer.
* dirmngr/server.c (cmd_ks_get): Add option --newer.
(cmd_ad_query): Ditto.
* dirmngr/ldap-misc.c (isotime2rfc4517): New.
(rfc4517toisotime): New.
* dirmngr/ks-action.c (ks_action_get): Add arg newer and pass on.
(ks_action_query): Ditto.
* dirmngr/ks-engine-ldap.c (extract_keys): Print new "chg" record.
(ks_ldap_get): Add arg newer.  Modify filter with newer arg.
(ks_ldap_search): Print the modifyTimestamp.
(ks_ldap_query): Add arg newer.  Modify filter with newer arg.
--

Note that the modifyTimestamp is also available on Windows, where its
value is more commonly known as whenChanged.  Both are constructed
attributes.

Note that the --newer option is a bit of a misnomer because LDAP has
only a greater-or-equal and no greater-than operator.
2023-04-04 08:49:55 +02:00
Werner Koch
a5360ae4c7
agent: Add trustlist flag "de-vs".
* agent/trustlist.c (struct trustitem_s): Add field de_vs.
(read_one_trustfile): Parse it.
(istrusted_internal): Emit TRUSTLISTFLAG status line.
* sm/gpgsm.h (struct rootca_flags_s): Add field de_vs.
* sm/call-agent.c (istrusted_status_cb): Detect the flags.

* sm/sign.c (write_detached_signature): Remove unused vars.
--

Right now this flag has no effect; we first need to specify the exact
behaviour.

GnuPG-bug-id: 5079
2023-04-03 14:10:33 +02:00
Werner Koch
8996b0b655
gpgsm: Create binary detached sigs with definite form length octets.
* sm/sign.c: Include tlv.h.
(write_detached_signature): New,
(gpgsm_sign): Fixup binary detached signatures.
--

This helps some other software to verify detached signatures.
2023-04-03 12:01:37 +02:00
Werner Koch
4b9346492e
gpgsm: Remove conditional compilation for older libksba versions.
* sm/sign.c (add_signed_attribute): Return an error because the option
--attribute is not yet working.

--

We require libskba 1.6 anyway.
2023-03-31 09:35:07 +02:00