aboutsummaryrefslogtreecommitdiffstats
path: root/g10 (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* gpg: When the TOFU DB is in batch mode, periodically drop the locks.Neal H. Walfield2015-10-261-0/+30
| | | | | | | | | | | | * g10/tofu.c: Include <sched.h>. (batch_update_started): New variable. (begin_transaction): If we've been in batch mode for a while, then commit any extant batch transactions. (tofu_begin_batch_update): If we are not in batch mode, initialize batch_update_started. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Provide an interface to patch TOFU updates.Neal H. Walfield2015-10-235-53/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/tofu.c (struct db): Rename begin_transaction to savepoint_batch. Rename end_transaction to savepoint_batch_commit. Update users. Remove field rollback. Add fields savepoint_inner and savepoint_inner_commit. Add field batch_update. (dump_cache): New function. (batch_update): New variable. (begin_transaction). New function. (end_transaction): New function. (rollback_transaction): New function. (tofu_begin_batch_update): New function. (tofu_end_batch_update): New function. (closedb): End any pending batch transaction. (closedbs): Assert that none of the DBs have a started batch transaction if we not in batch mode. (record_binding): Use the begin_transaction, end_transaction and rollback_transaction functions instead of including the SQL inline. Also start a batch mode transaction if we are using the flat format. (tofu_register): Use the begin_transaction, end_transaction and rollback_transaction functions instead of including the SQL inline. * g10/gpgv.c (tofu_begin_batch_update): New function. (tofu_end_batch_update): New function. * g10/test-stubs.c (tofu_begin_batch_update): New function. (tofu_end_batch_update): New function. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Cache prepared SQL queries and open DB connections.Neal H. Walfield2015-10-231-211/+518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/tofu.c: Include <stdarg.h>. (prepares_saved) [DEBUG_TOFU_CACHE]: New variable. (queries) [DEBUG_TOFU_CACHE]: New variable. (struct db): Add fields prevp, begin_transaction, end_transaction, rollback, record_binding_get_old_policy, record_binding_update, record_binding_update2, get_policy_select_policy_and_conflict, get_trust_bindings_with_this_email, get_trust_gather_other_user_ids, get_trust_gather_other_keys, register_already_seen, and register_insert. [DEBUG_TOFU_CACHE]: Add field hits. (STRINGIFY): New macro. (STRINGIFY2): New macro. (enum sqlite_arg_type): New enum. (sqlite3_stepx): New function. (combined_db): Remove variable. (opendb): Don't cache the combined db. (struct dbs): New struct. Update users to use this as the head of the local DB list rather than overloading struct db. (unlink_db): New function. (link_db): New function. (db_cache): New variable. (db_cache_count): New variable. (DB_CACHE_ENTRIES): Define. (getdb): If the dbs specific cache doesn't include the DB, look at DB_CACHE. Only if that also doesn't include the DB open the corresponding DB. (closedb): New function. (opendbs): Don't open the combined DB. Just return an initialized struct dbs. (closedbs): Don't close the dbs specific dbs. Attach them to the front of DB_CACHE. If DB_CACHE contains more than DB_CACHE_ENTRIES, close enough dbs from the end of the DB_CACHE list such that DB_CACHE only contains DB_CACHE_ENTRIES. Don't directly close the dbs, instead use the new closedb function. [DEBUG_TOFU_CACHE]: Print out some statistics. (record_binding): Use sqlite3_stepx instead of sqlite3_exec or sqlite3_exec_printf. (get_policy): Likewise. (get_trust): Likewise. (tofu_register): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Return the DBs meta-handle rather than the sqlite3 handle.Neal H. Walfield2015-10-231-28/+28
| | | | | | | | * g10/tofu.c (getdb): Return a struct db * instead of an sqlite *. Update users. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Use the proper type.Neal H. Walfield2015-10-233-13/+2
| | | | | | | | | | * g10/options.h: Include "tofu.h". (opt.tofu_default_policy): Change type to enum tofu_policy. * g10/gpgv.c (enum tofu_policy): Don't redeclare. * g10/test-stubs.c (enum tofu_policy): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]>
* Move SRV RR code from common/ to dirmngr/.Werner Koch2015-10-221-3/+1
| | | | | | | | | | | | * common/srv.c: Merge into dirmngr/dns-stuff.c. Delete file. * common/srv.h: Merge into dirmngr/dns-stuff.h. Delete file. * common/Makefile.am (common_sources): Remove srv.c and srv.h. * g10/keyserver.c: Do not include srv.h. The code using it is anyway disabled. * dirmngr/http.c: Remove header srv.h and stubs. * dirmngr/t-dns-stuff.c: Add option --srv. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add a new OpenPGP card vendor.Werner Koch2015-10-211-0/+1
| | | | --
* Change capitalization of TOR to Tor.Werner Koch2015-10-211-2/+2
| | | | --
* gpg: If the saved trust model is unknown, default to tofu+pgp.Neal H. Walfield2015-10-211-2/+2
| | | | | | | | * g10/trustdb.c (init_trustdb): If the saved trust model is unknown, default to tofu+pgp instead of pgp. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Don't accidentally free UTK_LIST.Neal H. Walfield2015-10-211-1/+2
| | | | | | | * g10/trustdb.c (validate_keys): Don't free UTK_LIST. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: When evaluating trust reg exps, treat tofu+pgp like pgp.Neal H. Walfield2015-10-211-2/+4
| | | | | | | | | * g10/trustdb.c (validate_one_keyblock): When checking trust regular expressions, treat the tofu+pgp trust model the same as the pgp trust model. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: If a key is ultimate trusted, return that in the tofu model.Neal H. Walfield2015-10-211-2/+54
| | | | | | | | | | | | * g10/tofu.c (get_trust): If the policy is auto or none, check if the key is ultimately trusted. If so, return that. (tofu_register): If the key is ultimately trusted, don't show any statistics. (tofu_get_validity): Likewise. -- Signed-off-by: Neal H. Walfield <[email protected]> Suggested-by: Andre Heinecke <[email protected]>
* gpg: Keep the trust DB up to date for the tofu and tofu+pgp models.Neal H. Walfield2015-10-211-7/+18
| | | | | | | | | | | | | | * g10/trustdb.c (init_trustdb): Recognize tofu and tofu+pgp as possibly saved trust models. Also register the ultimately trusted keys if the trust model is tofu or tofu+pgp. (check_trustdb): Don't skip if the trust model is tofu or tofu+pgp. (update_trustdb): Likewise. (tdb_check_trustdb_stale): Likewise. (validate_keys): If the trust model is TOFU, just write out the ultimately trusted keys. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Factor out code into a standalone function.Neal H. Walfield2015-10-212-7/+16
| | | | | | | | * g10/trustdb.c (tdb_keyid_is_utk): New function. (add_utk): Use it. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Make the tofu DB check and initialization atomic.Neal H. Walfield2015-10-211-14/+16
| | | | | | | | | * g10/tofu.c (initdb): Make the version check and the database initialization atomic. -- Signed-off-by: Neal H. Walfield <[email protected]> Co-authored-by: Andre Heinecke <[email protected]>
* build: Allow building without SQLlite support.Werner Koch2015-10-206-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Add option --dsiable-tofu and --disable-sqlite. (NEED_SQLITE_VERSION): New var. (USE_TOFU): New ac_define and am_conditional. * autogen.sh (build-w32): Add PKG_CONFIG_LIBDIR to configure so that pkg-config find the correct .pc file. * g10/Makefile.am (tofu_source): New. Build only if enabled. * g10/gpg.c (parse_trust_model)[!USE_TOFU]: Disable tofu models. (parse_tofu_policy)[!USE_TOFU]: Disable all. (parse_tofu_db_format)[!USE_TOFU]: Disable all. (main) <aTOFUPolicy>[!USE_TOFU]: Skip. * g10/keyedit.c (show_key_with_all_names_colon)[!USE_TOFU]: Do not call tofu functions. * g10/keylist.c (list_keyblock_colon)[!USE_TOFU]: Ditto. * g10/trustdb.c (tdb_get_validity_core)[!USE_TOFU]: Skip tofu processing. -- This allows to build a minimal version of GnuPG. It is also currently required to build for Windows. Signed-off-by: Werner Koch <[email protected]>
* gpg: Don't die immediately if the TOFU DB is locked.Neal H. Walfield2015-10-201-0/+4
| | | | | | | * g10/tofu.c (opendb): Don't die immediately if the DB is locked. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Improve output.Neal H. Walfield2015-10-201-4/+4
| | | | | | | | * g10/tofu.c (get_trust): Also show the binding when indicating a conflict occurred. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Synchronize translation template.Neal H. Walfield2015-10-201-1/+1
| | | | | | | * g10/tofu.c (show_statistics): Synchronize translation template. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: When showing conflicts, also show bindings with no recorded sigs.Neal H. Walfield2015-10-201-20/+34
| | | | | | | | | | * g10/tofu.c (signature_stats_collect_cb): If the time_ago column is NULL, then both time_ago and count should be 0. (get_trust): Reverse the direction of the join so that we also get statistics about bindings without any signatures. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Improve text.Neal H. Walfield2015-10-201-7/+9
| | | | | | | | * g10/tofu.c (show_statistics): Improve text. -- Signed-off-by: Neal H. Walfield <[email protected]> Suggested-by: Malte <[email protected]>
* gpg: Use the right variable to display the information.Neal H. Walfield2015-10-201-3/+4
| | | | | | | | | * g10/tofu.c (get_trust): Use the right variable to display the conflicting key. -- Signed-off-by: Neal H. Walfield <[email protected]> Reported-by: Andre Heinecke <[email protected]>
* gpg: Make failing to create a directory a soft error.Neal H. Walfield2015-10-201-1/+1
| | | | | | | | * g10/tofu.c (getdb): Don't exit if we can't create the directory. Just return an error. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Remove unused prototype digest_algo_from_sig.Neal H. Walfield2015-10-201-1/+0
| | | | | | | | * g10/packet.h (digest_algo_from_sig): Remove prototype without a corresponding implementation. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Fix --desig-revoke.Neal H. Walfield2015-10-193-11/+14
| | | | | | | | | | * g10/revoke.c (gen_desig_revoke): Add additional parameter ctrl. Check that the secret key is available. If not, display an error message. -- Signed-off-by: Neal H. Walfield <[email protected]> Regression-due-to: 8459bcf9
* gpg: Improve function documentation and some comments.Neal H. Walfield2015-10-193-48/+223
| | | | | | | | | * g10/main.h: Improve function documentation. * g10/packet.h.h: Improve function documentation. * g10/sig-check.c: Improve function documentation and some comments. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Improve and regularize naming of signature checking functions.Neal H. Walfield2015-10-193-31/+41
| | | | | | | | | | | | | | * g10/packet.h (signature_check): Rename from this... (check_signature): ... to this. Update users. (signature_check2): Rename from this... (check_signature2): ... to this. Update users. * g10/sig-check.c (do_check): Rename from this... (check_signature_end): ... to this. Update users. (do_check_messages): Rename from this... (check_signature_metadata_validity): ... to this. Update users. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Mark local function as static.Neal H. Walfield2015-10-191-1/+1
| | | | | | | * g10/tdbio.c (put_record_into_cache): Mark as static. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Print warning when rejecting weak digestsDaniel Kahn Gillmor2015-10-193-5/+11
| | | | | | | | | | | | | | | | * g10/misc.c (print_md5_rejected_note): Rename to .. (print_digest_rejected_note): this. Parameterize function to take an enum gcry_md_algos. * g10/sig-check.c: Use print_digest_rejected_note() when rejecting signatures. -- 76afaed65e3b0ddfa4923cb577ada43217dd4b18 allowed extra --weak-digests, but removed the one call to print_md5_rejected_note(). This replaces and generalizes that warning. Signed-Off-By: Daniel Kahn Gillmor <[email protected]>
* gpg: Add option --weak-digest to gpg and gpgv.Daniel Kahn Gillmor2015-10-196-7/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * g10/options.h: Add additional_weak_digests linked list to opts. * g10/main.h: Declare weakhash linked list struct and additional_weak_digest() function to insert newly-declared weak digests into opts. * g10/misc.c: (additional_weak_digest): New function. (print_digest_algo_note): Check for deprecated digests; use proper gcry_md_algos type. * g10/sig-check.c: (do_check): Reject weak digests in addition to MD5. * g10/gpg.c: Add --weak-digest option to gpg. * doc/gpg.texi: Document gpg --weak-digest option. * g10/gpgv.c: Add --weak-digest option to gpgv. * doc/gpgv.texi: Document gpgv --weak-digest option. -- gpg and gpgv treat signatures made over MD5 as unreliable, unless the user supplies --allow-weak-digests to gpg. Signatures over any other digest are considered acceptable. Despite SHA-1 being a mandatory-to-implement digest algorithm in RFC 4880, the collision-resistance of SHA-1 is weaker than anyone would like it to be. Some operators of high-value targets that depend on OpenPGP signatures may wish to require their signers to use a stronger digest algorithm than SHA1, even if the OpenPGP ecosystem at large cannot deprecate SHA1 entirely today. This changeset adds a new "--weak-digest DIGEST" option for both gpg and gpgv, which makes it straightforward for anyone to treat any signature or certification made over the specified digest as unreliable. This option can be supplied multiple times if the operator wishes to deprecate multiple digest algorithms, and will be ignored completely if the operator supplies --allow-weak-digests (as before). MD5 is still always considered weak, regardless of any further --weak-digest options supplied. Signed-off-by: Daniel Kahn Gillmor <[email protected]> Capitialized some comments, shorted a line in do_check, and changed subject to name the option. -wk
* gpg: Fix formatting.Neal H. Walfield2015-10-191-6/+6
| | | | | | | * g10/tofu.c (get_trust): Fix formatting. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Don't forget to free some memory.Neal H. Walfield2015-10-191-0/+1
| | | | | | | * g10/tofu.c (tofu_register): Free SIG_DIGEST before returning. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: If a conflict occurs in batch mode, record that.Neal H. Walfield2015-10-191-6/+20
| | | | | | | | | * g10/tofu.c (get_trust): If a conflict occurs when MAY_ASK is false, set conflict to the key. When prompting the user, don't show the conflicting key if the conflicting key is the current key. -- Signed-off-by: Neal H. Walfield <[email protected]>
* gpg: Silence two more warnings.Werner Koch2015-10-182-3/+3
| | | | | | | | * g10/trustdb.c (tdb_get_validity_core): Silence a warning. * g10/tofu.c (tofu_register): Move SIG_DIGEST computation to the top so that it is not uninitialized in case of an early error. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix harmless compiler warnings.Werner Koch2015-10-183-67/+74
| | | | | | | | | | | | | | * g10/tofu.h (_tofu_GET_POLICY_ERROR): New. This avoids warnings about undefined enum values in a switch. * g10/trustdb.h (_tofu_GET_TRUST_ERROR): New. * g10/tofu.c (TIME_AGO_FUTURE_IGNORE): Move to the top. (opendbs): Avoid compiler warning (use braces). (GET_POLICY_ERROR): Replace define by enum _tofu_GET_POLICY_ERROR. (get_policy): Remove assert. (GET_TRUST_ERROR): Replace by _tofu_GET_TRUST_ERROR macro. (show_statistics): Undef MIN_SECS et al. after use. Signed-off-by: Werner Koch <[email protected]>
* g10: Fix assert.Neal H. Walfield2015-10-181-1/+1
| | | | | | | * g10/tofu.c (get_trust): Fix assert. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* g10: Add TOFU support.Neal H. Walfield2015-10-1815-71/+2991
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Check for sqlite3. (SQLITE3_CFLAGS): AC_SUBST it. (SQLITE3_LIBS): Likewise. * g10/Makefile.am (AM_CFLAGS): Add $(SQLITE3_CFLAGS). (gpg2_SOURCES): Add tofu.h and tofu.c. (gpg2_LDADD): Add $(SQLITE3_LIBS). * g10/tofu.c: New file. * g10/tofu.h: New file. * g10/options.h (trust_model): Define TM_TOFU and TM_TOFU_PGP. (tofu_db_format): Define. * g10/packet.h (PKT_signature): Add fields digest and digest_len. * g10/gpg.c: Include "tofu.h". (cmd_and_opt_values): Declare aTOFUPolicy, oTOFUDefaultPolicy, oTOFUDBFormat. (opts): Add them. (parse_trust_model): Recognize the tofu and tofu+pgp trust models. (parse_tofu_policy): New function. (parse_tofu_db_format): New function. (main): Initialize opt.tofu_default_policy and opt.tofu_db_format. Handle aTOFUPolicy, oTOFUDefaultPolicy and oTOFUDBFormat. * g10/mainproc.c (do_check_sig): If the signature is good, copy the hash to SIG->DIGEST and set SIG->DIGEST_LEN appropriately. * g10/trustdb.h (get_validity): Add arguments sig and may_ask. Update callers. (tdb_get_validity_core): Add arguments sig and may_ask. Update callers. * g10/trust.c (get_validity) Add arguments sig and may_ask. Pass them to tdb_get_validity_core. * g10/trustdb.c: Include "tofu.h". (trust_model_string): Handle TM_TOFU and TM_TOFU_PGP. (tdb_get_validity_core): Add arguments sig and may_ask. If OPT.TRUST_MODEL is TM_TOFU or TM_TOFU_PGP, compute the TOFU trust level. Combine it with the computed PGP trust level, if appropriate. * g10/keyedit.c: Include "tofu.h". (show_key_with_all_names_colon): If the trust mode is tofu or tofu+pgp, then show the trust policy. * g10/keylist.c: Include "tofu.h". (public_key_list): Also show the PGP stats if the trust model is TM_TOFU_PGP. (list_keyblock_colon): If the trust mode is tofu or tofu+pgp, then show the trust policy. * g10/pkclist.c: Include "tofu.h". * g10/gpgv.c (get_validity): Add arguments sig and may_ask. (enum tofu_policy): Define. (tofu_get_policy): New stub. (tofu_policy_str): Likewise. * g10/test-stubs.c (get_validity): Add arguments sig and may_ask. (enum tofu_policy): Define. (tofu_get_policy): New stub. (tofu_policy_str): Likewise. * doc/DETAILS: Describe the TOFU Policy field. * doc/gpg.texi: Document --tofu-set-policy, --trust-model=tofu, --trust-model=tofu+pgp, --tofu-default-policy and --tofu-db-format. * tests/openpgp/Makefile.am (TESTS): Add tofu.test. (TEST_FILES): Add tofu-keys.asc, tofu-keys-secret.asc, tofu-2183839A-1.txt, tofu-BC15C85A-1.txt and tofu-EE37CF96-1.txt. (CLEANFILES): Add tofu.db. (clean-local): Add tofu.d. * tests/openpgp/tofu.test: New file. * tests/openpgp/tofu-2183839A-1.txt: New file. * tests/openpgp/tofu-BC15C85A-1.txt: New file. * tests/openpgp/tofu-EE37CF96-1.txt: New file. * tests/openpgp/tofu-keys.asc: New file. * tests/openpgp/tofu-keys-secret.asc: New file. -- Signed-off-by: Neal H. Walfield <[email protected]>.
* gpg: Try hard to use MDC also for sign+symenc.Werner Koch2015-10-123-9/+9
| | | | | | | | | | | | | | | * g10/encrypt.c (use_mdc): Make it a global func. * g10/sign.c (sign_symencrypt_file): Use that function to decide whether to use an MDC. * tests/openpgp/conventional-mdc.test: Add a simple test case. -- We used --force-mdc in sign+symenc mode (-cs) only with --force-mdc. That broke our assumption from commit 625e292 (GnuPG 2.1.9) that all uses of modern ciphers are using MDC. Reported-by: Ben Kibbey <[email protected]> Signed-off-by: Werner Koch <[email protected]>
* gpg: Add option --print-dane-records.Werner Koch2015-10-086-23/+134
| | | | | | | | | | | | | | | * g10/options.h (opt): Add field "print_dane_records". * g10/gpg.c (oPrintDANERecords): new. (opts): Add --print-dane-records. (main): Set that option. * g10/export.c (do_export): Remove EXPORT_DANE_FORMAT handling. (do_export_stream): Add EXPORT_DANE_FORMAT handling. * g10/keylist.c (list_keyblock_pka): Implement DANE record printing. * g10/gpgv.c (export_pubkey_buffer): New stub. * g10/test-stubs.c (export_pubkey_buffer): New stub. Signed-off-by: Werner Koch <[email protected]>
* Fix two unused/possible-uninitialized var warnings.Werner Koch2015-10-081-1/+0
| | | | --
* gpg: Pass CTRL parameter to all key listing functions.Werner Koch2015-10-084-34/+39
| | | | | | | | | | | | | | | | | | | | | * g10/keylist.c (public_key_list): Add arg CTRL. (secret_key_list): Ditto. (list_all, list_one): Ditto. (locate_one): Ditto. (list_keyblock_pka): Ditto. (list_keyblock): Ditto. (list_keyblock_direct): Ditto. * g10/keygen.c (proc_parameter_file): Add arg CTRL. (read_parameter_file): Ditto. (quick_generate_keypair): Ditto. (do_generate_keypair): Ditto. (generate_keypair): Pass arg CTRL. * g10/gpg.c (main): Pass arg CTRL to quick_generate_keypair. -- This will help use to implement the --server mode. Signed-off-by: Werner Koch <[email protected]>
* gpg: Remove unfinished experimental code to export as S-expressions.Werner Koch2015-10-072-175/+10
| | | | | | | | | | | | | * g10/options.h (EXPORT_SEXP_FORMAT): Remove. (EXPORT_DANE_FORMAT): New. * g10/export.c (parse_export_options): Remove "export-sexp-format". (export_seckeys): Adjust for removed option. (export_secsubkeys): Ditto. (do_export): Prepare for DANE format. (build_sexp, build_sexp_seckey): Remove. (do_export_stream): Remove use of removed functions. Signed-off-by: Werner Koch <[email protected]>
* gpg: Add new --auto-key-locate mechanism "dane".Werner Koch2015-10-065-15/+32
| | | | | | | | | | | | | | | * g10/call-dirmngr.c (gpg_dirmngr_dns_cert): Allow fetching via DANE. * g10/keyserver.c (keyserver_import_cert): Add arg "dane_mode". * g10/options.h (AKL_DANE): New. * g10/getkey.c (get_pubkey_byname): Implement AKL_DANE. (parse_auto_key_locate): Ditto. -- To test this use gpg --auto-key-locate clear,dane,local --locate-key -v [email protected] Signed-off-by: Werner Koch <[email protected]>
* dirmngr: Do tilde expansion for --hkp-cacert.Werner Koch2015-10-061-1/+1
| | | | | | | | | * dirmngr/dirmngr.c (parse_rereadable_options): Do tilde expansion and check for cert file existance in option --hkp-cacert. -- GnuPG-bug-id: 2120 Signed-off-by: Werner Koch <[email protected]>
* gpg: Fail decryption for AES etc message w/o MDC.Werner Koch2015-10-061-0/+16
| | | | | | | | | | | | | | | | * g10/mainproc.c (proc_encrypted): Fail for modern messages w/o MDC. -- This change turns the missing MDC warning into an error if the message has been encrypted using a cipher with a non-64 bit block length cipher and it is not Twofish. We can assume that such messages are created by code which should have been able to create MDC packets. AES was introduced with 1.0.3 on 2000-09-18 shortly after MDC (1.0.2 on 2000-07-12). We need to exclude Twofish because that might have been used before MDC. Signed-off-by: Werner Koch <[email protected]>
* gpg: Install a dirmngr.conf file.Werner Koch2015-10-054-46/+87
| | | | | | | | | | | | | | | | | * g10/dirmngr-conf.skel: New. * g10/Makefile.am (EXTRA_DIST): Add file. (install-data-local, uninstall-local): Install that file. * g10/openfile.c (copy_options_file): Add arg "name", return a value, simplify with xstrconcat, and factor warning message out to: (try_make_homedir): here. Also install dirmngr.conf. * g10/options.skel: Remove --keyserver entry. -- The option --keyserver in gpg has been deprecated in favor of --keyserver in dirmngr.conf. Thus we need to install a skeleton file for dirmngr to set a default keyserver. Signed-off-by: Werner Koch <[email protected]>
* gpg: Deprecate the --keyserver option.Werner Koch2015-10-054-27/+69
| | | | | | | | | | | | | | | | | | | | | | | * g10/keyserver.c (keyserver_refresh): Change return type to gpg_error_t. Use gpg_dirmngr_ks_list to print the name of the keyserver to use. (keyserver_search): Do not print the "no keyserver" error message. The same error is anyway returned from dirmngr. * g10/call-dirmngr.c (ks_status_parm_s): Add field "keyword". (ks_status_cb): Handle other status keywords. (gpg_dirmngr_ks_list): New. * tools/gpgconf-comp.c (gc_options_gpg): Deprecate "keyserver". (gc_options_dirmngr): Add "Keyserver" group and "keyserver". -- Along with the corresponding dirmngr change this option allows to configure the keyserver only in dirmngr.conf. Existing configurations will continue to work. However, GUIs using gpgconf now the keyserver option under the dirmngr (aka Key Acquirer) tab unless they are in export mode in which the keyserver option is also show for gpg. Signed-off-by: Werner Koch <[email protected]>
* gpg: Fix a practical hang after use of --faked-system-time.Werner Koch2015-10-012-8/+17
| | | | | | | * g10/sign.c (update_keysig_packet): Bail out if we would need to long for a new timestamp. Signed-off-by: Werner Koch <[email protected]>
* gpg: Print more info with "check selfsig".Werner Koch2015-10-011-0/+17
| | | | | * g10/keyedit.c (print_and_check_one_sig): Print more Some sigsub packets.
* gpg: Add debug helper to --edit-keys's check sub-command.Werner Koch2015-10-011-15/+35
| | | | | | | | | | | | | * g10/keyedit.c (print_and_check_one_sig): Add arg "extended" and print an asterisk for the chosen selfsig. (check_all_keysigs): Add arg "only_selfsig" (keyedit_menu) <cmdCHECK>: Add optional arg "selfsig". -- Using "check selfsig" prints only the self-signatures and indicates the chosen selfsig with an asterisk. Signed-off-by: Werner Koch <[email protected]>