aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* assuan: Fix exponential decay for first second.Werner Koch2018-08-283-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | * common/asshelp.c (wait_for_sock): Round SECSLEFT. * dirmngr/dirmngr.c (main): Take care of --debug-wait also in dameon mode. * common/sysutils.c (gnupg_usleep) [HAVE_NANOSLEEP]: Fix nanosleep use. -- Without the rounding we saw in verbose mose [...]to come up ... (5s) [...]to come up ... (4s) immediately without the expected one second delay. Waiting for the next seconds did not work if nanosleep was used due to improper passed parameters in gnupg_usleep. Adding --debug-wait for dirmngr in daemon mode is required to test this change. GnuPG-bug-id: 3490 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 0cfdd3b57d592fb6baa7dafe8fde124e8a6c7798) Fixes-commit: 1189df2cd7d4b6896ba22aa204c159ff2a425ead Signed-off-by: Werner Koch <[email protected]>
* assuan: Use exponential decay for first 1s of spinlock.Daniel Kahn Gillmor2018-08-281-5/+26
| | | | | | | | | | | | | | * common/asshelp.c (wait_for_sock): instead of checking the socket every second, we check 10 times in the first second (with exponential decay). -- This cuts the wall clock time for the standard test suite roughly by half. GnuPG-bug-id: 3490 Signed-off-by: Daniel Kahn Gillmor <[email protected]> (cherry picked from commit 149041b0b917f4298239fe18b5ebd5ead71584a6)
* assuan: Reorganize waiting for socket.Daniel Kahn Gillmor2018-08-281-42/+30
| | | | | | | | | | | | | | | * common/asshelp.c (wait_for_sock): New function, collecting codepaths from... (start_new_gpg_agent) here and... (start_new_dirmngr) here. -- This has no functional change, but makes it easier to make this function more efficient. GnuPG-bug-id: 3490 Signed-off-by: Daniel Kahn Gillmor <[email protected]> (cherry picked from commit 0471ff9d3bf8d6b9a359f3c426d70d0935066907)
* gpg: Refresh expired keys originating from the WKD.Werner Koch2018-08-282-17/+99
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/getkey.c (getkey_ctx_s): New field found_via_akl. (get_pubkey_byname): Set it. (only_expired_enc_subkeys): New. (get_best_pubkey_byname): Add support to refresh expired keys from the WKD. -- A little drawback of that code is that if the WKD has no update for an expired key each access of the key will trigger a WKD lookup (unless cached by the dirmngr). To avoid this we need to record the last time we have checked for an update but that would in turn require that we update the keyring for each check. We defer this until we have a better key database which allows for fast updates of meta data. Testing the code is currently a bit cumbersome because it requires to update a key in the WKD several times. Eventually we we need a network emulation layer to provide sample data for the regression tests. GnuPG-bug-id: 2917 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 7f172404bfcf719b9b1af4a182d4803525ebff7c)
* gpg: Remove unused arg from a function.Werner Koch2018-08-284-5/+5
| | | | | | | | * g10/getkey.c (get_best_pubkey_byname): Remove unused arg 'no_akl'. Change both callers. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit db67ccb759426c1173761574b14bdfe6a76394c2)
* po: Update Japanese translation.NIIBE Yutaka2018-08-221-9/+10
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* g10: Fix undefined behavior when EOF in parsing packet for S2K.NIIBE Yutaka2018-08-101-2/+2
| | | | | | | | | | | | | | | | | | * g10/parse-packet.c (parse_symkeyenc): Use iobuf_get_noeof. (parse_key): Likewise. -- Cherry picked from master commit: 1b309d9f6199a91caa0ca0b97b92d599e00b736e When EOF comes at parsing s2k.count, it is possible the value will be (unsigned long)-1. Then, the result of S2K_DECODE_COUNT will be undefined. This patch fixes undefined behavior. Reported-by: Philippe Antoine GnuPG-bug-id: 4093 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Set a limit for a WKD import of 256 KiB.Werner Koch2018-07-291-1/+9
| | | | | | | | | | | | | * g10/call-dirmngr.c (MAX_WKD_RESULT_LENGTH): New. (gpg_dirmngr_wkd_get): Use it. -- WKD should return only a single key with just one UID. For key rollover 2 keys may be send. A total of 256 KiB seems to be a generous limit here. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit e88f56f1937ac92f6a3b94e50b6db2649ec0be41)
* dirmngr: Validate SRV records in WKD queries.Werner Koch2018-07-291-0/+12
| | | | | | | | | | | | | * dirmngr/server.c (proc_wkd_get): Check the returned SRV record names to mitigate rogue DNS servers. -- I am not sure wether this really is very useful because the security relies on a trustworthy DNS system anyway. However, that check is easy enough to do. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ebe727ef596eefebb5eff7d03a98649ffc7ae3ee)
* common: New function to validate domain names.Werner Koch2018-07-293-2/+93
| | | | | | | | * common/mbox-util.c (is_valid_domain_name): New. * common/t-mbox-util.c (run_dns_test): New test. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit ddee9f9409fb5a089883eab0fadef7b9b7e61e72)
* scd: Add support for Trustica Cryptoucan.Jiří Keresteš2018-07-293-3/+13
| | | | (cherry picked from commit 967d3649d24aba623133808e8d01675dff389fbb)
* Post release updatesWerner Koch2018-07-122-1/+5
| | | | --
* Release 2.2.9gnupg-2.2.9Werner Koch2018-07-121-1/+40
|
* po: Fix one fuzzy in German translation.Werner Koch2018-07-121-4/+3
| | | | --
* po: auto updateWerner Koch2018-07-1226-2099/+9025
| | | | --
* gpg: Remove multiple subkey bindings during export-clean.Werner Koch2018-07-091-5/+84
| | | | | | | | | | * g10/key-clean.c (clean_one_subkey_dupsigs): New. (clean_all_subkeys): Call it. -- GnuPG-bug-id: 3804 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 76989d5bd89ed11f5b3656dc4748fcfc939a46dc)
* gpg: Let export-clean remove expired subkeys.Werner Koch2018-07-094-12/+125
| | | | | | | | | | | | | | | | * g10/key-clean.h (KEY_CLEAN_NONE, KEY_CLEAN_INVALID) (KEY_CLEAN_ENCR, KEY_CLEAN_AUTHENCR, KEY_CLEAN_ALL): New. * g10/key-clean.c (clean_one_subkey): New. (clean_all_subkeys): Add arg CLEAN_LEVEL. * g10/import.c (import_one): Call clean_all_subkeys with KEY_CLEAN_NONE. * g10/export.c (do_export_stream): Call clean_all_subkeys depedning on the export clean options. -- GnuPG-bug-id: 3622 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit c2fd65ec8498a08ee36ca52d99b6b014f6db8d93)
* gpg: Split key cleaning function for clarity.Werner Koch2018-07-094-16/+54
| | | | | | | | | | | | | * g10/key-clean.c (clean_key): Rename to clean_all_uids and split subkey cleaning into ... (clean_all_subkeys): new. Call that always after the former clean_key invocations. -- Note that the clean_all_subkeys function will later be extended. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 6c3567196f7e72552f326ce07dccbcce31926e5d)
* gpg: Move key cleaning functions to a separate file.Werner Koch2018-07-0910-429/+495
| | | | | | | | | | | | | | | | * g10/trust.c (mark_usable_uid_certs, clean_sigs_from_uid) (clean_uid_from_key, clean_one_uid, clean_key): Move to ... * g10/key-clean.c: new file. * g10/key-clean.h: New. * g10/Makefile.am (gpg_sources): Add new files. * g10/export.c, g10/import.c, g10/keyedit.c, g10/trustdb.c: Include new header. * g10/trustdb.h (struct key_item, is_in_klist): Move to ... * g10/keydb.h: here. -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 135e46ea480d749b8a9692f71d4d0bfdadd8ee2f)
* gpg: Allow decryption using several passphrases in may cases.Werner Koch2018-07-061-0/+15
| | | | | | | | | | | | | * g10/mainproc.c (symkey_decrypt_seskey): Check for a valid algorithm. (proc_symkey_enc): Clear passpharse on error from above function. -- This does not work reliable as stated in bug 3795 but we can try to fix ~95% of all cases. The real fix is to use AEAD which will come with 2.3 GnuPG-bug-id: 3795, 4050 Signed-off-by: Werner Koch <[email protected]>
* po: Add flag options for xgettext.Werner Koch2018-07-051-1/+55
| | | | | | | | * po/Makevars (XGETTEXT_OPTIONS): Add --flag options. -- GnuPG-bug-id: 4053, 4054 Signed-off-by: Werner Koch <[email protected]>
* gpg: Prepare for signatures with ISSUER_FPR but without ISSUER.Werner Koch2018-07-056-8/+60
| | | | | | | | | | | | | | | | | | | * g10/getkey.c (get_pubkey_for_sig): New. (get_pubkeyblock_for_sig): New. * g10/mainproc.c (issuer_fpr_raw): Give global scope. (check_sig_and_print): Use get_pubkeyblock_for_sig. * g10/pkclist.c (check_signatures_trust): Use get_pubkey_for_sig. * g10/sig-check.c (check_signature2): Ditto. (check_signature_over_key_or_uid): Ditto. -- GnuPG-bug-id: 4046 The whole getkey stuff is still a mess with way to much duplication and missing caching of already fetched data. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit f7526c7bc754acf68bde0b79c785e875a9365d60)
* po: Fix bug in german translationAndre Heinecke2018-07-041-1/+1
| | | | | | | | | | * po/de.po (decryption forced to fail!): Fix translation. -- The unmatched %s actually produced a crash on Windows. GnuPG-Bug-Id: T4053 GnuPG-Bug-Id: T4054
* gpg: Ignore too large user ids during import.Werner Koch2018-07-041-1/+30
| | | | | | | | | | | | | * g10/import.c (read_block): Add special treatment for bad user ids and comment packets. -- See GnuPG-bug-id: 4022 for an example of a bogus user id. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 01cd66f9faf1623833e6afac84164de5a136ecff)
* indent: Fix indentation of read_block in g10/import.cWerner Koch2018-07-041-66/+67
| | | | | | | -- Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 60e7e102a153a246d7e887a64e30dbb4c4f7b6dd)
* gpg: Extra check for sign usage when verifying a data signature.Werner Koch2018-07-041-2/+11
| | | | | | | | | | | | * g10/sig-check.c (check_signature_end_simple): Check sign usage. -- Without this patch the signature verification fails only due to the missing back signature. This check better explains what went wrong. GnuPG-bug-id: 4014 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 214b0077264e35c079e854a8b6374704aea45cd5)
* gpg: Print revocation reason for "rev" records.Werner Koch2018-07-034-4/+100
| | | | | | | | | | | | | | * g10/main.h: Add prototype. * g10/keylist.c (list_keyblock_print): Print revocation info. (list_keyblock_colon): Ditto. * g10/test-stubs.c (get_revocation_reason): New stub. * g10/gpgv.c (get_revocation_reason): New stub. -- GnuPG-bug-id: 1173 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 592deeddb9bf4ae9b3e236b439e2f39644eb6d46)
* gpg: Print revocation reason for "rvs" records.Werner Koch2018-07-033-3/+127
| | | | | | | | | | | | | | | | | | | | | * g10/import.c (get_revocation_reason): New. (list_standalone_revocation): Extend function. -- Note that this function extends the "rvs" field signature-class (field 11) with the revocation reason. GPGME does not yet parse this but it can be expected that the comma delimiter does not break other parsers. A new field is added to the "rvs" (and in future also the "rev") record to carry a record specific comment. Hopefully all parsers meanwhile learned the lesson from other new fields and don't bail out on more fields than they know about. This is partial solution to GnuPG-bug-id: 1173 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit b7cd2c2093ae1b47645be50fa1d431a028187cad)
* gpg: Let --show-keys print revocation certificates.Werner Koch2018-07-032-13/+122
| | | | | | | | | | * g10/import.c (list_standalone_revocation): New. (import_revoke_cert): Call new function. -- GnuPG-bug-id: 4018 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 386b9c4f25b28fd769d7563f2d86ac3a19cc3011)
* g10: Fix memory leak for PKT_signature.NIIBE Yutaka2018-07-033-3/+3
| | | | | | | | | | | | | | | * g10/getkey.c (buf_to_sig): Free by free_seckey_enc. * g10/gpgcompose.c (signature): Likewise. * g10/sign.c (write_signature_packets): Likewise. -- Cherry picked from master commit: 996febbab21eb9283b0634e51303a36b318734a6 Reported-by: Philippe Antoine GnuPG-bug-id: 4047 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: For SOCKS connection, just fails.NIIBE Yutaka2018-07-021-1/+1
| | | | | | | | | | | | | | | | * dirmngr/dns.c (dns_res_exec): If it's DNS_SO_SOCKS_CONN, don't iterate to other server, but return the error immediately. -- Cherry picked from master commit: 1aacd12471935a354cfd85ee1805edc7eb16e6c5 In the function libdns_switch_port_p in dns-stuff.c, this patch allows to fallback using TOR_PORT2 correctly. Fixes-commit: bcdbf8b8ebe9d61160e0b007dabe1b6462ffbc93 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Let kernel to decide the local port.NIIBE Yutaka2018-06-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | * dirmngr/dns.c (LEAVE_SELECTION_OF_PORT_TO_KERNEL): New. (dns_socket): Don't select ephemeral port in user space. -- Cherry picked from master commit: 861f1da0731bf29dcb9221c4f22c76b40ec15a78 There is no good reason to bind local port aggressively. It might be some reason to do so, then, a user can specify it in /etc/resolv.conf by the second argument of "interface" directive. At least, it causes a problem on Windows. Binding a specified port in user space can trigger the Firewall dialog on Windows. Since it can be considered valid question, it is better not to bind with an ephemeral port which is selected in user space, by default. GnuPG-bug-id: 3610 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Fix for non-FQDN hostname.NIIBE Yutaka2018-06-181-5/+8
| | | | | | | | | | | | | * dirmngr/dns.c (dns_resconf_open): Clear search[0] for non-FQDN hostname. -- Cherry pick from master commit: a4a054bf14fa855715faee01a152755c4e2a74f7 GnuPG-bug-id: T3803 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Fix connect and try next nameserver when ECONNREFUSED.NIIBE Yutaka2018-06-181-2/+23
| | | | | | | | | | | | | | | * dirmngr/dns.c (dns_so_check): When EINVAL, release the association by connect with AF_UNSPEC and try again. Also try again for ECONNREFUSED. (dns_res_exec): Try next nameserver when ECONNREFUSED. -- Cherry pick from master commit: bcdbf8b8ebe9d61160e0b007dabe1b6462ffbc93 GnuPG-bug-id: T3374 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Clear struct sockaddr_storage by zero.NIIBE Yutaka2018-06-181-0/+4
| | | | | | | | | | | | | | | | | * dirmngr/dns.c (dns_resconf_pton): Clear SS. (dns_resconf_setiface): Clear ->IFACE. (dns_hints_root, send_query): Clear SS. -- Cherry pick from master commit: 1c0b6681e4f322b88ac35d1f21c03d3cfc35fc23 POSIX requires clear the structure of struct sockaddr_in6. On macOS, in some case like bind, it is better to clear even for struct sockaddr_in. Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Sync to upstream.NIIBE Yutaka2018-06-181-10/+2
| | | | | | | | | | | | | | | * dirmngr/dns.c (dns_nssconf_loadfile): Handle exclamation mark. -- Cherry pick from master commit: 3e6ad302eaf3a4a9f3e60379133b3dfdbe0e1b2d Reverting local change, merge upstream's debug-tracing branch. (commit 21281fc1b63bb74d51762b8e363c49b1a258783d) Fixes-commit: d4c0187dd93163f12e9f953366adef81ecf526a6 Signed-off-by: NIIBE Yutaka <[email protected]>
* dirmngr: Fix recursive resolver mode.NIIBE Yutaka2018-06-181-0/+2
| | | | | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (libdns_init): Initialize options.recurse. -- Cherry pick from master commit: 5b40338f12762cd74238c2d2b3101c33dd2d0ed3 To reproduce an error, run: ./t-dns-stuff --debug --recursive-resolver www.gnupg.org Then, it returns "No name" error. That's because there was only setup for root servers, and no setup for recursive query in fact. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Do not import revocations with --show-keys.Werner Koch2018-06-121-26/+30
| | | | | | | | | | * g10/import.c (import_revoke_cert): Add arg 'options'. Take care of IMPORT_DRY_RUN. -- GnuPG-bug-id: 4017 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 6c9e37b2e541e96e7c65e1679982a614b4863fdb)
* gpg: Add new usage option for drop-subkey filters.Daniel Kahn Gillmor2018-06-122-0/+15
| | | | | | | | | | | | | | | * g10/import.c (impex_filter_getval): Add new "usage" property for drop-subkey filter. -- For example, this permits extraction of only encryption-capable subkeys like so: gpg --export-filter 'drop-subkey=usage !~ e' --export $FPR GnuPG-Bug-id: 4019 Signed-off-by: Daniel Kahn Gillmor <[email protected]> (cherry picked from commit 2ddfb5bef920919443309ece9fa2930282bbce85)
* doc: Mention new command --show-keys in the 2.2.7 NEWS.Werner Koch2018-06-111-0/+4
| | | | --
* gpg: Set some list options with --show-keysWerner Koch2018-06-112-3/+9
| | | | | | | | | | | | | * g10/gpg.c (main): Set some list options. -- The new command --show-keys is commonly used to check the content of a file with keys. In this case it can be expected that all included subkeys and uids are of interested, even when they are already expired or have been revoked. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit d2bc66f241a66cc95140cbb3a07555f6301290ed)
* gpg: Allow building with older libgpg-error.Werner Koch2018-06-081-1/+1
| | | | | | | | | | | | * g10/mainproc.c (proc_encrypted): Use constant from logging.h -- Because the log levels are enums I had to change there names in libgpg-error to avoid clashes. Master uses the new names but 2.2 needs to stick to the old names. Fixes-commit: 825909e9cd5f344ece6c0b0ea3a9475df1d643de Signed-off-by: Werner Koch <[email protected]>
* Post release updatesWerner Koch2018-06-082-1/+5
| | | | --
* Release 2.2.8gnupg-2.2.8Werner Koch2018-06-081-1/+25
| | | | Signed-off-by: Werner Koch <[email protected]>
* po: Auto updateWerner Koch2018-06-0825-77/+450
| | | | --
* po: Update German translationWerner Koch2018-06-081-4/+20
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* po: Update Russian translation.Ineiev2018-06-081-41/+21
|
* gpg: Sanitize diagnostic with the original file name.Werner Koch2018-06-081-1/+8
| | | | | | | | | | | | | | | * g10/mainproc.c (proc_plaintext): Sanitize verbose output. -- This fixes a forgotten sanitation of user supplied data in a verbose mode diagnostic. The mention CVE is about using this to inject status-fd lines into the stderr output. Other harm good as well be done. Note that GPGME based applications are not affected because GPGME does not fold status output into stderr. CVE-id: CVE-2018-12020 GnuPG-bug-id: 4012 (cherry picked from commit 13f135c7a252cc46cff96e75968d92b6dc8dce1b)
* gpg: Improve import's repair-key duplicate signature detection.Werner Koch2018-06-071-115/+134
| | | | | | | | | | | | | | | * g10/key-check.c (key_check_all_keysigs): Factor some code out to ... (remove_duplicate_sigs): new. (key_check_all_keysigs): Call remove_duplicate_sigs again after reordering. -- This is a follupup for commit 26bce2f01d2029ea2b8a8dbbe36118e3c83c5cba to cleanup the code and to add a second de-duplicate step when needed. GnuPG-bug-id: 3994 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 26746fe65d14a00773473c2d0d271406a5105bca)
* gpg: Fix import's repair-key duplicate signature detection.Werner Koch2018-06-072-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/packet.h (PKG_siganture): Add field 'help_counter'. * g10/key-check.c (sig_comparison): Take care of HELP_COUNTER. (key_check_all_keysigs): De-duplicate on a per-block base. -- The key_check_all_keysigs first does a detection of duplicate signature. This is done over all signatures at once. The problem here is for example: key uid_1 sig_uid_1.1 sig_uid_1.2 subkey_1 sig_sub_1.1 subkey_2 sig_sub_2.1 sig_sub_2.2 (duplicate of sig_sub_1.1) Now the de-duplication deletes the first signature and keeps the second. That works in most cases for foreign signature on userids but in the above constellation the code simply removes sig_sub_1.1 so that subkey_1 has no binding signature anymore. In a later step during import the missing binding is detected and subkey_1 is removed because it is not anymore valid. The sig_sub_2.2 will also be removed later because it does not check out for subkey_2 (that is as expected). The fix is to let the de-duplication work only on blocks (ie. within the signatures of a user id or a subkey). This will not detect all duplicates but that does not harm because later steps will detect and remove them. In the above case (with this patch applied) the second phase of key_check_all_keysigs will reorder key signatures and move the duplicate sig_sub_2.2 directly after sig_sub_1.1. This duplicates the signature and for cleanness we should kick the de-duplication process again. This will be done with a followup patch. GnuPG-bug-id: 3994 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 26bce2f01d2029ea2b8a8dbbe36118e3c83c5cba)