aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tests: Fix distcheck.Justus Winter2017-04-062-2/+2
| | | | | | | | | | | | | | | | * tests/Makefile.am (SUBDIRS): Add 'pkits' again. Simply dropping it makes 'make distcheck' unhappy. * tests/pkits/Makefile.am (TESTS): Remove all tests. -- Disable the 'pkits' tests in a way that keeps 'make distcheck' happy. To run tests individually, do make -Ctests/pkits check TESTS=some-test GnuPG-bug-id: 3067 Fixes-commit: af1c1a57e46a00a32d83c1a58c5f3ef6f4a1c1d1 Signed-off-by: Justus Winter <[email protected]>
* tests: Disable 'pkits' test suite.Justus Winter2017-04-063-4/+4
| | | | | | | | | | | | | | * tests/Makefile.am (SUBDIRS): Drop 'pkits'. * tests/pkits/common.sh: Fix locating 'PKITS_data.tar.bz2'. * tests/pkits/inittests: Likewise. -- These tests are unmaintained and broken, and were previously only run when doing in-tree builds, hence nobody noticed that they were badly broken. GnuPG-bug-id: 3067 Signed-off-by: Justus Winter <[email protected]>
* tests: Make test more robust.Justus Winter2017-04-062-3/+6
| | | | | | | | * tests/openpgp/4gb-packet.scm: Skip if we do not have BZIP2. * tests/openpgp/defs.scm (have-compression-algo?): New function. GnuPG-bug-id: 3028 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix setup of ephemeral home directories.Justus Winter2017-04-051-2/+2
| | | | | | | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): Set GNUPGHOME and cwd to the ephemeral directory before calling the setup function. GnuPG-bug-id: 3047 Fixes-commit: 32b75fb7743f35936d7014fce33c90ba97dfa374 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix setup of ephemeral home directories.Justus Winter2017-04-046-19/+20
| | | | | | | | | | | | | | | | | | | * tests/openpgp/defs.scm (with-ephemeral-home-directory): Create configuration files when we enter the context. * tests/openpgp/setup.scm: Do not use an ephemeral home directory. Tests should always use the cwd. * tests/gpgsm/setup.scm: Likewise. * tests/gpgsm/export.scm: Add explicit constructor function. * tests/openpgp/decrypt-session-key.scm: Likewise. * tests/openpgp/decrypt-unwrap-verify.scm: Likewise. -- Previously, ephemeral homedirectories lacked a configuration, hence GnuPG tried to start backend daemons using their installed locations. Fix this by explicitly creating a suitable configuration. GnuPG-bug-id: 3047 Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix copying values.Justus Winter2017-04-041-2/+52
| | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme.c (copy_value): New function. (mk_tagged_value): Use new function. (opexe_4): Likewise for OP_SAVE_FORCED. -- Occasionally, we need to copy a value from one location in the storage to another. Scheme objects are fine. Some primitive objects, however, require finalization, usually to free resources. For these values, we either make a copy or acquire a reference. Fixes e.g. a double free if a delayed expression evaluating to a string is forced. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Simplify get-output-string operation.Justus Winter2017-04-041-14/+6
| | | | | | * tests/gpgscm/scheme.c (opexe_4): Simplify 'get-output-string'. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Simplify substring operation.Justus Winter2017-04-041-7/+1
| | | | | | * tests/gpgscm/scheme.c (opexe_2): Simplify 'substring'. Signed-off-by: Justus Winter <[email protected]>
* po: Update Japanese translation.NIIBE Yutaka2017-04-041-15/+9
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Minor fix for get_client_pid.NIIBE Yutaka2017-04-041-4/+6
| | | | | | * agent/command-ssh.c (get_client_pid): Use 0 to initialize. Signed-off-by: NIIBE Yutaka <[email protected]>
* Post release updates.Werner Koch2017-04-032-4/+8
| | | | --
* Release 2.1.20gnupg-2.1.20Werner Koch2017-04-031-1/+45
| | | | Signed-off-by: Werner Koch <[email protected]>
* dirmngr: New option --disable-ipv6Werner Koch2017-04-0310-8/+40
| | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (struct opt): Add field 'disable_ipv6'. * dirmngr/dirmngr.c (oDisableIPv6): New const. (opts): New option --disable-ipv6. (parse_rereadable_options): Set that option. * dirmngr/dns-stuff.c (opt_disable_ipv6): New var. (set_dns_disable_ipv6): New. (resolve_name_standard): Make use of it. * dirmngr/ks-engine-finger.c (ks_finger_fetch): Take care of OPT.DISABLE_IPV6. * dirmngr/ks-engine-hkp.c (map_host): Ditto. (send_request): Ditto. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/ocsp.c (do_ocsp_request): Ditto. Signed-off-by: Werner Koch <[email protected]>
* dirmngr,w32: Silence the 'certificate already cached' message.Werner Koch2017-04-031-1/+4
| | | | | | | * dirmngr/certcache.c (load_certs_from_w32_store): Silenece an info message. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Handle EIO which is sometimes returned by cookie functions.Werner Koch2017-04-031-0/+1
| | | | | | | | * dirmngr/ks-engine-hkp.c (handle_send_request_error): Handle EIO. -- Suggested-by: Andre Heinecke Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Always print a warning for a missing /etc/hosts.Werner Koch2017-04-031-10/+1
| | | | | | | | | | | | | * dirmngr/dns-stuff.c (libdns_init): No Windows specific handling of a missing /etc/hosts. -- My last comment on this was flawed. Windows seems to always have its version of /etc/hosts. Only the en passant fixed bad escaping led me assume that this was the case. Thanks to Andre for complaining about my comment remark. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Do not assume that /etc/hosts exists.Werner Koch2017-04-031-4/+12
| | | | | | | | | | | | * dirmngr/dns-stuff.c (libdns_init): Do not bail out. -- A standard Windows installation does not have a hosts file and thus we can't bail out here. We should also not bail out on a Unix system because /etc/hosts is just one method in nsswitch.conf. Fixes-commit: 88f1505f0613894d5544290a170119eb538921e5 Signed-off-by: Werner Koch <[email protected]>
* po: Auto-update.Werner Koch2017-04-0325-76/+547
| | | | --
* po: Update the German translationWerner Koch2017-04-031-3/+16
| | | | Signed-off-by: Werner Koch <[email protected]>
* po: Update Russian translationIneiev2017-04-031-20/+13
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* doc: Add two example profiles.Werner Koch2017-04-033-0/+51
| | | | --
* gpgconf: Add --enable-extended-key-format for the agent.Werner Koch2017-04-032-0/+5
| | | | | | | * tools/gpgconf-conf.c: Add option. * agent/gpg-agent.c (main) <aGPGConfList>: Add option. Signed-off-by: Werner Koch <[email protected]>
* gpgscm: Slightly improve the procedure dispatch.Justus Winter2017-04-031-1/+1
| | | | | | | * tests/gpgscm/scheme.c (procnum): Procedures always have an integer number, so we can safely use the cheaper 'ivalue_unchecked'. Signed-off-by: Justus Winter <[email protected]>
* gpg: Handle critical marked 'Reason for Revocation'.Werner Koch2017-04-031-0/+1
| | | | | | | | | | | | | * g10/parse-packet.c (can_handle_critical): Add SIGSUBPKT_REVOC_REASON. -- Some software seems to mark that subpacket as criticial. Although gpg has no special treatment for a revocation reasons (except for --list-packets) we can accept a criticial marked anyway. There are no mandatary rules specified on how to handle a revocation reason. Signed-off-by: Werner Koch <[email protected]>
* agent: Use OCB for key protection with --enable-extended-key-format.Werner Koch2017-04-022-7/+3
| | | | | | | | * agent/protect.c (PROT_DEFAULT_TO_OCB): Remove macro. (agent_protect): Make the default protection mode depend on the extend key format option. Signed-off-by: Werner Koch <[email protected]>
* kbx: Unify blob reading functions.Werner Koch2017-04-015-37/+54
| | | | | | | | | | | * kbx/keybox-file.c (_keybox_read_blob): Remove. (_keybox_read_blob2): Rename to .... (_keybox_read_blob): this. Make arg options. Change all callers. * kbx/keybox-search.c (keybox_search): Factor fopen call out to ... (open_file): new. (keybox_seek): Als use open_file. Signed-off-by: Werner Koch <[email protected]>
* gpg: Avoid multiple open calls to the keybox file.Werner Koch2017-03-315-11/+33
| | | | | | | | | | | | | | | | | | | * g10/keydb.h (KEYDB_HANDLE): Move typedef to ... * g10/gpg.h: here. (struct server_control_s): Add field 'cached_getkey_kdb'. * g10/gpg.c (gpg_deinit_default_ctrl): Release that keydb handle. * g10/getkey.c (getkey_end): Cache keydb handle. (get_pubkey): Use cached keydb handle. * kbx/keybox-search.c (keybox_search_reset): Use lseek instead of closing the file. -- Before this patch a "gpg --check-sigs" opened and closed the keybox file for almost every signature check. By caching the keydb handle and using lseek(2) this can be limited to just 2 times. This might speed up things on Windows. Signed-off-by: Werner Koch <[email protected]>
* gpg: Pass CTRL also to getkey_end.Werner Koch2017-03-314-23/+23
| | | | | | * g10/getkey.c (getkey_end): Add arg CTRL. Change all callers. Signed-off-by: Werner Koch <[email protected]>
* gpg: Print more stats for the keydb and the signature cache.Werner Koch2017-03-314-12/+109
| | | | | | | | | | | | | * g10/sig-check.c (sig_check_dump_stats): New. (cache_stats): New struct. (check_key_signature2): Update stats. * g10/gpg.c (g10_exit): Call new function. * g10/keydb.c (kid_not_found_cache_count): Replace by ... (kid_not_found_stats): ... new struct. Change users. (keydb_stats): New struct. Update the counters. (keydb_dump_stats): Print all stats. Signed-off-by: Werner Koch <[email protected]>
* gpg: Assert that an opaque parameter is really what we expect.Werner Koch2017-03-313-1/+12
| | | | | | | | | * g10/gpg.h (SERVER_CONTROL_MAGIC): New const. (server_control_s): Add field 'magic'. * g10/gpg.c (gpg_init_default_ctrl): Init MAGIC. * g10/import.c (impex_filter_getval): Assert MAGIC. Signed-off-by: Werner Koch <[email protected]>
* gpg: Pass CTRL to many more functions.Werner Koch2017-03-3138-751/+885
| | | | | | | | | | -- For proper operations as a server we need to avoid global variables. Thus we need to pass the session state CTRL to most functions. Quite a lot of changes but fortunately straightforward to do. Signed-off-by: Werner Koch <[email protected]>
* gpg: Consistent use of preprocessor conditionals.Justus Winter2017-03-301-8/+8
| | | | | | | | * g10/parse-packet.c: Use '#if' instead of '#ifdef' when checking DEBUG_PARSE_PACKET. This fixes the build with '#define DEBUG_PARSE_PACKET 0'. Signed-off-by: Justus Winter <[email protected]>
* common: Avoid undefined behavior.Justus Winter2017-03-301-1/+1
| | | | | | | * common/iobuf.c (iobuf_read_line): Do not consider 'length' if 'buffer' is NULL. Signed-off-by: Justus Winter <[email protected]>
* gpg: Remove the use of the signature information from a KBX.Werner Koch2017-03-307-145/+25
| | | | | | | | | | | | | | | | | | | | | | | * g10/keydb.c (keyblock_cache): Remove field SIGSTATUS. (keyblock_cache_clear): Adjust for that removal. (parse_keyblock_image): Remove arg SIGSTATUS. Remove the signature cache setting; this is now done in the parser. (keydb_get_keyblock): Do not set SIGSTATUS. (build_keyblock_image): Remove arg SIGSTATUS and simplify. Change caller. * kbx/keybox-blob.c: Explain that the signature information is not anymore used. (_keybox_create_openpgp_blob): Remove arg SIGSTATUS and change callers. * kbx/keybox-search.c (keybox_get_keyblock): Remove arg R_SIGSTATUS and change callers. * kbx/keybox-update.c (keybox_insert_keyblock): Likewise. -- This thing was too complicated and has been replaced by the new ring trust packet code. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix actual leak and possible leaks in the packet parser.Werner Koch2017-03-305-19/+26
| | | | | | | | | | | | | | | * g10/packet.h (struct parse_packet_ctx_s): Change LAST_PKT deom a pointer to its struct. (init_parse_packet): Adjust for LAST_PKT not being a pointer. * g10/parse-packet.c (parse): Ditto. Free the last packet before storing a new one in case of a deep link. (parse_ring_trust): Adjust for LAST_PKT not being a pointer. * g10/free-packet.c (free_packet): Ditto. * g10/t-keydb-get-keyblock.c (do_test): Release keyblock. -- Fixes-commit: afa86809087909a8ba2f9356588bf90cc923529c Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix export porting of zero length user ID packets.Werner Koch2017-03-301-2/+10
| | | | | | | | | | | * g10/build-packet.c (do_user_id): Avoid indeterminate length header. -- We are able to import such user ids but when exporting them the exported data could not be imported again because the parser bails out on invalid keyrings. This is now fixed and should be backported. Signed-off-by: Werner Koch <[email protected]>
* gpg: Revamp reading and writing of ring trust packets.Werner Koch2017-03-3011-137/+377
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/parse-packet.c (parse_trust): Rename to ... (parse_ring_trust): this. Change args and implement new ring trust packet format. (parse): Add special ring trust packet handling. * g10/packet.h (PKT_user_id): New fields KEYUPDATE, UPDATEURL, and KEYSRC. (PKT_public_key): Ditto. (RING_TRUST_SIG, RING_TRUST_KEY, RING_TRUST_UID): New consts. (PKT_ring_trust): New. (struct packet_struct): Remove member RING_TRUST. (strcu parse_packet_ctx_s): Add field SKIP_META. (init_parse_packet): Init SKIPT_META. * g10/free-packet.c (release_public_key_parts): Free UDPATEURL. (free_user_id): Ditto. * g10/mainproc.c (list_node): Remove printing of non-documented "rtv" lines. * g10/build-packet.c (build_packet_and_meta): New. (do_ring_trust): New. * g10/export.c (write_keyblock_to_output): Use build_packet_and_meta in backup mode. (do_export_one_keyblock): Ditto. * g10/import.c (read_block): Add arg WITH_META. Skip ring trust packets if that ism not set. (import): Call read_block WITH_META in restore mode. * g10/keydb.h (KEYSRC_UNKNOWN, KEYSRC_FILE, KEYSRC_KS, KEYSRC_PREF_KS) (KEYSRC_WKD, KEYSRC_WKD_SD, KEYSRC_DANE): New constants. They are not yet used, though. * g10/keydb.c (parse_keyblock_image): Allow ring trust packets. (build_keyblock_image): Ditto. Use build_packet_and_meta. * g10/keyring.c (keyring_get_keyblock): Remove specila treatment of ring trust packets. (write_keyblock): Use build_packet_and_meta. Remove special treatment of ring trust packets and initialization of the signature caches. -- This patch introduced the framework to store meta data for keys and user ids in the keyrings/keyboxes. Ring trust packets are implementation defined and have always been used in gpg to cache the signature verification status. Ring trust packets are only exported with the export option "backup" and only imported with the import option "restore". The new code uses a cleaner way to handle the ring trust packets: When the parser reads a ring trust packet and the previously read packet matches the type of that ring trust packet, the information is stored in that previously read packet (signature, user id, or primary key) and the next packet is read immediately. Thus only the parser sees the ring trust packets. Ring trust packets are written by using the new function build_packet_and_meta instead of build_packet. That function writes a ring trust packet when the needed information is available. As a side-effect of this patch the signature status cache works again and "gpg --check-sigs" is thus much faster. Signed-off-by: Werner Koch <[email protected]>
* gpg: Extend free_packet to handle a packet parser context.Werner Koch2017-03-2912-53/+124
| | | | | | | | | | | | | | | * g10/packet.h (struct parse_packet_ctx_s): Add fields LAST_PKT and FREE_LAST_PKT. (init_parse_packet): Clear them. (deinit_parse_packet): New macro. Change all users if init_parse_packet to also call this macro. * g10/free-packet.c (free_packet): Add arg PARSECTX and handle shallow packet copies in the context. Change all callers. * g10/parse-packet.c (parse): Store certain packets in the parse context. -- Signed-off-by: Werner Koch <[email protected]>
* indent: Re-indent function free-packet.Werner Koch2017-03-291-44/+47
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Change parse_packet to take a context.Werner Koch2017-03-297-77/+137
| | | | | | | | | | | | | | | | | | * g10/packet.h (struct parse_packet_ctx_s): New. (parse_packet_ctx_t): New type. (init_parse_packet): New macro. * g10/parse-packet.c (parse_packet, dbg_parse_packet): Change to take a parse context. Change all callers to provide a context instead of directly supplying the input stream. (search_packet, dbg_search_packet): Ditto. (copy_all_packets, dbg_copy_all_packets): Init an use a parse context. (copy_some_packets, dbg_copy_some_packets): Ditto. (skip_some_packets, dbg_skip_some_packets): Ditto. -- We will need this change to handle ring packets inside the parser. Signed-off-by: Werner Koch <[email protected]>
* gpg: Export ring trust packets in backup mode.Werner Koch2017-03-291-1/+4
| | | | | | * g10/export.c (write_keyblock_to_output): Export ring trust packets. Signed-off-by: Werner Koch <[email protected]>
* indent: Re-indent parts of build-packet.cWerner Koch2017-03-291-146/+152
| | | | --
* tests,w32: Fix importing the extra key for GPGME's keylist test.Justus Winter2017-03-281-1/+1
| | | | | | | * tests/gpgme/wrap.scm: Qualify the tests name with the extension for executables (if any). Signed-off-by: Justus Winter <[email protected]>
* gpg: Prepare for listing last_update and key origin data.Werner Koch2017-03-282-2/+23
| | | | | | | | | | | * g10/keylist.c (list_keyblock_colon): Add empty fields 19 and 20. -- We add them now to early catch error in parsers which arbitrary limit the number of fields in --with-colon listings. Signed-off-by: Werner Koch <[email protected]>
* tests: Fix distcheck.Justus Winter2017-03-281-3/+27
| | | | | | | | * tests/openpgp/Makefile.am (sample_msgs): Add all missing sample messages. Fixes-commit: 211d71f19c24da94f4c58014606125c1a29d86a2 Signed-off-by: Justus Winter <[email protected]>
* tests: Add test for '--decrypt --unwrap'.Justus Winter2017-03-282-0/+42
| | | | | | | * tests/openpgp/Makefile.am (XTESTS): Add new test. * tests/openpgp/decrypt-unwrap-verify.scm: New file. Signed-off-by: Justus Winter <[email protected]>
* g10: Fix memory leak.Justus Winter2017-03-281-1/+2
| | | | | | * g10/decrypt-data.c (decrypt_data): Free 'filename'. Signed-off-by: Justus Winter <[email protected]>
* common: Fix connecting to the agent.Justus Winter2017-03-271-0/+2
| | | | | | | | | | | | | | | * common/homedir.c (_gnupg_socketdir_internal): Fix error handling. -- Prior to 26086b36 the non-existance of the socket directory was considered an error if a non-default home directory is used. Since 26086b36 we now create the directory on demand, but the function still returned the fallback path. This made the agent bind the socket in the socket directory, and the client trying to connect to the socket in the home directory. Fixes-commit: 26086b362ff47d21b1abefaf674a6464bf0a8921 Signed-off-by: Justus Winter <[email protected]>
* g10: Support specifying SERIALNO for --card-status.NIIBE Yutaka2017-03-273-9/+76
| | | | | | | | | * g10/gpg.c (main): Allow an argument for --card-status. * g10/card-util.c (current_card_status): Rename from card_status. (card_status): New, which supports multiple cards. (get_one_name): Use current_card_status. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Change the order of applications when accessed.NIIBE Yutaka2017-03-271-2/+9
| | | | | | * scd/app.c (select_application): Move the app to top. Signed-off-by: NIIBE Yutaka <[email protected]>