aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* scd: Relax a condition for p15 driver.NIIBE Yutaka2017-04-101-1/+1
| | | | | | * scd/app-p15.c (read_ef_aodf): Remove possibly redundant condition. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Remove "special transport" support.NIIBE Yutaka2017-04-101-292/+64
| | | | | | | | | | * scd/ccid-driver.c (transports, my_sleep, prepare_special_transport) (writen): Remove. (ccid_dev_scan, ccid_dev_scan_finish, ccid_get_BAI): Only for USB. (ccid_open_reader, do_close_reader, bulk_out, bulk_in, abort_cmd) (ccid_poll, ccid_transceive): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgscm: Allocate small integers in the rodata section.Justus Winter2017-04-074-37/+861
| | | | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/Makefile.am (gpgscm_SOURCES): Add new file. * tests/gpgscm/scheme-private.h (struct cell): Move number to the top of the union so that we can initialize it. (struct scheme): Remove 'integer_segment'. * tests/gpgscm/scheme.c (initialize_small_integers): Remove function. (small_integers): New variable. (MAX_SMALL_INTEGER): Compute. (mk_small_integer): Adapt. (mark): Avoid marking objects already marked. This allows us to run the algorithm over objects in the rodata section if they are already marked. (scheme_init_custom_alloc): Remove initialization. (scheme_deinit): Remove deallocation. * tests/gpgscm/small-integers.h: New file. -- Allocate small integers from a fixed pool in the rodata section. This spares us the initialization, and deduplicates integers across different processes. It also makes the integers immutable, increasing memory safety. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Make global data constant when possible.Justus Winter2017-04-072-19/+15
| | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct scheme): Make 'vptr' const. * tests/gpgscm/scheme.c (num_zero): Statically initialize and turn into constant. (num_one): Likewise. (charnames): Change type so that it can be stored in rodata. (is_ascii_name): Adapt slightly. (assign_proc): Make argument const char *. (op_code_info): Make some fields const char *. (tests): Make const. (dispatch_table): Make const. At least it can be made read-only after relocation. (Eval_Cycle): Adapt slightly. (vtbl): Make const. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Remove arbitrary limit on number of cell segments.Justus Winter2017-04-072-44/+74
| | | | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct scheme): Remove fixed-size arrays for cell segments, replace them with a pointer to the new 'struct cell_segment' instead. * tests/gpgscm/scheme.c (struct cell_segment): New definition. (_alloc_cellseg): Allocate the header within the segment, return a pointer to the header. (_dealloc_cellseg): New function. (alloc_cellseg): Insert the segments into a list. (_get_cell): Allocate a new segment if less than a quarter of CELL_SIGSIZE is recovered during garbage collection. (initialize_small_integers): Adapt callsite. (gc): Walk the list of segments. (scheme_init_custom_alloc): Remove initialization of removed field. (scheme_deinit): Adapt deallocation. -- Previously the number of cells that could be allocated was a compile-time limit. Remove this limit. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Fix compact vector encoding.Justus Winter2017-04-071-1/+2
| | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct cell): Use uintptr_t for '_flags'. This way, '_flags' has the size of a machine word. -- The compact vector representation introduced in 49e2ae65 requires that we can tell apart pointers and type flags. This did not work on 64-bit big-endian architectures. Fixes a crash on 64-bit big-endian architectures. Hat-tip-to: gniibe Fixes-commit: 49e2ae65e892f93be7f87cfaae3392b50a99e4b1 Signed-off-by: Justus Winter <[email protected]>
* doc: Explain the '>' in a key listing.Werner Koch2017-04-071-4/+7
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix printing of offline taken subkey.Werner Koch2017-04-071-1/+1
| | | | | | | | * g10/keylist.c (list_keyblock_print): Set SECRET to 2 and not 0x32. -- Reported-by: Danielle McLean <[email protected]> Signed-off-by: Werner Koch <[email protected]>
* scd: Internal CCID reader cleanup.NIIBE Yutaka2017-04-071-269/+41
| | | | | | | | | | | | * scd/ccid-reader.c (scan_usb_device): Only for scan mode, so, rename from scan_or_find_usb_device. (scan_devices): Likewise. Remove support of special transport types. (ccid_get_reader_list): Simplify. (abort_cmd): Fix error return. (send_escape_cmd): Fix for RESULTLEN == NULL. (ccid_transceive_secure): Remove unnecessary var updates. Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Don't keep CCID reader open when card is not available.NIIBE Yutaka2017-04-071-8/+3
| | | | | | * scd/apdu.c (open_ccid_reader): Fail if no ATR. Signed-off-by: NIIBE Yutaka <[email protected]>
* agent: Serialize access to passphrase cache.NIIBE Yutaka2017-04-061-36/+37
| | | | | | | | | | | | | | * agent/cache.c (encryption_lock): Remove. (cache_lock): New. Now, we have coarse grain lock to serialize entire cache access. (initialize_module_cache): Use CACHE_LOCK. (init_encryption, new_data): Remove ENCRYPTION_LOCK. (agent_flush_cache, agent_put_cache, agent_get_cache): Lock the cache. -- GnuPG-bug-id: 3027 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgscm: Avoid mutating integer.Justus Winter2017-04-061-1/+1
| | | | | | | | * tests/gpgscm/scheme.c (opexe_5): Do not modify the integer in-place while printing an vector. Integer objects may be shared, so they must not be mutated. Signed-off-by: Justus Winter <[email protected]>
* gpgscm: Initialize unused slots in vectors.Justus Winter2017-04-061-0/+8
| | | | | | | | | | | | * tests/gpgscm/scheme.c (get_vector_object): Initialize unused slots at the end of vectors. -- They should not be used for anything, but let's just initialize them to something benign to be sure. GnuPG-bug-id: 3014 Signed-off-by: Justus Winter <[email protected]>
* 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]>