Commit Graph

8111 Commits

Author SHA1 Message Date
Werner Koch 82b9e1bdbd
Release 2.2.18 2019-11-25 20:28:33 +01:00
Werner Koch 253fadbf88
po: auto-update
--
2019-11-25 20:24:48 +01:00
Andre Heinecke f29a9ed9d0
speedo: Tell makensis the used charset of the script.
--

Adapted from the version in master.
2019-11-25 20:09:48 +01:00
Werner Koch 8e49fc7f43
tests: Adjust for now invalid SHA-1 key signatures.
* tests/openpgp/defs.scm (create-gpghome): Add
allow-weak-key-signatures.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-25 16:28:06 +01:00
Werner Koch f027c2d5be
po: Update German translation
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-25 16:26:25 +01:00
Werner Koch 96c4943a5b
agent: Improve --debug-pinentry diagnostics
* agent/call-pinentry.c (atfork_cb): Factor code out to ...
(atfork_core): new.
--

We convey certain envvars directly via the environment to Pinentry and
thus they don't show up in the Assuan logging.  Because we better
don't call a logging function in an atfork handle, this patch splits
the code up and uses the same code to display what was done in at fork
after the connection has been established.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit c8783b3a20)
2019-11-25 11:41:02 +01:00
Werner Koch 10168a103b
doc: Prepare a NEWS file for the next release.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-24 20:42:57 +01:00
Werner Koch dd373d4a27
doc,dirmngr: Clarify --standard-resolver.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit c21267e1c7)
GnuPG-bug-id: 4547
2019-11-23 20:30:22 +01:00
Werner Koch 6e893061b5
wkd: Let --install-key write a template policy file.
* tools/wks-util.c (ensure_policy_file): New.
(wks_cmd_install_key): Call it.
--

GnuPG-bug-id: 4753
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 50cd1a58f3)
2019-11-23 13:50:21 +01:00
Werner Koch 499cd4d2eb
doc: Clarify how to use --log-file in gpg.
--

Note that in 2.3 --batch is not anymore required.
2019-11-18 18:51:36 +01:00
Werner Koch 3efc94f1eb
dirmngr,gpg: Better diagnostic in case of bad TLS certificates.
* doc/DETAILS: Specify new status code "NOTE".
* dirmngr/ks-engine-http.c (ks_http_fetch): Print a NOTE status for a
bad TLS certificate.
* g10/call-dirmngr.c (ks_status_cb): Detect this status.
--

For example a

  gpg -v --locate-external-keys dd9jn@posteo.net

now yields

  gpg: Note: server uses an invalid certificate
  gpg: (further info: bad cert for 'posteo.net': \
                      Hostname does not match the certificate)
  gpg: error retrieving 'dd9jn@posteo.net' via WKD: Wrong name
  gpg: error reading key: Wrong name

(without -v the "further info" line is not shown).  Note that even
after years Posteo is not able to provide a valid certificate for
their .net addresses.  Anyway, this help to show the feature.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-18 18:44:36 +01:00
Werner Koch 4dd5099125
dirmngr: Forward http redirect warnings to gpg.
* dirmngr/http.c: Include dirmngr-status.h
(http_prepare_redirect): Emit WARNING status lines for redirection
problems.
* dirmngr/http.h: Include fwddecl.h.
(struct http_redir_info_s): Add field ctrl.
* dirmngr/ks-engine-hkp.c (send_request): Set it.
* dirmngr/ks-engine-http.c (ks_http_fetch): Set it.
* g10/call-dirmngr.c (ks_status_cb): Detect the two new warnings.
--

This should make it easier to diagnose problems with bad WKD servers.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-18 18:44:33 +01:00
Werner Koch 466bdf7c07
dirmngr: Factor some prototypes out to dirmngr-status.h.
* dirmngr/dirmngr-status.h: New.
* dirmngr/dirmngr.h: Include dirmngr-status.h and move some prototypes
to that file.
* dirmngr/t-support.c: New.
* dirmngr/Makefile.am (t_common_src): Add new file.
--

This helps to backport changes from master.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-18 18:44:30 +01:00
Werner Koch 0f37727fca
dirmngr: Fixed typo in recently added diagnostic.
--
2019-11-18 18:44:28 +01:00
NIIBE Yutaka 9b41f58c8a scd,ccid: Add support of GEMPC_EZIO.
* scd/ccid-driver.h (GEMPC_EZIO): New.
* scd/ccid-driver.c (ccid_transceive_secure): Support GEMPC_EZIO.

--

This is backport from master.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2019-11-15 15:49:46 +09:00
Werner Koch 392e068e9f
dirmngr: Use IPv4 or IPv6 interface only if available.
* dirmngr/dns-stuff.c (cached_inet_support): New variable.
(dns_stuff_housekeeping): New.
(check_inet_support): New.
* dirmngr/http.c (connect_server): Use only detected interfaces.
* dirmngr/dirmngr.c (housekeeping_thread): Flush the new cache.
--

This currently works only for Windows but that is where users really
ran into problems.  The old workaround was to configure disable-ipv4
or disable-ipv6.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-12 20:31:34 +01:00
Werner Koch 754a03f5a2
gpg: Forbid the creation of SHA-1 third-party key signatures.
* g10/sign.c (SIGNHINT_KEYSIG, SIGNHINT_SELFSIG): New.
(do_sign): Add arg signhints and inhibit SHA-1 signatures.  Change
callers to pass 0.
(complete_sig): Add arg signhints and pass on.
(make_keysig_packet, update_keysig_packet): Set signhints.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit dd18be979e)
2019-11-11 12:39:22 +01:00
Werner Koch 3b1fcf6523
gpg: Add option --allow-weak-key-signatures.
* g10/gpg.c (oAllowWeakKeySignatures): New.
(opts): Add --allow-weak-key-signatures.
(main): Set it.
* g10/options.h (struct opt): Add flags.allow_weak_key_signatures.
* g10/misc.c (print_sha1_keysig_rejected_note): New.
* g10/sig-check.c (check_signature_over_key_or_uid): Print note and
act on new option.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit e624c41dba)
2019-11-11 12:29:18 +01:00
Werner Koch 1d83f92fa9
doc: Improved description of status PLAINTEXT_LENGTH.
--

GnuPG-bug-id: 4741
2019-11-07 15:46:00 +01:00
Werner Koch 2975868ede
gpg: Fix a potential loss of key sigs during import with self-sigs-only.
* g10/import.c (import_one_real): Don't do the final clean in the
merge case.
--

This fixes a regression introduced with self-sigs-only.

GnuPG-bug-id: 4628
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 6701a38f8e)
2019-11-07 15:13:13 +01:00
Werner Koch 3ae5cefc64
po: Fix an accidentally translated keyword in zh_TW.
--
GnuPG-bug-id: 4737

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-11-04 09:51:25 +01:00
Werner Koch 76d606d95d
doc: Typo fix for gpg.texi in desc of --local-sigs.
--

(Already fixed in master in January)
2019-10-17 16:40:46 +02:00
Werner Koch d8052db74a
gpg: Also delete key-binding signature when deleting a subkey.
* g10/delkey.c (do_delete_key): Simplify and correct subkey deletion.
--

GnuPG-bug-id: 4665, 4457
Fixes-commit: d9b31d3a20
Signed-off-by: Werner Koch <wk@gnupg.org>
2019-10-15 14:37:54 +02:00
NIIBE Yutaka 2906636b92 Revert "gpg: The first key should be in candidates."
This reverts commit 66eb953f43.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2019-10-15 20:54:10 +09:00
Werner Koch 652ca4b2bf
gpg: Extend --quick-gen-key for creating keys from a card.
* g10/keygen.c (parse_key_parameter_part): Add arg R_KEYGRIP and
support the special algo "card".
(parse_key_parameter_string): Add args R_KEYGRIP and R_SUBKEYGRIP.
Handle the "card" algo.  Adjust callers.
(parse_algo_usage_expire): Add arg R_KEYGRIP.
(quickgen_set_para): Add arg KEYGRIP and put it into the parameter
list.
(quick_generate_keypair): Handle algo "card".
(generate_keypair): Also handle the keygrips as returned by
parse_key_parameter_string.
(ask_algo): Support ed25519 from a card.
--

Note that this allows to create a new OpenPGP key from an initialized
OpenPGP card or from any other supported cards.  It has been tested
with the TCOS Netkey card.  Right now a stub file for the cards might
be needed; this can be achieved by running "gpgsm --learn" with the
card plugged in.

Example:

  gpg --quick-gen-key foo@example.org card

Signed-off-by: Werner Koch <wk@gnupg.org>

Backported from master d3f5d8544f
which required to remove the extra key version args.

GnuPG-bug-id: 4681
Signed-off-by: Werner Koch <wk@gnupg.org>
2019-10-15 12:11:02 +02:00
NIIBE Yutaka fe02709ffd po: Update Japanese translation.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2019-10-15 10:06:59 +09:00
NIIBE Yutaka 66eb953f43 gpg: The first key should be in candidates.
* g10/getkey.c (get_best_pubkey_byname): Handle the first key
as the initial candidate for the selection.

--

Cherry-picked from master commit:
	7535f1d47a

GnuPG-bug-id: 4713
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2019-10-15 09:47:09 +09:00
NIIBE Yutaka 2924ac374e gpg: Fix a memory leak in get_best_pubkey_byname.
* g10/getkey.c (get_best_pubkey_byname): Free the public key parts.

--

Cherry-picked from master commit:
	e28572116f

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2019-10-15 09:46:15 +09:00
Werner Koch beeab41e47
doc: Fix c+p bug in the examples for --import-filter.
--

Reported-by: Steve McIntyre
Signed-off-by: Werner Koch <wk@gnupg.org>
2019-10-12 12:33:33 +02:00
Werner Koch edc36f59fc
gpg: Be prepared for chosen-prefix SHA-1 collisions in key signatures.
* g10/sig-check.c (check_signature_over_key_or_uid): Reject cewrtain
SHA-1 based signatures.
--

Signed-off-by: Werner Koch <wk@gnupg.org>

(cherry picked from c4f2d9e3e1)

Adjusted for changed added arguments in a function.
2019-10-03 17:47:55 +02:00
Werner Koch de57b5bf91
gpg: Make --quiet work on --send-keys.
* g10/keyserver.c (keyserver_put): Act upon --quiet.
--

Suggested-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Werner Koch <wk@gnupg.org>
2019-09-06 16:49:57 +02:00
Werner Koch b96b48d2bf
doc: Fix grammar error.
--
GnuPG-bug-id: 4691
2019-08-30 08:32:57 +02:00
Werner Koch b5f7ac6c36
gpg: Implement keybox compression run
* kbx/keybox-init.c (keybox_lock): Add arg TIMEOUT and change all
callers to pass -1.
* g10/keydb.c (keydb_add_resource): Call keybox_compress.
--

Note that here in the 2.2 branch the way we call the locking in gpgsm
is different from the one in gpg.  So we could not cherry-pick from
master.

GnuPG-bug-id: 4644
Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-23 16:18:07 +02:00
Werner Koch 34f55c5e34
kbx: Include deleted records into the --stats output.
* kbx/keybox-dump.c (_keybox_dump_file): Take deleted records in
account.
--

This also changes the numbering of the records to reflect the real
record number.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 5ef0d7a795)
2019-08-23 15:59:06 +02:00
Werner Koch e854580fa5
kbx: Allow "gpgsm --faked-system-time" to kick off a compression run.
* kbx/keybox-update.c (keybox_compress): Use make_timestamp.
--

We have implemented the same in master, albeit we needed two commits
for that.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-23 15:58:27 +02:00
Werner Koch df6cff8233
gpg: Allow --locate-external-key even with --no-auto-key-locate.
* g10/getkey.c (akl_empty_or_only_local): New.
* g10/gpg.c (DEFAULT_AKL_LIST): New.
(main): Use it here.
(main) <aLocateExtKeys>: Set default AKL if none is set.
--

This better matches the expectations of the user.  The used list in
this case is the default list ("local,wkd") with local ignored by the
command anyway.

GnuPG-bug-id: 4662
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit d058d80ed0)
2019-08-23 13:22:54 +02:00
Werner Koch 589f118713
gpg: Silence some warning messages during -Kv.
* g10/options.h (glo_ctrl): Add flag silence_parse_warnings.
* g10/keylist.c (list_all): Set that during secret key listsings.
* g10/parse-packet.c (unknown_pubkey_warning): If new flag is set do
 not print info message normally emitted inh verbose mode.
(can_handle_critical_notation, enum_sig_subpkt): Ditto.
(parse_signature, parse_key, parse_attribute_subpkts): Ditto.
--

Those messages are annoying because they might be emitted due to
parsing public keys which are latter not shows because the secret part
is missing.  No functional regressions are expected because --verbose
should not change anything.

Note that this suppression is only done if no arguments are given to
the command; that is if a listing of the entire keyring is requested.
Thus to see the earnings anyway, a listing of a single or group of
keys can be requested.

GnuPG-bug-id: 4627
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit d7aca1bef6)
2019-08-23 12:53:58 +02:00
Werner Koch 215858aba3
gpg: Do not show an informational diagnostics with quiet.
* g10/trustdb.c (verify_own_keys): Silence informational diagnostic.
--

This silences this notes with --quiet
  gpg: key EE65E8C75D41FD1D marked as ultimately trusted

GnuPG-bug-id: 4634
Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-23 11:47:12 +02:00
Werner Koch 7c386c5fb5
gpgconf: Suggest the use of --gpgconf-test on --launch problems.
* tools/gpgconf-comp.c (gc_component_launch): Change suggestion.
--

GnuPG-bug-id: 4668
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 2a45800b2f)
2019-08-23 10:44:56 +02:00
Werner Koch f812e09904
gpg: Use modern spelling for the female salutation.
--
GnuPG-bug-id: 4682

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-22 10:25:59 +02:00
Werner Koch 0a9053eff0
scd:nks: Extend keypairinfo with usage flags.
* scd/app-nks.c (do_learn_status_core): Return usage.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-21 13:59:20 +02:00
Werner Koch 6f67abcc03
scd:openpgp: Extend keypairinfo with usage flags.
* scd/app-openpgp.c (send_keypair_info): Return usage.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-21 13:59:18 +02:00
Werner Koch a8aacaf204
sm: Show the usage flags when generating a key from a card.
* g10/call-agent.c (scd_keypairinfo_status_cb): Also store the usage
flags.
* sm/call-agent.c (scd_keypairinfo_status_cb): Ditto.
* sm/certreqgen-ui.c (gpgsm_gencertreq_tty): Print the usage flags.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 9ed1aa56c4)
2019-08-21 13:59:17 +02:00
Werner Koch 9a317557c5
gpg: Allow decryption using non-OpenPGP cards.
* g10/call-agent.c (struct getattr_one_parm_s): New.
(getattr_one_status_cb): New.
(agent_scd_getattr_one): New.
* g10/pubkey-enc.c (get_it): Allow the standard leading zero byte from
pkcs#1.
* g10/getkey.c (enum_secret_keys): Move to...
* g10/skclist.c (enum_secret_keys): here and handle non-OpenPGP cards.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit ec6a677923)

This commit also incorporates "g10: Move enum_secret_keys to
skclist.c."  Which was started with
commit 03a8de7def
on master about a year ago.

Signed-off-by: Werner Koch <wk@gnupg.org>
GnuPG-bug-id: 4681
2019-08-21 13:58:34 +02:00
Werner Koch 23784f8bf0
scd: New standard attributes $ENCRKEYID and $SIGNKEYID.
* g10/call-agent.c (agent_scd_keypairinfo): Use --keypairinfo.
* sm/call-agent.c (gpgsm_agent_scd_keypairinfo): Ditto.
* scd/app-openpgp.c (do_getattr): Add attributes "$ENCRKEYID" and
"$SIGNKEYID".
* scd/app-nks.c (do_getattr): Add attributes too.
--

We already have $AUTHKEYID to locate the keyref of the key to be used
with ssh.  It will also be useful to have default keyref for
encryption and signing.  For example, this will allow us to replace
the use of "OPENPGP.2" by a app type specific keyref.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 2b1135cf92)

Removed changes for the non-existing app-piv.c.
Added support for NKS.
2019-08-21 11:00:18 +02:00
Werner Koch fbed618a36
gpg: Allow direct key generation from card with --full-gen-key.
* g10/call-agent.c (agent_scd_readkey): New.
* g10/keygen.c (ask_key_flags): Factor code out to ..
(ask_key_flags_with_mask): new.
(ask_algo): New mode 14.
--

Note that this new menu 14 is always displayed.  The usage flags can
be changed only in --expert mode, though.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit a480182f9d)

Removed stuff from gpg-card which does not exists in 2.2.  No tests
yet done for this backport.
2019-08-21 10:37:01 +02:00
Werner Koch 0353cb0a5e
common: Extend function pubkey_algo_string.
* common/sexputil.c (pubkey_algo_string): Add arg R_ALGOID.
* sm/certreqgen-ui.c (gpgsm_gencertreq_tty): Adjust.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit f952226043)

Removed the changes in gpg-card which is not part of 2.2

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-21 10:23:05 +02:00
Werner Koch c185f6dfbd
gpg: New option --use-only-openpgp-card
* g10/gpg.c (opts): Add option.
(main): Set flag.
* g10/options.h: Add flags.use_only_openpgp_card.
* g10/call-agent.c (start_agent): Implement option.
--

With the previous patch we switch to autoselect an application
instead of requesting an openpgp card.  This option allows to revert
this in case of use use cases which expected the former behaviour.

Signed-off-by: Werner Koch <wk@gnupg.org>
2019-08-21 10:19:16 +02:00
Werner Koch fe5c8de862
gpg: Prepare card code to allow other than OpenPGP cards.
* g10/call-agent.c (start_agent): Use card app auto selection.
* g10/card-util.c (current_card_status): Print the Application type.
(card_status): Put empty line between card listings.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit e47524c34a)
2019-08-21 10:08:13 +02:00
Werner Koch 768cb6402f
gpg: New card function agent_scd_keypairinfo.
* g10/call-agent.c (scd_keypairinfo_status_cb)
(agent_scd_keypairinfo): New.  Taken from gpgsm.

Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit 0fad61de15)
2019-08-21 10:06:47 +02:00