aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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]>
* agent: Add some extra robustness to extract_private_keyWerner Koch2015-01-283-4/+13
| | | | | | | | | | | * agent/cvt-openpgp.c (extract_private_key): Add arg "arraysize". Make sure that R_FLAGS and R_CURVE are set to NULL. -- Given that extract_private_key is not file local it is good to have some extra asserts to protect against future wrong use. Signed-off-by: Werner Koch <[email protected]>
* scd: Fix varargs call for 64-bit arch on ECC keys.NIIBE Yutaka2015-01-281-14/+12
| | | | | | | | | | | | | * scd/app-openpgp.c (store_fpr): Remove CARD_VERSION from the arguments. (rsa_writekey): Follow the change. (do_genkey): Likewise. (ecc_writekey): Likewise. Cast to size_t. -- KEYTOCARD caused SEGV of scdaemon on 64-bit arch. That's because int is 32-bit, but size_t is 64-bit.
* gpg: Fix segv introduced to commit 4d7c9b0.Werner Koch2015-01-271-1/+1
| | | | | | * g10/keygen.c (get_parameter_passphrase): Take care of R == NULL. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix agent_public_key_from_file for ECC.NIIBE Yutaka2015-01-273-94/+151
| | | | | | | | | | | | | * agent/cvt-openpgp.c (extract_private_key): New. (convert_to_openpgp): Use extract_private_key. * agent/findkey.c (agent_public_key_from_file): Use extract_private_key. -- This patch add support of ECC key with a curve name and flags. Since same functionality is also needed for convert_to_openpgp, it was factored out into the extract_private_key function.
* sm: Simplify fix ed8383c6Werner Koch2015-01-261-4/+2
| | | | | | | | * sm/minip12.c (p12_build): Release PWBUF only at the end. -- Suggested-by: Eygene Ryabinkin <[email protected]> Signed-off-by: Werner Koch <[email protected]>
* ccid: Remove incorrect expression leading to errors.Joshua Rogers2015-01-251-1/+1
| | | | | | | | | | | | | | * scd/ccid-driver.c (send_escape_cmd): Fix setting of 'rc'. -- Variable 'rc' in send_escape_cmd was overwritten before it was returned, leading to incorrect computation. Signed-off-by: Joshua Rogers <[email protected]> [Log entry reformatted - wk] (cherry picked from commit 3d9f8bf1dc0c7165a5d2a31568ed425d2dc3b91e)
* gpgconf: Fix validity check for UINT32 values.Werner Koch2015-01-231-1/+1
| | | | | | | | | | | | | * tools/gpgconf-comp.c (option_check_validity): Enable check for UINT32. -- Reported-by: Günther Noack <[email protected]> This is actually a bug which inhibited the checking of values of type UINT32. Signed-off-by: Werner Koch <[email protected]>
* gpg,sm: Remove unnecessary duplicated checksWerner Koch2015-01-232-2/+2
| | | | | | -- Reported-by: Günther Noack <[email protected]>
* doc: Fix some typos and add missing options.Werner Koch2015-01-223-14/+26
| | | | | | | | | | | -- GnuPG-bug-id: 1602 I added options shown with --help but missing in the man page. However, --help won't show everything listed in the man age and frankly there are even more options not listed anywhere (to see them use --dump-options).
* gpg: Improve skipping of PGP-2 keys.Werner Koch2015-01-225-11/+61
| | | | | | | | | | | | | | | | | * g10/keydb.c (keydb_search_first, keydb_search_next): Skip legacy keys. * g10/keyring.c (keyring_get_keyblock): Handle GPG_ERR_LEGACY_KEY. (prepare_search): Ditto. (keyring_rebuild_cache): Skip legacy keys. * g10/keyserver.c (keyidlist): Ditto. * g10/trustdb.c (validate_key_list): Ditto. -- This is not the most elegant way to handle it but it reduces the chance for unwanted side effects. GnuPG-bug-id: 1816 Signed-off-by: Werner Koch <[email protected]>
* gpg: Add dedicated error code for PGP-2 keys.Werner Koch2015-01-225-11/+7
| | | | | | | | | | | | * g10/parse-packet.c (parse_key): Return GPG_ERR_LEGACY_KEY for PGP2 keys. * g10/import.c (read_block): Simplify by checking GPG_ERR_LEGACY_KEY. * g10/getkey.c (lookup): Silence error message for PGP-2 keys. * common/util.h (GPG_ERR_LEGACY_KEY): Add replacement for older libgpg-error. Signed-off-by: Werner Koch <[email protected]>
* gpg: Replace remaining old error code macros by GPG_ERR_.Werner Koch2015-01-2232-408/+362
| | | | | | | | | * g10/gpg.h (g10_errstr): Remove macro and change all occurrences by gpg_strerror. (G10ERR_): Remove all macros and change all occurrences by their GPG_ERR_ counterparts. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove an unused variable.Werner Koch2015-01-222-3/+1
| | | | * g10/getkey.c (getkey_ctx_s): Remove last_rc.
* dirmngr: Fix TLS build problems.Werner Koch2015-01-211-2/+4
| | | | | | | | * dirmngr/Makefile.am (AM_CFLAGS): Add flags for TLS libs. -- This should fix GnuPG-bug-id: 1813.
* gpg: Support --passphrase with --quick-gen-key.Werner Koch2015-01-213-2/+41
| | | | | | | | | * g10/keygen.c: Include shareddefs.h. (quick_generate_keypair): Support static passphrase. (get_parameter_passphrase): New. (do_generate_keypair): Use it. Signed-off-by: Werner Koch <[email protected]>
* gpg: Re-enable the "Passphrase" parameter for batch key generation.Werner Koch2015-01-219-57/+128
| | | | | | | | | | | | | * agent/command.c (cmd_genkey): Add option --inq-passwd. * agent/genkey.c (agent_genkey): Add new arg override_passphrase. * g10/call-agent.c (inq_genkey_parms): Handle NEWPASSWD keyword. (agent_genkey): Add arg optional arg "passphrase". * g10/keygen.c (common_gen, gen_elg, gen_dsa, gen_ecc) (gen_rsa, do_create): Add arg "passphrase" and pass it through. (do_generate_keypair): Make use of pPASSPHRASE. (release_parameter_list): Wipe out a passphrase parameter. Signed-off-by: Werner Koch <[email protected]>
* artwork: Crop and rename the commonly used logo.Werner Koch2015-01-203-126/+138
| | | | --