aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyserver.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make screening of keyserver result work with multi-key commands.Werner Koch2014-06-301-23/+45
| | | | | | | | | | | | | | * g10/keyserver.c (ks_retrieval_filter_arg_s): new. (keyserver_retrieval_filter): Use new struct and check all descriptions. (keyserver_spawn): Pass filter arg suing the new struct. -- This is a fix for commit 52303043. The old code did only work for a single key. It failed as soon as several keys are specified ("gpg --refresh-keys" or "gpg --recv-key A B C").
* Screen keyserver responses.Stefan Tomanek2014-06-231-20/+66
| | | | | | | | | | | | | | | | | | | | | | * g10/main.h: Typedef import_filter for filter callbacks. * g10/import.c (import): Add filter callbacks to param list. (import_one): Ditto. (import_secret_one): Ditto. (import_keys_internal): Ditto. (import_keys_stream): Ditto. * g10/keyserver.c (keyserver_retrieval_filter): New. (keyserver_spawn): Pass filter to import_keys_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]> Re-indention and minor changes by wk.
* gpg: Protect against rogue keyservers sending secret keys.Werner Koch2013-10-041-5/+10
| | | | | | | | | | | | | | | | | | | | | * 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/options.h
* The keyserver search menu should honor --keyid-formatDavid Shaw2012-11-291-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).
* Minor changes to help the VMS portWerner Koch2010-09-281-1/+3
|
* Try and detect mis-coded Latin1 and convert it to UTF8. Whether theDavid Shaw2009-08-121-7/+32
| | | | | | heuristics succeed or not, the resulting string must be valid UTF8 as LDAP requires that. This is bug 1055.
* * keyserver.c (keyserver_import_ldap): Try a DNS-SD lookup to find aDavid Shaw2009-07-231-13/+50
| | | | | domain-specific LDAP server before resorting to keys.{domain}.
* * keyserver.c (keyserver_typemap): gpgkeys_hkp handles hkps as well.David Shaw2009-02-031-2/+4
|
* * keyserver.c (keyserver_import_cert): Allow keyserver URLs inDavid Shaw2008-09-041-7/+1
| | | | | addition to full URLs in CERT records.
* Powerpc64 fix.Werner Koch2008-03-251-2/+2
|
* * keyserver.c (keyserver_spawn): Cosmetic, but looks cleaner.David Shaw2007-10-271-1/+1
|
* Switched to GPLv3.Werner Koch2007-10-231-4/+2
| | | | | Updated gettext.
* * keyserver.c: Windows Vista doesn't grok X_OK and so fails access()David Shaw2007-03-141-2/+10
| | | | | | tests. Previous versions interpreted X_OK as F_OK anyway, so we'll just use F_OK directly.
* Preparing a releasegnupg-1.4.6Werner Koch2006-12-061-5/+6
|
* * keyserver.c (keyserver_spawn): Write the 16-digit keyid rather thanDavid Shaw2006-10-061-2/+6
| | | | | whatever key selector the user used on the command line.
* (keyserver_import_cert): Show warning if there is a CERT fingerprint,David Shaw2006-04-271-0/+6
| | | | | but no --keyserver set.
* * keyserver.c (path_makes_direct): New. (keyserver_spawn): Used hereDavid Shaw2006-04-271-32/+22
| | | | | | to add "_uri" to certain gpgkeys_xxx helpers when the meaning is different if a path is provided (i.e. ldap).
* * keyserver.c: Fix build problem with platforms that stick libcurl inDavid Shaw2006-04-221-3/+0
| | | | | a place not in the regular include search path.
* * keyserver.c (keyserver_import_cert): Handle the IPGP CERT type forDavid Shaw2006-03-171-12/+25
| | | | | | | both the fingerprint alone, and fingerprint+URL cases. * getkey.c (get_pubkey_byname): Minor cleanup.
* * cert.c (get_cert): Handle the fixed IPGP type with fingerprint.David Shaw2006-03-161-1/+1
|
* * keyserver-internal.h, keyserver.c (keyserver_import_pka): Use theDavid Shaw2006-03-141-3/+9
| | | | | | | | | | | | same API as the other auto-key-locate fetchers. * getkey.c (get_pubkey_byname): Use the fingerprint of the key that we actually fetched. This helps prevent problems where the key that we fetched doesn't have the same name that we used to fetch it. In the case of CERT and PKA, this is an actual security requirement as the URL might point to a key put in by an attacker. By forcing the use of the fingerprint, we won't use the attacker's key here.
* * keyserver-internal.h, keyserver.c (keyserver_spawn, keyserver_work,David Shaw2006-03-141-19/+26
| | | | | | keyserver_import_cert, keyserver_import_name, keyserver_import_ldap): Pass fingerprint info through.
* * main.h, import.c (import_one): Optionally return the fingerprint ofDavid Shaw2006-03-141-2/+3
| | | | | | the key being imported. (import_keys_internal, import_keys_stream, import): Change all callers.
* * keydb.h, getkey.c (release_akl), gpg.c (main): AddDavid Shaw2006-02-241-2/+38
| | | | | | | | | | | | | | | --no-auto-key-locate. * options.h, gpg.c (main): Keep track of each keyserver registered so we can match on them later. * keyserver-internal.h, keyserver.c (cmp_keyserver_spec, keyserver_match), gpgv.c: New. Find a keyserver that matches ours and return its spec. * getkey.c (get_pubkey_byname): Use it here to get the per-keyserver options from an earlier keyserver.
* * keyserver.c (parse_keyserver_options): Only change max_cert if it isDavid Shaw2006-02-241-1/+1
| | | | | used.
* * options.c, gpg.c (main), keyserver.c (keyserver_spawn): No specialDavid Shaw2006-02-231-16/+7
| | | | | | treatment of include-revoked, include-subkeys, and try-dns-srv. These are keyserver features, and GPG shouldn't get involved here.
* * keyserver.c (parse_keyserver_uri, add_canonical_option): Always appendDavid Shaw2006-02-231-3/+3
| | | | | options to the list, as ordering may be significant to the user.
* * options.h, keyserver.c (add_canonical_option): New.David Shaw2006-02-231-19/+43
| | | | | | | (parse_keyserver_options): Moved from here. (parse_keyserver_uri): Use it here so each keyserver can have some private options in addition to the main keyserver-options (e.g. per-keyserver auth).
* * options.h, keyserver-internal.h, keyserver.c (keyserver_import_name),David Shaw2006-02-221-2/+2
| | | | | | getkey.c (free_akl, parse_auto_key_locate, get_pubkey_byname): The obvious next step: allow arbitrary keyservers in the auto-key-locate list.
* * options.h, keyserver.c (parse_keyserver_options): RemoveDavid Shaw2006-02-221-6/+4
| | | | | | auto-cert-retrieve as it is no longer meaningful. Add max-cert-size to allow users to pick a max key size retrieved via CERT.
* * options.h, gpg.c (main), mainproc.c (check_sig_and_print), keyserver.cDavid Shaw2006-02-221-4/+10
| | | | | | (keyserver_opts): Rename auto-pka-retrieve to honor-pka-record to be consistent with honor-keyserver-url.
* * getkey.c (get_pubkey_byname): Fix minor security problem with PKA whenDavid Shaw2006-02-211-3/+2
| | | | | | | | | | importing at -r time. The URL in the PKA record may point to a key put in by an attacker. Fix is to use the fingerprint from the PKA record as the recipient. This ensures that the PKA record is followed. * keyserver-internal.h, keyserver.c (keyserver_import_pka): Return the fingerprint we requested.
* * gpgv.c: Stub keyserver_import_ldap.David Shaw2006-02-211-0/+35
| | | | | | * keyserver-internal.h, keyserver.c (keyserver_import_ldap): Import using the PGP Universal trick of asking ldap://keys.(maildomain) for the key.
* * keyserver.c (parse_keyserver_uri): Include the scheme in the uriDavid Shaw2006-02-211-2/+7
| | | | | even when we've assumed "hkp" when there was no scheme.
* * keyserver.c (parse_keyserver_uri): If there is a path present, set theDavid Shaw2006-01-241-0/+3
| | | | | direct_uri flag so the right keyserver helper is run.
* * keyserver.c (keyserver_spawn): Include the EXEEXT so we can findDavid Shaw2006-01-221-2/+4
| | | | | | | | keyserver helpers on systems that use extensions. * misc.c (path_access) [HAVE_DRIVE_LETTERS]: Do the right thing with drive letter systems.
* * keyserver.c (keyserver_refresh): Fix problem when more than one keyDavid Shaw2006-01-071-1/+1
| | | | | | in a refresh batch has a preferred keyserver set. Noted by Nicolas Rachinsky.
* * mainproc.c (check_sig_and_print), keyserver.cDavid Shaw2006-01-011-1/+1
| | | | | | | (keyserver_import_pka), card-util.c (fetch_url): Always require a scheme:// for keyserver URLs except when used as part of the --keyserver command for backwards compatibility.
* * keyserver.c (keyserver_import_pka): New. Moved fromDavid Shaw2005-12-231-1/+98
| | | | | | | | | | | | | getkey.c:get_pubkey_byname which was getting crowded. * keyserver.c (keyserver_import_cert): Import a key found in DNS via CERT records. Can handle both the PGP (actual key) and IPGP (URL) CERT types. * getkey.c (get_pubkey_byname): Call them both here. * options.h, keyserver.c (parse_keyserver_options): Add "auto-cert-retrieve" option with optional max size argument.
* * gpgv.c: Stub.David Shaw2005-12-231-25/+62
| | | | | | | | | | * keyserver-internal.h, keyserver.c (keyserver_spawn, keyserver_work, keygerver_getname): New keyserver_getname function to fetch keys by name. * getkey.c (get_pubkey_byname): Call it here to enable locating keys by full mailbox from a keyserver a la PKA. Try PKA first, though, as it is likely to be faster.
* Finished PKA featureWerner Koch2005-12-201-1/+1
|
* * keyserver.c (keyserver_fetch): Switch on fast-import before weDavid Shaw2005-12-081-0/+13
| | | | | --fetch-keys so we don't rebuild the trustdb after each fetch.
* Made strings translatable. Minor fixes.Werner Koch2005-12-081-2/+2
|
* * options.h, keyserver.c (curl_cant_handle, keyserver_spawn,David Shaw2005-12-081-7/+25
| | | | | | | keyserver_fetch): Set a flag to indicate that we're doing a direct URI fetch so we can differentiate between a keyserver operation and a URI fetch for protocols like LDAP that can do either.
* * keyserver.c (keyserver_spawn): Don't print "searching for key 00000000"David Shaw2005-12-071-9/+48
| | | | | | | | | | when fetching a URI. * keyserver-internal.h, keyserver.c (keyserver_fetch): New. Fetch an arbitrary URI using the keyserver helpers. * gpg.c (main): Call it from here for --fetch-keys.
* * main.h, misc.c (parse_options): Add the ability to have helpDavid Shaw2005-09-141-9/+20
| | | | | | | | | strings in xxx-options commands. * keyserver.c (keyserver_opts), import.c (parse_import_options), export.c (parse_export_options), g10.c (parse_list_options, main): Add help strings to xxx-options.
* * misc.c (openpgp_pk_algo_usage): Default to allowing CERT for signingDavid Shaw2005-08-271-0/+2
| | | | | | | | | | | | | | | | | algorithms. * keyedit.c (sign_uids): Don't request a signing key to make a certification. * keygen.c (do_add_key_flags): Force the certify flag on for all primary keys, as the spec requires primary keys must be able to certify (if nothing else, which key is going to issue the user ID signature?) (print_key_flags): Show certify flag. (ask_key_flags, ask_algo): Don't allow setting the C flag for subkeys. * keyid.c (usagestr_from_pk), getkey.c (parse_key_usage): Distinguish between a sign/certify key and a certify-only key.
* * Makefile.am: No need to link with curl any longer.David Shaw2005-08-211-33/+32
| | | | | | | | | | | | | * main.h, misc.c (path_access): New. Same as access() but does a PATH search like execlp. * keyserver.c (curl_can_handle): Removed. Replaced by... (curl_cant_handle): We are now relying on curl as the handler of last resort. This is necessary because PGP LDAP and curl LDAP are apples and oranges. (keyserver_typemap): Only test for ldap and ldaps. (keyserver_spawn): If a given handler is unusable (as determined by path_access()) then try gpgkeys_curl.
* auto retrieve keys from PKA. Thsi allows to specify an email addressWerner Koch2005-08-051-0/+1
| | | | | | so that gpg can get the key from DNS. This helps with opportunistic encryption. No integration with the trust modell yet.
* Converted all m_free to xfree etc.Werner Koch2005-07-271-57/+57
|