aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add script to build a CD with the test environment.justus/scm-9Justus Winter2016-04-212-0/+57
| | | | | | | | | | * tests/make-windows-cd.sh: New file. * tests/run-tests.bat: Likewise. -- This makes it easy to deploy GnuPG with the test suite to a virtual machine for testing. Signed-off-by: Justus Winter <[email protected]>
* tests/openpgp: Reimplement tests in Scheme.Justus Winter2016-04-2140-18/+2879
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am: Build the test infrastructure on Windows. * tests/openpgp/Makefile.am (required_pgms): Add gpgscm. (TESTS_ENVIRONMENT): Make sure gpgscm and the libraries are found. (TESTS): Replace tests with the new Scheme implementations. * tests/openpgp/4gb-packet.scm: New file. * tests/openpgp/README: Likewise. * tests/openpgp/armdetach.scm: Likewise. * tests/openpgp/armdetachm.scm: Likewise. * tests/openpgp/armencrypt.scm: Likewise. * tests/openpgp/armencryptp.scm: Likewise. * tests/openpgp/armor.scm: Likewise. * tests/openpgp/armsignencrypt.scm: Likewise. * tests/openpgp/armsigs.scm: Likewise. * tests/openpgp/clearsig.scm: Likewise. * tests/openpgp/conventional-mdc.scm: Likewise. * tests/openpgp/conventional.scm: Likewise. * tests/openpgp/decrypt-dsa.scm: Likewise. * tests/openpgp/decrypt.scm: Likewise. * tests/openpgp/default-key.scm: Likewise. * tests/openpgp/defs.scm: Likewise. * tests/openpgp/detach.scm: Likewise. * tests/openpgp/detachm.scm: Likewise. * tests/openpgp/ecc.scm: Likewise. * tests/openpgp/encrypt-dsa.scm: Likewise. * tests/openpgp/encrypt.scm: Likewise. * tests/openpgp/encryptp.scm: Likewise. * tests/openpgp/finish.scm: Likewise. * tests/openpgp/genkey1024.scm: Likewise. * tests/openpgp/gpgtar.scm: Likewise. * tests/openpgp/import.scm: Likewise. * tests/openpgp/mds.scm: Likewise. * tests/openpgp/multisig.scm: Likewise. * tests/openpgp/run-tests.scm: Likewise. * tests/openpgp/seat.scm: Likewise. * tests/openpgp/setup.scm: Likewise. * tests/openpgp/signencrypt-dsa.scm: Likewise. * tests/openpgp/signencrypt.scm: Likewise. * tests/openpgp/sigs-dsa.scm: Likewise. * tests/openpgp/sigs.scm: Likewise. * tests/openpgp/use-exact-key.scm: Likewise. * tests/openpgp/verify.scm: Likewise. * tests/openpgp/version.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Add a TinySCHEME-based test driver.Justus Winter2016-04-2115-1/+2531
| | | | | | | | | | | | | | | | | | | | * configure.ac: Add new component. * tests/Makefile.am: Likewise. * tests/gpgscm/Makefile.am: New file. * tests/gpgscm/ffi-private.h: Likewise. * tests/gpgscm/ffi.c: Likewise. * tests/gpgscm/ffi.h: Likewise. * tests/gpgscm/ffi.scm: Likewise. * tests/gpgscm/lib.scm: Likewise. * tests/gpgscm/main.c: Likewise. * tests/gpgscm/private.h: Likewise. * tests/gpgscm/repl.scm: Likewise. * tests/gpgscm/scheme-config.h: Likewise. * tests/gpgscm/t-child.c: Likewise. * tests/gpgscm/t-child.scm: Likewise. * tests/gpgscm/tests.scm: Likewise. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Foreign objects support for TinySCHEME.Justus Winter2016-04-213-1/+45
| | | | | | | | | | | | | | | | | | | | | * tests/gpgscm/scheme-private.h (struct cell): Add 'foreign_object'. (is_foreign_object): New prototype. (get_foreign_object_{vtable,data}): Likewise. * tests/gpgscm/scheme.c (enum scheme_types): New type. (is_foreign_object): New function. (get_foreign_object_{vtable,data}): Likewise. (mk_foreign_object): Likewise. (finalize_cell): Free foreign objects. (atom2str): Pretty-print foreign objects. (vtbl): Add new functions. * tests/gpgscm/scheme.h (struct foreign_object_vtable): New type. (mk_foreign_object): New prototype. (struct scheme_interface): Add new functions. Patch from Thomas Munro, https://sourceforge.net/p/tinyscheme/patches/13/ Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Dynamically allocate string buffer.Justus Winter2016-04-212-4/+34
| | | | | | | | | | | | | | * tests/gpgscm/scheme-config.h (strbuff{,_size}): Make buffer dynamic. * tests/gpgscm/scheme.c (expand_strbuff): New function. (putcharacter): Adapt length test. (readstrexp): Expand buffer if necessary. (scheme_init_custom_alloc): Initialize buffer. (scheme_deinit): Free buffer. Patch from Thomas Munro, https://sourceforge.net/p/tinyscheme/patches/11/ Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Make exception value available.Justus Winter2016-04-211-4/+5
| | | | | * tests/gpgscm/init.scm (throw): Hand exception value to the handler. (catch): And bind it to *error*.
* tests/gpgscm: Add package macro.Justus Winter2016-04-211-0/+5
| | | | | | * tests/gpgscm/init.scm: Add package macro from manual. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Expose function to open streams as Scheme ports.Justus Winter2016-04-212-1/+3
| | | | | | | | * tests/gpgscm/scheme.c (vtbl): Add 'port_from_file' to the vtable. * tests/gpgscm/scheme.h (struct scheme_interface): New field 'mk_port_from_file'. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Nicer error message.Justus Winter2016-04-211-1/+1
| | | | | | | * tests/gpgscm/scheme.c (opexe_0): Include the value that we tried to evaluate as function-like in the error message. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Fix error hook.Justus Winter2016-04-211-1/+2
| | | | | | | * tests/gpgscm/init.scm (*error-hook*): Fix error hook so that the whole error message is displayed. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Handle unhandled enumeration values.Justus Winter2016-04-211-0/+6
| | | | | | | * tests/gpgscm/scheme.c (opexe_{3,4}): Handle unhandled enumeration values in the opcode dispatching code. Signed-off-by: Justus Winter <[email protected]>
* tests/gpgscm: Verbatim import of latest TinySCHEME.Justus Winter2016-04-217-0/+6913
| | | | | | | | | | | * tests/gpgscm/COPYING: New file. * tests/gpgscm/init.scm: Likewise. * tests/gpgscm/opdefines.h: Likewise. * tests/gpgscm/scheme-private.h: Likewise. * tests/gpgscm/scheme.c: Likewise. * tests/gpgscm/scheme.h: Likewise. Signed-off-by: Justus Winter <[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]>