aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* common: Print https URLs in help messages.Werner Koch2016-05-031-4/+4
| | | | | | * common/argparse.c (strusage): Print https URLS. Signed-off-by: Werner Koch <[email protected]>
* tests: Silence output of some tests.Werner Koch2016-05-037-18/+40
| | | | | | | | | | | | | | * common/t-exechelp.c (print_open_fds): Silence non-verbose output. (test_close_all_fds): Ditto. * common/t-session-env.c (show_stdnames): Indent output. * g10/test.c (TEST): Silence non-verbose okay output. (exit_tests): Ditto. * tools/gpg-zip.in (tar_verbose_opt): Add option --quiet. * tests/openpgp/gpgtar.test (GPGZIP): Pass option --quiet. * tests/openpgp/mds.test: Indent MD5 notice. * tests/openpgp/version.test: Indent --version output. Signed-off-by: Werner Koch <[email protected]>
* gpg: Emit status lines TOFU_STATS and TOFU_STATS_LONG.Werner Koch2016-05-032-8/+105
| | | | | | | | | * g10/tofu.c (NO_WARNING_THRESHOLD): Rename to BASIC_TRUST_THRESHOLD. (FULL_TRUST_THRESHOLD): New. (write_stats_status): New. (show_statistics): Call new function. Print TOFU_STATS_LONG. Signed-off-by: Werner Koch <[email protected]>
* gpg: Extend TRUST_foo status lines with the trust model.Werner Koch2016-05-024-24/+58
| | | | | | | | | | | * g10/trustdb.h (TRUST_FLAG_TOFU_BASED): New. * g10/trustdb.c (trust_model_string): Lowercase the strings. Add arg "model" and change callers to call with OPT.TRUST_MODEL. * g10/tofu.c (tofu_wot_trust_combine): Set TRUST_FLAG_TOFU_BASED. * g10/pkclist.c (write_trust_status): New. (check_signatures_trust): Call new function. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve line wrapping for a tofu message.Werner Koch2016-05-021-8/+14
| | | | | | | * g10/tofu.c (time_ago_str): Mark non-breakable spaces. (show_statistics): Remove marks. Signed-off-by: Werner Koch <[email protected]>
* gpg: Re-format some tofu messages.Werner Koch2016-05-022-107/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/status.h (STATUS_TOFU_USER, STATUS_TOFU_STATS) (STATUS_TOFU_STATS_SHORT, STATUS_TOFU_STATS_LONG): New. * g10/tofu.c (NO_WARNING_THRESHOLD): New. (record_binding, tofu_register): Take care of --dry-run. (show_statistics): Print STATUS_TOFU_USER. Reformat some messages. Fix the ngettext/strcmp thing. Use log_string instead of log_info. Use NO_WARNING_THRESHOLD constant. (get_trust): Use format_text and print a compact fingerprint. -- The use of log_string makes long messages better readable; instead of gpg: Warning: if you think you've seen more[...] key, then this key might be a forgery! Car[...] address for small variations. If the key i[...] we now have gpg: Warning: if you think you've seen more[...] key, then this key might be a forgery![...] address for small variations. If the [...] We also put the key information after the message and not between the user id and the last used info like here: gpg: Verified 7 messages signed by "Werner Koch <[email protected]>" in the past 4 days, 16 hours. The most recent message was verified 3 days, 13 hours ago. (key: 8061 5870 F5BA D690 3336 [...] 1E42 B367, policy: auto) This also makes the key info a separate translatable string. Further a compact version of the fingerprint (hex w/o spaces) is printed in some messages. Signed-off-by: Werner Koch <[email protected]>
* doc: Add a comment about the goals of the agent.Werner Koch2016-05-021-0/+26
| | | | --
* scd: More fix of error return path.NIIBE Yutaka2016-05-021-2/+2
| | | | | | | | | | * scd/command.c (open_card): Return GPG_ERR_ENODEV on the failure of apdu_connect. -- GnuPG-bug-id: 2306 Signed-off-by: NIIBE Yutaka <[email protected]>
* common: Extend log_string to indent lines.Werner Koch2016-04-291-3/+18
| | | | | | | * common/logging.c (do_logv): Add indentation when called via log_string. Signed-off-by: Werner Koch <[email protected]>
* gpg: Factor some code code out of tofu.cWerner Koch2016-04-291-82/+82
| | | | | | | | | | | | | | | | * g10/tofu.c (string_to_long): New. (string_to_ulong): New. (get_single_unsigned_long_cb): Replace strtol/strtoul by new function. (get_single_long_cb): Ditto. (signature_stats_collect_cb): Ditto. (get_policy): Ditto. (show_statistics): Ditto. Uese es_free instead of free. -- There is one minor semantic change: We now accept "nnn.0" always. The old code did not checked for ".0: in show_statistics. Signed-off-by: Werner Koch <[email protected]>
* doc: Fix name of gpg's option --tofu-policyWerner Koch2016-04-291-2/+2
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove all assert.h and s/assert/log_assert/.Werner Koch2016-04-2952-285/+232
| | | | Signed-off-by: Werner Koch <[email protected]>
* common: Improve log_assert.Werner Koch2016-04-292-15/+39
| | | | | | | | | * common/logging.c (bug_at): Do not i18n the string. (_log_assert): New. * common/logging.h (log_assert): Use new function and pass line information. Signed-off-by: Werner Koch <[email protected]>
* scd: Fix error return path.NIIBE Yutaka2016-04-281-3/+4
| | | | | | | | | | * scd/ccid-driver.c (bulk_in): Remove EAGAIN handling. Handle LIBUSB_ERROR_NO_DEVICE to return CCID_DRIVER_ERR_NO_READER. -- GnuPG-bug-id: 2306 Signed-off-by: NIIBE Yutaka <[email protected]>
* scd: Fix memory leaks.NIIBE Yutaka2016-04-271-1/+10
| | | | | | | | | | * scd/ccid-driver.c (scan_or_find_usb_device): Return on LIBUSB_ERROR_NO_MEM. Free CONFIG before return except on error. (scan_or_find_devices): Free device list. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Add experimental AKL method "wkd" and option --with-wkd-hash.Werner Koch2016-04-2712-22/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/getkey.c (parse_auto_key_locate): Add method "wkd". (get_pubkey_byname): Implement that method. Also rename a variable. * g10/call-dirmngr.c (gpg_dirmngr_wkd_get): New. * g10/keyserver.c (keyserver_import_wkd): New. * g10/test-stubs.c (keyserver_import_wkd): Add stub. * g10/gpgv.c (keyserver_import_wkd): Ditto. * g10/options.h (opt): Add field 'with_wkd_hash'. (AKL_WKD): New. * g10/gpg.c (oWithWKDHash): New. (opts): Add option --with-wkd-hash. (main): Set that option. * g10/keylist.c (list_keyblock_print): Implement that option. -- The Web Key Directory is an experimental feature to retrieve a key via https. It is similar to OpenPGP DANE but also uses an encryption to reveal less information about a key lookup. For example the URI to lookup the key for [email protected] is: https://example.org/.well-known/openpgpkey/ hu/example.org/iy9q119eutrkn8s1mk4r39qejnbu3n5q (line has been wrapped for rendering purposes). The hash is a z-Base-32 encoded SHA-1 hash of the mail address' local-part. The address [email protected] can be used for testing. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add experimental command WKD_GET.Werner Koch2016-04-271-4/+74
| | | | | | | * dirmngr/server.c (cmd_wkd_get): New. (register_commands): Add command WKD_GET. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Use system provided root CAs with KS_FETCH.Werner Koch2016-04-272-2/+5
| | | | | | * dirmngr/ks-engine-http.c (ks_http_fetch): Use HTTP_FLAG_TRUST_SYS. Signed-off-by: Werner Koch <[email protected]>
* http: Allow to request system defined CAs for TLS.Werner Koch2016-04-265-14/+41
| | | | | | | | | | | | * dirmngr/http.h (HTTP_FLAG_TRUST_DEF, HTTP_FLAG_TRUST_SYS): New. * dirmngr/http.c (http_session_new): Add arg "flags". * dirmngr/ks-engine-hkp.c (send_request): Use new flag HTTP_FLAG_TRUST_DEF for the new arg of http_session_new. * dirmngr/ks-engine-http.c (ks_http_fetch): Ditto. * dirmngr/t-http.c (main): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Add OpenPGP card vendor 0x2342.Werner Koch2016-04-261-1/+1
| | | | --
* common: Minor fixes for the new private-keys.c.Werner Koch2016-04-251-31/+41
| | | | | | | | | | | | | | | | | | | | | | | * common/private-keys.c (my_error_from_syserror): New. Use it in place of gpg_error_from_syserror. (_pkc_add, pkc_lookup, pke_next_value): Use ascii_strcasecmp. (pkc_parse): Use xtrystrdup and append_to_strlist_try as intended. (_pkc_add): Add braces around if-statement. -- We should have a macro so that we do not need to define a wrapper function like my_error_from_syserror in files where it is needed. I am not sure about a proper name, "my_" seems to be the easiest replacement. Note that the global DEFAULT_ERRSOURCE is relatively new to replace the need to convey the error source in function calls; we want that function from common/ return the error source of the main binary. We require that a key is ASCII and thus we better use ascii_strcasecmp to avoid problems with strange locales. Signed-off-by: Werner Koch <[email protected]>
* 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.