aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tools: Add experimental code for a pairing protocolseckey-sync-workWerner Koch2018-07-053-1/+2030
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (GNUPG_CACHE_DIR): New const. * tools/Makefile.am (libexec_PROGRAMS): Add gpg-pair-tool. (gpg_pair_tool_SOURCES, gpg_pair_tool_CFLAGS) (gpg_pair_tool_LDADD): New. * tools/gpg-pair-tool.c: New. -- This is a first try on a protocol to pair two devices so that they can agree on a shared secret to exchange secret keys. The idea is that if you want to sync your secret keys to another machine (e.g. from desktop to mobile) you have physical access to both devices and thus a pairing protocol allows to authenitcate the connection using a short string. See the source for a protocol description. How to test: $ gpg-pair-tool -va --homedir . --initiate >msg.commit $ gpg-pair-tool -va --homedir 2ndhome --respond \ <msg.commit >msg.dhpart1 $ gpg-pair-tool -va --homedir . --respond \ <msg.dhpart1 >msg.dhpart2 $ gpg-pair-tool -va --homedir 2ndhome --respond \ <msg.dhpart2 >msg.confirm Now set the SAS as printed by the responder into SAS and run $ gpg-pair-tool -va --homedir . --respond --sas $SAS <msg.confirm Storing the secret on disk is obviously not the right thing to do. With the new PUT_SECRET and GET_SECRET commands of gpg-agent we can change this to store it all in gpg-agent instead. This will make it also easier for gpg to access the secret and we won't need an option to return it from gpg-pair-tool. Thus gpg-pair-tool can be dedicated to run the protocol and maybe to popup info dialogs. Adding a second expiration time for running the protocol in addition to the expiration of the secret is probably a better idea than just that simple catch-all TTL. Signed-off-by: Werner Koch <[email protected]>
* 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]>
* indent: Fix indentation of read_block in g10/import.cWerner Koch2018-07-041-66/+67
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* 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]>
* 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. -- Reported-by: Philippe Antoine GnuPG-bug-id: 4047 Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: New commands PUT_SECRET and GET_SECRET.Werner Koch2018-07-023-12/+237
| | | | | | | | | | | | | | | | | | | | * agent/agent.h (CACHE_MODE_DATA): New const. * agent/cache.c (DEF_CACHE_TTL_DATA): new. (housekeeping): Tweak for CACHE_MODE_DATA. (cache_mode_equal): Ditto. (agent_get_cache): Ditto. (agent_put_cache): Implement CACHE_MODE_DATA. * agent/command.c (MAXLEN_PUT_SECRET): New. (parse_ttl): New. (cmd_get_secret): New. (cmd_put_secret): New. (register_commands): Register new commands. -- These commands allow to store secrets in memory for the lifetime of the gpg-agent process. Signed-off-by: Werner Koch <[email protected]>
* common: New function percent_data_escape.Werner Koch2018-07-023-1/+95
| | | | | | | * common/percent.c (percent_data_escape): New. * common/t-percent.c (test_percent_data_escape): New. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix segv running in --server modeWerner Koch2018-07-021-9/+14
| | | | | | | | | | | | * agent/command.c (start_command_handler): Do not write to CLIENT_CREDS after an error. -- assuan_get_peercred is special insofar that it returns a pointer into CTX. Writing data via this pointer should never be done. Fixes-commit: 28aa6890588cc108639951bb4bef03ac17743046 Signed-off-by: Werner Koch <[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. -- 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]>
* gpg: Print revocation reason for "rev" records.Werner Koch2018-06-214-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]>
* gpg: Print revocation reason for "rvs" records.Werner Koch2018-06-213-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]>
* gpg: Let --show-keys print revocation certificates.Werner Koch2018-06-212-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]>
* build: Remove duplicates from AC_CHECK_FUNCSWerner Koch2018-06-212-13/+12
| | | | | | | | | | | * configure.ac (AC_CHECK_FUNCS): Fold most calls into one. -- A few functions were tested two times which slightly increases the size of the configure script. Also put the functions in sorted order into the macro. Signed-off-by: Werner Koch <[email protected]>
* libdns: Let kernel to decide the local port.NIIBE Yutaka2018-06-191-0/+3
| | | | | | | | | | | | | | | | | | | * dirmngr/dns.c (LEAVE_SELECTION_OF_PORT_TO_KERNEL): New. (dns_socket): Don't select ephemeral port in user space. -- 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]>
* wks: Take name of sendmail from configure.Werner Koch2018-06-192-1/+3
| | | | | | | | | | | | * configure.ac (NAME_OF_SENDMAIL): New ac_define. * tools/send-mail.c (run_sendmail): Use it. -- We used to ac_subst the SENDMAIL in the old keyserver via mail script. We cab reuse this to avoid a fixed name for sendmail in the send-mail.c helper. Signed-off-by: Werner Koch <[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. -- GnuPG-bug-id: T3803 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Fix connect and try next nameserver when ECONNREFUSED.NIIBE Yutaka2018-06-151-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. -- GnuPG-bug-id: T3374 Signed-off-by: NIIBE Yutaka <[email protected]>
* libdns: Clear struct sockaddr_storage by zero.NIIBE Yutaka2018-06-151-0/+4
| | | | | | | | | | | | | | * dirmngr/dns.c (dns_resconf_pton): Clear SS. (dns_resconf_setiface): Clear ->IFACE. (dns_hints_root, send_query): Clear SS. -- 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-141-10/+2
| | | | | | | | | | | | * dirmngr/dns.c (dns_nssconf_loadfile): Handle exclamation mark. -- 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-141-0/+2
| | | | | | | | | | | | | | | * dirmngr/dns-stuff.c (libdns_init): Initialize options.recurse. -- 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]>
* Some preparations to eventuallt use gpgrt_argparse.Werner Koch2018-06-124-3/+10
| | | | | | | | | * configure.ac (GNUPG_DEF_COPYRIGHT_LINE: New. * tools/watchgnupg.c (print_version): USe this macro. * common/init.c (_init_common_subsystems): Register argparse functions. Signed-off-by: Werner Koch <[email protected]>
* Require libgpg-error 1.29 and remove internal logging functions.Werner Koch2018-06-125-1228/+6
| | | | | | | | | | * configure.ac (NEED_GPG_ERROR_VERSION): Set to 1.29 * common/util.h: Remove replacement error codes. * common/logging.h: Remove fallback to internal logging functions. * common/logging.c: Remove. * common/Makefile.am (common_sources): Remove logging.c Signed-off-by: Werner Koch <[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]>
* card: Fix memory leak for fetch-url sub command.NIIBE Yutaka2018-06-121-0/+1
| | | | | | * g10/card-util.c (fetch_url): Release INFO. Signed-off-by: NIIBE Yutaka <[email protected]>
* 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]>
* doc: Include release info from 2.2.8Werner Koch2018-06-111-1/+41
| | | | --
* 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]>
* 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
* 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]>
* 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]>
* gpg: Improve verbose output during import.Werner Koch2018-06-071-13/+32
| | | | | | | | * g10/import.c (chk_self_sigs): Print the subkeyid in addition to the keyid. (delete_inv_parts): Ditto. Signed-off-by: Werner Koch <[email protected]>
* agent: Add DBUS_SESSION_BUS_ADDRESS et al. to the startup list.Werner Koch2018-06-061-7/+7
| | | | | | | | | | | | | | | * agent/gpg-agent.c (agent_copy_startup_env): Replace explicit list with the standard list. -- Although the function agent_copy_startup_env is newer than session_env_list_stdenvnames the latter was not used. When DBUS_SESSION_BUS_ADDRESS was added to the latter it was forgotten to add it to the former as well. Having all stdnames here seems to be the Right Thing (tm) to do. GnuPG-bug-id: 3947 Signed-off-by: Werner Koch <[email protected]>
* doc: Typo fixesWerner Koch2018-06-063-4/+4
| | | | | | | -- Reported-by: Claus Assmann <[email protected]> Signed-off-by: Werner Koch <[email protected]>
* gpg: Also detect a plaintext packet before an encrypted packet.Werner Koch2018-06-061-0/+12
| | | | | | | | | | | | | | | | * g10/mainproc.c (proc_encrypted): Print warning and later force an error. -- Note that when this error is triggered the plaintext from the literal data packet has already been outputted before the BEGIN_DECRYPTION status line. We fail only later to get more information. Callers need to check and act upon the decryption error code anyway. Thanks to Marcus for pointing out this case. GnuPG-bug-id: 4000 Signed-off-by: Werner Koch <[email protected]>
* gpg: New command --show-keys.Werner Koch2018-06-063-2/+28
| | | | | | | | | | | | | | | | | | | * g10/gpg.c (aShowKeys): New const. (opts): New command --show-keys. (main): Implement command. * g10/import.c (import_keys_internal): Don't print stats in show-only mode. (import_one): Be silent in show-only mode. -- Using --import --import-options show-only to look at a key is too cumbersome. Provide this shortcut and also remove some diagnostic cruft in this case. Signed-off-by: Werner Koch <[email protected]>
* g10: Remove bogus comment.NIIBE Yutaka2018-06-051-5/+0
| | | | | | | | | | | * g10/mainproc.c (proc_pubkey_enc): Remove a comment. -- GnuPG always uses the OpenPGP algo number in its status report. We can find a function in GPGME, it's _gpgme_map_pk_algo. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Print a hint on how to decrypt a non-mdc message anyway.Werner Koch2018-05-311-2/+19
| | | | | | | * g10/mainproc.c (proc_encrypted): Print a hint for legacy ciphers w/o MDC. Also print a dedicated status error code Signed-off-by: Werner Koch <[email protected]>
* gpg: Ignore the multiple message override options.Werner Koch2018-05-305-50/+17
| | | | | | | | | | | | | | | | | * g10/gpg.c (oAllowMultisigVerification) (oAllowMultipleMessages, oNoAllowMultipleMessages): Remove. (opts): Turn --allow-multisig-verification, --allow-multiple-messages and --no-allow-multiple-messages into NOPs * g10/options.h (struct opt): Remove flags.allow_multiple_messages. * g10/mainproc.c (proc_plaintext): Assume allow_multiple_messages is false. -- These options are very old compatibility hacks and should not be used anymore. We keep them as dummy options in case someone has them in the conf file. Signed-off-by: Werner Koch <[email protected]>
* gpg: Detect multiple literal plaintext packets more reliable.Werner Koch2018-05-301-2/+15
| | | | | | | | * g10/mainproc.c (proc_encrypted): Bump LITERALS_SEEN. -- GnuPG-bug-id: 4000 Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove PGP6 compliance mode.Werner Koch2018-05-2910-54/+25
| | | | | | | | * g10/gpg.c: Make --pgp6 an alias for --pgp7. * common/compliance.h (gnupg_compliance_mode): Remove CO_PGP6. * g10/options.h (PGP6): Remove. Adjust all users. Signed-off-by: Werner Koch <[email protected]>
* doc: Add a hint about gpgsm and DECRYPTION_INFO.Werner Koch2018-05-291-1/+2
| | | | --
* gpg: Remove MDC optionsWerner Koch2018-05-297-88/+46
| | | | | | | | | | | | | | | | * g10/gpg.c: Tuen options --force-mdc, --no-force-mdc, --disable-mdc and --no-disable-mdc into NOPs. * g10/encrypt.c (use_mdc): Simplify. MDC is now almost always used. (use_aead): Ignore MDC options. Print warning for missing MDC feature flags. * g10/pkclist.c (warn_missing_mdc_from_pklist): Rename to ... (warn_missing_aead_from_pklist): this and adjust. -- The MDC is now always used except with --rfc2440 which will lead to a a big fat warning. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix detection of the AEAD feature flag.Werner Koch2018-05-291-1/+1
| | | | | | * g10/getkey.c (fixup_uidnode): Use bitmask 0x02. Signed-off-by: Werner Koch <[email protected]>
* po: Update Spanish translation.emma peel2018-05-251-45/+27
| | | | | | -- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Hard fail on a missing MDC even for legacy algorithms.Werner Koch2018-05-153-13/+12
| | | | | | | | * g10/mainproc.c (proc_encrypted): Require an MDC or AEAD * tests/openpgp/defs.scm (create-gpghome): Use --ignore-mdc-error to allow testing with the current files. Signed-off-by: Werner Koch <[email protected]>
* gpg: Turn --no-mdc-warn into a NOP.Werner Koch2018-05-155-10/+3
| | | | | | | | | | | | | | | * g10/gpg.c (oNoMDCWarn): Remove. (opts): Make --no-mdc-warn a NOP. (main): Don't set var. * g10/options.h (struct opt): Remove 'no_mdc_var'. * g10/cipher-cfb.c (write_header): Assume opt.no_mdc_warn is false. * g10/mainproc.c (proc_encrypted): Ditto. -- Users should not be allowed to suppress the warning that they are shooting into their foot. Signed-off-by: Werner Koch <[email protected]>
* po: Fix Swedish and Turkish translations.NIIBE Yutaka2018-05-142-3/+3
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* po: Fix Danish translation.NIIBE Yutaka2018-05-141-1/+1
| | | | | | | | -- Debian-bug-id: 898552 Reported-by: Jonas Smedegaard <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* doc: Include release info for 2.2.7Werner Koch2018-05-131-0/+36
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* Merge branch 'STABLE-BRANCH-2-2' into masterWerner Koch2018-05-1373-3582/+3269
|\ | | | | | | | | | | | | | | | | | | -- Resolved Conflicts: NEWS - removed configure.ac - removed Signed-off-by: Werner Koch <[email protected]>