aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (unfollow)
Commit message (Collapse)AuthorFilesLines
2016-02-16gpg: Reorder signatures, if appropriate.neal/issue2236Neal H. Walfield5-63/+730
XXX -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2236
2016-02-16gpg: Make ASCII armor decoding more robust to encoding errors.Neal H. Walfield1-0/+18
* g10/armor.c (radix64_read): If the = is followed by the string "3D", check if the following four characters are valid radix 64 and are followed by a new line. If so, warn and ignore the '3D'. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2250
2016-02-15common, g10: Fix indentation to silence GCC-6.NIIBE Yutaka2-12/+12
* common/iobuf.c (iobuf_ioctl): Fix. * g10/encrypt.c (encrypt_filter): Likewise. * g10/keyring.c (prepare_search): Likewise. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2016-02-14Put asterisks in front of two function descriptions.Werner Koch1-9/+9
-- This helps visual impaired hackers to easier read comments and also helps use when looking at a printout.
2016-02-14gpg: Add hidden key-edit subcommand "change-usage".Werner Koch3-11/+146
* g10/keyedit.c (cmdCHANGEUSAGE): New. (cmds): Add command "change-usage". (keyedit_menu): Handle that command. (menu_changeusage): New. * g10/keygen.c (keygen_add_key_flags): New. (ask_key_flags): Add optional arg current. -- Signed-off-by: Werner Koch <[email protected]>
2016-02-14gpg: Improve API documentation.Neal H. Walfield3-13/+24
* g10/seskey.c (make_session_key): Improve documentation. (encode_session_key): Improve documentation. * g10/encrypt.c (encrypt_seskey): Remove gratuitous initialization. * g10/dek.h (DEK): Improve documenation. -- Signed-off-by: Neal H. Walfield <[email protected]>
2016-02-14gpg: Fix calc_header_length when LEN is 0 and improve documentation.Neal H. Walfield1-4/+8
* g10/build-packet.c (calc_header_length): Return the correct haeder size when LEN is 0. Fix documentation. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 2240
2016-02-14gpg: Fix format_keyid when dynamically allocating the buffer.Neal H. Walfield2-3/+6
* g10/keyid.c (format_keyid): Return a char *, not a const char *. If BUFFER is NULL, then set LEN to the static buffer's size. -- Signed-off-by: Neal H. Walfield <[email protected]>
2016-02-12g10: Make sure to have the directory for trustdb.NIIBE Yutaka1-56/+62
* g10/tdbio.c (tdbio_set_dbname): Return earlier if !CREATE. Check the directory and create it if none before calling take_write_lock. -- Thanks to Marc Deslauriers for the bug report and his patch. GnuPG-bug-id: 2246 Signed-off-by: NIIBE Yutaka <[email protected]>
2016-01-27gpg: Shorten the --tofu-policy help textWerner Koch1-1/+1
-- Using "help" as value lists the options. Not having the current options in the help text also makes it easier to keep translations clean. Signed-off-by: Werner Koch <[email protected]>
2016-01-26Update copyright years.Werner Koch1-1/+1
--
2016-01-26g10: Fix segfault on unsupported curve.NIIBE Yutaka1-8/+4
* g10/call-agent.c (learn_status_cb): Don't use NULL for strcmp. -- With libgcrypt not supporting cv25519, gpg segfaults. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-01-25gpg: Print PROGRESS status lines during key generation.Werner Koch1-11/+10
* g10/call-agent.c (cache_nonce_status_cb): Rewrite by using has_leading_keyword. Handle PROGRESS lines. -- GnuPG-bug-id: 1415 Co-authored-by: Daiki Ueno <[email protected]> Signed-off-by: Werner Koch <[email protected]>
2016-01-22gpg: Rework gpg-conf.skelWerner Koch1-55/+26
-- Some of the options are too rarley used to deserve an entry in the skeleton config file. Some are even the default for many years. Added auto-key-locate because that is a very useful option. Signed-off-by: Werner Koch <[email protected]>
2016-01-22gpg: Allow new user ids with only the mail address.Werner Koch1-6/+18
* g10/keygen.c (ask_user_id): Allow empty name. -- The --quick-gen-key command allows this and further some mail providers require that a key has only the mail address to allow for anonymous accounts. Signed-off-by: Werner Koch <[email protected]>
2016-01-21gpg: Improve header text of the auto-created revocations.Werner Koch1-3/+10
* g10/revoke.c (gen_standard_revoke): Improve header text for the file. Add info output. -- GnuPG-bug-id: 1724 Signed-off-by: Werner Koch <[email protected]>
2016-01-21gpg: Make --auto-key-retrieve work with dirmngr configured server.Werner Koch8-29/+56
* g10/call-dirmngr.c (gpg_dirmngr_ks_list): Make R_KEYSERVER optional. * g10/keyserver.c (keyserver_any_configured): New. (keyserver_put): Remove arg keyserver because this will always receive opt.keyserver which is anyway used when connecting dirmngr. Do not check opt.keyserver. (keyserver_import_cert): Replace opt.keyserver by keyserver_any_configured. * g10/mainproc.c (check_sig_and_print): Ditto. * g10/import.c (revocation_present): Ditto. * g10/getkey.c (get_pubkey_byname): Ditto. * g10/gpgv.c (keyserver_any_configured): Add stub. * g10/test-stubs.c (keyserver_any_configured): Add stub. -- The keyserver should be configured in dirmngr.conf and thus we can't use opt.keyserver in gpg to decide whether a keyserver has been configured. GnuPG-bug-id: 2147 Signed-off-by: Werner Koch <[email protected]>
2016-01-20gpg: Silence message about ignoring revoked user ids.Werner Koch1-10/+14
* g10/trustdb.c (tdb_get_validity_core): Print message only in debug mode. -- This makes only sense for debugging. Signed-off-by: Werner Koch <[email protected]>
2016-01-19gpg: Streamline use of error messages in tofu.cWerner Koch1-123/+134
* g10/tofu.c: Make use of print_further_info to reduce the number of different error messages to be translated. Also streamline some messages. Signed-off-by: Werner Koch <[email protected]>
2016-01-19gpg: Add function print_further_info.Werner Koch2-0/+22
* g10/misc.c (print_further_info): New. Signed-off-by: Werner Koch <[email protected]>
2016-01-18g10: Improve strings printed by tofu.c.Werner Koch1-128/+132
* g10/tofu.c: Include ttyio.h. Change many strings to help translating. Make use of ngettext wehere needed. (CONTROL_L): New. (TIME_AGO_UNIT_SMALL_NAME): Remove this and all similar *_NAME macros. (time_ago_unit): Remove. (get_trust): Use tty_prints and cpr_get only for the actual prompt. Add Ctrl-L hack. (show_statistics): Use two English strings for singular and plural. * po/POTFILES.in: Add tofu.c. -- These changes are required for proper translation. More to changes may be needed, though. Signed-off-by: Werner Koch <[email protected]>
2016-01-18gpg: Minor string changes.Werner Koch3-4/+4
--
2016-01-18gpg: Use "days" in "...newer than..." diagnostics.Werner Koch1-10/+35
* g10/sig-check.c (check_signature_metadata_validity): Use days if useful. -- Using days instead of a high number of seconds is for the majority of users a better measurement. Signed-off-by: Werner Koch <[email protected]>
2016-01-18Use ngettext for some strings.Werner Koch7-73/+86
* scd/app-openpgp.c (build_enter_admin_pin_prompt): Use ngettext for some diagnostics. (do_genkey): Ditto. * g10/keyedit.c (check_all_keysigs, menu_delsig, menu_clean): Ditto. * g10/keylist.c (print_signature_stats): Ditto. * g10/keyserver.c (keyserver_refresh): Ditto. * g10/sig-check.c (check_signature_metadata_validity): Ditto. * g10/sign.c (do_sign): Ditto. * g10/trustdb.c (reset_trust_records): Ditto. (validate_keys): Use a table like diagnostic output. -- Suggested-by: Ineiev <[email protected]> Signed-off-by: Werner Koch <[email protected]>
2016-01-14w32: Fix deadlock introduced by keybox_file_rename.Werner Koch1-4/+17
* g10/keyring.c (keyring_lock) [W32]: Flush the close cache before locking. * kbx/keybox-init.c (keybox_lock) [W32]: Close the file before locking. Signed-off-by: Werner Koch <[email protected]>
2016-01-14gpg: Detect race between pubring.gpg and pubring.kbx use.Werner Koch1-0/+32
* g10/keydb.c (maybe_create_keyring_or_box): Detect race condition. Signed-off-by: Werner Koch <[email protected]>
2016-01-14kbx: New function keybox_file_rename to replace rename.Werner Koch1-18/+5
* kbx/keybox-util.c: Include windows.h. (keybox_file_rename): New. * kbx/keybox-update.c (rename_tmp_file): Replace remove+rename by keybox_file_rename. * g10/keyring.c (rename_tmp_file): Ditto. Signed-off-by: Werner Koch <[email protected]>
2016-01-14kbx: Add function keybox_tmp_names to avoid code duplication.Werner Koch1-57/+26
* kbx/keybox-update.c (create_tmp_file): Move some code to... * kbx/keybox-util.c (keybox_tmp_names): new. * g10/keyring.c: Include keybox.h. (create_tmp_file): Replace parts by keybox_tmp_names. -- Signed-off-by: Werner Koch <[email protected]>
2016-01-14gpg: Make --list-options show-usage the default.Werner Koch1-1/+2
* g10/gpg.c (main): Add LIST_SHOW_USAGE. -- The usage flags are often useful and they don't take away much space in a key listing. Thus it is better to have them enabled by default. Signed-off-by: Werner Koch <[email protected]>
2016-01-13gpg: Improve error code from lock_all.Werner Koch1-1/+1
* g10/keydb.c (lock_all): Do not clobber RC during failur cleanup. Signed-off-by: Werner Koch <[email protected]>
2016-01-13gpg: Make sure to mark a duplicate registered keybox as primary.Werner Koch1-28/+29
* kbx/keybox-init.c (keybox_register_file): Change interface to return the token even if the file has already been registered. * g10/keydb.c (primary_keyring): Rename to primary_keydb. (maybe_create_keyring_or_box): Change return type to gpg_error_t. (keydb_add_resource): Ditto. s/rc/err/. (keydb_add_resource): Mark an already registered as primary. * sm/keydb.c (maybe_create_keybox): Change return type to gpg_error_t. (keydb_add_resource): Ditto. s/rc/err/. (keydb_add_resource): Adjust for changed keybox_register_file. -- This change aligns the registering of keyboxes with those of keyrings. This fixes a potential bug: gpg --keyring foo.kbx --keyring bar.gpg --keyring foo.kbx would have marked bar.gpg as primary resource and thus inserting new keys there. The correct and now fixed behavior is to insert to foo.kbx. Signed-off-by: Werner Koch <[email protected]>
2016-01-12gpg: Re-indent check_key_signature2.Werner Koch1-284/+309
-- I am considering some changes and thus better start off by switching to standard GNU indentation. This patch also changes comment lines like if (foo) /* Comment on foo. */ { to if (foo) { /* Comment on foo. */ or if (foo) /* Comment on foo. */ { to make the brace of the opening block stand out immediately. Further stars on the left are added to longer comments because that makes the code easier to read by disabled hackers, when reading without font locking, and for reading black-white printouts.
2016-01-12common: Fix iobuf API of filter function for alignment.NIIBE Yutaka9-10/+10
* common/iobuf.h (IOBUFCTRL_DESC): Change the call semantics. * common/iobuf.c (iobuf_desc): Add the second argument DESC. (print_chain, iobuf_close, do_open, iobuf_sockopen, iobuf_ioctl) (iobuf_push_filter2, pop_filter, iobuf_write_temp): Change calls of iobuf_desc. (file_filter, file_es_filter, sock_filter, block_filter): Fill the description. * common/t-iobuf.c (every_other_filter, double_filter): Likewise. * g10/armor.c, g10/cipher.c, g10/compress-bz2.c, g10/compress.c, g10/decrypt-data.c, g10/encrypt.c, g10/mdfilter.c, g10/progress.c, g10/textfilter.c: Likewise. -- Newer GCC warns against possible alignment difference of pointers. This change can silence those warnings. Signed-off-by: NIIBE Yutaka <[email protected]>
2016-01-11gpg: Move documentation from keydb.h to keydb.c and getkey.c.Werner Koch3-499/+531
-- When using tags (e.g. GNU global) to navigate the source code it is way easier to have the documentation close to the function we are looking at. Having the documentation in the header file would require an extra manual lookup to understand the function. Signed-off-by: Werner Koch <[email protected]>
2016-01-11gpg: Fix NULL de-ref for ambiguous key check in --export-ssh-keys.Werner Koch2-1/+10
* g10/getkey.c: Allow arg RET_KEYBLOCK to be NULL. -- This change adds the expected behavior for the getkey_next function to fix this NULL de-ref. GnuPG-bug-id: 2212 Signed-off-by: Werner Koch <[email protected]>
2016-01-09tools: Remove gpgkey2ssh.Werner Koch1-1/+1
* tools/gpgkey2ssh.c: Remove. * tools/Makefile.am (bin_PROGRAMS): Ditto. -- Also remove it form the docs. Signed-off-by: Werner Koch <[email protected]>
2016-01-08gpg: Support ECDSA keys with --export-ssh-key.Werner Koch1-0/+6
* g10/export.c (key_to_sshblob): Add hack for ECDSA. Signed-off-by: Werner Koch <[email protected]>
2016-01-08gpg: New command --export-ssh-keyWerner Koch3-2/+312
* g10/export.c: Include membuf.h and host2net.h. (key_to_sshblob): New. (export_ssh_key): New. * g10/gpg.c (aExportSshKey): New. (opts): Add command. (main): Implement that command. -- GnuPG-bug-id: 2212 I have done only a few tests rights now and the ECDSA curves do not yet work. However ssh-keygen -l accept RSA and ed25519 keys exported using this command. Signed-off-by: Werner Koch <[email protected]>
2016-01-08gpg: Add an exact search flag to the PK struct.Werner Koch2-4/+7
* g10/getkey.c (merge_selfsigs_subkey): Clear exact flag. (finish_lookup): Set exact flag. * g10/packet.h (PKT_public_key): Add field flags.exact. -- Signed-off-by: Werner Koch <[email protected]>
2016-01-08Print warnings if old daemon versions are used.Werner Koch2-5/+78
* common/status.h (STATUS_WARNING): New. * g10/call-agent.c (warn_version_mismatch): New. (start_agent): Call warn function. * g10/call-dirmngr.c: Include status.h. (warn_version_mismatch): New. (create_context): Call warn function. * sm/call-agent.c (warn_version_mismatch): New. (start_agent): Call warn function. (gpgsm_agent_learn): Call warn function. * sm/call-dirmngr.c (warn_version_mismatch): New. (prepare_dirmngr): Call warn function. -- We have seen too often bug reports which are due to still running old versions of the daemons. To catch this problematic use we now print warning messages and also provide the warning via the status interface. Signed-off-by: Werner Koch <[email protected]>
2016-01-08common: New function get_assuan_server_version.Werner Koch1-17/+1
* common/asshelp.c: Include membuf.h. (get_assuan_server_version): New. * g10/call-agent.c (agent_get_version): Use new function. -- Signed-off-by: Werner Koch <[email protected]>
2016-01-08common: New put_membuf_cb to replace static membuf_data_cb.Werner Koch1-24/+12
* common/membuf.c (put_membuf_cb): New. * agent/call-scd.c (membuf_data_cb): Remove. Change callers to use put_membuf_cb. * common/get-passphrase.c (membuf_data_cb): Ditto. * g10/call-agent.c (membuf_data_cb): Ditto. * sm/call-agent.c (membuf_data_cb): Ditto. -- Signed-off-by: Werner Koch <[email protected]>
2016-01-07gpg: Return an error code from keygrip_from_pk.Werner Koch1-1/+1
* g10/keyid.c (keygrip_from_pk): Return an error code. -- The error was show but the function did not return it. This change should improve error messages for unknown algorithms. Signed-off-by: Werner Koch <[email protected]>
2016-01-07gpg: Avoid warnings about possible NULL deref.Werner Koch4-3/+8
* g10/getkey.c (cache_public_key): Protect deref of CE which actually can't happen. * g10/keygen.c (quickgen_set_para): s/sprintf/snprintf/. * g10/tofu.c (end_transaction, rollback_transaction): Allow NULL for DB. * g10/trustdb.c (update_min_ownertrust): Remove useless clearling of ERR. -- Signed-off-by: Werner Koch <[email protected]>
2016-01-07gpg: Fix warnings about useless assignments.Werner Koch10-30/+30
* g10/armor.c (parse_hash_header): Remove duplicate var assignment. * g10/getkey.c (cache_user_id): Ditto. * g10/keygen.c (ask_curve): Ditto. This also fixes a small memory leak. * g10/keygen.c (proc_parameter_file): Remove useless assignment or pointer increment. (generate_keypair): Ditto. * g10/getkey.c (finish_lookup, lookup): Ditto. * g10/card-util.c (change_pin): Ditto. * g10/gpg.c (main) <aVerify>: Ditto. * g10/import.c (import): Ditto. (print_import_check): Ditto * g10/keyring.c (do_copy): Ditto. * g10/tdbio.c (tdbio_read_record): Ditto. * g10/trustdb.c (tdb_update_ownertrust): Ditto. (update_validity): Ditto. * g10/server.c (cmd_passwd): Remove useless call to skip_options. -- Signed-off-by: Werner Koch <[email protected]>
2016-01-07gpg: Fix DNS cert lookup returning an URL.Werner Koch1-3/+1
* g10/call-dirmngr.c (dns_cert_status_cb): Store URL status in the URL param. The old code was entirely buggy (c+p error). -- Fixes-commit: 154f3ed2 Signed-off-by: Werner Koch <[email protected]>
2016-01-06Fix keystrlen to work when OPT.KEYID_FORMAT is KF_DEFAULT.Daniel Kahn Gillmor1-2/+6
* g10/keyid.c (keystrlen): If opt.keyid_format is KF_DEFAULT unset, default to KF_SHORT. (format_keyid): Default to KF_SHORT, not KF_0xLONG. -- Without this fix, gpgv2 fails with: gpgv: Ohhhh jeeee: ... this is a bug (keyid.c:342:keystrlen) Signed-off-by: Daniel Kahn Gillmor <[email protected]> Signed-off-by: Neal H. Walfield <[email protected]>
2016-01-06gpg: Silence some regression tests.Werner Koch1-5/+6
* g10/test.c (TEST): Print diagnostics only in verbose mode. Signed-off-by: Werner Koch <[email protected]>
2016-01-06gpg: Avoid using an uninitialized SALT on premature EOF.Werner Koch1-0/+5
* g10/parse-packet.c (parse_key): Check for premature end of salt. -- This has no security implications because an arbitrary salt could have also been inset by an attacker. Signed-off-by: Werner Koch <[email protected]>
2016-01-06gpg: Silence warnings found by static analyzer.Werner Koch2-4/+3
* g10/keyedit.c (change_passphrase): Remove useless init of ANY. (keyedit_quick_adduid): Remove useless setting of ERR. * g10/parse-packet.c (parse_key): Remove PKTLEN from condition because it has been checked before the loop. (parse_plaintext): Remove useless init of PKTLEN. Signed-off-by: Werner Koch <[email protected]>