aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Use the matching key if the search description is exact.Neal H. Walfield2015-12-0211-8/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/gpg.c (check_user_ids): If the search description is for an exact match (a keyid or fingerprint that ends in '!'), then use the matching key, not the primary key. * tests/openpgp/Makefile.am (TESTS): Add use-exact-key.test. (priv_keys): Add privkeys/00FE67F28A52A8AA08FFAED20AF832DA916D1985.asc, privkeys/1DF48228FEFF3EC2481B106E0ACA8C465C662CC5.asc, privkeys/A2832820DC9F40751BDCD375BB0945BA33EC6B4C.asc, privkeys/ADE710D74409777B7729A7653373D820F67892E0.asc and privkeys/CEFC51AF91F68A2904FBFF62C4F075A4785B803F.asc. (sample_keys): Add samplekeys/E657FB607BB4F21C90BB6651BC067AF28BC90111.asc. * tests/openpgp/privkeys/00FE67F28A52A8AA08FFAED20AF832DA916D1985.asc: New file. * tests/openpgp/privkeys/1DF48228FEFF3EC2481B106E0ACA8C465C662CC5.asc: New file. * tests/openpgp/privkeys/A2832820DC9F40751BDCD375BB0945BA33EC6B4C.asc: New file. * tests/openpgp/privkeys/ADE710D74409777B7729A7653373D820F67892E0.asc: New file. * tests/openpgp/privkeys/CEFC51AF91F68A2904FBFF62C4F075A4785B803F.asc: New file. * tests/openpgp/samplekeys/E657FB607BB4F21C90BB6651BC067AF28BC90111.asc: New file. * tests/openpgp/use-exact-key.test: New file. * tests/openpgp/version.test: Install the new private keys. -- Signed-off-by: Neal H. Walfield <[email protected]> Reported-by: Reported-by: Kristian Fiskerstrand <[email protected]> Fixes-commit: 10cca02
* build: Require at least Libassuan 2.4.1.Werner Koch2015-12-025-65/+2
| | | | | | | | | | | | | | | * configure.ac (NEED_LIBASSUAN_VERSION): Set to 2.4.1. * agent/gpg-agent.c (create_server_socket): Remove check for libassuan >= 2.3.0 and >= 2.1.4. (main): Remove check for libassuan >= 2.1.4. * scd/scdaemon.c (create_server_socket): Remove check for libassuan >= 2.1.4. * dirmngr/dirmngr.c (set_tor_mode): Remove check for libassuan >= 2.3.0. * dirmngr/http.c (http_raw_connect, send_request): Remove checks for libassuan >= 2.3.0. Signed-off-by: Werner Koch <[email protected]>
* gpg: Improve documentation.Neal H. Walfield2015-12-021-2/+1
| | | | | | | * g10/tofu.c (initdb): Improve documentation. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Fix type mismatch resulting in a buffer overflow.Neal H. Walfield2015-12-021-1/+4
| | | | | | | | | | | * g10/tofu.c (record_binding): Change policy_old's type from an enum tofu_policy to a long: this variable is passed by reference and a long is expected. -- Signed-off-by: Neal H. Walfield <[email protected]> Reported-by: Justus Winter <[email protected]> Fixes-commit: f77913e
* dirmngr: Switch to an onion address if Tor is running.Werner Koch2015-12-025-31/+132
| | | | | | | | | | | | | | | | | | | | | | | | * dirmngr/dirmngr.h (opt): Turn field 'keyserver' into an strlist. * dirmngr/dirmngr.c (parse_rereadable_options): Allow multiple --keyserver options. * dirmngr/server.c (server_local_s): Add field 'tor_state'. (release_uri_item_list): New. (release_ctrl_keyservers): Use it. (start_command_handler): Release list of keyservers. (is_tor_running): New. (cmd_getinfo): Re-implement "tor" subcommand using new fucntion. (ensure_keyserver): Rewrite. * g10/dirmngr-conf.skel: Add two keyserver options. -- This feature is independent of --use-tor and automagically uses Tor if available. The dirmngr.conf file needs to specify two keyservers to make this work. For new installations this is done using the skeleton file. This feature requires the Libassuan 2.4.2 to work. This patch also fixes a memory leak of opt.keyserver en passant. Signed-off-by: Werner Koch <[email protected]>
* http: Enhance parser to detect .onion addresses.Werner Koch2015-12-023-33/+45
| | | | | | | | * dirmngr/http.h (parsed_uri_s): Add flag 'onion'. * dirmngr/http.c (do_parse_uri): Set that flag. * dirmngr/t-http.c (main): Print flags. Signed-off-by: Werner Koch <[email protected]>
* common,gpg: Fix processing of search descriptions ending in '!'.Neal H. Walfield2015-12-022-5/+25
| | | | | | | | | | | | | | | * g10/gpg.c (check_user_ids): If the search description describes a keyid or fingerprint and ends in a '!', include the '!' in the rewritten description. * common/userids.c (classify_user_id): Accept keyids and fingerprints ending in '!'. -- Signed-off-by: Neal H. Walfield <[email protected]> Reported-by: Kristian Fiskerstrand <[email protected]> Fixes-commit: f99830b7 Fixes-commit: e8c53fca
* dirmngr: Improve error handling.Justus Winter2015-12-011-3/+2
| | | | | | | | | | * dirmngr/dns-stuff.c (getsrv): Avoid looking at 'header' before checking for errors, but silently ignore errors when looking up SRV records. -- This is a follow-up to 946faaff. Signed-off-by: Justus Winter <[email protected]>
* Update NEWS fileWerner Koch2015-12-011-0/+54
| | | | --
* build: Let configure show the the status of Tor supportWerner Koch2015-12-011-1/+26
| | | | | | * configure.ac (show_tor_support): New Signed-off-by: Werner Koch <[email protected]>
* doc: Clarify dirmngr's --keyserver option.Werner Koch2015-11-301-2/+2
| | | | | -- GnuPG-bug-id: 2165
* doc: Typo fix.Werner Koch2015-11-301-1/+1
| | | | --
* doc: Make make distcheck work again.Werner Koch2015-11-301-1/+1
| | | | | | * doc/Makefile.am (DISTCLEANFILES): Add gpgkey2ssh.1 Signed-off-by: Werner Koch <[email protected]>
* yat2m: Add keyword @url.Werner Koch2015-11-301-0/+1
| | | | | | * doc/yat2m.c (proc_texi_cmd): Add keyword @url. Signed-off-by: Werner Koch <[email protected]>
* doc: Build man pages with the same date as the info files.Werner Koch2015-11-301-0/+2
| | | | | | | | | * doc/Makefile.am (yat2m-stamp): Use option --date. -- This changes allows reproducible builds. Debian-bug-id: 806494
* yat2m: New option --date.Werner Koch2015-11-301-3/+18
| | | | | | * doc/yat2m.c (opt_date): new. (isodatestring): Use it if set. (main): New option --date.
* gpg: Avoid extra translation strings.Werner Koch2015-11-271-16/+4
| | | | | | | | | | | | | | | | | | | | | | * g10/keyedit.c (menu_expire): Use only one prompt. -- The old code was anyway not fully i18n because it did not used ngettext. Further we ran into const char*/char* conflicts on Windows where we use a different gettext implementation. FWIW: A better pattern in the case of a static and a malloced string w/o error return on malloc failure would be: const char *s; char *s_buf; s_buf = xtryasprintf ("%d foo", n); if (!s_buf) s = "several foo"; else s = s_buf; bar (s); xfree (s_buf);
* kbx: Include gpg-error prior to mischelp.h.Werner Koch2015-11-271-1/+1
| | | | | | | | | * kbx/keybox-init.c: Change order of includes. -- This is to avoid redefintion warnings about GPGRT_ATTR_PRINTF. Signed-off-by: Werner Koch <[email protected]>
* gpg,w32: Fix a format string error.Werner Koch2015-11-271-2/+2
| | | | | | * g10/keyring.c (keyring_search): Fix format string for off_t. Signed-off-by: Werner Koch <[email protected]>
* Silence compiler warnings related to not using assuan_fd_t.Werner Koch2015-11-272-4/+4
| | | | | | | | | | | | * common/call-gpg.c (start_gpg): Use assuan_fd_t. Note that the declaration was already fixed by a previous change. * dirmngr/server.c (cmd_getinfo): Use assuan_fd_t. -- Note that this matters only for Windows and it does not harm as long as we can only build for 32 bit Windows withsizeof(int)==sizeof(void*). Signed-off-by: Werner Koch <[email protected]>
* Silence unused variable or parameter warnings.Werner Koch2015-11-276-10/+23
| | | | --
* Avoid incompatible pointer assignment warnings on Windows.Werner Koch2015-11-275-20/+21
| | | | | | | | | | | | | | * common/logging.c (fun_writer): Use gpgrt_ssize_t instead of ssize_t. * dirmngr/server.c (data_line_cookie_write): Ditto. * sm/certdump.c (format_name_writer): Ditto. * sm/server.c (data_line_cookie_write): Ditto. * dirmngr/http.c (cookie_read, cookie_write): Ditto. -- See the release notes of libgpg-error 1.15 for background info on gpgrt_ssize_t. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Avoid a declarations after statements.Werner Koch2015-11-271-29/+33
| | | | | | | * tools/gpgtar.c (parse_arguments): Use a block for a local varibale definition. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Avoid casting away a const from an char**.Werner Koch2015-11-271-13/+38
| | | | | | | * dirmngr/ldap.c (start_cert_fetch_ldap): Do not use pointers from global variables. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Allow testing for a running Tor via "getinfo tor".Werner Koch2015-11-271-2/+19
| | | | | | | * dirmngr/server.c (cmd_getinfo): Print an S line if Tor is not running. Signed-off-by: Werner Koch <[email protected]>
* g13: Fix commit 1a045b13.Werner Koch2015-11-261-4/+4
| | | | | | * g13/g13.c (main): Use existsing function. Signed-off-by: Werner Koch <[email protected]>
* common: Fix off-by-one access in the new format_text.Werner Koch2015-11-262-7/+9
| | | | | | | * common/stringhelp.c (format_text): Use existsing fucntion to trim trailing spaces. Fix off-by-one access. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Improve output of "getinfo tor".Werner Koch2015-11-261-1/+7
| | | | | | * dirmngr/server.c (cmd_getinfo): Print a message along with OK. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Let Libassuan employ nPth wrappers for connect.Werner Koch2015-11-261-9/+0
| | | | | | | | | | | | * dirmngr/http.c (my_unprotect, my_protect): Remove. (connect_server): Do not use these wrappers. -- Since Libassuan version 2.4.2 the macro ASSUAN_SYSTEM_NPTH_IMPL protects the low-level connect calls with npth_unprotect and npth_protect. This is better than the high-level kludge we used here. Signed-off-by: Werner Koch <[email protected]>
* tools/gpgtar: Add '--dry-run'.Justus Winter2015-11-263-2/+14
| | | | | | | | | | | * tools/gpgtar-extract.c (extract_{regular,directory}): Honor '--dry-run'. * tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add '--dry-run'. (parse_arguments): Handle '--dry-run'. * tools/gpgtar.h (opt): Add field 'dry_run'. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Handle '--gpg-args'.Justus Winter2015-11-266-7/+30
| | | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Use given arguments. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add 'gpg-args'. (parse_arguments): Handle arguments. * tools/gpgtar.h (opt): Add field 'gpg_arguments'. * tests/openpgp/gpgtar.test: Simplify accordingly. Signed-off-by: Justus Winter <[email protected]>
* common: Make the GPG arguments configurable in call-gpg.Justus Winter2015-11-269-26/+73
| | | | | | | | | | | | | | | | * common/call-gpg.c (start_gpg): Add parameter 'gpg_arguments'. (_gpg_encrypt, gpg_encrypt_blob, gpg_encrypt_stream): Likewise. (_gpg_decrypt, gpg_decrypt_blob, gpg_decrypt_stream): Likewise. * common/call-gpg.h: Adapt prototypes. * g13/create.c (encrypt_keyblob): Adapt callsite. * g13/g13-common.h (opt): Add field 'gpg_arguments'. * g13/g13.c (main): Construct default arguments. * g13/mount.c (decrypt_keyblob): Adapt callsite. * tools/gpgtar-create.c (gpgtar_create): Likewise. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Handle '--tar-args' for compatibility with gpg-zip.Justus Winter2015-11-262-14/+152
| | | | | | | | | | | | | | * tools/gpgtar.c (enum cmd_and_opt_values): New value. (opts): Add new group for tar options, rearrange a little, add '--tar-args'. (tar_opts): New variable. (shell_parse_stringlist): New function. (shell_parse_argv): Likewise. (parse_arguments): Add option argument, handle '--tar-args'. (main): Fix invokation of 'parse_arguments'. * tests/openpgp/gpgtar.test: Simplify decryption. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Rework argument parsing.Justus Winter2015-11-261-40/+52
| | | | | | * tools/gpgtar.c (main): Move argument parsing into its own function. Signed-off-by: Justus Winter <[email protected]>
* tests: Add tests for gpgtar and gpg-zip.Justus Winter2015-11-252-1/+61
| | | | | | | * tests/openpgp/Makefile.am (TESTS): Add new file. * tests/openpgp/gpgtar.test: New file. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Handle '--directory' argument.Justus Winter2015-11-253-22/+32
| | | | | | | | | | | * tools/gpgtar-extract.c (gpgtar_extract): Only generate a directory name if none is given via arguments. * tools/gpgtar.c (enum cmd_and_opt_values): New constant. (opts): Add argument. (main): Parse argument. * tools/gpgtar.h (opt): New field 'directory'. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Handle '--gpg' argument.Justus Winter2015-11-255-3/+11
| | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Use given gpg program. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (enum cmd_and_opt_values): New constant. (opts): Add argument. (main): Handle argument. * tools/gpgtar.h (opt): Add field 'gpg_program'. Signed-off-by: Justus Winter <[email protected]>
* tools/gpgtar: Improve error handling.Justus Winter2015-11-255-36/+51
| | | | | | | | | | | | | | | | * tools/gpgtar-create.c (gpgtar_create): Return an error code, fix error handling. * tools/gpgtar-extract.c (gpgtar_extract): Likewise. * tools/gpgtar-list.c (read_header): Return an error code. (gpgtar_list): Return an error code, fix error handling. (gpgtar_read_header): Return an error code. * tools/gpgtar.c: Add missing include. (main): Print an generic error message if a command failed and no error has been printed yet. * tools/gpgtar.h (gpgtar_{create,extract,list,read_header}): Fix the prototypes accordingly. Signed-off-by: Justus Winter <[email protected]>
* tools: Add encryption and decryption support to gpgtar.Justus Winter2015-11-256-56/+118
| | | | | | | | | | | | | | | | | | * tools/Makefile.am: Amend CFLAGS and LDADD. * tools/gpgtar-create.c (gpgtar_create): Add encrypt flag and encrypt stream if requested. * tools/gpgtar-extract.c (gpgtar_extract): Likewise for decryption. * tools/gpgtar-list.c (gpgtar_list): Likewise. * tools/gpgtar.c (main): Initialize npth and assuan. Parse recipient and local user, and note which flags are currently ignored. Adapt calls to gpgtar_list and friends. (tar_and_encrypt): Drop stub function and prototype. (decrypt_and_untar): Likewise. (decrypt_and_list): Likewise. * tools/gpgtar.h (gpgtar_{create,extract,list}): Add encryption or decryption argument. Signed-off-by: Justus Winter <[email protected]>
* common: Add stream interface to call-pgp.Justus Winter2015-11-252-19/+128
| | | | | | | | | | | | | | | | | | | * common/call-gpg.c (struct writer_thread_parms): Add field 'stream'. (writer_thread_main): Support reading from a stream. (start_writer): Add stream argument. (struct reader_thread_parms): Add field 'stream'. (reader_thread_main): Support writing to a stream. (start_reader): Add stream argument. (_gpg_encrypt): Add stream api. (gpg_encrypt_blob): Adapt accordingly. (gpg_encrypt_stream): New function. (_gpg_decrypt): Add stream api. (gpg_decrypt_blob): Adapt accordingly. (gpg_decrypt_stream): New function. * common/call-gpg.h (gpg_encrypt_stream): New prototype. (gpg_decrypt_stream): Likewise. Signed-off-by: Justus Winter <[email protected]>
* common: Refactor the call-gpg code.Justus Winter2015-11-251-46/+79
| | | | | | | * common/call-gpg.c (gpg_{en,de}crypt_blob): Move most of the code into two new functions, _gpg_encrypt and _gpg_decrypt. Signed-off-by: Justus Winter <[email protected]>
* g13: Move 'call-gpg.c' to common.Justus Winter2015-11-256-37/+39
| | | | | | | | | | | | * common/Makefile.am (common_sources): Add files. * g13/call-gpg.c: Move to 'common' and adapt slightly. Add a parameter to let callees override the gpg program to execute. * g13/call-gpg.h: Likewise. * g13/Makefile.am (g13_SOURCES): Drop files. * g13/create.c (encrypt_keyblob): Hand in the gpg program to execute. * g13/mount.c (decrypt_keyblob): Likewise. Signed-off-by: Justus Winter <[email protected]>
* gpg: When comparing keyids, use the keyid, not the fingerprint's suffix.Neal H. Walfield2015-11-241-12/+41
| | | | | | | | | | | * g10/keyedit.c (menu_select_key): Use spacep and hexdigitp instead of inline tests. Don't compare P to the suffix of the fingerprint. If P appears to be a keyid, do an exact compare against the keyid. If it appears to be a fingerprint, do an exact compare against the fingerprint. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Reflow long texts.Neal H. Walfield2015-11-234-4/+283
| | | | | | | | | | | * common/stringhelp.c (format_text): New function. * common/t-stringhelp.c (stresc): New function. (test_format_text): New function. Test format_text. * g10/tofu.c (get_trust): Use format_text to reflow long texts. (show_statistics): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Extend utf8_charcount to include the string's length.Neal H. Walfield2015-11-234-8/+22
| | | | | | | | * common/stringhelp.c (utf8_charcount): Take additional parameter, len. Process at most LEN bytes. -- Signed-off-by: Neal H. Walfield <[email protected]>
* dirmngr: Fix http lookups when libadns is used.Justus Winter2015-11-231-1/+1
| | | | | | | | * dirmngr/dns-stuff.c (resolve_name_adns): Fill in the port. -- Previously, sin_port was set to zero, making connect fail. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Fix SRV record lookups when using the system resolver.Justus Winter2015-11-231-2/+2
| | | | | | | | * dirmngr/dns-stuff.c (getsrv): Fix error handling. -- This fixes hkp server pools not using SRV records. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Honor ports specified in SRV records.Justus Winter2015-11-231-14/+32
| | | | | | | | | | * dirmngr/ks-engine-hkp.c (struct hostinfo_s): New field 'port'. (create_new_hostinfo): Initialize 'port'. (add_host): Add host parameter and update the hosttable entry. (map_host): Return port if known, adjust calls to 'add_host'. (make_host_part): Let 'map_host' specify the port if known. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Support hkp server pools using SRV records.Justus Winter2015-11-231-1/+46
| | | | | | | * dirmngr/ks-engine-hkp.c (map_host): Handle SRV records. -- Signed-off-by: Justus Winter <[email protected]> GnuPG-bug-id: 1788
* dirmngr: Refactor 'map_host'.Justus Winter2015-11-231-99/+110
| | | | | | | * dirmngr/ks-engine-hkp.c (add_host): New function. (map_host): Use the new function. Signed-off-by: Justus Winter <[email protected]>