summaryrefslogtreecommitdiffstats
path: root/common/dns-cert.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* gpg: Move all DNS access to Dirmngr.Werner Koch2015-04-231-368/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/dns-cert.h: Move to ../dirmngr/. * common/dns-cert.c: Move to ../dirmngr/. Change args to return the key as a buffer. * common/t-dns-cert.c: Move to ../dirmngr/. * common/pka.c, common/pka.h, common/t-pka.c: Remove. * dirmngr/server.c (data_line_cookie_write): Factor code out to data_line_write and make it a wrapper for that. (data_line_write): New. (cmd_dns_cert): New. (register_commands): Register new command. * g10/Makefile.am (LDADD): Remove DNSLIBS. * g10/call-dirmngr.c (dns_cert_parm_s): New. (dns_cert_data_cb, dns_cert_status_cb): New. (gpg_dirmngr_dns_cert): New. (gpg_dirmngr_get_pka): New. * g10/gpgv.c (gpg_dirmngr_get_pka): New dummy function. * g10/keyserver.c (keyserver_import_cert): Replace get_dns_cert by gpg_dirmngr_dns_cert. (keyserver_import_pka): Replace get_pka_info by gpg_dirmngr_get_pka. * g10/mainproc.c: Include call-dirmngr.h. (pka_uri_from_sig): Add CTX arg. Replace get_pka_info by gpg_dirmngr_get_pka. -- With this patch gpg does not do any network access itself but uses dirmngr for that. Note that we need to keep linking to NETLIBS due to the logging code and because we need TCP for our socket emulation under Windows. Probably also required for Solaris etc. Signed-off-by: Werner Koch <wk@gnupg.org>
* gpg: Switch to a hash and CERT record based PKA system.Werner Koch2015-02-251-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common/dns-cert.c (get_dns_cert): Make r_key optional. * common/pka.c: Rewrite for the new hash based lookup. * common/t-pka.c: New. * configure.ac: Remove option --disable-dns-pka. (USE_DNS_PKA): Remove ac_define. * g10/getkey.c (parse_auto_key_locate): Always include PKA. -- Note that although PKA is now always build, it will only work if support for looking up via DNS has not been disabled. The new PKA only works with the IPGP DNS certtype and shall be used only to retrieve the fingerprint and optional the key for the first time. Due to the security problems with DNSSEC the former assumption to validate the key using DNSSEC is not anymore justified. Instead an additional layer (e.g. Trust-On-First-Use) needs to be implemented to track change to the key. Having a solid way of getting a key matching a mail address is however a must have. More work needs to go into a redefinition of the --verify-options pka-lookups and pka-trust-increase. The auto-key-locate mechanism should also be able to continue key fetching with another methods once the fingerprint has been retrieved with PKA. Signed-off-by: Werner Koch <wk@gnupg.org>
* common: Allow requesting a specific certtype with get_dns_cert()Werner Koch2015-02-251-21/+15
| | | | | | | | | * common/dns-cert.c (get_dns_cert): Add arg want_certtype. Change all callers. (CERTTYPE_): Move constants to ... * common/dns-cert.h: here as DNS_CERTTYPE_. Signed-off-by: Werner Koch <wk@gnupg.org>
* common: Fix regression due to commit 2183683b.Werner Koch2015-02-231-1/+0
| | | | | | | | * common/dns-cert.c (get_dns_cert): Remove cruft. -- GnuPG-bug-id: 1850 Signed-off-by: Werner Koch <wk@gnupg.org>
* Use inline functions to convert buffer data to scalars.Werner Koch2015-02-111-9/+11
| | | | | | | | | | | | | | | * common/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. -- Commit 91b826a38880fd8a989318585eb502582636ddd8 was not enough to avoid all sign extension on shift problems. Hanno Böck found a case with an invalid read due to this problem. To fix that once and for all almost all uses of "<< 24" and "<< 8" are changed by this patch to use an inline function from host2net.h. Signed-off-by: Werner Koch <wk@gnupg.org>
* build: Improve test for ADNSWerner Koch2014-11-071-3/+0
| | | | | | | | | | | | | * configure.ac <adns>: Use adns_free as probe function for libadns. (HAVE_ADNS_FREE): Remove bogus tests to set this and remove the macro. (ADNSLIBS): Do not ac_subst - it is only used within configure. -- adns_free is required on Windows anyway (for robustness reasons) and it has been around for so long now that we do not need a separate test. An upstream adns 1.5 has meanwhile been release but I doubt that this has the required Windows code - and it is not libtool based anyway.
* w32: Include winsock2.h to silence warnings.Werner Koch2014-03-071-0/+3
|
* tests: Avoid segv if dns cert lookup is not configured.Werner Koch2014-02-101-4/+4
| | | | * common/dns-cert.c (get_dns_cert) [!USE_DNS_CERT]: Reset return args.
* common: Fix a build error when using adns.Werner Koch2013-08-011-4/+5
| | | | | | | | | * common/dns-cert.c (get_dns_cert) [USE_ADNS]: Fix synatx error. -- (fixes commit 31f548a18aed729c05ea367f2d8a8104480430d5) Signed-off-by: Werner Koch <wk@gnupg.org>
* Change license for some files in common to LGPLv3+/GPLv2+.Werner Koch2012-04-201-5/+15
| | | | | | | | | | | | | | | | | | | | | | | Having the LGPL on the common GnuPG code helps to share code between GnuPG and related projects (like GPGME and Libassuan). This is good for interoperability and to reduces bugs. * common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c * common/b64enc.c, common/convert.c, common/dns-cert.c * common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c * common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c * common/helpfile.c, common/homedir.c, common/http.c, common/http.h * common/i18n.c, common/init.c, common/init.h, common/iobuf.c * common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h * common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h * common/percent.c, common/pka.c, common/pka.h, common/session-env.c * common/session-env.h, common/sexp-parse.h, common/sexputil.c * common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c * common/ssh-utils.h, common/sysutils.c, common/sysutils.h * common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h * common/userids.c, common/userids.h, common/xasprintf.c: Change license to LGPLv3+/GPLv2+/
* common: Replace macro based function calls by using DEFAULT_ERRSOURCE.Werner Koch2012-02-071-18/+21
| | | | | | | | | | | | | | | | | | | | * common/dns-cert.h (get_dns_cert): Remove macro. * common/dns-cert.c (_get_dns_cert): Rename to get_dns_cert. Replace arg ERRSOURCE by global DEFAULT_ERRSOURCE. * common/http.h (http_parse_uri, http_raw_connect, http_open) (http_open_document, http_wait_response): Remove macros. * common/http.c (_http_parse_uri, _http_raw_connect, _http_open) (_http_open_document, _http_wait_response): Remove underscore from symbols. Replace args ERRSOURCE by global DEFAULT_ERRSOURCE. * common/ssh-utils.h (ssh_get_fingerprint) (ssh_get_fingerprint_string): Remove macros. * common/ssh-utils.h (_ssh_get_fingerprint) (_ssh_get_fingerprint_string): Remove underscore from symbols. Replace args ERRSOURCE by global DEFAULT_ERRSOURCE. * common/tlv.h (parse_ber_header, parse_sexp): Remove macros. * common/tlv.c: Include util.h. (_parse_ber_header, _parse_sexp): Remove underscore from symbols. Replace args ERRSOURCE by global DEFAULT_ERRSOURCE.
* Rewrite dns-cert.c to not use the gpg-only iobuf stuff.Werner Koch2011-11-301-72/+123
| | | | | | | | | | | | | * 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.
* dns-cert.c: Use constants for better readability.Werner Koch2011-11-301-8/+21
|
* Re-indented dns-cert.cWerner Koch2011-11-301-121/+122
|
* Use separate test module for dns-cert.c.Werner Koch2011-11-301-60/+2
| | | | | * dns-cert.c (get_dns_cert): Factor test code out to ... * t-dns-cert.c: new file.
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-5/+5
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* More chnages to use estream. Add a way to replace the standardWerner Koch2010-03-221-0/+7
| | | | | descriptors.
* Unification of the search descriptor usage.Werner Koch2009-12-081-1/+1
|
* Support CERT records via ADNSWerner Koch2009-12-081-9/+107
|
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Added missing filesWerner Koch2006-06-161-0/+246