aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* g10: Fix regexp sanitization.NIIBE Yutaka2017-12-041-1/+7
| | | | | | | | | | | | | | | | | | | | | | * g10/trustdb.c (sanitize_regexp): Only escape operators. -- Backport from master commit: ccf3ba92087e79abdeaa0208795829b431c6f201 To sanitize a regular expression, quoting by backslash should be only done for defined characters. POSIX defines 12 characters including dot and backslash. Quoting other characters is wrong, in two ways; It may build an operator like: \b, \s, \w when using GNU library. Case ignored match doesn't work, because quoting lower letter means literally and no much to upper letter. GnuPG-bug-id: 2923 Co-authored-by: Damien Goutte-Gattat <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* gpg: Avoid cluttering stdout with trustdb info in verbose mode.Werner Koch2015-11-201-1/+1
| | | | | | | | | | | | | | | | * g10/trustdb.c (validate_keys): Call dump_key_array only in debug mode. -- I guess that is a left-over from an early attempt to output information on the trustdb for use by other tools. Maybe related to the former --list-trust-path command. Sending it to stdout is probably useful so we do this now only in debug mode. Signed-off-by: Werner Koch <[email protected]> Backported to STABLE-BRANCH-1-4 from b03a2647299a6c8764a2574590cbaccdff9e497d by dkg
* Use inline functions to convert buffer data to scalars.Werner Koch2015-02-231-1/+1
| | | | | | | | | | | | | | | | | | | * include/host2net.h (buf16_to_ulong, buf16_to_uint): New. (buf16_to_ushort, buf16_to_u16): New. (buf32_to_size_t, buf32_to_ulong, buf32_to_uint, buf32_to_u32): New. -- This fixes sign extension on shift problems. Hanno Böck found a case with an invalid read due to this problem. To fix that almost all uses of "<< 24" and "<< 8" are changed by this patch to use an inline function from host2net.h. (back ported from commit 2183683bd633818dd031b090b5530951de76f392) Signed-off-by: Werner Koch <[email protected]> [dkg: rebased to STABLE-BRANCH-1-4] Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* gpg: Need to init the trustdb for import.Werner Koch2014-03-061-0/+1
| | | | | | | | | | * g10/trustdb.c (clear_ownertrusts): Init trustdb. -- This is actually a hack to fix a bug introduced with commit 2528178. Debian uses it and thus we should do too. GnuPG-bug-id: 1622
* gpg: Do not require a trustdb with --always-trust.Werner Koch2013-10-111-85/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/tdbio.c (tdbio_set_dbname): Add arg R_NOFILE. * g10/trustdb.c (trustdb_args): Add field no_trustdb. (init_trustdb): Set that field. (revalidation_mark): Take care of a nonexistent trustdb file. (read_trust_options): Ditto. (get_ownertrust): Ditto. (get_min_ownertrust): Ditto. (update_ownertrust): Ditto. (update_min_ownertrust): Ditto. (clear_ownertrusts): Ditto. (cache_disabled_value): Ditto. (check_trustdb_stale): Ditto. (get_validity): Ditto. * g10/gpg.c (main): Do not create a trustdb with most commands for trust-model always. -- This slightly changes the semantics of most commands in that they won't create a trustdb if --trust-model=always is used. It just does not make sense to create a trustdb if there is no need for it. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 1a0eeaacd1bf09fe5125dbc3f56016bc20f3512e) Resolved conflicts: g10/gpg.c g10/tdbio.h g10/trustdb.c (indentation fixes)
* Actually show translators comments in PO filesDavid Prévot2012-08-241-5/+5
| | | | | | | -- Note that strings marked for gettext need to immediately follow a TRANSLATOR comment block.
* Changes to --min-cert-level should cause a trustdb rebuild (issue 1366)David Shaw2012-01-201-3/+7
| | | | | | | | | | | | | | | | * g10/gpgv.c, g10/trustdb.c (read_trust_options): Add min_cert_level * g10/trustdb.c (check_trustdb_stale): Request a rebuild if pending_check_trustdb is true (set when we detect a trustdb parameter has changed). * g10/keylist.c (public_key_list): Use 'l' in the "tru" with-colons listing for min_cert_level not matching. * g10/tdbio.c (tdbio_update_version_record, create_version_record, tdbio_db_matches_options, tdbio_dump_record, tdbio_read_record, tdbio_write_record): Add a byte for min_cert_level in the tdbio version record.
* Remove warnings on VMSWerner Koch2010-10-201-1/+1
|
* Fix some spelling errors. Fixes bug#1127.Werner Koch2009-12-211-2/+2
|
* Fix bug#1138.Werner Koch2009-09-281-0/+6
|
* Parse EXTCAP lines from the card.Werner Koch2009-07-231-0/+21
| | | | | Change messages for a corrupt trustdb.
* * trustdb.c (validate_one_keyblock): Fix the trust signatureDavid Shaw2008-11-181-40/+62
| | | | | | | calculations so that we lower the trust depth of signatures to fit within the current chain, rather than discarding any signature that does not fit within the trust depth.
* * trustdb.c (sanitize_regexp): New. Protect against dangerous regexpsDavid Shaw2007-12-121-11/+86
| | | | | | | (malloc bombs) by force-commenting any characters aside from the ones we explicitly want. (check_regexp): Use it here before passing the regexp to regcomp().
* Switched to GPLv3.Werner Koch2007-10-231-4/+2
| | | | | Updated gettext.
* * options.h, gpg.c (main, parse_trust_model), pkclist.cDavid Shaw2006-03-071-6/+1
| | | | | | | (check_signatures_trust), mainproc.c (check_sig_and_print, pka_uri_from_sig), trustdb.c (init_trustdb): Some tweaks to PKA so that it is a verify-option now.
* Finished PKA featureWerner Koch2005-12-201-2/+8
|
* Some cleanup so we don't build files that are completely ifdeffed out. David Shaw2005-12-061-1/+1
| | | | | | This causes a warning on Sun's cc. Do the internal regex code as well for consistency.
* * keyedit.c (keyedit_menu, menu_clean): Simplify clean options to justDavid Shaw2005-11-181-26/+20
| | | | | | | | | | | | | | "clean", and add "minimize". * import.c (parse_import_options): Make help text match the export versions of the options. * options.h, export.c (parse_export_options, do_export_stream): Reduce clean options to two: clean and minimize. * trustdb.h, trustdb.c (clean_one_uid): New function that joins uid and sig cleaning into one for a simple API outside trustdb.
* * trustdb.h, trustdb.c (clean_key): New function to handle keyDavid Shaw2005-11-121-8/+40
| | | | | | | | | | | cleaning from one convenient place. * options.h, import.c (parse_import_options, clean_sigs_from_all_uids, import_one): Reduce clean options to two: clean and minimize. * parse-packet.c (setup_user_id): Remove. (parse_user_id, parse_attribute): Just use xmalloc_clear instead.
* * trustdb.c (clean_uid_from_key, clean_uids_from_key): SignificantlyDavid Shaw2005-11-121-66/+49
| | | | | simpler implementation.
* * keyedit.c (keyedit_menu, menu_clean_sigs_from_uids): Add "minimize"David Shaw2005-11-101-2/+0
| | | | | command.
* * packet.h, keyedit.c (menu_clean_uids_from_key), trustdb.cDavid Shaw2005-11-101-9/+6
| | | | | | (clean_uids_from_key): Fix display bug where sigs cleaned for other reasons caused a uid to appear as if it had been compacted.
* * trustdb.h, trustdb.c (clean_sigs_from_uid): Add flag to remove allDavid Shaw2005-11-101-3/+9
| | | | | | | | non-selfsigs from key during cleaning. Change all callers. * export.c (do_export_stream): Use it here so we don't need additional minimize code in the export path.
* * trustdb.c (clean_sigs_from_uid): Include sigs from unavailable keys inDavid Shaw2005-11-021-5/+11
| | | | | the sigs that are cleaned. Suggested by Dirk Traulsen and many others.
* * import.c (import_one): Do collapse_uids() before we do any cleaningDavid Shaw2005-11-021-2/+7
| | | | | | | | | | | | | | | so keyserver mangled keys with doubled user IDs can be properly cleaned - possibly sigs on the different user IDs cancel each other out. * import.c (parse_import_options), export.c (parse_export_options): List "xxx-clean" before the longer options so we don't end up with a partial match on the longer options. * trustdb.c (clean_uids_from_key): Return proper number of cleaned user IDs. Don't count user IDs as cleaned unless we actually delete something.
* Converted all m_free to xfree etc.Werner Koch2005-07-271-20/+20
|
* * trustdb.c (clean_uids_from_key): Don't keep a valid selfsig aroundDavid Shaw2005-07-091-8/+4
| | | | | | | | | | | | | when compacting a uid. There is no reason to make an attacker's job easier - this way they only have a revocation which is useless in bringing the uid back. * keydb.h, kbnode.c (undelete_kbnode): Removed. No longer needed. * import.c (chk_self_sigs): Allow a uid revocation to be enough to allow importing a particular uid (no self sig needed). This allows importing compacted uids.
* * keygen.c (save_unprotected_key_to_card): Fix gcc4 warning.David Shaw2005-06-141-2/+6
| | | | | | | | | | * options.h, import.c (parse_import_options, import_one): Add import-clean-uids option to automatically compact unusable uids when importing. Like import-clean-sigs, this may nodify the local keyring. * trustdb.c (clean_uids_from_key): Only allow selfsigs to be a candidate for re-inclusion.
* * options.h, export.c (do_export_stream), keyedit.c (keyedit_menu,David Shaw2005-06-101-60/+0
| | | | | | | | | menu_clean_subkeys_from_key), trustdb.h, trustdb.c (clean_subkeys_from_key): Remove subkey cleaning function. It is of very limited usefulness since it cannot be used on any subkey that can sign, and can only affect multiple selfsigs on encryption-only subkeys.
* * keydb.h, kbnode.c (undelete_kbnode): New function to undelete aDavid Shaw2005-06-101-7/+34
| | | | | | | | kbnode. * trustdb.c (clean_uids_from_key): Further tweak the algorithm so that the last good selfsig is kept when the chosen selfsig is a revocation.
* * trustdb.c (clean_uids_from_key), keyedit.cDavid Shaw2005-06-091-15/+9
| | | | | | (menu_clean_uids_from_key): Tweak algorithm to preserve the last selfsig which helps prevent uid resurrections.
* * keyedit.c (menu_clean_uids_from_key, menu_clean_subkeys_from_key),David Shaw2005-05-311-2/+2
| | | | | | trustdb.c (clean_uids_from_key, clean_subkeys_from_key): Fix mingw32 build warnings. Noted by Joe Vender.
* Updated FSF street address and preparations for a release candidate.Werner Koch2005-05-311-1/+2
|
* * trustdb.h, trustdb.c (clean_subkeys_from_key): New. Walk throughDavid Shaw2005-05-311-8/+68
| | | | | | | | | | | | | the subkeys on a key, and mark any that aren't usable for deletion. Note that a signing subkey is never marked for deletion since these keys are still useful after expiration or revocation. * keyedit.c (menu_clean_subkeys_from_key): New function to call clean_subkeys_from_key() on a key. Note that the strings here are not marked for translation yet. The UI is still in flux, and there is no point in annoying the translators twice. (keyedit_menu): Call it here as part of the "clean" command.
* * trustdb.h, trustdb.c (clean_uids_from_key): New. Walk through theDavid Shaw2005-05-301-1/+74
| | | | | | | | | user IDs on a key, and mark any that aren't valid for deletion. * keyedit.c (menu_clean_uids_from_key): New function to call clean_uids_from_key() on a key. (keyedit_menu): Call it from here as part of the "clean" command.
* * trustdb.h, trustdb.c (mark_usable_uid_certs): Add flags for theDavid Shaw2005-04-241-16/+94
| | | | | | | | | | no-pubkey and chosen revocation cases. (clean_uid): New function to clean a user ID of unusable (as defined by mark_usable_uid_certs) certs. * keyedit.c (keyedit_menu, menu_clean_uids): Call it here for new "clean" command that removes unusable sigs from a key.
* * trustdb.h, trustdb.c (trustdb_check_or_update): New. If the trustdbDavid Shaw2005-02-061-0/+14
| | | | | | | | | | | | | | is dirty and --interactive is set, do an --update-trustdb. If not interactive, do a --check_trustdb unless --no-auto-check-trustdb is set. * import.c (import_keys_internal): Moved from here. * keyserver.c (keyserver_refresh): Call it here after all refreshing has happened so that we don't rebuild after each preferred keyserver set of imports, but do one big rebuild at the end. This is Debian bug #293816, noted by Kurt Roeckx.
* * apdu.c (apdu_send_le, apdu_send_direct), keylist.cDavid Shaw2004-12-151-2/+2
| | | | | | | | | | (status_one_subpacket, print_one_subpacket): Fix some compiler warnings. * g10.c (main): Fix --compression-algo to take a string argument like --compress-algo. * trustdb.c (uid_trust_string_fixed): For safety, check for a pk.
* * trustdb.c (uid_trust_string_fixed): Show uids as revoked if the key isDavid Shaw2004-12-141-3/+4
| | | | | | | | | | | | | revoked. * keyedit.c (show_key_with_all_names): Don't show validity for secret key UIDs. * keyedit.c (parse_sign_type): New. Figure out the flags (local, nonrevoke, trust) for a signature. (keyedit_menu): Call it here so we can mix and match flags, and don't need "nrltsign", "ltsign", "tnrsign", etc, etc, etc.
* * options.h, g10.c (main), textfilter.c (standard): Use --rfc2440 orDavid Shaw2004-12-111-0/+1
| | | | | | | | --openpgp directly to determine the end of line hashing rule. * trustdb.c (uid_trust_string_fixed): Show uids as expired if the key is expired.
* * trustdb.c (uid_trust_string_fixed): Use a string that can be atoi-ed,David Shaw2004-11-251-3/+4
| | | | | but also has a comment for the translator.
* * trustdb.h, trustdb.c (uid_trust_string_fixed): New. Return a fixed-sizeDavid Shaw2004-11-241-0/+28
| | | | | | | | | | | translatable string similar to trust_value_to_string. This allows for easier lining up of displays. * keyedit.c (show_key_with_all_names), keylist.c (list_keyblock_print): Use it here to print validity strings. * gpgv.c: Stub.
* * pkclist.c (do_edit_ownertrust): Different prompt when we're using directDavid Shaw2004-10-131-0/+9
| | | | | | | | | | | | | | trust since the meaning is different. * keyedit.c (trustsig_prompt): Change the strings to match the ones in pkclist.c:do_edit_ownertrust to make translation easier. * trustdb.c (trust_model_string, get_validity): Add direct trust model which applies to the key as a whole and not per-uid. * options.h, g10.c (parse_trust_model): New. (main): Call it from here to do string-to-trust-model.
* * pkclist.c (do_edit_ownertrust): Use the same translated string forDavid Shaw2004-10-111-4/+4
| | | | | | | | | | | | | | showing the user ID as mainproc.c:print_pkenc_list. * mainproc.c (print_pkenc_list): Allow translating the quotes around the user ID. * card-util.c, g10.c, photoid.c, trustdb.c: The last of the \"%s\" -> `%s' quoting for things that aren't user IDs. * keyserver.c (keyserver_spawn): If there is no keyserver host, print the whole URI since it is self-contained.
* some late minor fixes.V1-3-6Werner Koch2004-05-221-4/+4
|
* * trustdb.c (update_min_ownertrust, validate_keys): Do not use keystrDavid Shaw2004-03-191-4/+5
| | | | | | | | | | | | | | | functions in log_debug. * import.c (import_one): Try and collapse user IDs when importing a key for the first time. * keyedit.c (menu_addrevoker): Allow appointing a subkey as a designated revoker if the user forces it via keyid!, so long as the subkey can certify. Also use the proper date string when prompting for confirmation. * g10.c (main): Maintain ordering of multiple Comment lines. Requested by Peter Hyman.
* * trustdb.c (add_utk, verify_own_keys, update_min_ownertrust,David Shaw2004-03-151-31/+30
| | | | | get_validity, ask_ownertrust, validate_keys): --keyid-format conversion.
* * plaintext.c: Copyright.David Shaw2004-02-241-1/+1
| | | | | | | | | | | | | | * encode.c (encode_simple): Show cipher with --verbose. * options.h, g10.c (main), keyedit.c (sign_keys): Add --ask-cert-level option to enable cert level prompts during sigs. Defaults to on. Simplify --default-cert-check-level to --default-cert-level. If ask-cert-level is off, or batch is on, use the default-cert-level as the cert level. * options.h, g10.c (main), trustdb.c (mark_usable_uid_certs): Simplify --min-cert-check-level to --min-cert-level.
* * options.h, g10.c (main), trustdb.c (mark_usable_uid_certs): AddDavid Shaw2004-02-231-2/+5
| | | | | | --min-cert-check-level option to specify minimum cert check level. Defaults to 2 (so 0x11 sigs are ignored). 0x10 sigs cannot be ignored.
* * trustdb.c (reset_trust_records): New, faster, implementation thatDavid Shaw2004-01-211-86/+27
| | | | | doesn't involve a keyring scan. (clear_validity): Removed.