aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* doc: Explain use of common error variable names.Werner Koch2016-04-251-7/+24
| | | | --
* common: Use new function to print a failure of xtrymalloc.Werner Koch2016-04-253-3/+17
| | | | | | | | * common/miscellaneous.c (xoutofcore): New. * common/strlist.c (append_to_strlist): Use instead of abort. (append_to_strlist_try): Use xtrymalloc instead of xmalloc. Signed-off-by: Werner Koch <[email protected]>
* common: Drop unused variables, fix warnings.Justus Winter2016-04-212-3/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* common: Add support for the new extended private key format.Justus Winter2016-04-2114-13/+1831
| | | | | | | | | | | | | | | | | | | | | | | | | | * agent/findkey.c (write_extended_private_key): New function. (agent_write_private_key): Detect if an existing file is in extended format and update the key within if it is. (read_key_file): Handle the new format. * agent/keyformat.txt: Document the new format. * common/Makefile.am: Add the new files. * common/private-keys.c: New file. * common/private-keys.h: Likewise. * common/t-private-keys.c: Likewise. * common/util.h (alphap, alnump): New macros. * tests/migrations: Add test demonstrating that we can cope with the new format. -- GnuPG 2.3+ will use a new format to store private keys that is both more flexible and easier to read and edit by human beings. The new format stores name,value-pairs using the common mail and http header convention. This patch adds the parser and support code and prepares GnuPG 2.1 for the new format. Signed-off-by: Justus Winter <[email protected]>
* common: Add 'free_strlist_wipe' which wipes memory.Justus Winter2016-04-212-0/+16
| | | | | | | * common/strlist.c (free_strlist_wipe): New function. * common/strlist.h (free_strlist_wipe): New prototype. Signed-off-by: Justus Winter <[email protected]>
* common: Add 'append_to_strlist_try' which can fail.Justus Winter2016-04-212-0/+16
| | | | | | | | * common/strlist.c (append_to_strlist): Use the new function. (append_to_strlist_try): New function. * common/strlist.h (append_to_strlist_try): New prototype. Signed-off-by: Justus Winter <[email protected]>
* agent: Convert key format document to org.Justus Winter2016-04-211-47/+32
| | | | | | * agent/keyformat.txt: Convert to org mode. Signed-off-by: Justus Winter <[email protected]>
* tests: Make migration test more robust and silent.Justus Winter2016-04-211-8/+18
| | | | | | | * tests/migrations/from-classic.test: Fix in-tree build, silence test. Fixes-commit: defbc70b Signed-off-by: Justus Winter <[email protected]>
* w32: Use --enable-gpg2-is-gpg by default.Werner Koch2016-04-212-2/+2
| | | | | | * autogen.rc: Add option also for plain Windows. Signed-off-by: Werner Koch <[email protected]>
* w32: Replace libiconv DLL by iconv feature of libgpg-error.Werner Koch2016-04-214-16/+26
| | | | | | | | | | | * configure.ac: Do nor require libiconv for W32. * common/utf8conv.c [W32]: Do not incluce iconv.h. Request libgpg-error iconv macros. (jnlib_iconv): Use ICONV_CONST macro. * build-aux/speedo/w32/inst.nsi [!WITH_GUI]: Do not install libiconv. * build-aux/speedo.mk (speedo_spkgs) [!WITH_GUI]: Likewise. Signed-off-by: Werner Koch <[email protected]>
* agent: Sanitize permissions of the private key directory.Justus Winter2016-04-204-24/+69
| | | | | | | | | | | | | * agent/gpg-agent.c (create_private_keys_directory): Set permissions. * common/sysutils.c (modestr_to_mode): New function. (gnupg_mkdir): Use new function. (gnupg_chmod): New function. * common/sysutils.h (gnupg_chmod): New prototype. * tests/migrations/from-classic.test: Test migration with existing directory. GnuPG-bug-id: 2312 Signed-off-by: Justus Winter <[email protected]>
* tests: Test the migration from a classic GnuPG home directory.Justus Winter2016-04-207-1/+258
| | | | | | | | | | | | * configure.ac: Add new directory. * tests/Makefile.am (SUBDIRS): Likewise. * tests/migrations/Makefile.am: New file. * tests/migrations/from-classic.gpghome/pubring.gpg.asc: Likewise. * tests/migrations/from-classic.gpghome/secring.gpg.asc: Likewise. * tests/migrations/from-classic.gpghome/trustdb.gpg.asc: Likewise. * tests/migrations/from-classic.test: Likewise. Signed-off-by: Justus Winter <[email protected]>
* speedo: Use swdb.lst to define the SQLite version.Werner Koch2016-04-203-9/+32
| | | | | | | | | * build-aux/speedo.mk: Change sqlite to use our mirror and the swdb.lst file. * build-aux/speedo/w32/inst.nsi: gpg is now build and installed as gpg. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve UID selction of --quick-sign-key.Werner Koch2016-04-192-13/+60
| | | | | | | | * g10/keyedit.c (keyedit_quick_sign): Improve UID selection and print error for non-found userids. -- GnuPG-bug-id: 2315
* gpg: Avoid debug like output at start of --edit-key.Werner Koch2016-04-191-6/+12
| | | | | | | | * g10/keyedit.c (check_all_keysigs): Print info only after something has been modified. -- Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Fix https never reported in general helpAndre Heinecke2016-04-151-1/+7
| | | | | | | | * dirmngr/ks-engine-http.c (ks_hkp_help): Also print https when supported and no uri provided. -- Wrong reporting was pointed out by K_F, again.
* dirmngr: Fix https incorrectly reported in helpAndre Heinecke2016-04-151-0/+2
| | | | | | | | | * dirmngr/ks-engine-http.c (ks_hkp_help): Only print https if tls is supported. -- Wrong reporting was pointed out by K_F. Check is the same as in ks-engine-hkp.c
* po: Fix a string in de.po.Werner Koch2016-04-151-3/+2
| | | | | | | | | | -- With commit b3378b3a56fc90ba8ae38e6298b23a378305af32 from July 2014 we use strconcat instead of sprintf for the string and thus we need to remove one level of percent escaping. Signed-off-by: Werner Koch <[email protected]>
* agent: Fix regression due to recent commit 4159567.Werner Koch2016-04-141-2/+4
| | | | | | | | | | | | | | * agent/protect.c (do_encryption): Fix CBC hashing. -- The buggy code included an extra closing parenthesis before the (protected-at) term in the CBC hashing. We now do it by explicitly hashing the protected stuff and append the rest of the expression instead of a fixed closing parenthesis. Note that the OCB hashing only differs that it does no include the protected part. Fixes-commit: 4159567f7ed7a1139fdc3a6c92988e1648ad84ab Signed-off-by: Werner Koch <[email protected]>
* agent: Allow gpg-protect-tool to handle openpgp-native protection.Werner Koch2016-04-142-14/+97
| | | | | | | | | | | | | | | * agent/protect-tool.c (read_and_unprotect): Add arg ctrl and pass to agent_unprotect. (main): Allocate a simple CTRL object and pass it to read_and_unprotect. (convert_from_openpgp_native): Remove stub. (agent_key_available, agent_get_cache): New stubs. (agent_askpin): New emulation for the one in call-pinentry.c. (agent_write_private_key): New to dump key. * agent/Makefile.am (gpg_protect_tool_SOURCES): Add cvt-openpgp.c -- Signed-off-by: Werner Koch <[email protected]>
* tests: Set fake-pinentry's stdout and stdin to _IOLBF.Werner Koch2016-04-141-2/+19
| | | | | | | | * tests/openpgp/fake-pinentry.c (main): Call setvbuf. Show passphrase at startup. Increase buffer. -- Signed-off-by: Werner Koch <[email protected]>
* agent: Implement new protection mode openpgp-s2k3-ocb-aes.Werner Koch2016-04-129-138/+374
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/protect.c (agent_protect): Add arg use_ocb. Change all caller to pass -1 for default. * agent/protect-tool.c: New option --debug-use-ocb. (oDebugUseOCB): New. (opt_debug_use_ocb): New. (main): Set option. (read_and_protect): Implement option. * agent/protect.c (OCB_MODE_SUPPORTED): New macro. (PROT_DEFAULT_TO_OCB): New macro. (do_encryption): Add args use_ocb, hashbegin, hashlen, timestamp_exp, and timestamp_exp_len. Implement OCB. (agent_protect): Change to support OCB. (do_decryption): Add new args is_ocb, aadhole_begin, and aadhole_len. Implement OCB. (merge_lists): Allow NULL for sha1hash. (agent_unprotect): Change to support OCB. (agent_private_key_type): Remove debug output. -- Instead of using the old OpenPGP way of appending a hash of the plaintext and encrypt that along with the plaintext, the new scheme uses a proper authenticated encryption mode. See keyformat.txt for a description. Libgcrypt 1.7 is required. This mode is not yet enabled because there would be no way to return to an older GnuPG version. To test the new scheme use gpg-protect-tool: ./gpg-protect-tool -av -P abc -p --debug-use-ocb <plain.key >prot.key ./gpg-protect-tool -av -P abc -u <prot.key Any key from the private key storage should work. Signed-off-by: Werner Koch <[email protected]>
* doc: Note that the persistant passphrase format is unimplemented.Werner Koch2016-04-122-1/+3
| | | | --
* indent: Help Emacs not to get confused by conditional compilation.Werner Koch2016-04-122-1/+4
| | | | | | | | * agent/protect.c (calibrate_get_time) [W32]: Use separate function calls for W32 and W32CE. -- Signed-off-by: Werner Koch <[email protected]>
* doc: Point to RFC-4880 for keyedit subcommand "tsign".Werner Koch2016-04-121-1/+2
| | | | | | -- GnuPG-bug-id: 2283
* g10: Fix exporting secret keys of certain sizes.Justus Winter2016-04-071-1/+1
| | | | | | | | | | | | | * g10/build-packet.c (do_key): Do not use the header length specified by the public key packet from the keyring, but let 'write_header2' compute the required length. -- Specifically exporting RSA keys of length 1024 failed, as the encoded public key packet requires 141 bytes a length that fits into one byte, but the secret key is significantly larger, making the export fail. GnuPG-bug-id: 2307 Signed-off-by: Justus Winter <[email protected]>
* g10: Fix typo.Justus Winter2016-04-071-1/+1
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* doc: Update help.ru.txtIneiev2016-04-061-107/+226
| | | | --
* Revert "g10: Support armored keyrings in gpgv."Justus Winter2016-04-066-137/+10
| | | | This reverts commit abb352de51bc964c06007fce43ed6f6caea87c15.
* dirmngr: Autodetect PEM format in dirmngr-client.Justus Winter2016-04-051-13/+30
| | | | | | | | | | | * dirmngr/dirmngr-client.c (init_asctobin): New function. (main): Move the initialization code to the new function. (read_pem_certificate): Initialize base64 table. (read_certificate): Try to decode certificates given in files as PEM first. GnuPG-bug-id: 1844 Signed-off-by: Justus Winter <[email protected]>
* build: Fix for: Build gpgcompose only in maintainer modeWerner Koch2016-04-051-1/+2
| | | | | | | * g10/Makefile.am (noinst_PROGRAMS): Always add module_tests. -- Fixes-commit: 4b5341d
* doc: Install gpg and gpgv man pages under the correct name.Werner Koch2016-04-054-31/+81
| | | | | | | | | | | | * doc/mkdefsinc.c (main): Add double include guard. Set variable gpgtwohack. Define macros gpgname and gpgvname. * doc/gpg.texi: Remove macro definition for gpgname. Use Texinfo var gpgtwohack to prepare the man pages. Use @gpgname everywhere. * doc/gpgv.texi: Likewise. * doc/Makefile.am (myman_pages): Remove gpg2.1 and gpgv2.1 but add them depending on USE_GPG2_HACK. Signed-off-by: Werner Koch <[email protected]>
* build: Build gpgcompose only in maintainer modeWerner Koch2016-04-052-1/+3
| | | | | | | * g10/Makefile.am (noinst_PROGRAMS): Add gpgcompose only in maintainer mode. Signed-off-by: Werner Koch <[email protected]>
* gpg: Replace use of "gpg2" by GPG_NAMEWerner Koch2016-04-053-15/+16
| | | | Signed-off-by: Werner Koch <[email protected]>
* Now build "gpg" binary but install as "gpg2"Werner Koch2016-04-0410-31/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (USE_GPG2_HACK): New ac_define am_conditional. * common/homedir.c (gnupg_module_name): Replace use of macro NAME_OF_INSTALLED_GPG. * g10/keygen.c (generate_keypair): Ditto. * g10/Makefile.am (bin_PROGRAMS): Remove. (noinst_PROGRAMS): Add gpg or gpg2 and gpgv or gpg2. (gpg2_hack_list): New. (use_gpg2_hack): New. (gpg2_SOURCES): Rename to gpg_SOURCES. (gpgv2_SOURCES): Rename to gpgv_SOURCES. (gpg2_LDADD): Rename to gpg_LDADD. (gpgv2_LDADD): Rename to gpgv_LDADD. (gpg2_LDFLAGS): Rename to gpg_LDFLAGS. (gpgv2_LDFLAGS): Rename to gpgv2_LDFLAGS. (install-exec-hook): Remove WinCE specific rules and add new rules. (uninstall-local): Uninstall gpg/gpg2 and gpgv/gpgv2. * tests/openpgp/Makefile.am (required_pgms): s/gpg2/gpg/. * tests/openpgp/defs.inc: Ditto. * tests/openpgp/gpgtar.test: Ditto. * tests/openpgp/mkdemodirs: Ditto. * tests/openpgp/signdemokey: Ditto. * Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Remove obsolete --enable-mailto, add --enable-gpg2-is-gpg. -- Although we need to duplicate some automake generated code this method allows to easily switch the name of the installed target using the configure option "--enable-gpg2-is-gpg". Signed-off-by: Werner Koch <[email protected]>
* tests: Add missing file.Werner Koch2016-04-041-0/+1
| | | | | | | * tests/openpgp/Makefile.am (TEST_FILES): Add plain-largeo.asc. -- Fixes-commit: 785a7f463ec4e937304ce1263c5e6a46e8079137
* g10: Support armored keyrings in gpgv.Justus Winter2016-04-046-10/+137
| | | | | | | | | | | | | * doc/gpgv.texi: Document the feature. * g10/Makefile.am (gpgv2_SOURCES): Add dearmor.c. * g10/dearmor.c (dearmor_file): Add sink argument. * g10/gpg.c (main): Adapt accordingly. * g10/gpgv.c (make_temp_dir): New function. (main): De-armor keyrings. * g10/main.h (dearmor_file): Adapt prototype. GnuPG-bug-id: 2290 Signed-off-by: Justus Winter <[email protected]>
* tests: Fix default key test.Justus Winter2016-04-041-2/+2
| | | | | | | * tests/openpgp/default-key.test: Avoid using the option '--trust-model' unconditionally. Signed-off-by: Justus Winter <[email protected]>
* po: Fix misleading german translation.Justus Winter2016-04-011-2/+1
| | | | | | -- GnuPG-bug-id: 2239 Signed-off-by: Justus Winter <[email protected]>
* build: Check for conflicting trust model options.Justus Winter2016-04-011-1/+4
| | | | | | | * configure.ac: Disable TOFU if configured without trust models, and check for conflicting options. Signed-off-by: Justus Winter <[email protected]>
* g10: Remove option --always-trust if compiled without trust models.Justus Winter2016-04-011-0/+2
| | | | | | | * g10/gpg.c (opts): Remove option --always-trust if compiled without trust models. Signed-off-by: Justus Winter <[email protected]>
* speedo,w32: Build libsqlite3.Justus Winter2016-03-311-1/+3
| | | | | | | | * build-aux/speedo.mk (speedo_spkgs): Add libsqlite3 on w32. (libsqlite3_ver): New variable. (speedo_pkg_libsqlite3_tar): Likewise. Signed-off-by: Justus Winter <[email protected]>
* g10: Use gpg-error abstraction of sched_yield.Justus Winter2016-03-311-2/+1
| | | | | | * g10/tofu.c (begin_transaction): Use 'gpgrt_yield'. Signed-off-by: Justus Winter <[email protected]>
* gpg: Fix NULL-segv for missing tofu DB.Werner Koch2016-03-291-1/+2
| | | | | | | | | | | * g10/tofu.c (opendb): Guard call to timeout function. -- GnuPG-bug-id: 2294 Fix not tested but is pretty obvious. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve message when asking for key capabilities.Werner Koch2016-03-221-5/+7
| | | | | | | | | | | | * g10/keygen.c (ask_key_flags): Improve message. -- Because the curve is only selected after the capabilities are queried we do not know whether ECDSA or EdDSA will eventually be used. When printing the possible capabilities we now use print "ECDSA/EdDSA" for the algorithm. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove the extra prompt for Curve25519.Werner Koch2016-03-221-34/+30
| | | | | | | | | | | | | | * g10/keygen.c (MY_USE_ECDSADH): New macro local to ask_curve. (ask_curve): Use a fixed table of curve names and reserve a slot for Curve448. Simplify CurveNNNN/EdNNNN switching. (ask_curve): Remove the Curve25519 is non-standard prompt. -- Given that ECC generation is only available in export mode and that gpg will in any case support our current ed2559/cv25519 definition the extra prompt does not make anymore sense. Signed-off-by: Werner Koch <[email protected]>
* gpg: Silence trustdb computation with --quiet.Werner Koch2016-03-191-8/+11
| | | | | | | * g10/trustdb.c (validate_keys): Do not print log_info stuff in quiet mode. Signed-off-by: Werner Koch <[email protected]>
* sm: Always create a keybox header when creating a new keybox.Werner Koch2016-03-171-0/+12
| | | | | | | | | | | | | * sm/keydb.c (maybe_create_keybox): Create the header blob. -- This is required so that g10/keydb.c can properly detect that a keybox file is actually there. Just writing a 0 zero length keybox file is not sufficient because a file with that name may also be an old-style OpenPGP keyring. GnuPG-bug-id: 2275 Signed-off-by: Werner Koch <[email protected]>
* doc: Improve documentation of --enable-large-rsa.Neal H. Walfield2016-03-171-4/+6
| | | | | | | | * doc/gpg.texi (--enable-large-rsa): Improve text. -- Signed-off-by: Neal H. Walfield <[email protected]> Suggested-by: Bernhard Reiter <[email protected]>
* agent: allow removal of the shadowed key.NIIBE Yutaka2016-03-161-1/+1
| | | | | | | | * agent/findkey.c (agent_delete_key): Remove the key when asked. -- Signed-off-by: NIIBE Yutaka <[email protected]>