aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* g10: Fix another race condition for trustdb access.Niibe Yutaka2016-06-151-2/+5
| | | | | | | | | | | | | | | * g10/tdbio.c (create_version_record): Call create_hashtable to always make hashtable, together with the version record. (get_trusthashrec): Remove call to create_hashtable. -- GnuPG-bug-id: 1675 Thanks to Scott Moser to reproducible script and patience. Signed-off-by: NIIBE Yutaka <[email protected]> (backport from master commit 35a3ce2acf78a95fecbccfd8db0560cca24232df)
* g10: Make sure to have the directory for trustdb.NIIBE Yutaka2016-02-121-45/+52
| | | | | | | | | | | | | | | | * 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]> (backport from master commit 2f3e42047d17313eeb38d354048f343158402a8d)
* w32: Avoid warning when using newer mingw versions.Werner Koch2015-12-191-1/+1
| | | | | | * g10/tdbio.c (ftruncate): Do not define if already defined. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix a race condition initially creating trustdb.NIIBE Yutaka2015-06-161-3/+3
| | | | * g10/tdbio.c (take_write_lock, tdbio_set_dbname): Fix message.
* g10: Fix a race condition initially creating trustdb.NIIBE Yutaka2015-06-151-65/+56
| | | | | | | | | | | | | * g10/tdbio.c (take_write_lock, release_write_lock): New. (put_record_into_cache, tdbio_sync, tdbio_end_transaction): Use new lock functions. (tdbio_set_dbname): Fix the race. (open_db): Don't call dotlock_create. -- (backported from 2.1 commit fe5c6edaed78839303d67e01e141cfc6b5de9aec) GnuPG-bug-id: 1675
* Use inline functions to convert buffer data to scalars.Werner Koch2015-02-231-11/+11
| | | | | | | | | | | | | | | | | | | * 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: Do not require a trustdb with --always-trust.Werner Koch2013-10-111-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)
* Changes to --min-cert-level should cause a trustdb rebuild (issue 1366)David Shaw2012-01-201-5/+11
| | | | | | | | | | | | | | | | * 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.
* Replace file locking by the new portable dotlock code.Werner Koch2012-01-101-24/+24
| | | | | | | | | | | | | * include/dotlock.h: New. From current gnupg master. * util/dotlock.c: Ditto. Include util.h. The major changes done in master are: Factor Unix and W32 specific code out into specific functions. Define HAVE_POSIX_SYSTEM. Rearrange some functions. (disable_dotlock): Rename to dotlock_disable. (create_dotlock): Rename to dotlock_create and add a dummy arg. (destroy_dotlock): Rename to dotlock_destroy. (make_dotlock): Rename to dotlock_take. (release_dotlock): Rename to dotlock_release. (remove_lockfiles): Rename to dotlock_remove_lockfiles.
* fix bug#1162.Werner Koch2009-12-151-1/+2
|
* Parse EXTCAP lines from the card.Werner Koch2009-07-231-3/+3
| | | | | Change messages for a corrupt trustdb.
* Fix bug#931.Werner Koch2009-05-051-8/+8
| | | | | Silent a compiler warning.
* Fix !EROFS bugWerner Koch2008-08-011-1/+2
|
* Switched to GPLv3.Werner Koch2007-10-231-4/+2
| | | | | Updated gettext.
* Converted all m_free to xfree etc.Werner Koch2005-07-271-9/+9
|
* * tdbio.c (open_db): Check for EROFS. Suggested by Bryce Nichols.Werner Koch2005-07-181-1/+5
| | | | | | * ttyio.c (do_get): Move printing of the prompt after disabling echo. Suggested by Scott Worley.
* Updated FSF street address and preparations for a release candidate.Werner Koch2005-05-311-1/+2
|
* * misc.c (is_secured_filename): New.Werner Koch2004-10-141-10/+15
| | | | | | | | | | | | | | | | * keydb.c (maybe_create_keyring) * tdbio.c (tdbio_set_dbname) * plaintext.c (handle_plaintext) * openfile.c (copy_options_file, open_outfile) * exec.c (exec_write) * keygen.c (do_generate_keypair, gen_card_key_with_backup) * sign.c (sign_file, clearsign_file) * keyring.c (create_tmp_file, do_copy): Check for secured files before creating them. * keygen.c (print_status_key_created): s/unsigned char/byte/ due to a strange typedef for RISC OS. Noted by Stefan.
* Added SELInux hacks and did some cleanups.Werner Koch2004-10-131-0/+1
|
* * misc.c (pull_in_libs): Dead code. Removed.David Shaw2003-12-301-12/+8
| | | | | | | | | | | | | | | | | | | | | | | * sig-check.c (check_revocation_keys): Comments. * getkey.c (merge_selfsigs_main): Don't bother to check designated revoker sigs if the key is already revoked. * packet.h, getkey.c (merge_selfsigs_main): New "maybe_revoked" flag on PKs. It is set when there is a revocation signature from a valid revocation key, but the revocation key is not present to verify the signature. * pkclist.c (check_signatures_trust): Use it here to give a warning when showing key trust. * compress-bz2.c: Include stdio.h. Solaris 9 has a very old bzip2 library and we can at least guarantee that it won't fail because of the lack of stdio.h. * tdbio.c: Fixed format string bugs related to the use of DB_NAME. Reported by Florian Weimer.
* * parse-packet.c (parse_signature): No need to reserve 8 bytes for theDavid Shaw2003-07-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unhashed signature cache any longer. * misc.c (pct_expando): Add two new expandos - signer's fingerprint (%g), and signer's primary fingerprint (%p). * Makefile.am: Include W32LIBS where appropriate. * g10.c (main): Add --rfc2440 alias for --openpgp since in a few months, they won't be the same thing. * keyserver.c (parse_keyserver_uri): Accept "http" as an alias for "hkp", since it is occasionally written that way. (keyserver_spawn): Use ascii_isspace to avoid locale issues. * keygen.c (ask_user_id): Make --allow-freeform-uid apply to the email field as well as the name field, and allow mixing fields when it is set. * options.skel: Use subkeys.pgp.net as the default keyserver. * trustdb.c (validate_one_keyblock): Certifications on revoked or expired uids do not count in the web of trust. * signal.c (init_one_signal, pause_on_sigusr, do_block): Only use sigprocmask() if we have sigset_t, and only use sigaction() if we have struct sigaction. This is for Forte c89 on Solaris which seems to define only the function call half of the two pairs by default. (pause_on_sigusr): Typo. (do_block): If we can't use sigprocmask() and sigset_t, try to get the number of signals from NSIG as well as MAXSIG, and if we can't, fail with an explanation. * signal.c, tdbio.c: Comment out the transaction code. It was not used in this version, and was causing some build problems on quasi-posix platforms (Solaris and Forte c89). * keylist.c (list_keyblock_colon): Don't include validity values when listing secret keys since they can be incorrect and/or misleading. This is a temporary kludge, and will be handled properly in 1.9/2.0. * mainproc.c (check_sig_and_print): Only show the "key available from" preferred keyserver line if the key is not currently present. * keyedit.c (sign_uids): Do not sign expired uids without --expert (same behavior as revoked uids). Do not allow signing a user ID without a self-signature. --expert overrides. Add additional prompt to the signature level question. (menu_expire): When changing expiration dates, don't replace selfsigs on revoked uids since this would effectively unrevoke them. There is also no point in replacing expired selfsigs. This is bug #181 * g10.c (add_notation_data): Make sure that only ascii is passed to iscntrl. Noted by Christian Biere. * getkey.c (classify_user_id2): Replaced isspace by spacep * keygen.c (ask_user_id): Ditto. (get_parameter_algo): Ditto. * keyedit.c (keyedit_menu): Ditto. * tdbdump.c (import_ownertrust): Ditto. s/isxdigit/hexdigitp/. * revoke.c (ask_revocation_reason): * keyserver.c (keyserver_spawn): Dito.
* * tdbio.c (create_version_record): Only create new trustdbs withDavid Shaw2003-05-011-1/+4
| | | | | | | | | | | | | | | | | | | | TM_CLASSIC or TM_PGP. * trustdb.h, trustdb.c (trust_string, get_ownertrust_string, get_validity_string, ask_ownertrust, validate_keys), pkclist.c (do_edit_ownertrust): Rename trust_string to trust_value_to_string for naming consistency. * trustdb.h, trustdb.c (string_to_trust_value): New function to translate a string to a trust value. * g10.c (main): Use string_to_trust_value here for --force-ownertrust. * options.h, g10.c (main), trustdb.c (trust_model_string, init_trustdb, check_trustdb, update_trustdb, get_validity, validate_one_keyblock): An "OpenPGP" trust model is misleading since there is no official OpenPGP trust model. Use "PGP" instead.
* * sign.c (do_sign): Show the hash used when making a signature in verboseDavid Shaw2003-04-261-0/+12
| | | | | | | | | | | | mode. * tdbio.h, tdbio.c (tdbio_read_model): New function to return the trust model used in a given trustdb. * options.h, g10.c (main), trustdb.c (init_trustdb, check_trustdb, update_trustdb): Use tdbio_read_model to implement an "auto" trust model which is set via the trustdb.
* * tdbio.c (tdbio_set_dbname): Fix assertion failure withDavid Shaw2003-01-121-3/+12
| | | | | non-fully-qualified trustdb names.
* * packet.h, tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record),David Shaw2003-01-061-0/+4
| | | | | | | | | | | | trustdb.c (update_validity): Store temporary full & marginal counts in the trustdb. (clear_validity, get_validity_counts): Return and clear temp counts. (store_validation_status): Keep track of which keyids have been stored. (validate_one_keyblock, validate_key_list): Use per-uid copies of the full & marginal counts so they can be recalled for multiple levels. (validate_keys): Only use unused keys for each new round. (reset_unconnected_keys): Rename to reset_trust_records, and only skip specifically excluded records.
* * tdbio.c (tdbio_read_record, tdbio_write_record): Compact theDavid Shaw2002-12-111-4/+4
| | | | | | | | | | | | | | | RECTYPE_TRUST records a bit. * g10.c (main): Comment out --list-trust-path until it can be implemented. * import.c (import_one): Warn when importing an Elgamal primary that this may take some time (to verify self-sigs). (chk_self_sigs): Try and cache all self-sigs so the keyblock is written to the keyring with a good rich cache. * keygen.c (ask_algo): Make the Elgamal sign+encrypt warning stronger, and remove the RSA sign+encrypt warning.
* * trustdb.c (validate_keys): Show trust parameters when building trustdb,David Shaw2002-12-041-26/+15
| | | | | | | | | and make sure that the version record update was successful. (init_trustdb): If the current parameters aren't what was used for building the trustdb, the trustdb is invalid. * tbio.c (tdbio_db_matches_options): Update to work with new trustdbs.
* * tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record): Store trustDavid Shaw2002-12-041-8/+35
| | | | | | | | | | | | model in the trustdb version record. (tdbio_update_version_record): New function to update version record values during a trustdb check or update. (tdbio_dump_record): Show trust model in dump. * trustdb.c (validate_keys): Call tdbio_update_version_record on success so that the correct options are stored in the trustdb. * options.h: rearrange trust models so that CLASSIC is 0 and OPENPGP is 1.
* * exec.c [__CYGWIN32__]: Keep cygwin separate from Mingw32; we don't needDavid Shaw2002-11-131-2/+2
| | | | | | | | | | | | | | | it here as it behaves more like a Posix system. From Werner on stable branch. * passphrase.c (agent_get_passphrase): Ditto. From Werner on stable branch. * tdbio.c (MY_O_BINARY): Need binary mode with Cygwin. From Werner on stable branch. * g10.c, gpgv.c (main) [__CYGWIN32__]: Don't get the homedir from the registry. From Werner on stable branch.
* * keyedit.c (print_and_check_one_sig, show_key_and_fingerprint,David Shaw2002-10-291-0/+2
| | | | | | | | | | | | | menu_addrevoker), keylist.c (list_keyblock_print, print_fingerprint): Show "T" or the trust depth for trust signatures, and add spaces to some strings to make room for it. * packet.h, parse-packet.c (dump_sig_subpkt, parse_one_sig_subpkt, parse_signature): Parse trust signature values. * tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record): Reserve a byte for the minimum ownertrust value (for use with trust signatures).
* * g10.c, options.h: Removed option --emulate-checksum-bug.Werner Koch2002-09-111-10/+14
| | | | | | | | | | | | | | | * misc.c (checksum_u16_nobug): Removed. (checksum_u16): Removed the bug emulation. (checksum_mpi): Ditto. (checksum_mpi_counted_nbits): Removed and replaced all calls with checksum_mpi. * parse-packet.c (read_protected_v3_mpi): New. (parse_key): Use it here to store it as an opaque MPI. * seckey-cert.c (do_check): Changed the v3 unprotection to the new why to store these keys. (protect_secret_key): Likewise. * build-packet.c (do_secret_key): And changed the writing.
* * tdbio.c (tdbio_set_dbname): Create new trustdbs with user-onlyDavid Shaw2002-08-081-0/+3
| | | | | permissions.
* * keyedit.c (menu_revsig): Properly show a uid is revoked withoutDavid Shaw2002-08-071-2/+0
| | | | | | | | | | | | | | | restarting gpg. This is Debian bug 124219, though their supplied patch will not do the right thing. * main.h, tdbio.c (tdbio_set_dbname), misc.c (removed check_permissions), keydb.c (keydb_add_resource), g10.c (main, check_permissions): Significant reworking of the permission check mechanism. The new behavior is to check everything in the homedir by checking the homedir itself. If the user wants to put (possibly shared) keyrings outside the homedir, they are not checked. The options file and any extension files are checked wherever they are, as well as their enclosing directories. This is Debian bug 147760.
* Update head to match stable 1.0David Shaw2002-06-291-554/+375
|
* See ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner KochWerner Koch2000-07-141-17/+5
|
* See ChangeLog: Thu Jan 27 18:00:44 CET 2000 Werner KochWerner Koch2000-01-271-57/+57
|
* See ChangeLog: Mon Jan 24 13:04:28 CET 2000 Werner KochWerner Koch2000-01-241-7/+7
|
* See ChangeLog: Mon Sep 6 19:59:08 CEST 1999 Werner KochWerner Koch1999-09-061-4/+5
|
* See ChangeLog: Wed Jul 7 13:23:40 CEST 1999 Werner KochWerner Koch1999-07-071-2/+2
|
* See ChangeLog: Tue Jun 29 21:44:25 CEST 1999 Werner KochWerner Koch1999-06-291-8/+137
|
* See ChangeLog: Sat Jun 26 12:15:59 CEST 1999 Werner KochWerner Koch1999-06-261-1/+1
|
* See ChangeLog: Sun Apr 18 10:11:28 CEST 1999 Werner KochWerner Koch1999-04-181-2/+3
|
* See ChangeLog: Wed Mar 17 13:09:03 CET 1999 Werner KochWerner Koch1999-03-171-2/+5
|
* See ChangeLog: Thu Mar 11 16:39:46 CET 1999 Werner KochWerner Koch1999-03-111-11/+73
|
* See ChangeLog: Tue Feb 16 14:10:02 CET 1999 Werner KochWerner Koch1999-02-161-3/+4
|
* See ChangeLog: Sat Feb 13 14:13:04 CET 1999 Werner KochWerner Koch1999-02-131-0/+5
|
* See ChangeLog: Wed Feb 10 17:15:39 CET 1999 Werner KochWerner Koch1999-02-101-27/+51
|
* See ChangeLog: Thu Jan 7 18:00:58 CET 1999 Werner KochWerner Koch1999-01-071-9/+14
|
* See ChangeLog: Tue Dec 29 14:41:47 CET 1998 Werner KochWerner Koch1998-12-291-4/+4
|
* See ChangeLog: Wed Dec 23 13:34:22 CET 1998 Werner KochWerner Koch1998-12-231-3/+3
|