aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyserver.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-08-14gpg: Screen keyserver responses.Werner Koch1-4/+90
* g10/main.h (import_screener_t): New. * g10/import.c (import): Add screener callbacks to param list. (import_one): Ditto. (import_secret_one): Ditto. (import_keys_internal): Ditto. (import_keys_stream): Ditto. * g10/keyserver.c (struct ks_retrieval_screener_arg_s): New. (keyserver_retrieval_screener): New. (keyserver_get): Pass screener to import_keys_es_stream(). -- These changes introduces import functions that apply a constraining filter to imported keys. These filters can verify the fingerprints of the keys returned before importing them into the keyring, ensuring that the keys fetched from the keyserver are in fact those selected by the user beforehand. Signed-off-by: Stefan Tomanek <[email protected]> This is an extended and fixed versions of Stefan's patch. In addition to the changes done in gnupg 2.0, namely the commits 5e933008beffbeae7255ece02383606481f9c169 044847a0e2013a2833605c1a9f80cfa6ef353309 088f82c0b5e39687f70e44d3ab719854e808eeb6 the symbol names have been changed to "screener" to void mixing them up with the iobuf filter feature and it has been changed to be used with the dirmngr based keyserver lookup. Signed-off-by: Werner Koch <[email protected]>
2014-08-12gpg: Make --with-colons work again for --search-keys.Werner Koch1-2/+2
* g10/keyserver.c (search_line_handler): Replace log_debug by es_printf.
2014-03-17gpg: Make --auto-key-locate work again with keyservers.Werner Koch1-46/+52
* dirmngr/ks-engine-hkp.c (ks_hkp_get): Allow exact search mode. * g10/keyserver.c (keyserver_import_name): Implement. (keyserver_get): Use exact mode for name based import. (keyserver_get): Add args R_FPR and R_FPRLEN. Change all callers.
2014-03-14gpg: Print the actual used keyserver address.Werner Koch1-7/+23
* dirmngr/ks-engine-hkp.c (ks_hkp_search, ks_hkp_get): Print SOURCE status lines. * g10/call-dirmngr.c (ks_status_parm_s): New. (ks_search_parm_s): Add field stparm. (ks_status_cb): New. (ks_search_data_cb): Send source to the data callback. (gpg_dirmngr_ks_search): Change callback prototope to include the SPECIAL arg. Adjust all users. Use ks_status_cb. (gpg_dirmngr_ks_get): Add arg r_source and use ks_status_cb. * g10/keyserver.c (search_line_handler): Adjust callback and print "data source" disgnostic. (keyserver_get): Print data source diagnostic. -- It has often been requested that the actually used IP of a keyservers is shown in with gpg --recv-key and --search-key. This is helpful if the keyserver is actually a pool of keyservers. This patch does this.
2014-03-12Comment typo fixesWerner Koch1-2/+5
--
2014-03-07gpg: Protect against rogue keyservers sending secret keys.Werner Koch1-4/+8
* g10/options.h (IMPORT_NO_SECKEY): New. * g10/keyserver.c (keyserver_spawn, keyserver_import_cert): Set new flag. * g10/import.c (import_secret_one): Deny import if flag is set. -- By modifying a keyserver or a DNS record to send a secret key, an attacker could trick a user into signing using a different key and user id. The trust model should protect against such rogue keys but we better make sure that secret keys are never received from remote sources. Suggested-by: Stefan Tomanek Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit e7abed3448c1c1a4e756c12f95b665b517d22ebe) Resolved conflicts: g10/import.c g10/keyserver.c
2014-02-10gpg: Allow building without any trust model support.Werner Koch1-2/+2
* configure.ac: Add option --disable-trust-models (NO_TRUST_MODELS): New ac_define and am_conditional. * g10/Makefile.am (trust_source): New. (gpg2_SOURCES): Factor some files out to above. Add trust.c. * g10/gpg.c [NO_TRUST_MODELS]: Disable options --export-ownertrust, --import-ownertrust, --update-trustdb, --check-trustdb, --fix-trustdb, --list-trustdb, --trustdb-name, --auto-check-trustdb, --no-auto-check-trustdb, and --force-ownertrust. (parse_trust_model) [NO_TRUST_MODELS]: Do not build. (main) [NO_TRUST_MODELS]: Set trust_model to always and exclude all trustdb related option code. * g10/keyedit.c (cmds) [NO_TRUST_MODELS]: Remove menu items "trust", "enable", and "disable". * g10/keylist.c (public_key_list) [NO_TRUST_MODELS]: Do not print "tru" record. * g10/trust.c: New. * g10/trustdb.c (struct key_item): Move to trustdb.h. (register_trusted_keyid): Rename to tdb_register_trusted_keyid. (register_trusted_key): Rename to tdb_register_trusted_key. (trust_letter, uid_trust_string_fixed, trust_value_to_string) (string_to_trust_value, get_ownertrust_with_min, get_ownertrust_info) (get_ownertrust_string, get_validity_info, get_validity_string) (clean_sigs_from_uid, clean_uid_from_key, clean_key): Move to trust.c. (mark_usable_uid_certs): Move to trust.c and make global. (is_in_klist): Move as inline to trustdb.h. (trustdb_check_or_update): Rename to tdb_check_or_update (revalidation_mark): Rename to tdb_revalidation_mark. (get_ownertrust): Rename to tdb_get_ownertrust. (get_min_ownertrust): Rename to tdb_get_min_ownertrust. (update_ownertrust): Rename to tdb_update_ownertrust. (clear_ownertrusts): Rename to tdb_clear_ownertrusts. (cache_disabled_value): Rename to tdb_cache_disabled_value. (check_trustdb_stale): Rename to tdb_check_trustdb_stale. (get_validity): Rename to tdb_get_validity_core, add arg MAIN_PK and factor some code out to ... * trust.c (get_validity): ...new. (check_or_update_trustdb): New wrapper. (revalidation_mark): New wrapper. (get_ownertrust): New wrapper. (get_ownertrust_with_min): New wrapper. (update_ownertrust): New wrapper. (clear_ownertrusts): New wrapper. (cache_disabled_value): New wrapper. (check_trustdb_stale): New wrapper. * tests/openpgp/defs.inc (opt_always): New. Use in all tests instead of --always-trust.
2014-01-30gpg: Use only OpenPGP public key algo ids and add the EdDSA algo id.Werner Koch1-1/+1
* common/sexputil.c (get_pk_algo_from_canon_sexp): Change to return a string. * g10/keygen.c (check_keygrip): Adjust for change. * sm/certreqgen-ui.c (check_keygrip): Likewise. * agent/pksign.c (do_encode_dsa): Remove bogus map_pk_openpgp_to_gcry. * g10/misc.c (map_pk_openpgp_to_gcry): Remove. (openpgp_pk_test_algo): Change to a wrapper for openpgp_pk_test_algo2. (openpgp_pk_test_algo2): Rewrite. (openpgp_pk_algo_usage, pubkey_nbits): Add support for EdDSA. (openpgp_pk_algo_name): Rewrite to remove need for gcry calls. (pubkey_get_npkey, pubkey_get_nskey): Ditto. (pubkey_get_nsig, pubkey_get_nenc): Ditto. * g10/keygen.c(do_create_from_keygrip): Support EdDSA. (common_gen, gen_ecc, ask_keysize, generate_keypair): Ditto. * g10/build-packet.c (do_key): Ditto. * g10/export.c (transfer_format_to_openpgp): Ditto. * g10/getkey.c (cache_public_key): Ditto. * g10/import.c (transfer_secret_keys): Ditto. * g10/keylist.c (list_keyblock_print, list_keyblock_colon): Ditto. * g10/mainproc.c (proc_pubkey_enc): Ditto. * g10/parse-packet.c (parse_key): Ditto, * g10/sign.c (hash_for, sign_file, make_keysig_packet): Ditto. * g10/keyserver.c (print_keyrec): Use openpgp_pk_algo_name. * g10/pkglue.c (pk_verify, pk_encrypt, pk_check_secret_key): Use only OpenPGP algo ids and support EdDSA. * g10/pubkey-enc.c (get_it): Use only OpenPGP algo ids. * g10/seskey.c (encode_md_value): Ditto. -- This patch separates Libgcrypt and OpenPGP public key algorithms ids and in most cases completely removes the Libgcrypt ones. This is useful because for Libgcrypt we specify the algorithm in the S-expressions and the public key ids are not anymore needed. This patch also adds some support for PUBKEY_ALGO_EDDSA which will eventually be used instead of merging EdDSA with ECDSA. As of now an experimental algorithm id is used but the plan is to write an I-D so that we can get a new id from the IETF. Note that EdDSA (Ed25519) does not yet work and that more changes are required. The ECC support is still broken right now. Needs to be fixed. Signed-off-by: Werner Koch <[email protected]>
2013-01-08gpg: Remove a function wrapper.Werner Koch1-1/+1
* g10/keydb.h (keydb_search): Remove macro. * g10/keydb.c (keydb_search2): Rename to keydb_search. Change all callers.
2012-11-29The keyserver search menu should honor --keyid-formatDavid Shaw1-5/+11
* keyserver.c (print_keyrec): Honor --keyid-format when getting back full fingerprints from the keyserver (the comment in the code was correct, the code was not).
2012-11-27Fix printing of ECC algo names in hkp keyserver listings.Werner Koch1-2/+4
* g10/keyserver.c (print_keyrec): Map OpenPGP algorithm ids.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-5/+5
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2011-11-30Rewrite dns-cert.c to not use the gpg-only iobuf stuff.Werner Koch1-20/+16
* common/dns-cert.c: Remove iobuf.h. (get_dns_cert): Rename to _get_dns_cert. Remove MAX_SIZE arg. Change iobuf arg to a estream-t. Rewrite function to make use of estream instead of iobuf. Require all parameters. Return an gpg_error_t error instead of the type. Add arg ERRSOURCE. * common/dns-cert.h (get_dns_cert): New macro to pass the error source to _gpg_dns_cert. * common/t-dns-cert.c (main): Adjust for changes in get_dns_cert. * g10/keyserver.c (keyserver_import_cert): Ditto. * doc/gpg.texi (GPG Configuration Options): Remove max-cert-size.
2011-11-30Increase the default buffer size for DNS certificates.Werner Koch1-2/+3
* common/t-dns-cert.c (main): Increase MAX_SIZE to 64k. * g10/keyserver.c (DEFAULT_MAX_CERT_SIZE): Increase from 16k to 64k.
2011-04-29Re-indentation of keydb.c and error code changes.Werner Koch1-2/+2
Returning -1 as an error code is not very clean given that gpg error has more descriptive error codes. Thus we now return GPG_ERR_NOT_FOUND for all search operations and adjusted all callers.
2011-04-25Fix regression in gpg's mail address parsing.Werner Koch1-4/+4
Since 2009-12-08 gpg was not able to find email addresses indicated by a leading '<'. This happened when I merged the user id classification code of gpgsm and gpg.
2011-02-09Replace printf by es_printf in keyserver.cWerner Koch1-27/+24
This is similar to the change in keylist.c and elsewhere.
2011-02-08Add finger support to dirmngr.Werner Koch1-25/+24
The basic network code from http.c is used for finger. This keeps the network related code at one place and we are able to use the somewhat matured code form http.c. Unfortunately I had to enhance the http code for more robustness and probably introduced new bugs. Test this code using gpg --fetch-key finger:[email protected] (I might be the last user of finger ;-)
2011-01-20All standard keyserver commands are now using dirmngr.Werner Koch1-687/+61
2011-01-18Keyserver search and get basically works again.Werner Koch1-260/+481
2011-01-10Initial code checking for backup - not yet working.Werner Koch1-22/+101
2010-10-20Make public key data structure easier to read.Werner Koch1-1/+1
Check vor v1 card while signing.
2010-10-01Exporting secret keys via gpg-agent is now basically supported.Werner Koch1-49/+63
A couple of forward ported changes. Doc updates.
2010-08-31Import OpenPGP keys into the agent.Werner Koch1-5/+7
2010-04-21More changes on the way to remove secring.gpg.Werner Koch1-1/+1
2009-12-08Unification of the search descriptor usage.Werner Koch1-18/+23
2009-07-23Try a DNS-SD lookup to find a domain-specific LDAP server beforeDavid Shaw1-13/+50
resorting to keys.{domain}.
2009-06-17Add readcert command.Werner Koch1-0/+3
fix reading large certificates.
2009-05-11* keyserver.c (keyserver_typemap): gpgkeys_hkp handles hkps as well.David Shaw1-2/+4
From 1.4.
2008-12-09Flush keyserver search output.Werner Koch1-0/+2
Add trustdb chnages from 1.4. Check algo usage for batch key generation.
2008-09-04* keyserver.c (keyserver_import_cert): Allow keyserver URLs inDavid Shaw1-7/+1
addition to full URLs in CERT records.
2008-04-08Enhanced --auto-key-locate.Werner Koch1-9/+20
2008-04-07Minor cleanups.Werner Koch1-1/+9
Implemented key helper kdns
2008-03-25Changed the way i18n files are located under Windows. The setting of theWerner Koch1-2/+2
Registry key is not anymore required. Helpfiles are not properly located.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2007-06-14A whole bunch of changes to allow building for Windows.Werner Koch1-2/+2
See the ChangeLogs for details.
2007-03-14From STABLE-BRANCH-1-4David Shaw1-2/+9
* keyserver.c: Windows Vista doesn't grok X_OK and so fails access() tests. Previous versions interpreted X_OK as F_OK anyway, so we'll just use F_OK directly.
2006-12-06Fixes for CVE-2006-6235Werner Koch1-6/+7
2006-10-06* keyserver.c (keyserver_spawn): Write the 16-digit keyid ratherDavid Shaw1-2/+6
than whatever key selector the user used on the command line.
2006-10-02Fix for bug 537Werner Koch1-20/+20
2006-09-14Take advantage of newer gpg-error features.Werner Koch1-1/+1
2006-08-16With --enable-gpg the keyservers are now build and a first test using gpg2Werner Koch1-0/+4
shows no prblems. Needs more testing of course.
2006-05-23g10/ does build again.Werner Koch1-3/+6
2006-04-28Merged recent changes from 1.4Werner Koch1-35/+29
2006-04-27(keyserver_import_cert): Show warning if there is a CERT fingerprint,David Shaw1-0/+6
but no --keyserver set.
2006-04-27* keyserver.c (path_makes_direct): New. (keyserver_spawn): Used hereDavid Shaw1-32/+22
to add "_uri" to certain gpgkeys_xxx helpers when the meaning is different if a path is provided (i.e. ldap).
2006-04-22* keyserver.c: Fix build problem with platforms that stick libcurl inDavid Shaw1-3/+0
a place not in the regular include search path.
2006-04-21Still merging 1.4.3 code backWerner Koch1-1/+1
2006-04-19Continued with merging.Werner Koch1-2/+2
Still does not build.
2006-04-19Merged with gpg 1.4.3 code. Werner Koch1-274/+1028
The gpg part does not yet build.