aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* common:stringhelp.c: Replace use of jblib_malloc with xtrymalloc, etc.neal/strsplitNeal H. Walfield2015-03-121-26/+26
| | | | --
* common: Add new helper function, strsplit.Neal H. Walfield2015-03-123-1/+98
| | | | | | | | | * common/stringhelp.h (strsplit): New declaration. * common/stringhelp.c (strsplit): New function. * common/t-stringhelp.c (test_strsplit): New function. (main): Call it here. --
* agent: Improve error reporting from Pinentry.Werner Koch2015-03-111-0/+28
| | | | | | | | | | | | * agent/call-pinentry.c (unlock_pinentry): Add error logging. Map error source of uncommon errors to Pinentry. -- With this change it is possible to detect whether an error like GPG_ERR_ASS_INV_RESPONSE has its origin in a call to Pinentry or comes from another part of gpg-agent. Signed-off-by: Werner Koch <[email protected]>
* gpg: Change --print-pka-records into an option.Werner Koch2015-03-103-18/+11
| | | | | | | | | | | | | * g10/gpg.c (aPrintPKARecords): Rename to oPrintPKARecords and do not use it as a command. * g10/keylist.c (list_keyblock): List PKA rceords also for secret keys. -- An option allows to use it more flexible. For example to select only secret keys. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add --list-gcrypt-config and "curve" item for --list-config.Werner Koch2015-03-106-19/+133
| | | | | | | | | | | | | * common/openpgp-oid.c (curve_supported_p): New. (openpgp_enum_curves): New. * common/t-openpgp-oid.c (test_openpgp_enum_curves): New. (main): Add option --verbose. * g10/gpg.c (opts): Add --list-gcrypt-config. (list_config): Add items "curve" and "curveoid". Remove unused code. -- GnuPG-bug-id: 1917 Signed-off-by: Werner Koch <[email protected]>
* scd: fix for 64-bit arch.NIIBE Yutaka2015-03-092-5/+6
| | | | | | | | | | * agent/pksign.c (agent_pksign_do): Use int. * scd/app-openpgp.c (get_public_key): Likewise. -- On 64-bit architecture, int and size_t might be different. For the first argument for '%b', int is expected.
* doc: Some typo fixes.Werner Koch2015-03-062-3/+3
| | | | --
* doc: Fix FAQ stub and remove faq build rules.Werner Koch2015-03-042-25/+4
| | | | | | -- The FAQ is maintained in the gnupg-doc repo.
* gpg: avoid chatter about trustdb when --quietDaniel Kahn Gillmor2015-03-041-2/+4
| | | | | | | | | | | | | | | | | * g10/trustdb.c (tdb_check_trustdb_stale): avoid log_info() when opt.quiet -- gpg(1) says: -q, --quiet Try to be as quiet as possible. While the mentions about the stale trustdb information are edifying, they aren't necessary, and shouldn't be emitted when the user requests --quiet. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Lowercase mailbox for PKA lookups.Werner Koch2015-02-263-3/+17
| | | | | | | | * common/stringhelp.c (ascii_strlwr): New. * common/mbox-util.c (mailbox_from_userid): Downcase result. -- Signed-off-by: Werner Koch <[email protected]>
* Remove an unused variable.Werner Koch2015-02-261-1/+0
| | | | --
* gpg: Fix memory leak due to PKA lookup.Werner Koch2015-02-261-1/+1
| | | | * g10/keyserver.c (keyserver_import_pka): Move the xfree.
* doc: Fix name of keep-ownertrust.Werner Koch2015-02-261-1/+1
| | | | | | | -- Reported-by: Guilhem Moulin <[email protected]> (cherry picked from commit 0d286a11c857a8f84b084b6f4e8a38737adca034)
* doc: Update the description of the S2K extension.Werner Koch2015-02-261-6/+20
| | | | --
* gpg: Switch to a hash and CERT record based PKA system.Werner Koch2015-02-259-314/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/dns-cert.c (get_dns_cert): Make r_key optional. * common/pka.c: Rewrite for the new hash based lookup. * common/t-pka.c: New. * configure.ac: Remove option --disable-dns-pka. (USE_DNS_PKA): Remove ac_define. * g10/getkey.c (parse_auto_key_locate): Always include PKA. -- Note that although PKA is now always build, it will only work if support for looking up via DNS has not been disabled. The new PKA only works with the IPGP DNS certtype and shall be used only to retrieve the fingerprint and optional the key for the first time. Due to the security problems with DNSSEC the former assumption to validate the key using DNSSEC is not anymore justified. Instead an additional layer (e.g. Trust-On-First-Use) needs to be implemented to track change to the key. Having a solid way of getting a key matching a mail address is however a must have. More work needs to go into a redefinition of the --verify-options pka-lookups and pka-trust-increase. The auto-key-locate mechanism should also be able to continue key fetching with another methods once the fingerprint has been retrieved with PKA. Signed-off-by: Werner Koch <[email protected]>
* common: Allow requesting a specific certtype with get_dns_cert()Werner Koch2015-02-254-24/+35
| | | | | | | | | * common/dns-cert.c (get_dns_cert): Add arg want_certtype. Change all callers. (CERTTYPE_): Move constants to ... * common/dns-cert.h: here as DNS_CERTTYPE_. Signed-off-by: Werner Koch <[email protected]>
* Move new mailbox.c source file to common/.Werner Koch2015-02-2510-48/+67
| | | | | | | | | | | * g10/mailbox.c: Move to ... * common/mbox-util.c: new file. * common/mbox-util.h: New. Include where needed. * g10/t-mailbox.c: Move to ... * common/t-mbox-util.c: new file. -- This will make it easier to use the code by other modules in common/.
* gpg: Add command --print-pka-records.Werner Koch2015-02-243-3/+105
| | | | | | | | | | | | | * g10/gpg.c (main): Add command --print-pka-records. * g10/options.h (struct opt): Add field "print_pka_records". * g10/keylist.c (list_keyblock_pka): New. (list_keyblock): Call it if new option is set. (print_fingerprint): Add mode 10. -- This is a fist step towards a slightly updated PKA implementation. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add function to extract the mailbox.Werner Koch2015-02-245-79/+322
| | | | | | | | | | | | | | | * g10/misc.c (has_invalid_email_chars, is_valid_mailbox) (is_valid_user_id): Move to ... * g10/mailbox.c: new file. (string_has_ctrl_or_space, has_dotdot_after_at): New. (has_invalid_email_chars): New. * g10/t-mailbox.c: New. * g10/Makefile.am (module_tests): Add t-mailbox. (t_mailbox_SOURCES, t_mailbox_LDADD): New. -- Signed-off-by: Werner Koch <[email protected]>
* common: Add another test case to zb32.cWerner Koch2015-02-241-0/+3
| | | | | | | -- Fingerprints may eventually be used with zb32 and thus thre should be a test case.
* gpg: Add option to print fingerprints in ICAO spelling.Werner Koch2015-02-234-0/+45
| | | | | | | | | * g10/gpg.c: Add option --with-icao-spelling. * g10/options.h (struct opt): Add with_icao_spelling. * g10/keylist.c (print_icao_hexdigit): New. (print_fingerprint): Print ICAO spelling. Signed-off-by: Werner Koch <[email protected]>
* gpg: Skip legacy keys while searching keyrings.Werner Koch2015-02-231-2/+37
| | | | | | | | | * g10/getkey.c (search_modes_are_fingerprint): New. (lookup): Skip over legacy keys. -- GnuPG-bug-id: 1847 Signed-off-by: Werner Koch <[email protected]>
* common: Fix regression due to commit 2183683b.Werner Koch2015-02-231-1/+0
| | | | | | | | * common/dns-cert.c (get_dns_cert): Remove cruft. -- GnuPG-bug-id: 1850 Signed-off-by: Werner Koch <[email protected]>
* gpg: Replace remaining uses of stdio by estream.Werner Koch2015-02-1912-115/+118
| | | | | | | | | | | | | | | | | | | | | | | * g10/sign.c (sign_file): Use log_printf instead of stderr. * g10/tdbdump.c (export_ownertrust): Use estream fucntions. (import_ownertrust): Ditto. * g10/tdbio.c (tdbio_dump_record): Ditto. Change arg to estream_t. -- Reported-by: Guilhem Moulin <[email protected]> Needed for unattended key edits with --status-fd, because since 2.1 status prompts are preceded by es_fflush (in cpr.c:do_get_from_fd) not fflush(3), so the standard output may not be flushed before each prompt. (Which breaks scripts using select(2) to multiplex between the standard and status outputs.) His patch only affected print_and_check_one_sig_colon() but there are many more places where stdio and estream are mixed. This patch now replaces most of them in g10/. At some places stdio is still used, but that is local to a function and should not have side effects. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix segv due to NULL value stored as opaque MPI.Werner Koch2015-02-192-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/build-packet.c (gpg_mpi_write): Check for NULL return from gcry_mpi_get_opaque. (gpg_mpi_write_nohdr, do_key): Ditto. * g10/keyid.c (hash_public_key): Ditto. -- This fix extends commmit 0835d2f44ef62eab51fce6a927908f544e01cf8f. gpg2 --export --no-default-keyring --keyring TESTDATA With TESTDATA being below after unpacking. -----BEGIN PGP ARMORED FILE----- mBMEhdkMmS8BcX8F//8F5voEhQAQmBMEnAAAZwAAo4D/f/8EhQAAAIAEnP8EhQAQ iBMEnP8AAAAABf8jIID///8EhQYQmBMEnIUAEIgTBKT/AAAAAAUAACCA/f//BIUA EJgTBJx/AP8ABPPzBJx/AP8ABPPz =2yE0 -----END PGP ARMORED FILE----- Reported-by: Jodie Cunningham Signed-off-by: Werner Koch <[email protected]>
* scd: Fix regression in 2.1.2 (due to commit 2183683)Werner Koch2015-02-121-2/+2
| | | | | | | | * scd/apdu.c (pcsc_vendor_specific_init): Replace use of bufNN_to_uint by direct code. -- Hey, that was little endian.
* dirmngr: Initialize cache from sysconfig dirAndre Heinecke2015-02-125-23/+21
| | | | | | | | | | | | | | | | | | | * dirmngr/certcache.c (cert_cache_init): Load certificates from sysconfig dir instead of the homeidr. * dirmngr/dirmngr.c (main): Removed parsing of obsolete homedir_data option. * dirmngr/dirmngr.h (opt): Removed homedir_data. * doc/dirmngr.texi: Update and clarify certs directory doc. -- Using the homedir for extra-certs and trusted-certs makes little sense when dirmngr is used with a caller that manages it's own store of certificates and can provide those through the SENDCERT command. You can use trusted-certs and extra-certs to provide users with a base of locally available certificates that are not already in store of the applications.
* Post release updates.Werner Koch2015-02-112-1/+5
| | | | --
* Release 2.1.2gnupg-2.1.2Werner Koch2015-02-111-4/+25
|
* po: Auto update.Werner Koch2015-02-1124-6/+78
| | | | --
* dirmngr: Avoid warning about unused function.Werner Koch2015-02-111-1/+2
| | | | * dirmngr/dirmngr.c (my_gnutls_log): Build only if gnutls is used.
* build: Update standard build-aux files.Werner Koch2015-02-118-1003/+1292
|
* doc: Add another use case for --show-session-key.Werner Koch2015-02-111-2/+7
| | | | | -- GnuPG-bug-id: 1835
* doc: Change remaining http links to gnupg.org to httpsWerner Koch2015-02-113-5/+5
| | | | | -- GnuPG-bug-id: 1830
* Use inline functions to convert buffer data to scalars.Werner Koch2015-02-1131-210/+220
| | | | | | | | | | | | | | | * common/host2net.h (buf16_to_ulong, buf16_to_uint): New. (buf16_to_ushort, buf16_to_u16): New. (buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New. -- Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to avoid all sign extension on shift problems. Hanno Böck found a case with an invalid read due to this problem. To fix that once and for all almost all uses of "<< 24" and "<< 8" are changed by this patch to use an inline function from host2net.h. Signed-off-by: Werner Koch <[email protected]>
* gpg: Prevent an invalid memory read using a garbled keyring.Werner Koch2015-02-092-13/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/keyring.c (keyring_get_keyblock): Whitelist allowed packet types. * g10/keydb.c (parse_keyblock_image): Ditto. -- The keyring DB code did not reject packets which don't belong into a keyring. If for example the keyblock contains a literal data packet it is expected that the processing code stops at the data packet and reads from the input stream which is referenced from the data packets. Obviously the keyring processing code does not and cannot do that. However, when exporting this messes up the IOBUF and leads to an invalid read of sizeof (int). We now skip all packets which are not allowed in a keyring. Reported-by: Hanno Böck <[email protected]> Test data: gpg2 --no-default-keyring --keyring FILE --export >/dev/null With this unpacked data for FILE: -----BEGIN PGP ARMORED FILE----- mI0EVNP2zQEEALvETPVDCJDBXkegF4esiV1fqlne40yJnCmJeDEJYocwFPXfFA86 sSGjInzgDbpbC9gQPwq91Qe9x3Vy81CkyVonPOejhINlzfpzqAAa3A6viJccZTwt DJ8E/I9jg53sbYW8q+VgfLn1hlggH/XQRT0HkXMP5y9ClURYnTsNwJhXABEBAAGs CXRlc3QgdGVzdIi5BBMBCgAjBQJU0/bNAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwEC HgECF4AACgkQlsmuCapsqYLvtQP/byY0tM0Lc3moftbHQZ2eHj9ykLjsCjeMDfPx kZUUtUS3HQaqgZLZOeqPjM7XgGh5hJsd9pfhmRWJ0x+iGB47XQNpRTtdLBV/WMCS l5z3uW7e9Md7QVUVuSlJnBgQHTS6EgP8JQadPkAiF+jgpJZXP+gFs2j3gobS0qUF eyTtxs+wAgAD =uIt9 -----END PGP ARMORED FILE----- Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix a NULL-deref in export due to invalid packet lengths.Werner Koch2015-02-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | * g10/build-packet.c (write_fake_data): Take care of a NULL stored as opaque MPI. -- Reported-by: Hanno Böck <[email protected]> Test data: gpg2 --no-default-keyring --keyring FILE --export With this unpacked data for FILE: -----BEGIN PGP ARMORED FILE----- Version: GnuPG v2 Comment: Use "gpg --dearmor" for unpacking mI0EGRkZGRkZGRkZGRkZGRkBGRkZGRkZGRkZGRkZGQAZGRkZGRkZGRkZGRkZGRkZ GRkZInzgDbpa/9gQ4wq9////f3Vy81CkyVq3HQaqgZLZOeqPjM7XgGh5hJvAkpec 9wAAAgDHe0FVFbkppJZXP+gFs6z3gobS0qUFeyTtxs+wAgAD =JDFT -----END PGP ARMORED FILE----- Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix a NULL-deref due to empty ring trust packets.Werner Koch2015-02-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/parse-packet.c (parse_trust): Always allocate a packet. -- Reported-by: Hanno Böck <[email protected]> Signed-off-by: Werner Koch <[email protected]> Test data: gpg2 --no-default-keyring --keyring FILE --export With this unpacked data for FILE: -----BEGIN PGP ARMORED FILE----- Version: GnuPG v2 Comment: Use "gpg --dearmor" for unpacking mI0EVNP2zQEEALvETPVDCJDBXkegF4esiV1fqlne40yJnCmJeDEJYocwFPXfFA86 sSGjInzgDbpbC9gQPwq91Qe9x3Vy81CkyVonPOejhINlzfpzqAAa3A6viJccZTwt DJ8E/I9jg53sbYW8q+VgfLn1hlggH/XQRT0HkXMP5y9ClURYnTsNwJhXABEBAAG0 CXRlc3QgdGVzdIi5BBMBCgAjBQJU0/bNAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwEC HgECF4AACgkQlsmuCapsqYLvtQP/byY0tM0Lc3moftbHQZ2eHj9ykLjsCjeMDfPx kZUUtUS3HQaqgZLZOeqPjM7XgGh5hJsd9pfhmRWJ0x+iGB47XQNpRTtdLBV/WMCS l5z3uW7e9Md7QVUVuSlJnBgQHTS6EgP8JQadPkAiF+jgpJZXP+gFs2j3gobS0qUF eyTtxs+wAAAD =puSt -----END PGP ARMORED FILE-----
* gpg-agent: Use "pinentry-basic" as fallback.Werner Koch2015-02-045-12/+66
| | | | | | | | | | | | | | | | | | | | | | * common/homedir.c (get_default_pinentry_name): New. (gnupg_module_name): Use that for the default pinentry. (gnupg_module_name_flush_some): New. * agent/gpg-agent.c (agent_sighup_action): Flush some module names. * agent/call-pinentry.c (start_pinentry): Do not modify opt.pinentry_program. -- The idea with this change is that under Windows we can install a simple native Windows pinentry as "pinentry-basic" and a full GUI version may then later install pinentry-gtk etc which would then automatically be used. Unfortunately installing another pinentry from a different package would clobber the GnuPG core directory which is not nice. To fix that we would need to agree on standard installation directories for GUIs to also look there. Signed-off-by: Werner Koch <[email protected]>
* w32: Add manifest to gpg.Werner Koch2015-02-044-3/+29
| | | | | | | | | | | | | | | * g10/gpg.w32-manifest.in: New. * g10/gpg-w32info.rc: Add manifest. * g10/Makefile.am (EXTRA_DIST): Add manifest. (gpg-w32info.o): Depend on manifest. * configure.ac (BUILD_VERSION): New. (AC_CONFIG_FILES): Add manifest. -- There are no dependencies yet defined - we need to do this for the libs first. Signed-off-by: Werner Koch <[email protected]>
* Update copyright years.Werner Koch2015-02-036-9/+9
| | | | | * common/w32info-rc.h.in (W32INFO_COMPANYNAME): Change to "The GnuPG Project".
* w32: Change default Windows install dir and add bin to PATH.Werner Koch2015-02-022-34/+111
| | | | | | | | | | | * build-aux/speedo.mk (WITH_GUI): New macro. The Windows installer is now build by default without any GUI stuff. * build-aux/speedo/w32/inst.nsi: Change standard installation directory. (AddToPath, un.RemoveFromPath): New. (gnupginst): Add bin directory to the PATH. Signed-off-by: Werner Koch <[email protected]>
* w32: Allow for Unicocde installation directory.Werner Koch2015-02-011-13/+7
| | | | | | | | | | | * common/homedir.c (w32_rootdir): Use Unicode fucntion not only for WinCE. -- This uses the same code We used for WindowsCE. It has not been tested with a Unicode requiring installation directory. Signed-off-by: Werner Koch <[email protected]>
* kbx: Fix resource leak.Joshua Rogers2015-01-301-5/+32
| | | | | | | | | | | * kbx/keybox-update.c (blob_filecopy): Fix resource leak. On error return, 'fp' and 'newfp' was never closed. -- Signed-off-by: Joshua Rogers <[email protected]> [Log entry reformatted, and added more fixes - gniibe]
* agent: Fix use of imported but unprotected openpgp keys.Werner Koch2015-01-295-15/+119
| | | | | | | | | | | | * agent/agent.h (PRIVATE_KEY_OPENPGP_NONE): New. * agent/command.c (do_one_keyinfo): Implement it. * agent/findkey.c (agent_key_from_file): Ditto. (agent_key_info_from_file): Ditto. (agent_delete_key): Ditto. * agent/protect.c (agent_private_key_type): Add detection for openpgp "none" method. Signed-off-by: Werner Koch <[email protected]>
* po: Update Japanese Translation.NIIBE Yutaka2015-01-291-23/+27
|
* gpg: Limit the size of key packets to a sensible value.Werner Koch2015-01-281-3/+19
| | | | | | | | | | | | | | | | | | | | | | | * g10/parse-packet.c (MAX_KEY_PACKET_LENGTH): New. (MAX_UID_PACKET_LENGTH): New. (MAX_COMMENT_PACKET_LENGTH): New. (MAX_ATTR_PACKET_LENGTH): New. (parse_key): Limit the size of a key packet to 256k. (parse_user_id): Use macro for the packet size limit. (parse_attribute): Ditto. (parse_comment): Ditto. -- Without that it is possible to force gpg to allocate large amounts of memory by using a bad encoded MPI. This would be an too easy DoS. Another way to mitigate would be to change the MPI read function to allocate memory dynamically while reading the MPI. However, that complicates and possibly slows down the code. A too large key packet is in any case a sign for broken data and thus gpg should not use it. Reported-by: Hanno Böck GnuPG-bug-id: 1823 Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix buffering problem in --list-config.Werner Koch2015-01-284-259/+14
| | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (list_config): Replace print_sanitized_string2 by es_write_sanitized. * common/stringhelp.c (print_sanitized_buffer2): Remove. (print_sanitized_buffer, print_sanitized_utf8_buffer): Remove. (print_sanitized_utf8_buffer, print_sanitized_utf8_string): Remove. (print_sanitized_string): Remove. * sm/certdump.c (print_dn_part, print_dn_parts): Remove arg FP. (pretty_print_sexp, gpgsm_print_name2, gpgsm_print_name): Remove. -- Mixing stdio and estream is never a good idea. This fix also allows us to remove a lot of garbage. Reported-by: Jason A. Donenfeld <[email protected]> GnuPG-bug-id: 1822 Signed-off-by: Werner Koch <[email protected]>
* Add a hook to be called right after main.Werner Koch2015-01-2818-0/+28
| | | | | | * common/init.c (early_system_init): New stub function. Signed-off-by: Werner Koch <[email protected]>
* gpg: Allow predefined names as answer to the keygen.algo prompt.Werner Koch2015-01-282-16/+50
| | | | | | * g10/keygen.c (ask_algo): Add list of strings. Signed-off-by: Werner Koch <[email protected]>