Commit Graph

9316 Commits

Author SHA1 Message Date
Werner Koch 8e15506d66
gpg: Prepare for globing with UTF-8.
* g10/gpg.c (_dowildcard): Remove.
(my_strusage): Enable wildcards using our new system.
--

This patch actually removes the current globing using a mingw
feature.  We are not able to use this because it does not handle
Unicode filenames.  The plan is to implement this in init.c.  This
patch merely configures gpg to request globing.

GnuPG-bug-id: 4398
2021-03-04 10:43:46 +01:00
Werner Koch deb6c94362
common: First take on handling Unicode command line args.
* common/w32-misc.c: New.
* common/t-w32-cmdline.c: New.
* common/init.c: Include w32help.h.
(prepare_w32_commandline): New.
(_init_common_subsystems) [W32]: Call prepare_w32_commandline.

* common/Makefile.am (common_sources) [W32]: Add w32-misc.c
(module_tests): Add t-w32-cmdline
(t_w32_cmdline_LDADD): New.
--

The rules for the command line parser are not cleary specified - if at
all.  See the comment in t-w32-cmdline.c.

We can't use the mingw version because that would require to change
all argv handling to be wchar_t and that only for Windows.  That would
be too ugly.  Parsing the command line into argv by us is much easier
and we can do that only if needed - i.e. if globing is required (we
are prepared for this) or a non-ASCII character has been encountered.
This way we keep things stable and only fix the currently not working
Unicode problem.

GnuPG-bug-id: 4398
2021-03-04 10:22:14 +01:00
Nicolas Fella via Gnupg-devel be2da24456
gpg: Keep temp files when opening images via xdg-open
* g10/photoid.c (get_default_photo_command): Change parameter for
xdg-open.
--

xdg-open spawns the user's preferred image viewer and then exits.
Therefore we must not remove the temp file when it exits,
otherwise by the time the actual image viewer is started the file
doesn't exist any more.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2021-03-01 09:43:26 +01:00
Werner Koch 5ed1567e7c
po: Make agent/commands.c translatable and update German translation.
--

GnuPG-bug-id: 4777

This also fixes a bad fuzzy translation which accidently had been
commited without realizing that there was indeed a change (from
"... GnuPG" to "... %s").
2021-02-26 14:53:48 +01:00
bobwxc f5897b3d24 po: Update Simplified Chinese Translation.
--

Signed-off-by: bobwxc <bobwxc@yeah.net>
2021-02-26 12:00:12 +09:00
Werner Koch e54cd36bbb
doc: Typo fixes for dirmngr.texi
--
2021-02-25 17:03:35 +01:00
Werner Koch c032066d6b
kbx: Log debug fixes
--
2021-02-25 17:02:49 +01:00
Werner Koch d51a5ca108
scd:p15: Read out the access flags.
* scd/app-p15.c (struct keyaccess_flags_s): New.
(struct prkdf_object_s): Add field accessflags.
(dump_keyusage_flags): New.
(dump_keyaccess_flags): New.
(parse_keyaccess_flags): New.
(parse_common_key_attr): Return access flags.
(read_ef_prkdf): Parse the access flags.  Allow for ECkeys.
(read_ef_pukdf): Ditto.  Use new functions for printing.
(read_p15_info): Use new fucntion for printing.
2021-02-25 17:01:38 +01:00
Werner Koch 7de53c2633
build: Require sqlite 3.27
--

Requiring 3.28 had the problem that for example Debin distributes a
3.27 with backported fixes.  There is no 3.28.  So we relax this
again.

Fixes-commit: d763548f2e
2021-02-25 17:01:03 +01:00
Werner Koch a170f0e73f
sm: Do not print certain issuer not found diags in quiet mode.
* sm/certchain.c (find_up_dirmngr): Print one diagnostic only in
verbose mode.  Do not print issuer not found diags in quiet mode.
* sm/minip12.c (parse_bag_data): Add missing verbose condition.
--

GnuPG-bug-id: 4757
2021-02-25 09:16:18 +01:00
Werner Koch 473b83d1b9
sm: Fix issuer certificate look error due to legacy error code.
* sm/certchain.c (find_up): Get rid of the legacy return code -1 and
chnage var name rc to err.
(gpgsm_walk_cert_chain): Change var name rc to err.
(do_validate_chain): Get rid of the legacy return code -1.
--

This was detected while fixing
GnuPG-bug-id: 4757
2021-02-25 09:00:38 +01:00
Werner Koch d763548f2e
build: Require a fixed SQlite version.
--

We are actually not vulnerable but it seems to be a good idea to force
installation of a good copy of SQlite

GnuPG-bug-id: 4510
2021-02-24 22:53:40 +01:00
Werner Koch cfdaf2bcc8
scd:p15: Get the label value of all objects for better diagnostics.
* scd/app-p15.c (struct cdf_object_s): Add fields authid, authidlen,
and label.
(struct prkdf_object_s): Add field label.
(struct aodf_object_s): Ditto.
(release_cdflist): Free new fields.
(release_prkdflist): Free new field.
(release_aodf_object): Ditto.
(parse_common_obj_attr): Return the label.
(read_ef_prkdf): Store the label.
(read_ef_pukdf): Ditto.
(read_ef_cdf): Use parse_common_obj_attr and store authid and label.
Print them im verbose mode.
(read_ef_aodf): Store the label and print it.
2021-02-24 15:50:00 +01:00
Werner Koch 8f353cbacb
doc: Explain how Tor is detected.
--
2021-02-24 11:08:45 +01:00
Werner Koch 615d2e4fb1
sm: Silence some output on --quiet
* sm/encrypt.c (gpgsm_encrypt): Take care of --quiet.
* sm/gpgsm.c: Include minip12.h.
(set_debug): Call p12_set_verbosity.
* sm/import.c (parse_p12): Dump keygrip only in debug mode.
* sm/minip12.c (opt_verbose, p12_set_verbosity): New.
(parse_bag_encrypted_data): Print info messages only in verbose mode.
--

GnuPG-bug-id: 4757
2021-02-24 08:40:06 +01:00
Werner Koch 33aaa37e5b
scd:p15: Make it code work again for D-Trust cards.
* scd/app-p15.c (select_and_read_binary): Allow to skip the select.
(select_and_read_record): Return the statusword.  Silence error
message for SW_FILE_STRUCT.
(select_ef_by_path): Fix selection with a home_DF.
(read_first_record): Fallback to read_binary for CardOS and return
info about this.
(read_ef_prkdf): Use info from read_first_record to decide whether to
use record or binary mode.
(read_ef_pukdf): Ditto.
(read_ef_aodf): Ditto.
(read_ef_cdf): Ditto.  New arg cdftype for diagnostics.
(read_p15_info): Pass cdftype.

* scd/apdu.h (SW_FILE_STRUCT): New.
* scd/apdu.c (apdu_strerror): Map that one to a string.
* scd/iso7816.c (map_sw): and to a gpg-error.
2021-02-23 12:56:42 +01:00
Werner Koch 2490f4e8e1
scd: Fix readkey --info in case a readkey command is available.
* scd/command.c (do_readkey): Make --info also work if a readkey
command is available.

* scd/app-p15.c (cdf_object_from_certid): Fix a but introduced with
the previous commit.
2021-02-22 18:28:45 +01:00
Werner Koch 488eaedc9a
scd:p15: Extract extended usage flagsand act upon them.
* scd/app-p15.c: Add a couple of oid constants.
(struct cdf_object_s): Replace fields image and imagelen by cert.
(struct prkdf_object_s): Add extusage flags
(send_keypairinfo): Use them.
(cdf_object_from_certid): Factor parts out to ...
(cdf_object_from_objid): new function.
(read_ef_prkdf): Move info printing to ...
(read_p15_info): here.  Fill the extusage flags.
(readcert_by_cdf): Cache the ksba cert object instead of the binary
cert.
* scd/app.c (select_additional_application): Fix a log_debug call.
(scd_update_reader_status_file): Ditto.
--

This allows us to return only KEYPAIRINFO lines for keys we can
actually use.
2021-02-22 17:51:11 +01:00
Werner Koch 4c9b509d24
sm: Extend the list of known OIDs.
* sm/keylist.c (oidtranstbl): Add a couple of OIDs and mark them for
key usage.
2021-02-22 15:54:05 +01:00
Werner Koch 54c1f2518e
tools,w32: Add resource and manifest files to all binaries.
--
2021-02-21 12:38:55 +01:00
Werner Koch c7d389e772
doc: Update NEWS
--
2021-02-19 18:01:25 +01:00
Werner Koch 4da91414e7
wkd: Install gpg-wks-client under bin and add wrapper for libexec
--

gpg-wks-client is a pretty useful command on the command line.
Thus we now install it at bin and provide a compatibility wrapper.
2021-02-19 12:11:38 +01:00
Werner Koch 5573ab714b
build: Remove now obsolete HAVE_NEWER_LIBGCRYPT AM conditional.
* configure.ac (HAVE_NEWER_LIBGCRYPT): Remove conditional.
* tools/Makefile.am (gpg_pair_tool_SOURCES):  We build it always.
--

This is because we require libgcrypt 1.9 anyway.
2021-02-19 11:05:32 +01:00
Werner Koch 6d4280b13d
scd: Minor tweak for easier backporting
* scd/app-common.h (APP_CARD): New.  Use it in app-*.c to access
app->card.
--

This should help to make backporting to 2.2 easier.
2021-02-19 10:15:54 +01:00
NIIBE Yutaka 8d5a9c858d po: Update Japanese Translation.
--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-19 11:39:34 +09:00
Werner Koch 5c2ff88339
po: Unified the term "message" in the German translation
--

Using "Botschaft" as we used to do is better than "Nachricht" as used
in tofu and some other places.
2021-02-18 16:16:25 +01:00
Werner Koch 22b4ab1ec7
po: Update German translation
--
2021-02-18 16:11:49 +01:00
Werner Koch 40ddd9a6ba
po: update-po
--
2021-02-18 16:09:05 +01:00
Werner Koch 8a74b87261
scd:piv: Fix a typo in a string.
--
2021-02-18 16:08:02 +01:00
Werner Koch 0be4861762
po: Change translatability of a fallback string.
* agent/call-pinentry.c (setup_genpin): Do not make the fallback
translatable.
2021-02-18 14:43:43 +01:00
Werner Koch 311f477b18
po: Update all po files from 2.2.27
--
2021-02-18 14:26:00 +01:00
Werner Koch 8b2d01c68e
po: Update POTFILES
--
2021-02-18 14:24:26 +01:00
Werner Koch 919a969354
speedo: Update w32 stuff from 2.2
* build-aux/speedo.mk: Update from 2.2.  Add target w32-msi-release.
* build-aux/speedo/w32/inst.nsi: Fix location of doc files.
* build-aux/speedo/w32/wixlib.wxs: Add gpg-card and fix a wrong name.
* Makefile.am (release): Support a WITH_MSI variable.
(wixlibfile): Improve copying to archive.
(release): Use AMTAR instead of TAR.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2021-02-18 13:25:33 +01:00
Werner Koch ab7dc4b524
dirmngr: Support new gpgNtds parameter in LDAP keyserver URLs.
* dirmngr/ldap-parse-uri.c (ldap_parse_uri): Support a new gpgNtds
extension.
* dirmngr/ks-engine-ldap.c (my_ldap_connect): Do ldap_init always with
hostname - which is NULL and thus the same if not given.  Fix minor
error in error code handling.
--

Note that "gpgNtds" is per RFC-4512 case insensitive and has not yet
been officially regisetered.  Thus for correctness the OID can be
used:

  1.3.6.1.4.1.11591.2.5          LDAP URL extensions
  1.3.6.1.4.1.11591.2.5.1          gpgNtds=1 (auth. with current user)

Note that the value must be 1; all other values won't enable AD
authentication and are resevered for future use.

This has been cherry-picked from the 2.2 branch,
commit 55f46b33df

Signed-off-by: Werner Koch <wk@gnupg.org>
2021-02-17 17:40:02 +01:00
NIIBE Yutaka 3fa1fa747b build: Update gpg-error.m4 again.
* m4/gpg-error.m4: Update from libgpg-error.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-16 13:36:32 +09:00
NIIBE Yutaka 985e85dc0e build: Update gpg-error.m4.
* m4/gpg-error.m4: Update from libgpg-error.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-15 10:15:13 +09:00
NIIBE Yutaka 42e637a1c3 agent: Comment spell fix.
--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-12 16:07:19 +09:00
NIIBE Yutaka e1e3f1db46 build: Update gpg-error.m4.
* m4/gpg-error.m4: Update from libgpg-error.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-12 15:40:15 +09:00
NIIBE Yutaka 83e0a9d6b9 build: Fix library dependency of g13 test program.
* g13/Makefile.am (t_common_ldadd): Add GPG_ERROR_LIBS.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-12 15:33:11 +09:00
Werner Koch 9235c9b65b
doc: Add NEWS with news from the 2.2 series.
--
2021-02-11 12:53:28 +01:00
Werner Koch b770393b76
doc: Improve the gpg-card man page.
--
2021-02-11 12:15:49 +01:00
Werner Koch 825dd7220f
gpg: Do not allow old cipher algorithms for encryption.
* g10/gpg.c: New option --allow-old-cipher-algos.
(set_compliance_option): Set --rfc4880bis explictly to SHA256 and
AES256.  Allow old cipher algos for OpenPGP, rfc4880, and rfc2440.
* g10/options.h (opt): Add flags.allow_old_cipher_algos.
* g10/misc.c (print_sha1_keysig_rejected_note): Always print the note
unless in --quiet mode.
* g10/encrypt.c (setup_symkey): Disallow by default algos with a
blocklengt < 128.
(encrypt_crypt): Ditto.  Fallback by default to AES instead of 3DES.
* g10/pkclist.c (algo_available): Take care of old cipher also.
(select_algo_from_prefs): Use AES as implicit algorithm by default.

* tests/openpgp/defs.scm (create-gpghome): Set allow-old-cipher-algos.
--

GnuPG-bug-id: 3415
2021-02-10 14:40:02 +01:00
Werner Koch 6e730c1881
Remove obsolete M4 macros.
* m4/gnupg-pth.m4: Remove.
* m4/libcurl.m4: Remove.
--

Both macros are not used for ages.
2021-02-10 08:40:56 +01:00
Werner Koch 2b75b25605
Require GpgRT version 1.41.
* configure.ac (NEED_GPG_ERROR_VERSION): Rename to NEED_GPGRT_VERSION
and set to 1.41.
* common/sysutils.c (gnupg_access): Remove code for older gpgrt
versions.
* kbx/backend-sqlite.c: Ditto.
* sm/gpgsm.c (main): Ditto.
--

We already have a requirement for a newer Libgcrypt and thus we can
also require a more recent libgpgrt (aka libgpg-error) which was
released before Libgcrypt.
2021-02-10 08:32:57 +01:00
Werner Koch f9e4dae08d
build: Make make distcheck work again.
* m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4
--

Fixes-commit: d66fb3aa53
2021-02-09 18:42:34 +01:00
Werner Koch 209b7113f3
tools: Remove the symcryptrun tool.
* tools/symcryptrun.c: Remove.
* tools/Makefile.am: Ditto.
* doc/tools.texi: Remove man page.
* configure.ac: Remove build option and tests used only by this tool.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Do not build
symcryptrun.
--

symcryptrun is too ancient to be of any use and has not been tested in
many years.  Thus we should not distribute it anymore.
2021-02-09 18:42:25 +01:00
NIIBE Yutaka 390f597868 gpg: Fix selection of key.
* g10/getkey.c (pubkey_cmp): Handle the case of TRUST_EXPIRED.

--

GnuPG-bug-id: 4713
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2021-02-05 13:49:10 +09:00
Werner Koch 7f3ce66ec5
gpg: Remove support for PKA.
* g10/gpg.c (oPrintPKARecords): Remove.
(opts): Remove --print-pka-records.
(main): Remove "pka-lookups","pka-trust-increase" and other PKA stuff.
* g10/options.h (EXPORT_DANE_FORMAT): Remove.
(VERIFY_PKA_LOOKUPS, VERIFY_PKA_TRUST_INCREASE): Remove.
(KEYSERVER_HONOR_PKA_RECORD): Remove.
* g10/packet.h (pka_info_t): Remove.
(PKT_signature): Remove flags.pka_tried and pka_info.
* g10/parse-packet.c (register_known_notation): Remove
"pka-address@gnupg.org".
* g10/pkclist.c (check_signatures_trust): Remove PKA stuff.
* g10/call-dirmngr.c (gpg_dirmngr_get_pka): Remove.
* g10/export.c (parse_export_options): Remove "export-pka".
(do_export): Adjust for this.
(write_keyblock_to_output): Ditto.
(do_export_stream): Ditto.
(print_pka_or_dane_records): Rename to ...
(print_dane_records): this and remove two args. Remove PKA printing.
* g10/free-packet.c (free_seckey_enc, cp_pka_info): Adjust for removed
pka_info field.
* g10/getkey.c (get_pubkey_byname): Make AKL_PKA a dummy.
* g10/keyserver.c: Remove "honor-pka-record".
(keyserver_import_pka): Remove.
* g10/mainproc.c (get_pka_address): Remove.
(pka_uri_from_sig): Remove.
(check_sig_and_print): Remove code for PKA.
--

PKA (Public Key Association) was a DNS based key discovery method
which looked up fingerprint by mail addresses in the DNS.  This goes
back to the conference where DKIM was suggested to show that we
already had a better method for this available with PGP/MIME.  PKA was
was later superseded by an experimental DANE method and is today not
anymore relevant.  It is anyway doubtful whether PKA was ever widely
used.

Signed-off-by: Werner Koch <wk@gnupg.org>
2021-02-02 19:53:21 +01:00
Werner Koch fde7d83357
gpg: Remove more or less useless tool gpgcompose.
* g10/gpgcompose.c: Remove
--

This tool duplicated a lot of code and was hard to maintain.  IIRC, it
was part of some Univerity assignment and of no real use anymore.
2021-02-02 13:06:33 +01:00
Werner Koch 3491faa3bb
gpg: Remove experimental feature to export w/o user-ids.
* g10/options.h (IMPORT_DROP_UIDS, EXPORT_DROP_UIDS): Remove.
* g10/import.c (parse_import_options): Remove option import-drop-uids.
(import_one_real): Remove drop uids code.
(remove_all_uids): Remove function.
* g10/export.c (parse_export_options): Remove option export-drop-uids.
(do_export_one_keyblock): Remove drop uids code.
2021-02-02 12:57:00 +01:00