aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Fix formatting string.Neal H. Walfield2015-11-061-1/+1
| | | | | | | * g10/decrypt-data.c (decrypt_data): Fix formatting string. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Add new option --only-sign-text-ids.Neal H. Walfield2015-11-064-16/+46
| | | | | | | | | | | | | | | | | * g10/options.h (opt): Add field only_sign_text_ids. * g10/gpg.c (enum cmd_and_opt_values): Add value oOnlySignTextIDs. (opts): Handle oOnlySignTextIDs. (main): Likewise. * g10/keyedit.c (sign_uids): If OPT.ONLY_SIGN_TEXT_IDS is set, don't select non-text based IDs automatically. (keyedit_menu): Adapt the prompt asking to sign all user ids according to OPT.ONLY_SIGN_TEXT_IDS. * doc/gpg.texi: Document the new option --only-sign-text-ids. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1241 Debian-bug-id: 569702
* common: When classifying keyids and fingerprints, reject trailing junk.Neal H. Walfield2015-11-061-19/+66
| | | | | | | | | | | * common/userids.c (classify_user_id): Trim any trailing whitespace. Before assuming that a hexstring corresponds to a key id or fingerprint, make sure that it is NUL terminated. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1206 Debian-bug-id: 575084
* gpg: Check for ambiguous or non-matching key specs.Neal H. Walfield2015-11-062-28/+189
| | | | | | | | | | | | | | | | | * g10/gpg.c (check_user_ids): New function. (main): Check that any user id specifications passed to --local-user and --remote-user correspond to exactly 1 user. Check that any user id specifications passed to --default-key correspond to at most 1 user. Warn if any user id specifications passed to --local-user or --default-user are possible ambiguous (are not specified by long keyid or fingerprint). * g10/getkey.c (parse_def_secret_key): Don't warn about possible ambiguous key descriptions here. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1128 Debian-debug-id: 544490
* common: Add new function strlist_rev.Neal H. Walfield2015-11-064-2/+106
| | | | | | | | | | | * common/strlist.c (strlist_rev): New function. * common/t-strlist.c: New file. * common/Makefile.am (common_sources): Add strlist.c and strlist.h. (module_tests): Add t-strlist. (t_strlist_LDADD): New variable. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Include required, but not included headers in t-support.h.Neal H. Walfield2015-11-061-0/+3
| | | | | | | * common/t-support.h: Include <stdlib.h> and <stdio.h>. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Indicate which characters are invalid.Neal H. Walfield2015-11-051-0/+3
| | | | | | | | * g10/keygen.c (ask_user_id): Indicate which characters are invalid. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1143
* gpg: Add support for unwrapping the outer level of encryption.Neal H. Walfield2015-11-055-48/+130
| | | | | | | | | | | | | | | | | * g10/decrypt-data.c (decrypt_data): If OPT.UNWRAP_ENCRYPTION is set, copy the data to the output file instead of continuing to process it. * g10/gpg.c (enum cmd_and_opt_values): Add new value oUnwrap. (opts): Handle oUnwrap. (main): Likewise. * g10/options.h (opt): Add field unwrap_encryption. * g10/plaintext.c (handle_plaintext): Break the output file selection functionality into ... (get_output_file): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1060 Debian-bug-id: 282061
* common: Add a function for copying data from one iobuf to another.Neal H. Walfield2015-11-052-0/+43
| | | | | | | * common/iobuf.c (iobuf_copy): New function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* doc: Note that gpgkey2ssh is deprecated.Neal H. Walfield2015-11-051-0/+2
| | | | | | | * doc/tools.texi (gpgkey2ssh): Note that gpgkey2ssh is deprecated. -- Signed-off-by: Neal H. Walfield <[email protected]>
* tools: Fix gpgkey2ssh's most gratuitous errors. Use gpg2, not gpg.Neal H. Walfield2015-11-051-9/+38
| | | | | | | | | * tools/gpgkey2ssh.c (main): Add support for --help. Replace the most gratuitous asserts with error messages. Invoke gpg2, not gpg. -- Signed-off-by: Neal H. Walfield <[email protected]> Debian-bug-id: 380241
* doc: Add documentation for gpgkey2ssh.Neal H. Walfield2015-11-051-0/+71
| | | | | | | | | | * doc/tools.texi: Add documentation for gpgkey2ssh. -- Signed-off-by: Neal H. Walfield <[email protected]> Co-authored-by: Daniel Kahn Gillmor <[email protected]> GnuPG-bug-id: 1067 Debian-bug-id 380241
* gpg: Print a better error message for --multifile --sign --encrypt.Neal H. Walfield2015-11-041-0/+3
| | | | | | | | | * g10/gpg.c (main): Print a better error message for --multifile --sign --encrypt. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1009
* gpg: Add --encrypt-to-default-key.Neal H. Walfield2015-11-045-1/+30
| | | | | | | | | | | | | * g10/getkey.c (parse_def_secret_key): Drop the static qualifier and export the function. * g10/gpg.c (enum cmd_and_opt_values): Add value oEncryptToDefaultKey. (opts): Handle oEncryptToDefaultKey. (main): Likewise. * g10/options.h (opt): Add field encrypt_to_default_key. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 807
* gpg: Allow multiple --default-key options. Take the last available key.Neal H. Walfield2015-11-0416-53/+145
| | | | | | | | | | | | | | | | | | | | | | | | | * g10/getkey.c (parse_def_secret_key): New function. (get_seckey_default): Add parameter ctrl. Update callers. Use parse_def_secret_key to get the default secret key, if any. (getkey_byname): Likewise. (enum_secret_keys): Likewise. * g10/options.h (opt): Change def_secret_key's type from a char * to a strlist_t. * g10/gpg.c (main): When processing --default-key, add the key to OPT.DEF_SECRET_KEY. * g10/gpgv.c (get_session_key): Add parameter ctrl. Update callers. * g10/mainproc.c (proc_pubkey_enc): Likewise. (do_proc_packets): Likewise. * g10/pkclist.c (default_recipient): Likewise. * g10/pubkey-enc.c (get_session_key): Likewise. * g10/sign.c (clearsign_file): Likewise. (sign_symencrypt_file): Likewise. * g10/skclist.c (build_sk_list): Likewise. * g10/test-stubs.c (get_session_key): Likewise. -- Signed-off-by: Neal H. Walield <[email protected]> GnuPG-bug-id: 806
* scd: Fix error handling with libusb-compat library.NIIBE Yutaka2015-11-041-7/+12
| | | | | | | | | * scd/ccid-driver.c (bulk_out): Use LIBUSB_ERRNO_NO_SUCH_DEVICE. -- With libusb-compat library, the error is different than original libusb. (The libusb-compat library is used by Fedora.)
* scd: fix change_keyattr.NIIBE Yutaka2015-11-041-2/+2
| | | | * scd/app-openpgp.c (change_keyattr_from_string): Fix parsing.
* gpg: Change out of core error message.Werner Koch2015-11-031-19/+28
| | | | | | | | | | | | | | | * g10/tofu.c (fingerprint_str): Die with the error code returned by the failed function. (time_ago_str): Ditto. Do not make a comma translatable. (fingerprint_format): Use "%zu" for a size_t. -- Also wrapped some long strings. In general we should not use log_fatal or use xmalloc functions but properly return an error code and use xtrymalloc like functions. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make translation easier.Werner Koch2015-11-031-3/+3
| | | | | | | * g10/import.c (import_secret_one): Split info string for easier translation. Signed-off-by: Werner Koch <[email protected]>
* gpg: Also show when the most recently signed message was observed.Neal H. Walfield2015-11-031-1/+23
| | | | | | | | | * g10/tofu.c (show_statistics): Also show when the most recently signed message was observed. -- Signed-off-by: Neal H. Walfield <[email protected]>. Suggested-by: MFPA <[email protected]>
* gpg: Split a utility function out of a large function.Neal H. Walfield2015-11-031-134/+157
| | | | | | | | | * g10/tofu.c (show_statistics): Break the time delta to string code into... (time_ago_str): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Fix message formatting.Neal H. Walfield2015-11-031-2/+2
| | | | | | | * g10/tofu.c (get_trust): Fix message formatting. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Don't store formatting fingerprints in the TOFU DB.Neal H. Walfield2015-11-031-77/+100
| | | | | | | | | | | | | | | | | * g10/tofu.c (fingerprint_pp): Split this function into... (fingerprint_str): ... this function... (fingerprint_format): ... and this function. (record_binding): Store the unformatted fingerprint in the DB. Only use the formatting fingerprint when displaying a message to the user. (get_trust): Likewise. (show_statistics): Likewise. (tofu_register): Likewise. (tofu_get_validity): Likewise. (tofu_set_policy): Likewise. (tofu_get_policy): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* g10: notify a user when importing stub is skipped.NIIBE Yutaka2015-11-021-2/+29
| | | | | | | | | | | | | | | * g10/import.c (transfer_secret_keys): Return GPG_ERR_NOT_PROCESSED when stub_key_skipped. (import_secret_one): Notify a user, suggesting --card-status. -- Migration to 2.1 might be confusing with smartcard. With this patch, a user can learn to run gpg ---card-status. Thanks to intrigeri for the report. Debian-bug-id: 795881
* gpg: Consider newlines to be whitespace in an SQL statement.Neal H. Walfield2015-10-311-1/+1
| | | | | | | | * g10/sqlite.c (sqlite3_stepx): When making sure that there is no second SQL statement, ignore newlines. -- Signed-off-by: Neal H. Walfield <[email protected]>
* common: Improve t-zb32 to be used for manual encoding.Werner Koch2015-10-303-12/+214
| | | | | | | | * common/t-support.h (no_exit_on_fail, errcount): New. (fail): Bump errcount. * common/t-zb32.c (main): Add options to allow manual use. Signed-off-by: Werner Koch <[email protected]>
* common: Add separate header for zb32.c.Werner Koch2015-10-306-6/+42
| | | | | | | * common/util.h (zb32_encode): Move prototype to ... * common/zb32.h: new. Include this for all callers of zb32_encode. Signed-off-by: Werner Koch <[email protected]>
* Use of some C99 features is now permitted.Werner Koch2015-10-291-1/+41
| | | | | | -- Signed-off-by: Werner Koch <[email protected]>
* gpg: Display the correct error message.Neal H. Walfield2015-10-291-4/+7
| | | | | | | | | * g10/trustdb.c (validate_keys): If tdbio_update_version_record fails, RC does not contain the error code. Save the error code in rc2 and use that. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Eliminate a memory leak.Neal H. Walfield2015-10-291-7/+9
| | | | | | | | * g10/trustdb.c (validate_key_list): Don't leak the keyblocks on failure. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Remove unused prototype.Neal H. Walfield2015-10-291-1/+0
| | | | | | | g10/keyring.h (keyring_locate_writable): Remove unused prototype. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Eliminate a memory leak.Neal H. Walfield2015-10-291-1/+4
| | | | | | | * g10/gpg.c (main): Don't leak OPT.DEF_RECIPIENT. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Fix keyring support.Neal H. Walfield2015-10-291-1/+2
| | | | | | | | | * g10/keydb.c (keydb_rebuild_caches): Only mark the cached as prepared if it is actually prepared, which it only is if the resource is a keybox. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Change sqlite3_stepx to pass the sqlite3_stmt * to the callback.Neal H. Walfield2015-10-293-10/+58
| | | | | | | | | | | * g10/sqlite.h (enum sqlite_arg_type): Add SQLITE_ARG_BLOB. (sqlite3_stepx_callback): New declaration. (sqlite3_stepx): Change the callback's type to sqlite3_stepx_callback, which passes an additional parameter, the sqlite3_stmt *. Update users. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Move sqlite helper functions into their own file.Neal H. Walfield2015-10-294-224/+293
| | | | | | | | | | | | | | * g10/tofu.c (sqlite3_exec_printf): Move from here... * g10/sqlite.c (sqlite3_exec_printf): ... to this new file. Don't mark as static. * g10/tofu.c (sqlite3_stepx): Move from here... * g10/sqlite.c (sqlite3_stepx): ... to this new file. Don't mark as static. * g10/tofu.c (enum sqlite_arg_type): Move from here... * g10/sqlite.h (enum sqlite_arg_type): ... to this new file. -- Signed-off-by: Neal H. Walfield <[email protected]>
* doc: Don't install gpg-zip.1.NIIBE Yutaka2015-10-291-2/+2
| | | | | | | | | | | * doc/Makefile.am (myman_pages): Remove gpg-zip.1. (DISTCLEANFILES): Add gpg-zip.1. -- Thanks to Thomas Klausner. GnuPG-bug-id: 2095
* sm: Allow combination of usage flags --gen-key.Werner Koch2015-10-281-31/+46
| | | | | | | | | * sm/certreqgen.c (create_request): Re-implement building of the key-usage extension. -- GnuPG-bug-id: 2029 Signed-off-by: Werner Koch <[email protected]>
* doc: Document some changed default options.Damien Goutte-Gattat2015-10-281-4/+4
| | | | | | | * doc/gpg.texi: Update the description of some options which are now enabled by default. Signed-off-by: Damien Goutte-Gattat <[email protected]>
* dirmngr: Fix NULL-deref while loading a CRL.Werner Koch2015-10-281-1/+2
| | | | | | | | | * dirmngr/crlcache.c (crl_parse_insert): Set error before leaping to failure. -- GnuPG-bug-id: 2082 Signed-off-by: Werner Koch <[email protected]>
* Fix typosDaniel Kahn Gillmor2015-10-286-6/+6
| | | | --
* agent: Clarify agent's KEYWRAP_KEY description.Daniel Kahn Gillmor2015-10-281-1/+1
| | | | | | -- Signed-Off-By: Daniel Kahn Gillmor <[email protected]>
* dirmngr: Minor cleanup of the SRV RR code.Werner Koch2015-10-282-9/+16
| | | | | | | * dirmngr/dns-stuff.c: Include unistd.h. (getsrv): Run srand only once. * dirmngr/t-dns-stuff.c (main): Allow passing another name for --srv and change output format.
* dirmngr: Add a getaddrinfo wrapper backend using ADNS.Werner Koch2015-10-281-51/+143
| | | | | | | | | * dirmngr/dns-stuff.c: Replace all use of default_errsource. (my_adns_init): Move to top. (resolve_name_adns): New. (resolve_dns_name) [USE_ADNS]: Divert to new func. Signed-off-by: Werner Koch <[email protected]>
* gpg: Do not call an extra get_validity if no-show-uid-validity is used.Werner Koch2015-10-261-6/+25
| | | | | | | * g10/mainproc.c (check_sig_and_print): Do not call the informational get_validity if we are not going to use it. Signed-off-by: Werner Koch <[email protected]>
* gpg: Ensure all weak digest rejection notices are shownDaniel Kahn Gillmor2015-10-266-37/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/main.h: Add rejection_shown flag to each weakhash struct * g10/misc.c (print_digest_algo_note, additional_weak_digest): Do not treat MD5 separately; (print_digest_rejected_note): Use weakhash.rejection_shown instead of static shown. * g10/options.h (opt): Change from additional_weak_digests to weak_digests. * g10/sig-check.c: Do not treat MD5 separately. * g10/gpg.c (main): Explicitly set MD5 as weak. * g10/gpgv.c (main): Explicitly set MD5 as weak. -- Previously, only one weak digest rejection message was shown, of whichever was the first type encountered. This meant that if "gpg --weak-digest SHA224" encountered both an MD5 digest and a SHA224 digest, it would only show the user that the MD5 digest was rejected. In order to let the user know which algorithms were rejected, we needed to move the "shown" flag into a per-weak-algorithm location. Given this additional complication, it made no sense to continue to treat MD5 specially, so it is added as a default weak algorithm in the same opt.weak_digests data structure as any other. Signed-Off-By: Daniel Kahn Gillmor <[email protected]>
* w32: Make it build again if Tofu support is not available.Werner Koch2015-10-261-0/+4
| | | | | | | * g10/keylist.c (public_key_list) [!USE_TOFU]: Do not call tofu functions. Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Add example Tor hidden service.Werner Koch2015-10-262-1/+4
| | | | --
* dirmngr: Support Tor hidden services.Werner Koch2015-10-264-2/+62
| | | | | | | | | | | | | | * dirmngr/dns-stuff.c (is_onion_address): New. * dirmngr/ks-engine-hkp.c (hostinfo_s): Add field "onion". (map_host): Special case onion addresses. (ks_hkp_print_hosttable): Print an 'O' for an onion address. * dirmngr/http.c (connect_server): Special case onion addresses. -- Note that this requires the latest libassuan from git. Onion addresses are always support regardless of the --use-tor flag. Signed-off-by: Werner Koch <[email protected]>
* dirmngr,w32: Remove gethostbyname hack and make it build again.Werner Koch2015-10-262-37/+10
| | | | | | | | | * dirmngr/http.c (connect_server) [W32]: Remove gethostbyname hack; we require getaddrinfo anyway. * dirmngr/dns-stuff.c (AI_ADDRCONFIG): Add replacement if not defined. (map_eai_to_gpg_error) [W32]: Take care of unsupported codes. Signed-off-by: Werner Koch <[email protected]>
* gpg: Make sure we only have a single SQL statement.Neal H. Walfield2015-10-261-1/+16
| | | | | | | | * g10/tofu.c (sqlite3_stepx): Make sure SQL only contains a single SQL statement. -- Signed-off-by: Neal H. Walfield <[email protected]>