aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* g13: First chunk of code to support dm-crypt.wk/g13workWerner Koch2015-11-3014-9/+2489
| | | | | | | | | | | | | | | | | | | | | | | | | * g13/call-syshelp.c, g13/call-syshelp.h: New. * g13/g13-syshelp.c, g13/g13-syshelp.h: New. * g13/sh-cmd.c: New. * g13/sh-blockdev.c: New. * g13/sh-exectool.c: New. * g13/sh-dmcrypt.c: New. * g13/Makefile.am (sbin_PROGRAMS): Add g13-syshelp.c (g13_syshelp_SOURCES): New. (g13_syshelp_LDADD): New. * g13/g13.c (opts): Add option --type. (g13_deinit_default_ctrl): New. (main): Implement that option. Call g13_deinit_default_ctrl. * g13/g13.h (struct call_syshelp_s): New declaration. (server_control_s): Add field syshelp_local. * g13/keyblob.h (KEYBLOB_TAG_CREATED): New. (KEYBLOB_TAG_ALGOSTR): New. (KEYBLOB_TAG_HDRCOPY): New. * g13/backend.c (be_parse_conttype_name): New. (be_get_detached_name): Add CONTTYPE_DM_CRYPT. Signed-off-by: Werner Koch <[email protected]>
* 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]>
* dirmngr: Fix pool detection.Justus Winter2015-11-231-2/+2
| | | | | | * dirmngr/ks-engine-hkp (arecords_is_pool): Fix counting IP addresses. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Refactor 'map_host'.Justus Winter2015-11-231-12/+21
| | | | | | | * dirmngr/ks-engine-hkp.c (arecords_is_pool): New function. (map_host): Use the new function. Signed-off-by: Justus Winter <[email protected]>
* dirmngr: Start dirmngr on demand.Justus Winter2015-11-232-130/+17
| | | | | | | | | | * common/asshelp.h: Include 'util.h'. * dirmngr/dirmngr-client.c (main): Use 'start_new_dirmngr' to connect to the dirmngr. (start_dirmngr): Drop now unused declaration and function. -- Signed-off-by: Justus Winter <[email protected]> GnuPG-bug-id: 1843
* gpg: If sqlite is not available, don't build things depending on it.Neal H. Walfield2015-11-232-1/+10
| | | | | | | | | | | * configure.ac: Define the automake conditional SQLITE3. * tests/openpgp/Makefile.am (TESTS): Move the sqlite3 dependent tests to... (sqlite3_dependent_tests): ... this new variable. If SQLITE3 is not defined, then clear this variable. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Allow updating the expiration time of multiple subkeys at once.Neal H. Walfield2015-11-231-6/+25
| | | | | | | | | * g10/keyedit.c (menu_expire): Allow updating the expiration time of multiple subkeys at once. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1944
* gpg: Don't crash if key is not passed an argument.Neal H. Walfield2015-11-231-1/+2
| | | | | | | * g10/keyedit.c (menu_select_key): Don't crash if P is NULL. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Fail if the search description passed to --gen-revoke is ambiguous.Neal H. Walfield2015-11-201-0/+41
| | | | | | | | * g10/revoke.c (gen_revoke): Error out if the search description is ambiguous. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Refactor print_seckey_info.Neal H. Walfield2015-11-202-5/+17
| | | | | | | | | * g10/keylist.c (print_seckey_info): Break formatting functionality into... (format_seckey_info): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Improve an error message.Neal H. Walfield2015-11-201-2/+6
| | | | | | | | | * g10/revoke.c (gen_revoke): Provide a more descriptive error message if searching for a key fails. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1987
* dirmngr: Improve error handling.Justus Winter2015-11-191-0/+1
| | | | | | | | * dirmngr/crlcache.c (crl_cache_cert_isvalid): Add missing break. -- Found using the Clang Static Analyzer. Signed-off-by: Justus Winter <[email protected]>