Compare commits

...

2295 Commits

Author SHA1 Message Date
Sara Dickinson f8c95b4f15 Update Stubby to fix Windows build issues 2023-01-09 16:50:12 +00:00
Sara Dickinson ee534d10bf Fix typo preventing Windows build when Pkgconfig not available 2023-01-09 16:40:19 +00:00
Willem Toorop 6395fe43cc Fix #536 Broken trust anchor files are silently ignored 2023-01-02 16:03:59 +01:00
Willem Toorop d98d307e64 New 1.7.3 release with quickfix 1.4.3 stubby release 2022-12-22 15:22:09 +01:00
Willem Toorop c8df60e67d
Merge pull request #532 from GabrielGanne/cmake-required-version-fix
Increase CMake required version 3.5 -> 3.20
2022-12-22 15:18:56 +01:00
Gabriel Ganne 037892739f Increase CMake required version 3.5 -> 3.20
Commit 777e0b245c introduced cmake_path
which has been added to Cmake in 3.20 onlyi [1], so this should only make
the error message more explicit.

[1] https://cmake.org/cmake/help/git-master/command/cmake_path.html
2022-11-09 11:51:55 +01:00
Willem Toorop 9c076ca34b Issue #526 Some gldns files need stdlib 2022-08-22 10:41:05 +02:00
Willem Toorop 3a71bd350e getdns-1.7.2 quickfix stubby release 2022-08-19 20:00:36 +02:00
Willem Toorop 8aa19255b8 Leave out some tests that fail to be reviewed later on 2022-08-19 15:42:13 +02:00
Willem Toorop 7eaf8454a2 Okay, assert detection with check is broken (at least with me) 2022-08-19 15:08:46 +02:00
Willem Toorop 2e04e9f8b6 Why do these tests destroy the context from a callback? 2022-08-19 14:46:15 +02:00
Willem Toorop a19177d41e Bump version for release 2022-08-19 13:27:06 +02:00
Willem Toorop a1451df680 Fix #512 update README.md to show correct pgp key location 2022-08-19 11:36:34 +02:00
Willem Toorop 777e0b245c Fix #517 Allow Absolute paths in pkg-config 2022-08-19 11:29:45 +02:00
Willem Toorop 2d48a3bd1b Fix Issue #524 merge upstream ssl_dane into submodule 2022-08-19 11:01:57 +02:00
Willem Toorop 9bb533ab57 Update stubby (and no release yet) 2022-08-12 18:56:03 +02:00
Willem Toorop 86bd62cb40
Merge pull request #523 from getdnsapi/gnu_tls_alpn
Add support for `dot` ALPN for GnuTLS
2022-08-12 15:27:59 +02:00
Sara Dickinson adcdf20289 Add support for dot ALPN for GnuTLS 2022-08-12 12:45:15 +01:00
Willem Toorop aca15088e5 Update stubby 2022-08-11 16:48:23 +02:00
Willem Toorop 1ea92a68ad Set version to first release candidate 2022-08-11 16:24:42 +02:00
Willem Toorop 142f616693 ChangeLog entry for issue getdnsapi/stubby#295 2022-08-11 16:21:14 +02:00
Willem Toorop 6b65aed443 Fix getdnsapi/stubby#295 set default build type to RelWithDebInfo
And expose CFLAGS through GETDNS_BUILD_CFLAGS define and via getdns_context_get_api_information()
2022-08-11 16:15:30 +02:00
Willem Toorop 0cb72000f8 Avoid using old OpenSSL HMAC functions 2022-08-11 12:26:41 +02:00
Willem Toorop 1748ca4c29 First step in dealing with OpenSSL 3.0 warnings 2022-08-11 11:30:53 +02:00
Willem Toorop b181782e0e Update gldns 2022-08-11 11:30:34 +02:00
Willem Toorop f97ee14b69 Merge branch 'madebr-cmake_pkgconfig' into develop 2022-08-10 16:10:38 +02:00
Willem Toorop 1a1e79603c Merge branch 'cmake_pkgconfig' of github.com:madebr/getdns into madebr-cmake_pkgconfig 2022-08-10 16:10:13 +02:00
Willem Toorop 875c03176e Log uzlonewolf contribution 2022-08-10 14:58:38 +02:00
uzlonewolf 2d7d8a4ea5 Tighten up _getdns_ipaddr_dict_mf() so it does not grab random strings beginning with '*' 2022-08-10 14:53:43 +02:00
Willem Toorop 8e2accfd74 Log fix from Shikha 2022-08-10 14:32:35 +02:00
Willem Toorop 861ae30725
Merge pull request #520 from SharmaShikha-84/master
Fix for issue in UDP stream selection in case of timeouts.
2022-08-10 14:31:18 +02:00
Willem Toorop dc5026f2c8
Merge pull request #515 from thesamesam/develop
CMakeLists.txt: use CMAKE_INSTALL_MANDIR too
2022-08-09 17:02:36 +02:00
Willem Toorop 10a000b916
Merge pull request #518 from amialkow/develop
Fixed allowed offset range during name compression.
2022-08-09 17:00:13 +02:00
Willem Toorop 893d4720c9
Merge pull request #519 from getdnsapi/use_dot_alpn
Update Stubby to always send the `dot` ALPN when using DoT
2022-08-09 16:54:30 +02:00
Willem Toorop 2bbac1163b
Merge branch 'develop' into use_dot_alpn 2022-08-09 16:54:20 +02:00
Sara Dickinson 9d8eea97a5 Fix typo in cmake module for libidn2 2022-07-21 14:17:53 +01:00
Sara Dickinson c0e45395b8
Merge pull request #522 from jpbion/fixlibidn2
Category: Strengthen LibIDN2 version determination during cmake run
2022-07-21 14:14:35 +01:00
Joel Bion ed7bfa107e Category: Strengthen LibIDN2 version determination during cmake run 2022-07-20 16:01:25 -07:00
Shikha Sharma 94dbb8e916
Update stub.c
Fix for issue mentioned below:
Scenario: 4 UDP steams corresponding to 4 IP's configured.
Outbound query is always sent to 1st IP in the list unless there is a timeout.
If there is a timeout, the next outbound query is sent to the 2nd IP in the list.
If the 1st IP still times out then the next 2n queries (this increases in powers of 2) go to the 2nd IP.
If the 2nd IP times out at any point, then queries are sent to the 3rd IP (following the same algorithm of 2n queries before reverting to the 2nd IP)

Observation: Even if there is no timeout on 2nd IP, some queries are still sent to 3rd IP.
From code: The stream is switched whenever there is a timeout. If 10 messages were sent to first IP and they all timeout , the stream is switched 10 times in the current code.   
Suggestion: Switch stream only on the first timeout on a stream or ignore when the timeout occurs on a stream which is not the current_udp stream.
2022-06-13 17:06:55 +02:00
Sara Dickinson a5a1256adc Update Stubby to always send the `dot` ALPN when using DoT 2022-06-07 10:27:39 +01:00
Andrzej Mialkowski 190dbe1b91 Fixed allowed offset range during name compression. 2022-05-22 23:12:28 -07:00
Sam James c50288f71e
CMakeLists.txt: use CMAKE_INSTALL_MANDIR too
Signed-off-by: Sam James <sam@gentoo.org>
2022-03-30 05:27:54 +01:00
Willem Toorop c2e085ee9e
Merge pull request #509 from thesamesam/change-docdir-variable
CMakeLists.txt: use canonical GNUInstallDirs variable for docdir
2022-03-29 15:00:27 +02:00
Willem Toorop 01715688d7 Sync crypto funcs from Unbound 2022-02-04 16:32:54 +01:00
Willem Toorop ecb9de2c29 Sync gldns from Unbound sldns 2022-02-04 15:24:21 +01:00
Willem Toorop b86f8e904c Vim leftover 2022-02-04 14:55:39 +01:00
Willem Toorop 45683d3cfe Fix for getdnsapi/stubby#295
rdata not correctly written for validation for certain RR types
2022-01-11 00:09:44 +01:00
Sam James 822166d7ad
CMakeLists.txt: use canonical GNUInstallDirs variable for docdir
We use the GNUInstallDir variables for the rest of the build system
locations, so let's use CMAKE_INSTALL_DOCDIR too to allow customisation
downstream.

(In Gentoo, we set it to the exact package version including downstream-only
revisions.)

Signed-off-by: Sam James <sam@gentoo.org>
2021-06-09 23:57:40 +00:00
Willem Toorop e4661f957e getdns-1.7.0 release
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE3DTuXbJBe8wVHlEA5fj4IS93pJgFAmC6dzkUHHdpbGxlbUBu
 bG5ldGxhYnMubmwACgkQ5fj4IS93pJhrZg//YROnFsupA7JVFhaO05b20vDWxhp8
 kRBfsMyox8w4cOE0QXqcqsogmxAw0wyLp14+TvVwRxivcl21GyKTY07YpJDSopvy
 BM1DIPZ8O32ONyJUmEzAdJwvDcYJx4FIAeCAyK0bP7ev+ung1Q2GgSzej7oXd6hZ
 WCMSPZZcTnFXQ7w/4Fe4pQVoZWGVonEXBJbCUTgyeiKYnGXTO1qISsqeeYaMgP0n
 vPa4k8kSlr/KPDnD7ts0BKsWOFiHJyi/rHjLZVq8f5pCB3FE3FR3jlIo2e8w7hLM
 SC8wxH58+prHbe+1zNZiMA3OXY7nozvSO3QkomLm3QH/r73CkqkBYfBLAJ0LRuHj
 s0TRY7y7GEUGWPnLjkCw+H3/aumEep0i7YaVV5Tj1g+Htt4fMxZhQPWO/T+LGZap
 ILsN+LmqGR9ARHAo+j2REmot0ubk9FP+fan2EIe6c6/cOxSyIe3LncfLG/7U4MlF
 SYxcRtlzQrrU40hoA8S6xGRrSvG4qjthWTWsv35VzTZXA5nHuSdZn0HpWlfLrOi6
 CSZueZ1lQ9hfgTTbLLCdZYbmWDAPv13YBkLWQTSQy955vc34x/h+qRodhzfX8w18
 ypzqEmQwUQFXdG/Wat5vGcOf+M+6Ak2QqmN88AgfHmyKbQUEh6JbpvF85q7gp8ad
 A49nb6aGD2cuREI=
 =iTYQ
 -----END PGP SIGNATURE-----

Merge tag 'v1.7.0'

getdns-1.7.0 release
2021-06-04 20:57:12 +02:00
Willem Toorop 1f2aa585fc getdns-1.7.0 release 2021-06-04 20:53:14 +02:00
Willem Toorop 2a0114591a Resolve compile warnings
Thanks Andreas!
2021-06-03 20:45:55 +02:00
Anonymous Maarten de2137562d cmake: find libuv pkgconfig non-QUIET 2021-05-28 23:03:44 +02:00
Anonymous Maarten 6eb1a6790a cmake: don't call find_package_handle_standard_args when using pkg_config + cache variables 2021-05-28 16:03:30 +02:00
Anonymous Maarten f92f97bf1e Findlibidn module is not available 2021-05-28 14:15:40 +02:00
Anonymous Maarten cf2b805ef7 Try FindPkgConfig to find modules before going manual 2021-05-28 14:15:40 +02:00
Jim Hague 6dfbfa5dc5 Add header-present guards to include of sys/time.h.
I'm not sure why this hasn't been hit before - it breaks the build on
Windows. I guess that another change has started dragging in this file
where it wasn't used before.
2021-05-28 00:05:20 +01:00
Jim Hague 686285ef59 Re-remove strings.h include.
Again, looks like another copied-from-elsewhere problem.
2021-05-28 00:04:11 +01:00
Jim Hague ae854a8650 Re-add include guards to parseutil.c.
The lack of them breaks the build on Windows.

I suspect we may have another copied-from-elsewhere problem.
2021-05-27 22:24:17 +01:00
Willem Toorop ca97810ed6 Merge branch 'release/v1.7.0' into develop 2021-05-27 22:34:55 +02:00
Willem Toorop df4c7ce4f9 Mention event extension rename (back to old names) in ChangeLog 2021-05-27 22:23:16 +02:00
Willem Toorop 359a44d336 Merge branch 'release/v1.7.0' into develop 2021-05-27 22:21:43 +02:00
Willem Toorop 48a7700fa9 Update ChangeLog 2021-05-27 22:21:03 +02:00
Willem Toorop 2b348b046d Merge branch 'amialkow-develop4' into release/v1.7.0 2021-05-27 22:08:05 +02:00
Willem Toorop 50463c7480 Merge branch 'develop4' of https://github.com/amialkow/getdns into amialkow-develop4 2021-05-27 21:56:38 +02:00
Willem Toorop 1012e34441 update of ldns 2021-05-27 21:23:16 +02:00
Willem Toorop 3f07247e64 Merge branch 'develop' into release/v1.7.0 2021-05-27 20:41:23 +02:00
Willem Toorop 86aa356b48 Release version 1.7.0 tomorrow 2021-05-27 20:39:26 +02:00
Jim Hague fc62f8877c When cross-compiling, assume strptime() is POSIX unless told otherwise.
But issue a warning when making that assumption. Add new option
FORCE_COMPAT_STRPTIME to force the use of the compat version
when cross-compiling and the target platform strptime() is not
POSIX-compliant. Poster children for the latter are BSD platforms,
including MacOS, where %t is not handled POSIXly.

Fix #472
2021-05-27 12:11:49 +01:00
Jim Hague f9c3a359ed Revise recent lookup3.c update to restore building on Windows.
As we're now building with CMake, and CMake can supply endianness, just insist on using that.
2021-05-27 09:45:30 +01:00
Willem Toorop a694080400 First release candidate tomorrow 2021-05-27 09:59:15 +02:00
Willem Toorop fe79e7e633 Bump version 2021-05-26 23:29:44 +02:00
Willem Toorop 61f9ab4351 All tests again 2021-05-26 23:17:44 +02:00
Willem Toorop 6c3f75f4e9 Test transports with OpenSSL 2021-05-26 23:16:02 +02:00
Willem Toorop d055caff44 Test only transports 2021-05-26 23:02:30 +02:00
Willem Toorop 880189367a Make tcp_send_timeout work with GnuTLS 2021-05-26 23:01:45 +02:00
Willem Toorop ed9ac22c66 Update stubby to develop branch 2021-05-26 22:47:19 +02:00
Willem Toorop 189be4b5a5 Try to improve travis results with tcp_send_timeout 2021-05-26 22:37:55 +02:00
amialkow bfdba6d9d7 Merge branch 'getdnsapi:develop' into develop4 2021-05-26 09:55:16 -07:00
Willem Toorop 75b750b3f9
Merge pull request #506 from amialkow/develop3
Fixes #504
2021-05-26 16:11:01 +02:00
Willem Toorop 6a722f5d79
Merge pull request #496 from banburybill/develop
Some Windows behaviour fixes.
2021-05-26 16:09:35 +02:00
Willem Toorop eeb460af8d Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2021-05-26 16:06:30 +02:00
Willem Toorop e030b2525d Merge branch 'maciejsszmigiero-tcp-send-timeout' into develop 2021-05-26 16:05:27 +02:00
Willem Toorop 45ef080bad Changelog entry for getdns_context_set_tcp_send_timeout() contribution
Thanks a lot @maciejsszmigiero , this looks really valueable!
2021-05-26 16:03:56 +02:00
Willem Toorop 624f688967 Honour the claim from documentation: When not set (the default), the system default is left alone. 2021-05-26 15:57:52 +02:00
Willem Toorop 515127289c Merge branch 'tcp-send-timeout' of https://github.com/maciejsszmigiero/getdns into maciejsszmigiero-tcp-send-timeout 2021-05-26 15:56:55 +02:00
Willem Toorop ae090a29b1
Merge pull request #482 from neheb/patch-1
val_secalgo: add missing DSA header
2021-05-26 15:48:10 +02:00
Willem Toorop 7b388a1576 ChangeLog update for issue #480 2021-05-26 15:45:53 +02:00
Willem Toorop df2997d9b7 Eliminate compiler warnings in tests 2021-05-26 15:44:24 +02:00
Willem Toorop 1184f2b8ea Update components from Unbound 2021-05-26 15:43:40 +02:00
Willem Toorop 55be327f69 Fix wrong extension names from merge 2021-05-26 15:42:35 +02:00
Willem Toorop d934b4129f Merge branch 'banburybill-feature/installdlls' into develop 2021-05-26 15:13:11 +02:00
Willem Toorop 3966459fdb Merge branch 'feature/installdlls' of https://github.com/banburybill/getdns into banburybill-feature/installdlls 2021-05-26 15:12:59 +02:00
Willem Toorop c1b6903e58
Merge pull request #472 from cohall-2020/develop
Skip check_c_source_runs when cross-compiling.
2021-05-26 11:21:43 +02:00
Willem Toorop 8abc3b62b8
Merge pull request #468 from renaudallard/develop
Added checks for LibreSSL and OpenBSD
2021-05-26 11:18:20 +02:00
Willem Toorop 63e4d1a1ef
Merge pull request #474 from banburybill/feature/blocking-select
Observe blocking flag in select run_once.
2021-05-26 11:17:20 +02:00
Andrzej Mialkowski 8b558afde0 Fixes #505. Disable packet size checking. 2021-05-15 13:20:30 -07:00
Andrzej Mialkowski 7f606ea14f Add missing rr types: SVCB and HTTPS 2021-05-15 12:32:58 -07:00
Andrzej Mialkowski fa282a59ec Add missing rr types: SVCB and HTTPS 2021-05-15 12:32:58 -07:00
Andrzej Mialkowski 7b12e21ad0 Implement name compression during response packet generation. Compression is required by certain clients like UDP to fit response in packet size limit. While generating packet small cache stores recently used names (currently 4 entries) and uses relative references to previous instances of the same name. Each reused instance is just two bytes of relative reference (0xC000 + offset). Cache is currently performing lookup for query name, responses and CNAMEs. 2021-05-09 14:45:16 -07:00
Willem Toorop 291e001881
Merge pull request #497 from har-riz/develop
Fix typo in cmakeconfig.h.in files
2021-01-27 13:40:26 +01:00
har-riz 0a13e4dbd3
Fix typo in cmakeconfig.h.in files
Fix typo in CMAKE included files, so Stubby can use TLS v1.3 with chipersuites options ON.

This solve issue that's written in here :
https://github.com/getdnsapi/stubby/issues/240
2021-01-27 18:29:22 +07:00
Jim Hague 42e4cfc383 Windowqs mkstemp: open() needs more permissions.
Specifically:

1. The open must be for read only or read/write - use read/write.
2. The file permission must permit read and write.
2020-12-12 21:16:46 +00:00
Jim Hague 6439b0407a Add platform functions for reporting file errors.
Windows socket error numbers are not reported using errno, but with
WSAGetLastError(). _getdns_errnostr() and friends as implemented on
Windows don't work for errors resulting from file open/close/read/write
etc.

So add a parallel set of functions specifically for file errors.
2020-12-11 16:08:02 +00:00
Jim Hague 7fe308f718
Merge pull request #492 from fcelda/fix-lib-naming
Fix naming of extension libraries
2020-11-04 10:13:10 +00:00
Jim Hague 4440a24352
Merge pull request #489 from fcelda/fix-lib-exports
Fix exporting symbols for extension libraries
2020-11-04 10:04:43 +00:00
Willem Toorop ebeff97192
Merge pull request #486 from elindsey/eli
only check for and process read/write events if status is success
2020-10-05 12:34:28 +02:00
Jan Vcelak 03fc32984e build: fix naming of extension libraries 2020-10-05 12:23:27 +02:00
Jan Vcelak 6507e4c469 build: fix exporting symbols for extension libraries 2020-09-18 14:02:30 +02:00
Eli Lindsey 71521626d9 only check for and process read/write events if status is success 2020-09-10 10:59:12 -04:00
Rosen Penev 80cdfb3bd0
fix compilation without deprecated OpenSSL APIs
Several cmake header checks were missing and added.

Added rsa.h include.

Remove ENGINE_load_dynamic. ENGINE_load_builtin_engines already does
this.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-08-04 19:54:18 -07:00
Willem Toorop bda845ce43 Issue #430 listeners reply returned wireformat
So that proxies based on `getdns_set_listen_addresses()` reply with compression from the original response.
2020-08-04 00:05:04 +02:00
Maciej S. Szmigiero 606a88f9aa
Add "tcp_send_timeout" option to set a TCP send data timeout
When using Stubby as a system DNS over TLS resolver with a Internet
connection that disconnects and reconnects from time to time there is often
a long waiting time (~20 minutes) after the connection reconnects before
DNS queries start to work again.

This is because in this particular case all the upstream TLS TCP
connections in Stubby are stuck waiting for upstream server response.
Which will never arrive since the host external IP address might have
changed and / or NAT router connection tracking entries for these TCP
connections might have been removed when the Internet connection
reconnected.

By default Linux tries to retransmit data on a TCP connection 15 times
before finally terminating it.
This takes 16 - 20 minutes, which is obviously a very long time to wait for
system DNS resolving to work again.
This is a real problem on weak mobile connections.

Thankfully, there is a "TCP_USER_TIMEOUT" per-socket option that allows
explicitly setting how long the network stack will wait in such cases.

Let's add a matching "tcp_send_timeout" option to getdns that allows
setting this option on outgoing TCP sockets.
For backward compatibility the code won't try to set it by default.

With this option set to, for example, 15 seconds Stubby recovers pretty
much instantly in such cases.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2020-07-13 00:21:16 +02:00
Willem Toorop fc4eb466b9
Merge pull request #478 from banburybill/feature/static-openssl
Add system libraries when checking OpenSSL functions.
2020-06-25 12:18:15 +02:00
Jim Hague c9072b2526 Add system libraries when checking OpenSSL functions.
If OpenSSL is a static library, linking the test programs will require
system libraries.
2020-06-24 22:07:29 +01:00
Jim Hague 1c97459ec3 Install the DLLs when installing on Windows. 2020-06-24 14:36:30 +01:00
Willem Toorop 7c767b1a5f
Merge pull request #476 from elindsey/develop
register only a single poll_t with libuv
2020-06-19 10:24:17 +02:00
Eli Lindsey 2673a5736c register only a single poll_t with libuv
Most of the time we only need a read _or_ a write callback registered
with libuv - for example, on a UDP request a write callback is
registered, when executed the write callback performs the write,
deregisters itself, and registers a read callback.

However there is one case where getdns registers both read and write
callbacks: when a backlog of TCP requests is going to the same upstream
resolver, we use a single fd and queue the requests. In this instance we
want to listen for both read (to get responses for requests we've
already sent) and write (to continue to send our pending requests).

libuv, like most event libraries, only allows one callback to be
registered per fd. To get notification for both reads and writes, you
should examine the event flags and have appropriate conditional logic
within the single callback. Today getdns incorrectly tries to register
two separate poll_t with libuv, one for read and one for write - this
results in a crash (internal libuv assertion guaranteeing that only a
single poll_t is registered per fd).

Testing was done by using flamethrower
(https://github.com/DNS-OARC/flamethrower) to toss queries at a program
that embeds getdns.

Note that a higher qps trigger a _different_ getdns/libuv crashing bug
that occurs when the TCP backlog grows so large that requests start to
time out. That crash is not addressed in this PR, and will be more
involved to fix.
2020-06-18 17:31:34 -04:00
Jim Hague 8a95f3d279 Observe blocking flag in select run_once.
Currently run_once always blocks.
2020-06-12 10:49:47 +01:00
Willem Toorop f020cca206
Merge pull request #473 from rogers0/PR/fix_cmake
Fix install path for cmake build since we use GNUInstallDirs
2020-05-27 17:42:24 +02:00
Roger Shimizu 7c6188c53d Fix install path for cmake build since we use GNUInstallDirs
So we use install path below since cmake v3.0 [1]:
 - CMAKE_INSTALL_LIBDIR
 - CMAKE_INSTALL_INCLUDEDIR

[1] https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
2020-05-27 00:30:33 +09:00
cohall-2020 5e7bf99a5f
Merge pull request #1 from cohall-2020/cohall-2020-patch-CMakeList
Update CMakeLists.txt
2020-05-08 13:27:00 +02:00
Willem Toorop 5c79e2c731
Merge pull request #471 from getdnsapi/feature/privacy-aware-cookies
Privacy aware DNS Cookies
2020-05-01 11:13:00 +02:00
cohall-2020 320dd098a8
Update CMakeLists.txt 2020-04-28 23:56:40 +02:00
Willem Toorop 8bd87c490e Fix of const-info.c 2020-04-14 20:58:36 +02:00
Willem Toorop 9ecd3fde1c Privacy aware DNS Cookies
Track source IP address in an efficient manner to make sure the same cookie will not be sent from different source IP addresses.
2020-04-09 16:24:34 +02:00
Willem Toorop de13a0c32d Better retry on badcookie flooding prevention 2020-04-08 19:16:51 +02:00
Willem Toorop 8b62970e0c Response to BADCOOKIE extended rcode 2020-04-08 16:08:56 +02:00
Willem Toorop 563b2b113a Show dns_root_servers setting in API information 2020-03-27 10:11:26 +01:00
Renaud Allard 31031d7c57 Added checks for LibreSSL and OpenBSD 2020-03-24 14:14:39 +01:00
Willem Toorop 73cee29f55 Make TLS Handshake timeout max 4/5th of timeout
for the query, just like connection setup timeout was, so fallback transport have a chance too when TCP connection setup is less well detectable (as with TCP_FASTOPEN on MacOS).
2020-03-16 14:50:59 +01:00
Jim Hague 0b01ad8e6f Merge branch 'develop' of https://github.com/getdnsapi/getdns into develop 2020-03-16 11:23:52 +00:00
Willem Toorop 3c6756d68b Issue #466: Memory leak with retrying queries
(for examples with search paths).
Thanks doublez13.
2020-03-13 22:31:01 +01:00
Jim Hague 3f9e0f9671 Merge branch 'my-develop' into develop
Update Stubby and add small GnuTLS version fixup to signature selection.
2020-03-12 16:17:08 +00:00
Jim Hague be09306567 Update Stubby to pick up latest Stubby release tag and Windows packaging details. 2020-03-12 16:13:11 +00:00
Jim Hague cd386cd917 Merge commit '26a95b5b8a213096641654c5b97976e66ec32e5d' into my-develop
# Conflicts:
#	src/gnutls/tls.c
2020-03-12 15:51:22 +00:00
Willem Toorop 2c51db610a
Merge pull request #465 from banburybill/develop
Relax GnuTLS priority strings slightly to allow getdns to work with T…
2020-03-05 14:52:55 +01:00
Willem Toorop 26a95b5b8a Fix DoT with GnuTLS >= 3.6 2020-03-05 14:46:32 +01:00
Jim Hague 0078977ada Merge branch 'develop' into my-develop 2020-03-05 13:25:24 +00:00
Jim Hague 9baf655a7b Relax GnuTLS priority strings slightly to allow getdns to work with TLS1.3 servers.
Now GnuTLS 3.6.5 and later are in the field, we've run into problems handshaking with TLS1.3 servers with a GnuTLS build. OpenSSL works fine. Comparing the client handshake of GnuTLS and OpenSSL, we found GnuTLS was being considerably more restrictive. This change loosens the restriction so GnuTLS presents nearly the same set of cipher and other options and OpenSSL. OpenSSL provides more signature algorithms. The change gets GetDNS working against Quad1, Quad8, Quad9 and the getdnsapi servers.
2020-03-05 13:24:44 +00:00
Willem Toorop c234865a80 Print GnuTLS debug messages 2020-03-05 13:39:30 +01:00
Willem Toorop 6972c99268
Merge pull request #464 from banburybill/develop
Various small fixes
2020-03-05 10:14:28 +01:00
Jim Hague 252d68e67a Update stubby. 2020-03-04 16:06:14 +00:00
Jim Hague 37e33bc7f5 Merge branch 'develop' into my-develop 2020-03-04 15:30:47 +00:00
Jim Hague e96e334932 Point ssl_dane submodule back at getdnsapi version. 2020-03-04 15:30:26 +00:00
Jim Hague 55ffca15ce Merge branch 'develop' into my-develop 2020-03-04 15:13:57 +00:00
Jim Hague 1328fac5ae Merge commit 'ef455471f4f1db778e7bcc58818fc780a280c16d' into develop 2020-03-04 15:13:02 +00:00
Willem Toorop ef455471f4 Work around dnsmasq issue 2020-03-04 10:57:11 +00:00
Jim Hague f01e7188c8 CMake libunbound fixups.
1. ub_ctx_set_stub is in unbound.h, not unbound-events.h.
2. Only bother looking for unbound event API if enabled.
3. If building stub only, ensure all libunbound items are off. This is necessary in case we first configure without stub only, and then change to stub only.

Fixes #463
2020-03-04 09:45:52 +00:00
Jim Hague 65f7d96678 Merge branch 'develop' into my-develop 2020-03-03 17:29:52 +00:00
Jim Hague 822d8ad703 Revise recent lookup3.c update to restore building on Windows.
As we're now building with CMake, and CMake can supply endianness, just insist on using that.
2020-03-03 17:28:34 +00:00
Jim Hague 2e4070a3cd Merge branch 'develop' into my-develop 2020-03-03 14:51:17 +00:00
Willem Toorop 689415971a Run all tests again 2020-03-03 13:14:45 +00:00
Willem Toorop e7d435e426 Name only authentication with GNUTLS 2020-03-03 13:04:27 +00:00
Willem Toorop 9c8b70e4bc Eliminate compile error 2020-03-03 13:03:58 +00:00
Jim Hague 38627fbb01 Merge branch 'develop' into my-develop 2020-03-03 11:30:13 +00:00
Jim Hague 3073d33560 Update stubby. 2020-03-02 18:13:47 +00:00
Willem Toorop af46e20721 Fix reporting authentication failure 2020-03-02 15:51:46 +00:00
Willem Toorop e17ed3938c Fix: mem leak with gnutls 2020-03-02 15:12:18 +00:00
Willem Toorop 1067326bd0 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2020-03-02 15:31:28 +01:00
Willem Toorop f05c0ad754 Testing GNUTLS DoT tests 2020-03-02 15:30:58 +01:00
Willem Toorop 16c20fe04d
Merge pull request #462 from doublez13/develop
Fix uninitialized value in tls_create_object
2020-03-02 15:20:51 +01:00
Willem Toorop f73bf0dfa5 Dependencies for travis (+ testing...) 2020-03-02 15:17:03 +01:00
Willem Toorop 3b5d1a9353 Stub only links with GNUTLS
And valgrind check includes DoT session
2020-03-02 15:12:33 +01:00
Willem Toorop f3a38e9a40 Sync tools shared with unbound 2020-03-02 15:11:58 +01:00
Jim Hague 5721c501c3 Point stubby at my repo. 2020-03-02 13:41:12 +00:00
Zane Zakraisek b804b8effb Fix uninitialized value in tls_create_object
On the first call to tls_create_object (stub.c), tls_fallback_ok is read
before being initialized. This patch initializes tls_fallback_ok to 0 in
upsteam_init (context.c)

Valgrind complains about the uninitialized value:
==14774== Conditional jump or move depends on uninitialised value(s)
==14774==    at 0x1528C3: tls_create_object (stub.c:900)
==14774==    by 0x1556AD: upstream_connect (stub.c:2065)
==14774==    by 0x15582E: upstream_find_for_transport (stub.c:2109)
==14774==    by 0x1558B7: upstream_find_for_netreq (stub.c:2130)
==14774==    by 0x156027: _getdns_submit_stub_request (stub.c:2296)
==14774==    by 0x1421C8: _getdns_submit_netreq (general.c:478)
==14774==    by 0x14261D: getdns_general_ns (general.c:636)
==14774==    by 0x142905: _getdns_general_loop (general.c:731)
==14774==    by 0x1432FB: getdns_general (general.c:888)
==14774==    by 0x118B94: incoming_request_handler (stubby.c:692)
==14774==    by 0x14F46B: udp_read_cb (server.c:762)
==14774==    by 0x15C86B: poll_read_cb (poll_eventloop.c:295)
==14774==  Uninitialised value was created by a heap allocation
==14774==    at 0x483877F: malloc (vg_replace_malloc.c:309)
==14774==    by 0x123CCF: upstreams_create (context.c:581)
==14774==    by 0x128B24: getdns_context_set_upstream_recursive_servers (context.c:2760)
==14774==    by 0x12DBFE: _getdns_context_config_setting (context.c:4646)
==14774==    by 0x12FF47: getdns_context_config (context.c:4769)
==14774==    by 0x1178C2: parse_config (stubby.c:297)
==14774==    by 0x117B24: parse_config_file (stubby.c:343)
==14774==    by 0x11919F: main (stubby.c:833)
2020-03-01 14:13:27 -07:00
Willem Toorop fe30672afa shorten code with string conversion functions 2020-02-28 20:33:22 +01:00
Willem Toorop e19e6bd464 getdns-1.6.0 release
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE3DTuXbJBe8wVHlEA5fj4IS93pJgFAl5ZKkAUHHdpbGxlbUBu
 bG5ldGxhYnMubmwACgkQ5fj4IS93pJjVeA/+MIMCZm0pSET6kAIauItpeA506/2a
 U6Us1mQRKFu3kAq655CiCC2amXH+oPZg8ESKBqFn4AbbzSiWMcHEQh91v6vHGYe9
 0V1CciUUScFW2PlodKg/Ulxy+COmrmonkz4X/NbepsikYXUu4xmVL+FgfGw1xvAu
 mxLMWW3oZi7Rgr3zAixgNLE3t7KgjVVRXBNVDb9on3IyydAkgssUJQHAsupJJQy+
 CCPrqpj4s3nLGSACVkCQPJIYewYKAnvTwLSy2+9mOP8clIgmVonoeEaYwM5x0RU/
 boeqXR7A6iA6CvReeG/vQa/MVcVIIY/p7FSYZwtxrHef8cPXG9H8GVKy9s+xlNEO
 7tEG6uhwGq52i9zDfVi36TXwWe/FW9ER5cytmlhcMOIkMnH6KHn3iZrx6mVhInob
 93cwl+vVGd/MSt7JnDwsvRI1uUsdSapbqK58c/aCrC9aag9YWhwnGPMByqfyXJUf
 5Yv43/AI9wI0UY2BPzvtZbtfwL+30VotZLUJRmoBtmKJQ6XQ98LG3NPeq83v5Wzd
 DxRcCqLNwEBh0qADtdfEd07H+Hf5F7GT6xqJo+IWrTaZ+naZNMsVajGJtSpCthCq
 k02naEtEMegc9C+fsrbFfQeuvvBPnFgUJKFVQJH6UrMG278tkEklmHmJwnZKtSFY
 ZhNgm/04AG1hcdU=
 =pOTk
 -----END PGP SIGNATURE-----

Merge tag 'v1.6.0'

getdns-1.6.0 release
2020-02-28 16:03:59 +01:00
Willem Toorop 1b3f570792 Bump version for release 2020-02-28 15:39:53 +01:00
Willem Toorop 328903cb52
Merge pull request #459 from banburybill/release/1.6.0-rc.1
Tighten Nettle version checking, and fix build issue with Nettle >= 3.4.
2020-02-25 14:36:44 +01:00
Jim Hague ab49db8aa5 Tighten Nettle version checking, and fix build issue with Nettle >= 3.4.
Nettle 3.4 introduced accessor functions for obtaining nettle_secp_256r1 and nettle_secp_384r1. Use them if present.

Fixes #458
2020-02-25 13:30:25 +00:00
Willem Toorop e2cb4fc4ad Typo in changelog 2020-02-21 14:27:47 +01:00
Willem Toorop e3fbe4fb51 getdns-1.6.0-rc.1 2020-02-21 14:21:12 +01:00
Willem Toorop d7099f6e30 Deal with DoT servers that take long to connect to
(because they might be under attack)
2020-02-21 14:17:00 +01:00
Willem Toorop dadddb0d7b Detect if __func__ can be used with debugging 2020-02-20 21:09:17 +01:00
Willem Toorop 4453febf2d Build eventloop support libraries by default
Resolves issue #169
2020-02-20 20:25:35 +01:00
Willem Toorop e2c6241964 Issue #175: Include query in call_reporting dict
Thanks Tom Pusateri
2020-02-20 17:52:27 +01:00
Willem Toorop 56ca583fa6 Issue #407 run only offline tests 2020-02-14 16:49:45 +01:00
Willem Toorop ed36240f19 Fix test 2020-02-13 17:26:18 +01:00
Willem Toorop 6cb15939ba Issue #430: Record and guard UDP max payload size with servers. 2020-02-13 17:02:24 +01:00
Willem Toorop 971c43c659 Fix #432 answer_ipv4_address and answer_ipv6_address
in reply and reponse dicts.
I realise we also do not have intermediate_aliases yet...
2020-02-13 15:33:13 +01:00
Willem Toorop f33a4b2d4e More worldly changes that influenced unit testing 2020-02-12 13:23:51 +01:00
Willem Toorop 770c0a1282 Fix unit tests (for changed world)
- Google started to respond NOTIMP on unknown RR types!
- willem.getdnsapi.net has been removed
2020-02-12 12:28:50 +01:00
Willem Toorop a847d478ec Update stubby 2020-02-11 15:54:44 +01:00
Willem Toorop ad22492732
Merge pull request #455 from saradickinson/update_stubby_submodule
Update the stubby module to latest develop branch
2020-02-11 15:49:52 +01:00
Sara Dickinson 2b3a540fda Update the stubby module to develop 2020-01-16 15:54:15 +00:00
Willem Toorop 9b9cecd35d
Merge pull request #453 from getdnsapi/release/1.6.0-beta.1
Release/1.6.0 beta.1
2019-12-20 14:19:54 +01:00
Willem Toorop a6a2695fee Update stubby release & Changelog 2019-12-20 14:02:23 +01:00
Willem Toorop 56c83b7d3e What to install on FreeBSD 2019-12-20 13:44:26 +01:00
Willem Toorop 8b5c57bfcb Also clear returned netreq when result came from LOCALNAMES namespace 2019-12-20 12:42:52 +01:00
Willem Toorop 24824bb413 Not string.h but strings.h! 2019-12-20 11:23:45 +00:00
Willem Toorop 4fdf3a8b2a Stuff that came out of valgrind on FreeBSD 12 2019-12-20 11:09:24 +00:00
Willem Toorop 8da6fdb442 string.h not available on Windows 2019-12-20 11:08:32 +00:00
Willem Toorop 33633ea239 One more scan with extra argument 2019-12-20 10:46:59 +00:00
Willem Toorop 3345bb615d One more gldns_wire2str_rr_scan fix 2019-12-20 10:29:54 +00:00
Willem Toorop 8cda9816e4 Merge branch 'release/1.6.0-beta.1' of github.com:getdnsapi/getdns into release/1.6.0-beta.1 2019-12-20 09:56:08 +00:00
Willem Toorop 3ad84d0a51 Updated gldns 2019-12-20 10:55:47 +01:00
Willem Toorop 651e5f7c3f Work around FreeBSD12 FAST OPEN issue
Before (FreeBSD 11), poll could be used to wait for the socket to
be writeable immediately. Now (since FreeBSD 12) this results in
infinite wait, so we just have to write immediately to work around
this.
2019-12-19 15:00:53 +00:00
Willem Toorop b446bfdf11 Enable debugging symbols for better valgrind output 2019-12-19 14:56:12 +00:00
Willem Toorop 61dffd0e35 Fail eventloop test on errors 2019-12-19 12:45:47 +00:00
Willem Toorop 8b2e8c2be3 Memory leak via libunbound in FreeBSD11.3 2019-12-19 11:29:40 +00:00
Willem Toorop a78b963aa9 Make check timeout larger than getdns timeout
- when timeout should be expected
2019-12-19 10:44:22 +00:00
Willem Toorop 2cc4865b14
Merge pull request #451 from getdnsapi/feature/readme-polish
Feature/readme polish
2019-12-18 15:02:07 +01:00
Willem Toorop f701af7508 Remove INSTALL from CMakeLists.txt too 2019-12-18 14:53:26 +01:00
Willem Toorop 30104f8bc3 Merge branch 'release/1.6.0b1' into release/1.6.0-beta.1 2019-12-18 14:49:39 +01:00
Willem Toorop 0d04d1f397
Merge pull request #449 from banburybill/release/1.6.0b1
Get tests passing on Bionic and OSX
2019-12-18 14:47:16 +01:00
Jim Hague 015d209387 README fixups.
1. Be consistent about the primary platforms including Ubuntu.
2. Note that the regression tests run on all non-WIndows primary platforms.
3. Windows support is for Windows 10.
4. Rename Platform Specific Build Reports to Platform Specific Build Notes and remove section on RHEL/CentOS. We don't talk about how packages get built for any other platform.

Quite probably build notes for RHEL will re-appear, once I've tried building on CentOS 8.
2019-12-18 13:17:59 +00:00
Jim Hague 05e9cbf5de Correct CMake quick start URL. 2019-12-18 13:10:40 +00:00
Jim Hague 8b1cdd0fa8 Remove INSTALL. It's GNU boilerplate for an autoconf build. 2019-12-18 13:09:07 +00:00
Willem Toorop 6b1ba31334 Switch to semvers 2.0 2019-12-18 12:29:21 +01:00
Jim Hague 4f0f9c7eca Merge branch 'release/1.6.0b1' of https://github.com/getdnsapi/getdns into release/1.6.0b1 2019-12-18 11:27:14 +00:00
Jim Hague 489022dcb9 Some tests that use valgrind aren't flagged as such. Fix this. 2019-12-18 11:14:12 +00:00
Jim Hague 0226096974 Suppress memory leak in libunbound to get test 125 passing on Bionic. 2019-12-18 10:23:45 +00:00
Willem Toorop 5c33130454 Include NEWS with included Stubby 2019-12-17 12:58:21 +01:00
Willem Toorop 9c3321cdfc Merge branch 'feature/cmake_dist' into release/1.6.0b1 2019-12-16 16:44:11 +01:00
Willem Toorop 40bcf4cb4c Updated makedist.sh 2019-12-16 16:43:25 +01:00
Willem Toorop 52cb444065 Update all submodules with .gitattributes 2019-12-16 16:27:28 +01:00
Willem Toorop 2ac84800af
Merge pull request #448 from k0ekk0ek/mailing-lists
Update mailing list references
2019-12-16 16:21:14 +01:00
Jeroen Koekkoek bf29924d76 Update mailing lists 2019-12-16 16:10:15 +01:00
Willem Toorop 7d2e255ead git-archive-all.sh based makedist file 2019-12-16 15:36:53 +01:00
Willem Toorop 293011c27f Bump version + move CodeStyle to project-doc 2019-12-16 13:47:14 +01:00
Willem Toorop 60307d88fd
Merge pull request #447 from getdnsapi/feature/cmake
Feature/cmake
2019-12-16 12:33:12 +01:00
Willem Toorop 306110ab7e
Merge pull request #446 from saradickinson/feature/more_cmake
Feature/more cmake
2019-12-16 12:16:22 +01:00
Willem Toorop 3e373ab2af Now with actual fix for multiple localhost addresses 2019-12-16 12:05:29 +01:00
Willem Toorop aafdba690d Server capabilities test, listen on single localhost IPv4 address 2019-12-16 11:54:00 +01:00
Willem Toorop 0fbe0dccc3 Debugging server capability testing 2019-12-16 11:47:40 +01:00
Willem Toorop f1ea127e7a NLnet Labs reversed space takes long to lookup... 2019-12-16 11:04:49 +01:00
Willem Toorop e2813299ee Target everything does not exist with me ...
.. but did exist in travis???
2019-12-13 16:19:29 +01:00
Willem Toorop 17d5627529 Make TCP_FASTOPEN work again for linux and FreeBSD 2019-12-13 16:18:53 +01:00
Willem Toorop 39e2c8a33e replace '//' with #ifdef 0 / #endif
because my compiler complains about it for some reason
2019-12-13 11:34:14 +01:00
Willem Toorop 17784bd3f5 Try to fix yxml 2019-12-13 11:29:34 +01:00
Willem Toorop e28ee2b0e0 New commits in yxml 2019-12-10 15:21:51 +01:00
Sara Dickinson d92a91e771 Fix up unit tests for all the event loops.
Various housekeeping
2019-11-29 10:50:49 +00:00
Sara Dickinson 33774228a3 Missed one SOA that is not returned 2019-11-28 16:42:42 +00:00
Sara Dickinson 0fc75dfbaf Work around issue in cmake (after 3.5 but fixed in 3.12) where object libraries could not be used with target_link_library().
Tweak libcheck/windows logic.

Hacks to make tests pass with strange bionic system resolver behaviour
Add to README that xenial doesn’t have libunbound-dev 1.5.9 packaged
2019-11-28 16:22:45 +00:00
Sara Dickinson 26d678b344 More update to README
v. minor updates to tests to clean up output
2019-11-18 20:41:28 +00:00
Jim Hague 6352419823 Correct typo. 2019-11-18 18:33:00 +00:00
Jim Hague b8c7690df4 Add CMake build instructions for Windows and Visual Studio. 2019-11-18 18:31:41 +00:00
Sara Dickinson b455c3feca If we want to use only libidn2 then we need to move to bionic for the travis build (the libidn2 package for xenial is too old!). So update the travis build for this.
Fix the default mode for STUB_ONLY build for Windows vs linux
2019-11-18 16:59:29 +00:00
Sara Dickinson 38f59b7bea Remove libidn support
More updates to README
2019-11-18 14:05:50 +00:00
Sara Dickinson fa72271221 Add simple test to run stubby 2019-11-15 16:35:56 +00:00
Sara Dickinson 2925c7e80b Add verbose on failure output to unit tests 2019-11-15 15:52:39 +00:00
Sara Dickinson 323e6a6ba6 Update submodules and fix issue with loading local hosts 2019-11-15 14:29:33 +00:00
Sara Dickinson 499555b8a5 More fixes for remaining tests.. 2019-11-14 17:58:11 +00:00
Sara Dickinson 80b0c7a45e Add missing compile flags so JSON parsing of listen_addresses works!!!! 2019-11-14 17:43:26 +00:00
Sara Dickinson d59380fca0 Start work on remaining tests 2019-11-14 14:40:24 +00:00
Sara Dickinson 1cca550799 Fix lib name on linux 2019-11-14 14:05:47 +00:00
Sara Dickinson 8b3e3412f5 Merge branch 'feature/cmake' of https://github.com/getdnsapi/getdns into feature/cmake_testfix 2019-11-14 12:38:15 +00:00
Sara Dickinson ffbc49cc2d Get all of the tests run by ‘run-all.sh’ working apart from those that require valgrind…….
update stubby commit and ymlx commit to remove build warnings
2019-11-14 11:36:18 +00:00
Jim Hague 277a4ae9c7 Add test for new libuv callback styles.
This fixes a build warning on Mac.
2019-11-13 18:07:31 +00:00
Jim Hague 4314f5dbf9 Be more generous about what constitutes a build directory name. 2019-11-13 18:06:36 +00:00
Sara Dickinson cafd745383 More work on the README - some sections still to do
Also add build dir to .gitignore
2019-11-04 17:31:14 +00:00
Sara Dickinson 383a162bf4 update stubby submodule target 2019-11-04 14:07:26 +00:00
Willem Toorop 41e09259db
Merge pull request #438 from neheb/patch-1
platform: Prefer poll.h to sys/poll.h
2019-11-04 09:33:42 +01:00
Rosen Penev 3f6203bf0f
platform: Prefer poll.h to sys/poll.h
sys/poll.h seems to be some GNU extension. musl warns about this:

warning redirecting incorrect #include <sys/poll.h> to <poll.h>

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-11-03 14:30:34 -08:00
Jim Hague beda65f262 Basic updates to README for cmake version. 2019-11-01 12:40:05 +00:00
Jim Hague e00a79a240 Remove autoconf build and update to autoconf-less Stubby. 2019-11-01 12:27:10 +00:00
Jim Hague 7a1e72d51e Increase minimum libunbound version to 1.5.9 to get pluggable event handling.
At Willem's suggestion.
2019-11-01 12:10:52 +00:00
Jim Hague 1cac86424e Fix build problem with ENABLE_DEBUG_STUB when not using ENABLE_DEBUG_ALL. 2019-11-01 10:44:55 +00:00
Jim Hague 011b4c6099 Pick up stubby install fixes. 2019-10-31 18:03:48 +00:00
Jim Hague 5be26496ac Update to pick up latest Stubby build fixes. 2019-10-31 16:19:45 +00:00
Jim Hague 0e432cc7c2 Add option to build Doxygen.
This requires a change to the Doxyfile. I can't see a way to avoid this.
2019-10-31 13:41:04 +00:00
Jim Hague ba54c50779 Add options to build the example programs. 2019-10-31 12:59:28 +00:00
Jim Hague c66d772c97 Add libidn2 to list of library names searched when looking for libidn2.
Other find packages do this, and omitting it stops it from finding vcpkg library.
2019-10-31 12:45:46 +00:00
Jim Hague 07a074c1b1 Add binary build dir as include interface for the getdns libraries.
Any library user will need that to find the getdns header files.
2019-10-30 18:12:23 +00:00
Jim Hague a46ded25b6 Implement enabling and checking for TCP Fast Open. 2019-10-30 17:21:25 +00:00
Jim Hague ffa5d6144f Add manual enable/disable of the poll event loop.
And fix the detection of poll().
2019-10-30 14:40:11 +00:00
Jim Hague cbed43ed59 Add ENABLE_EDNS_COOKIES. 2019-10-30 14:09:13 +00:00
Jim Hague c75d8df399 Remove obsolete comment. 2019-10-30 14:02:49 +00:00
Jim Hague 74d9404759 FIrst pass at GnuTLS support. 2019-10-30 14:02:32 +00:00
Jim Hague f34218d812 Correct comments. 2019-10-30 13:41:15 +00:00
Jim Hague 633724327f Get CMake build working under MinGW.
The MinGW linker does not like -VERSION: one little bit.

I rearranged the order of the ifs hoping that MinGW and friends would be a UNIX, but it was not to be.
2019-10-29 18:10:04 +00:00
Jim Hague ea09baf376 Fix Windows build failure when libunbound is present. 2019-10-29 17:42:21 +00:00
Jim Hague b0ef0887db Add libunbound dependencies where necessary.
I think it's only needed for getdns_query and getdns_server_mon because it gets included in config.h, of all places.
2019-10-29 16:53:19 +00:00
Jim Hague 5bab6921bd Get libevent.c building under Windows. 2019-10-29 15:59:15 +00:00
Jim Hague bb59275ba9 More Windows system libraries. These are used by libuv. 2019-10-29 15:46:04 +00:00
Jim Hague 4af076f5fb Ensure include directories for external libraries are on the path. 2019-10-29 15:38:54 +00:00
Jim Hague 6a043d2fac Add libuv extension. 2019-10-29 09:15:04 +00:00
Jim Hague 3604add64f Correct header name. 2019-10-29 09:14:36 +00:00
Jim Hague c359a0b65e Add libev extension. 2019-10-29 09:13:57 +00:00
Jim Hague 02561c2d7e Add building the libevent extension.
Insist on libevent2.
2019-10-28 18:11:42 +00:00
Jim Hague 4ab7f8f757 Shared libraries - move versioning and export list into functions.
Also for Windows add looking for a template .RC of the target name and adding that to the build too.
2019-10-28 17:11:00 +00:00
Jim Hague 7cf119fb6b Only include libidn/idn2 includes on building getdns objects if they are set. 2019-10-28 11:05:54 +00:00
Jim Hague 8867e14e8c As with ssl_dane, temporarily point at different upstream repo for stubby to get the required change. 2019-10-28 10:47:11 +00:00
Jim Hague 69ab8adb12 Allow user to disable use of libidn/idn2.
It's tempting to do the same for libunbound, but that's only pulled in if you're not building stub-only, and in that case there is no choice - you have to have libunbound.
2019-10-28 10:36:34 +00:00
Jim Hague 5df3bc4fce Libidn/idn2 needs to be included in the library link, certainly for shared libs.
So might as well do the same for static libs.
2019-10-28 10:35:36 +00:00
Jim Hague 545916d347 Make building getdns_query and getdns_server_mon optional. Default is on. 2019-10-28 10:06:02 +00:00
Jim Hague 38bf04c86d Small comment typo. 2019-10-28 09:57:49 +00:00
Jim Hague 1da968a35f Detect and use libidn and libidn2 if present. 2019-10-28 09:57:29 +00:00
Jim Hague 164b089011 Add option to enable MDNS support. 2019-10-25 17:18:29 +01:00
Jim Hague d9e5f405e7 Add option to build Stubby from subproject, and remove Stubby-only items from getdns config.
This requires the latest version of the Stubby CMake build to work.
2019-10-25 16:16:04 +01:00
Jim Hague 2fa1a184e4 Remove blanket include directory addition and make specific to individual targets.
This is best practice. We don't want that directory potentially contaminating other included builds.
2019-10-25 15:58:48 +01:00
Jim Hague f1885cc4a6 Remove surplus entry on CMAKE_MODULE_PATH and verbosity put in there temporarily and accidentally committed. 2019-10-25 15:54:57 +01:00
Jim Hague 7adc1fc4ab Remove copyright notices copied from existing files in error. 2019-10-25 15:51:30 +01:00
Jim Hague dbad46c516 Correct ordering of project and includes. 2019-10-24 17:49:23 +01:00
Jim Hague 9dcd8482f5 Add stub only mode, on by default.
If disabled, it needs to drag in libunbound. So do all that.
2019-10-24 17:40:37 +01:00
Jim Hague 530c8c5e8e Use BSD library we found directly, and mark its path as advanced, as per other libraries. 2019-10-24 17:32:05 +01:00
Jim Hague 072bdd9a6b Pay attention to hint directories for Check.
Allow specifying a base hint directory, and look there and in include/libs underneath it.
2019-10-24 17:30:41 +01:00
Jim Hague e8eafdfa44 Rearrange includes, to CTest and thus BUILD_TESTING is always present.
We can then use BUILD_TESTING to control whether to build the test executables or not.
2019-10-24 17:29:30 +01:00
Jim Hague e4c2ddb401 Present more user friendly name for the native stub DNSSEC option. 2019-10-24 14:29:20 +01:00
Jim Hague 55a0456b67 Add cipher configuration options. 2019-10-24 14:21:25 +01:00
Jim Hague def0f1d714 Ensure some option values get defined in the config header. 2019-10-24 14:07:43 +01:00
Jim Hague e4333b13df Add debug message options. 2019-10-24 13:43:20 +01:00
Jim Hague 7fd7bda000 Add current date option. 2019-10-24 12:19:51 +01:00
Jim Hague 74bbfc02fa Ensure library locations are all marked as advanced options. 2019-10-24 12:04:27 +01:00
Jim Hague 3b44cd8f38 Minor formatting nit. 2019-10-24 11:57:34 +01:00
Jim Hague b5f260376e Expose file paths as options. 2019-10-24 11:57:16 +01:00
Jim Hague 07e617579d Add fd setsize configuration. 2019-10-24 11:15:41 +01:00
Jim Hague 5f3d5191b0 Make visible existing options that are visible in autoconf.
Also punctuate option text consistently.
2019-10-24 11:14:20 +01:00
Jim Hague 60eb113770 Add options ENABLE_STATIC and ENABLE_SHARED.
Stick a cautious toe in the water of CMake options, and add enabling/disabling shared/static library builds, because that's easy.
2019-10-24 10:51:28 +01:00
Jim Hague d447999c60 Add check for check library, and if found add the main test module.
Note that tests_dict/list/stub_async/namespaces are built, but not run. I don't know why.
2019-10-23 18:33:50 +01:00
Jim Hague 24e2d1acbf Includes are specified by the library interfaces. 2019-10-23 18:30:26 +01:00
Jim Hague 9acdc1cbb5 Resolv.conf location mustn't have prefix. It's so the library can find the system resolver.
If you add a prefix, getdns doesn't get any upstreams configured and test failures abound.
2019-10-23 18:28:54 +01:00
Jim Hague 2414d31951 Properly sort out exporting the include directory for in-tree builds but not for out of tree builds. 2019-10-22 15:42:06 +01:00
Jim Hague 165078a50d Improve manpage processing robustness.
Fix regex to expressly check for starting ., and switch to regex match for SH lines to stop any potential problems with training spaces or multiple spaces before section name.
2019-10-22 14:47:49 +01:00
Jim Hague ea1111d899 Add installation of work done so far.
The install is equivalent to the autoconf install with no options.

Note that where the autoconf adds copies of manual pages renamed to individual APIs via a script manpgaltnames (in doc), this functionality is now done in pure CMake, to ensure it works on Windows.

Also note there is no 'make uninstall'. See https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake.
2019-10-22 14:32:44 +01:00
Jim Hague c6e5ef6330 Set SONAME matching autoconf build on shared library for GNU ld. 2019-10-21 17:25:48 +01:00
Jim Hague 2c06e8b8ac Remove unused items. 2019-10-21 16:54:55 +01:00
Jim Hague a884426c6e Suggest C11 for the tools as well as the library. 2019-10-21 16:54:40 +01:00
Jim Hague 9682b4d41c Do platform versioning from single version source.
Now I understand what dark stuff libtool gets up to, just do the same at the platform level.
2019-10-21 13:51:19 +01:00
Jim Hague 41741f6cc4 Rather than listing in a variable, list sources, libs etc directly on targets. 2019-10-21 13:32:05 +01:00
Jim Hague 87177cc103 Add a Windows implementation of getdns_context_set_resolvconf().
Have it return GETDNS_RETURN_NOT_IMPLEMENTED. This function is listed in the shared library exports, and it's part of the official API, so we need it.
2019-10-18 19:04:17 +01:00
Jim Hague 73e9c32655 First pass at adding shared libraries to the current static library build.
* I can't find out where the .so version number currently produced by the autoconf build comes from, so for the moment supply it explicitly.
* Include a version in the Windows DLL. But Windows can only grok major[.minor]. So also supply one of those.
* On Windows, we need a .lib for the .dll, and a static .lib. These, obviously, need different names. So add _static onto the name of the static lib.
* Only build the objects once, so explicitly build both with PIC.
* Only export the explicit list of symbols from the shared library. This has to be done a different way on GNU ld, Mac linker and Windows.
* Although I have left the tools being linked statically, I have tested with dynamic linking. getdns_query uses gettimeofday(), which isn't on Windows. With a static link, it just happens to find it in the getdns library, as the symbols aren't filtered. But this doesn't work for shared use, when they are. So explicitly add the compat implementation into the getdns_query sources.
2019-10-18 18:54:09 +01:00
Jim Hague 4304bb7017 Be a little more modern CMake. 2019-10-18 11:28:39 +01:00
Jim Hague 4df33630ea Let CMake know about the target language. 2019-10-18 11:27:19 +01:00
Jim Hague 878fd0583f Jump off the fence on policy CMP0075.
The new behaviour is benign for us, so go with it if available.
2019-10-17 17:22:51 +01:00
Jim Hague 11e621b758 Regularise use or not of space between else/endif and (). Always have a space. 2019-10-17 17:21:58 +01:00
Jim Hague 97227f9bd7 Temporarily (I hope) redirect ssl_dane submodule to my patched repo. 2019-10-16 11:25:07 +01:00
Jim Hague 4da88601d9 Add getdns_server_mon to the build. 2019-10-16 10:42:05 +01:00
Jim Hague ec62d87fca Correct target dependencies exported by the getdns library and used by getdns_query. 2019-10-16 10:35:18 +01:00
Jim Hague effd229ef6 Don't dump includes of OpenSSL headers into config.h.
Where they are required, they are included in the source files.
2019-10-16 10:34:36 +01:00
Jim Hague 55d6b47ed1 Correct target dependencies.
And improve a variable name.
2019-10-16 10:29:29 +01:00
Jim Hague cd62f2b716 Don't include OpenSSL headers in config.h.
Add an include of stdlib.h to various files that were relying on config.h to drag it in. I don't think config.h should be pulling in standard C headers.
2019-10-15 18:37:10 +01:00
Jim Hague 8362a183e8 Remove use of pkg-config to see if libbsd is present.
Instead check for the library directly.In the process, fix the detection of the declarations and functions in libbsd so they work.
2019-10-15 18:35:06 +01:00
Jim Hague a2d09d2be5 Fix type warning on Windows. 2019-10-15 16:56:34 +01:00
Jim Hague e45f569603 Add getdns_query to CMake build. 2019-10-15 16:56:12 +01:00
Jim Hague 73e8e4653d Update to latest fix of ssl_dane.c for Windows. 2019-10-15 16:55:16 +01:00
Jim Hague dd70108558 Windows does not have mkstemp(). Add compat version.
The compat version is Windows-specific.
2019-10-15 16:54:13 +01:00
Jim Hague 323d76d7ae Add the rest of the compat functions to the build, if required.
Remove any preprocess guards from the sources, and only include them in the build if required. Add some additional required Windows libraries.
2019-10-15 16:53:03 +01:00
Jim Hague 5db0d03b13 Enable building on Windows with Visual Studio.
The change mostly consists of removing or replacing non-standard (usually POSIX) header includes.

Guards for replacements for inet_ntop(), inet_pton() and gettimeofday() are updated; the first two are macros on Windows, so the guards are changed to HAVE_DECL. gettimeofday() is present on MinGW builds but not Visual Studio, so that has a function check.
2019-10-15 10:09:17 +01:00
Jim Hague b8df26194e Add symbols for target endianness. 2019-10-14 09:47:03 +01:00
Jim Hague d1dca186bc Add Posix/XOpen support flags for Unix builds that aren't FreeBSD. 2019-10-14 09:45:38 +01:00
Jim Hague 7a0a2f712d Add support for building on Windows.
This should support both native Visual Studio builds and MinGW builds.
2019-10-14 09:44:28 +01:00
Jim Hague ffe626f5f3 Enable warnings when building. 2019-10-10 12:31:12 +01:00
Jim Hague dc6cadebbc Add OpenSSL function checks as per autoconf.
Well, those function checks that are actually used in the code, anyway.
2019-10-10 12:30:50 +01:00
Jim Hague c367b39c13 Update build to get the current source building.
Hardwire OpenSSL and do the minimum necessary to get libgetdns building.
2019-10-09 17:19:18 +01:00
Jim Hague 1d712cfa45 Merge branch 'develop' into feature/cmake 2019-10-07 12:58:33 +00:00
Willem Toorop 9050f63d5b
Merge pull request #434 from bnoordhuis/readme-libuv-url
Update libuv URL in README
2019-09-18 11:01:57 +02:00
Ben Noordhuis ad8ca06c57 Update libuv URL in README
I can state with some authority that the old URL hasn't been canonical
for almost five years now.
2019-09-17 23:27:31 +02:00
wtoorop 994466b3de
Merge pull request #428 from themiron/old-uclibc-fix
Optimize local addresses enumeration with old uClibc
2019-04-25 09:52:28 +02:00
Vladislav Grishenko 416c55734b Optimize local addresses enumeration with old uClibc
uClibc 0.9.30rc1 - 0.9.32rc5 has bug - getaddrinfo() does not accept numeric
service without any hints. As the related side effect, hint struct with
ai_socktype == 0 (unspec) and ai_protocol == 0 (unpsec) gives the same
EAI_SERVICE error instead of same address with different proto enumebration.
For more details please refer https://bugs.busybox.net/show_bug.cgi?id=3841 and
https://git.uclibc.org/uClibc/commit/?id=bc3be18145e4d57e7268506f123c0f0f373a15e2

Since 0.9.3x uClibc versions are still not somewhat unique in embedded (issue
https://github.com/getdnsapi/stubby/issues/124 as example) and non-zero
ai_socktype allows to avoid address dups for each supported UDP/TCP/etc proto,
seems worth to have it specified, as a minor memory allocation optimization at
least.

SOCK_DGRAM vs SOCK_STREAM choice doesn't really matter here, both are actually
used for DNS and both are non-zero, no difference is expected on *nix. So
SOCK_DGRAM selected due original comment only.
2019-04-25 03:31:56 +05:00
wtoorop c89b9d0796
Merge pull request #426 from themiron/typedef-redef-fixes
Fix build error with gnu99 compilers
2019-04-12 15:25:44 +02:00
Vladislav Grishenko 4f4ed98112 Fix build error with gnu99 compilers
Typedefs sha256_pin_t & getdns_log_config multiple declaration in context.h,
tls.h and tls_internal.h causes build error with some gnu99 compilers, even
if the redefinition is identical.
One possible way is to protect each occurence with ifdefs, but it seems too
brute, other one is to keep typedef in context.h only and use struct types
in recently added tls* scope.

Error example:
../libtool --quiet --tag=CC --mode=compile arm-brcm-linux-uclibcgnueabi-gcc
-std=gnu99 -I. -I. -I./util/auxiliary -I./tls -I./openssl -I./../stubby/src
-Wall -Wextra -D_BSD_SOURCE -D_DEFAULT_SOURCE ... -c ./convert.c -o convert.lo
In file included from ./context.h:53:0,
                 from ./util-internal.h:42,
                 from ./convert.c:50:
./tls.h:45:27: error: redefinition of typedef 'sha256_pin_t'
./openssl/tls-internal.h:57:27: note: previous declaration of 'sha256_pin_t' was here
In file included from ./util-internal.h:42:0,
                 from ./convert.c:50:
./context.h:133:3: error: redefinition of typedef 'sha256_pin_t'
./tls.h:45:27: note: previous declaration of 'sha256_pin_t' was here
./context.h:267:3: error: redefinition of typedef 'getdns_log_config'
./openssl/tls-internal.h:58:34: note: previous declaration of 'getdns_log_config' was here
2019-04-12 01:40:51 +05:00
Willem Toorop f9db16a65e Merge branch 'develop' 2019-04-03 16:19:31 +02:00
Willem Toorop 42ea03ef07 Release 1.5.2
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE3DTuXbJBe8wVHlEA5fj4IS93pJgFAlykwI0UHHdpbGxlbUBu
 bG5ldGxhYnMubmwACgkQ5fj4IS93pJhmUBAAhM1s6SjOHiG3vKpH+vyRfXHRTDSY
 b+VvNy1HHs+FBeCZOpg5Vw8tqlaLIWJh8uO/E1o+x4beo8j/6X39q0ebZLxhuTmZ
 jv0Ja1HBEKT/5c7qC+EFO2NjwdBYA3XJWJn+/iXqaTG9P5Wctcu9GIjAiRAXdEFB
 nGel0ZGBp0HP4ox9cIqs5WSzWmB03MX9vwxRb9Ef1E0myOmvjjGGTwoCK297kdYG
 gs063AVAKByR2cdNbJSM+nRWx4HqYe1oTY2FGxNfO2x9XdSCDpW0wyXSYsfKCZDc
 enJBNEtgeYLNljTtqNjSTqQwivejH/THplTG6ZgVyITJoe7xp/93trFzlSqL2kts
 1tr4SogY0vOCD7/x/S8THaZnSzZza70Je6dW+Low1coEDQl3K7h80sopyRweIoJd
 LyVLPrYUiTbepuYpvTfYtxuhnrIKMzafgkgAAaFZXBMuzQeh8VKtKqF+hMFpVYiv
 ojLz131gfja4qa9ecxwSrc7iEf7YHk7wJ84d5GhhCyWyoPq5EFvK15ngi6vofASd
 uqFAexM7iGPJ4iP0ZLYPiuXgr+TUJmI+Tz6DLQgZiq1HxSymKq5fdHAcz2pup0Mj
 26GrQ7zagZuirApckodDvdCE3Pc4MtPEyBvT7VwI1DwdZI/k8YdZ27YIlsvTTNhO
 Fu1WlmZ2ylSxUu4=
 =ECik
 -----END PGP SIGNATURE-----

Merge tag 'v1.5.2' into develop

Release 1.5.2
2019-04-03 16:18:59 +02:00
Willem Toorop ffe471543b Bumb versions for 1.5.2 release 2019-04-03 12:36:04 +02:00
Willem Toorop b22768709a Runtime fallback and FreeBSD compatible TFO 2019-04-03 12:24:09 +02:00
Willem Toorop b6e290f42a Fix compiling for debugging 2019-04-03 11:51:35 +02:00
Willem Toorop 8a2b4e0aa0 Merge branch 'develop' into release/1.5.2 2019-04-03 11:15:50 +02:00
wtoorop bc6adf01ca
Merge pull request #424 from maciejsszmigiero/anchor-fixes
Two small trust anchor fetcher fixes
2019-03-24 08:47:26 +01:00
Maciej S. Szmigiero 0a1883047d
Don't transmit an extra NULL byte in the anchor fetch HTTP request
When calculating HTTP request buffer size tas_connect() unnecessarily adds
an extra octet for the terminating NULL byte.
The terminating NULL was already accounted for by sizeof(fmt), however,
since sizeof("123") = 4.

The extra NULL byte at the end of the anchor fetch HTTP request resulted
in an extra "501 Not implemented" HTTP response from the trust anchor
server.
2019-03-24 00:51:20 +01:00
Maciej S. Szmigiero 99e32f1e46
Increase anchor fetch timeout in tas_doc_read()
tas_doc_read() uses a very short 50 msec network read timeout which makes
fetching trust anchors pretty much impossible on high-latency connections
like 3G.

Use a 2 second read timeout, just like the other tas_read_cb() callback
setter does.
2019-03-24 00:50:49 +01:00
Willem Toorop 1527979129 Release candidate need dashes before rc 2019-03-15 21:16:13 +01:00
Willem Toorop 5b20971464 Setup branch for the 1.5.2 release process 2019-03-15 20:45:04 +01:00
Willem Toorop 82b9f5781e Take along new dirs in distributions 2019-03-15 20:28:41 +01:00
Willem Toorop 342b1090f8 Declarations are always defined 2019-03-15 17:22:31 +01:00
Willem Toorop 754d65eb6d Correct dependencies 2019-03-15 16:58:10 +01:00
Willem Toorop 324370c537 GnuTLS with Zero configuration DNSSEC 2019-03-15 16:50:10 +01:00
Willem Toorop 7438de712a Issue #422: Update server & client TFO
Seems to work for TLS now too.
At least on Linux.
Thanks Craig Andrews
2019-03-15 12:13:38 +01:00
Willem Toorop 74e584cd61 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2019-03-13 14:21:51 +01:00
Willem Toorop 99d15b999c Issue #423: Fix insecure delegation detection while scheduling 2019-03-13 14:21:06 +01:00
wtoorop acd94cbe20
Merge pull request #421 from banburybill/feature/windows-fixes
Update to latest Stubby develop.
2019-03-13 12:06:05 +01:00
Jim Hague 13976cca68 Update to latest Stubby develop. 2019-03-01 12:27:48 +00:00
Willem Toorop 0abd2345de New commits in stubby 2019-02-28 16:07:11 +01:00
wtoorop 6b0ea5c47f
Merge pull request #420 from banburybill/feature/windows-fixes
Fix builds in mingw32.
2019-02-28 15:44:35 +01:00
Jim Hague eebea43b84 Update README to document root anchor storage directory on Windows.
This fixes Stubby issue #153.
2019-02-27 18:28:04 +00:00
Jim Hague 968e914e94 Avoid build errors if $sysconfdir or $runstatedir contain a space.
Building on Windows was failing if sysconfdir was, e.g. C:\Program Files.
2019-02-21 14:37:25 +00:00
Jim Hague a7a17f3725 Fix builds in mingw32.
On mingw64, configure does not find declarations for inet_ntop() and inet_pton(), but does find implementations, and so does not try to compile the compat versions.
On mingw32, configure find neither declarations or implementations, and so tries to compile the compat versions. However, there are declarations in ws2tcpip.h, and these do not have the same prototype as compat. The build fails, complaining about conflicting types for inet_ntop().

The declarations in ws2tcpip.h are #defines to Windows functions InetNtopA() and InetPtonA(). Which is not good, but we're stuck with it. Try to work around this by including ws2tcpip.h in the headers while checking for declarations. Unfortunately it looks like you can't do that when checking for implementations and substituting compat versions when not found. So only do that if we don't find declarations; we're already making sure that ws2tcpip.h is included via config.h in source modules.
2019-02-20 11:06:21 +00:00
Willem Toorop acc9b1cbd5 Typo and unused parameter warning 2019-02-15 13:46:28 +01:00
Willem Toorop 30367dada2 space needed for unit test to succeed 2019-02-15 13:43:28 +01:00
Willem Toorop 034b775e5c DOA & AMTRELAY RR types implementation 2019-02-15 13:36:39 +01:00
Willem Toorop 71b773ab2f '"' needs to be escaped too in json 2019-02-15 10:44:49 +01:00
Willem Toorop c3d0afd47d Issue #419: Escape backslashes when printing json
Thanks boB Rudis
2019-02-15 10:29:39 +01:00
Willem Toorop 97ac5d3ddc Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2019-02-04 15:46:46 +01:00
Willem Toorop 0fef131e9b bugfix #418 duplicate ,'s in Windows build 2019-02-04 15:46:10 +01:00
wtoorop f5194a9118
Merge pull request #417 from he32/warn-fixes
Fix various build warnings uncovered on NetBSD w/pkgsrc.
2019-01-28 11:41:35 +01:00
Havard Eidnes c68f5a7a8d Fix various build warnings uncovered on NetBSD w/pkgsrc.
The isxxxx() and toxxxx() functions have a limited well-defined
input value range, namely that of "unsigned char" plus EOF.  Cast
args accordingly.

Bring strncasecmp() into scope by including <strings.h>.
2019-01-28 11:24:10 +01:00
Willem Toorop 7c1b43b420 Fix sole pinset validation with ssl_dane library 2019-01-23 14:33:35 +00:00
Willem Toorop cad7eb2461 Probably the strlcpy 2019-01-23 14:06:04 +01:00
Willem Toorop f72fe60035 Cannot reuse qname (via name) after read_line_cb..
.. returns.
2019-01-23 13:55:29 +01:00
Willem Toorop 2206558376 Merge abstracted TLS API + GnuTLS alternative
Thank you Jim!

Merge branch 'devel/abstract-tls' into develop
2019-01-23 12:52:59 +01:00
Willem Toorop e657024531 Run all unit tests again 2019-01-23 12:50:44 +01:00
Willem Toorop 35f2ce37c0 Restore original serve delays 2019-01-23 12:49:22 +01:00
Willem Toorop c4bd91b196 Merge remote-tracking branch 'jim/feature/abstract-tls' into devel/abstract-tls 2019-01-23 12:46:07 +01:00
Willem Toorop d71dccaf2c - Nested getdns_context_runt() prevention
- Fix address query with qname and missing qtype for -I and -F too
- disable tiny delay again
2019-01-23 12:43:20 +01:00
Jim Hague cdc0d43315 Correct auth state thinko. Spotter credit to Willem. 2019-01-23 11:34:02 +00:00
Willem Toorop 8980f5f5ee Fix nested scheduling with getdns_query -F and -I
+ add 1 millisecond delay between batched queries, just because...
2019-01-23 11:41:00 +01:00
Willem Toorop 0af9a629f4 Does smaller delay make a difference? 2019-01-23 10:50:57 +01:00
Willem Toorop ac379787a2 Reassure clang static analyzer that all is OK 2019-01-23 10:29:20 +01:00
Willem Toorop 79fbef07d8 type specifier misplaced by #ifdef unclarity 2019-01-23 10:27:17 +01:00
Willem Toorop 2bd853bda5 Merge remote-tracking branch 'jim/feature/abstract-tls' into devel/abstract-tls 2019-01-23 09:49:17 +01:00
Jim Hague 61cae868e3 Update ChangeLog to include changes in this branch. 2019-01-17 11:24:40 +00:00
Jim Hague 814ee2c4cf Fix more gcc 8 warnings.
As warnings, these cause builds to fail when running the test suite.
2019-01-17 11:23:39 +00:00
Jim Hague 09ca9a826b Fix gcc 8 warnings. 2019-01-15 17:13:13 +00:00
Jim Hague 9024fd7736 Fix build with INTERCEPT_COM_DS defined.
Decide that layout of handling write results is more readable, and use with read too.
2019-01-15 15:34:33 +00:00
Jim Hague ee6bc7d978 Remove development test erroneously checked in. 2019-01-15 12:39:02 +00:00
Jim Hague 6553aa3aad The new minimum OpenSSL version means that Travis must switch to Xenial. 2019-01-15 12:11:13 +00:00
Jim Hague 8609a35e5b GnuTLS: Add support for TLS 1.3. 2019-01-15 11:31:22 +00:00
Jim Hague ccd6c3592d GnuTLS: Can't set priority for SSL3. 2019-01-15 11:30:56 +00:00
Jim Hague 24774fefd6 Remove 'upstream' association with connection, now unused. 2019-01-15 11:01:58 +00:00
Jim Hague 9e4add2219 Merge branch 'develop' into feature/abstract-tls 2019-01-14 19:15:53 +00:00
Jim Hague 3fe0c94357 Merge branch 'develop' into feature/abstract-tls 2019-01-14 19:09:20 +00:00
Willem Toorop 67b7a8c024 Release 1.5.1
-----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCgAyFiEE3DTuXbJBe8wVHlEA5fj4IS93pJgFAlw4tmgUHHdpbGxlbUBu
 bG5ldGxhYnMubmwACgkQ5fj4IS93pJi/vQ/8DPP6FoYLSBsDVgO+qU7KYzlFdSaX
 UNbLGxrmss2YSpN6BHkQN8FOpHMxJl2kxSNI0cJjFrpIG5OSevR+dj22JafDl10J
 +yrjeS8KI2JtEFEYWbmCT5u+EzYV6pZosiJhbg8mfAAby/hQcU+fTVjnsXYzI6WW
 8u9AhV0tSrdJaV7a9ng92FudgLiuh+9CDjMRcAOSpBTsLsd201e4A1VnGEIgOJVD
 v2bqde98WGaKcWq4b4WhUoNXd4L6IPw8GTLvl/taRB+Mio3zSDPEA2eKQOUH3n44
 Ork+yu4uiaPXJ/o8920bQ0FFs827M6crXrb7GmtjR1BKrNZtxCj0VW89d4thcVSG
 7Vjn2yFzZrXI9Z3QrVyGAltI5PyUbky+z2OJIpqWE2BjRPq9uqVcl9bDkGqYfIXm
 29oNjBg/nFObx0ev9IFcae07uf9k3Vc3UbTqFnKN53YipkCPcp2FT+YYXN8qHlrV
 Hmj1HXVfh0IsmSjb67d5UU1kt7HQmEYq+7DKPLohUJ5ITkxNF10DFgZW1QzqZA4G
 XbxQz2IbcVKZ4aQWBkzKuLK2V7kDmclLMrSTqk13/l8u9WhJ05s52bXB/rR5FWxQ
 ze4msZP66gfKwVkp44IYkEQrHpqnJwvAk4ASBBH0Uob/Dm5qvCkWd+2VPZgtMMaQ
 RYz3of1NZsliGbg=
 =Nj+6
 -----END PGP SIGNATURE-----

Merge tag 'v1.5.1'

Release 1.5.1
2019-01-11 16:31:45 +01:00
Willem Toorop 66f63b21bc Stubby with dns.google in stubby.yml.example 2019-01-11 14:52:40 +01:00
Willem Toorop 78d6bc30f5 Update stubby to 0.2.5 2019-01-11 13:04:07 +01:00
Jim Hague 51cb570809 Re-add support for OpenSSL prior to 1.1, but now require at least 1.0.2 and drop LibreSSL support. 2019-01-11 11:16:48 +00:00
Willem Toorop 35077bdc6d Update ChangeLog & bumb version 2019-01-11 12:08:38 +01:00
Willem Toorop 411c5cf571 Git rid of * if in libgetdns.symbols 2019-01-07 12:08:26 +01:00
Willem Toorop a4020a6841 mk-symfiles.sh improvent
to filter out #defines as intended.
Thanks Zero King
2019-01-07 11:33:21 +01:00
Willem Toorop 014ac3d368 Stubby with trust_anchors_backoff_time example config 2019-01-03 11:19:13 +01:00
Willem Toorop 426b6f67dd Merge branch 'devel/no-tls1.3-in-cipher_list' into develop 2018-12-31 16:14:26 +01:00
Willem Toorop bbe7dff257 No TLS1.3 ciphers in cipher_list only when ...
SSL_set_ciphersuites in OpenSSL API.
2018-12-31 16:13:20 +01:00
Willem Toorop c69a2f7806 Merge branch 'ArchangeGabriel-patch-1' into devel/no-tls1.3-in-cipher_list 2018-12-31 16:09:55 +01:00
Bruno Pagani 1962c03b79
context: remove TLS13 cipher from cipher_list
TLS 1.3 ciphers have to be set in ciphersuites instead.
2018-12-23 11:31:27 +00:00
Willem Toorop 215d553c0b Merge branch 'release/1.5.0' 2018-12-21 17:22:17 +01:00
Willem Toorop 6f4d25e096 Merge branch 'release/1.5.0' into develop 2018-12-21 17:22:01 +01:00
Willem Toorop 309db67f8b RFE getdnsapi/stubby#121 log re-instantiating TLS ...
... upstreams (because they reached tls_backoff_time) at log level 4 (WARNING)
2018-12-21 16:30:46 +01:00
Willem Toorop 345ed9a734 Final stubby update 2018-12-21 15:52:46 +01:00
Willem Toorop 4be406ce1f Bump version 2018-12-21 15:40:13 +01:00
Willem Toorop 7c52883341 Remove truncated response from transport test 2018-12-21 12:44:51 +01:00
Willem Toorop 431f86f414 Make tests aware of NODATA == NO_NAME change 2018-12-21 12:10:19 +01:00
Willem Toorop 5247fc8de4 Mention RESPSTATUS_NO_NAME change in Changelog 2018-12-21 11:44:04 +01:00
Willem Toorop 13e1e36ba3 RESPSTATUS_NO_NAME when no answers found
(so for NODATA answers too)
2018-12-21 11:28:00 +01:00
Willem Toorop ff1cdce6f8 s/explicitely/explicitly/g
Thanks Andreas Schulze
2018-12-20 15:06:01 +01:00
Jim Hague 65f4fbbc81 Make sure all connection deinits are only called if there is something to deinit. 2018-12-14 15:38:32 +00:00
Jim Hague c1bf12c8a2 Update default GnuTLS cipher suite priority string to one that gives the same ciphers as the OpenSSL version.
Also fix deinit segfault.

./gnutls-ciphers "NONE:+AES-256-GCM:+AES-128-GCM:+CHACHA20-POLY1305:+ECDHE-RSA:+ECDHE-ECDSA:+SIGN-RSA-SHA384:+AEAD:+COMP-ALL:+VERS-TLS-ALL:+CURVE-ALL"
Cipher suites for NONE:+AES-256-GCM:+AES-128-GCM:+CHACHA20-POLY1305:+ECDHE-RSA:+ECDHE-ECDSA:+SIGN-RSA-SHA384:+AEAD:+COMP-ALL:+VERS-TLS-ALL:+CURVE-ALL
TLS_ECDHE_RSA_AES_256_GCM_SHA384                  	0xc0, 0x30 TLS1.2
TLS_ECDHE_RSA_AES_128_GCM_SHA256                  	0xc0, 0x2f TLS1.2
TLS_ECDHE_RSA_CHACHA20_POLY1305                   	0xcc, 0xa8 TLS1.2
TLS_ECDHE_ECDSA_AES_256_GCM_SHA384                0xc0, 0x2 TLS1.2
TLS_ECDHE_ECDSA_AES_128_GCM_SHA256                0xc0, 0x2b TLS1.2
TLS_ECDHE_ECDSA_CHACHA20_POLY1305                 0xcc, 0xa9 TLS1.2

$ openssl ciphers -v TLS13-AES-256-GCM-SHA384:TLS13-AES-128-GCM-SHA256:TLS13-CHACHA20-POLY1305-SHA256:EECDH+AESGCM:EECDH+CHACHA20
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(128) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=AESGCM(128) Mac=AEAD
ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH     Au=ECDSA Enc=ChaCha20-Poly1305 Mac=AEAD
ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH     Au=RSA  Enc=ChaCha20-Poly1305 Mac=AEAD
2018-12-14 15:24:13 +00:00
Willem Toorop 79459f5d1d Merge branch 'release/1.5.0' into develop 2018-12-14 16:05:27 +01:00
Willem Toorop 36cb9b0243 We also always publish sha1 over tarballs 2018-12-14 13:45:22 +01:00
Willem Toorop 232f655663 trust_anchor_backoff_time also when appdata dir is not writable 2018-12-14 13:42:43 +01:00
Willem Toorop e9060792dc Merge branch 'release/1.5.0' into develop 2018-12-14 10:45:57 +01:00
Willem Toorop 990372329c typo 2018-12-13 15:26:13 +01:00
Willem Toorop dc6bb0fa52 Something wrong with /etc/hosts? 2018-12-13 15:24:37 +01:00
Willem Toorop eecc18703a Issue found with static analysis 2018-12-13 15:24:27 +01:00
Willem Toorop 154f98e321 Update consts 2018-12-13 15:24:19 +01:00
Willem Toorop 93b7cb6a01 ZONEMD rr-type 2018-12-13 14:53:41 +01:00
Jim Hague a4590bafcb Implement reading CAs from file or dir.
I found gnutls_certificate_set_x509_trust_(file|dir)(), so it's a lot
easier than I feared. Plus a little diggiing shows that if you're
loading the system defaults, GnuTLS on Windows does load them from the
Windows certificate store.
2018-12-13 13:33:54 +00:00
Willem Toorop 41f4940072 Log messages about trust anchor fetching and installing 2018-12-13 14:23:32 +01:00
Jim Hague e8f34d48fb Adjust default cipher list so required authentication works with getdnsapi.
The previous default cipher string wouldn't connect with getdnsapi.
Selection of cipher strings requires some deep study, I think.

So, taking working with getdnsapi.net as our target, discover that we
need SECURE128 as well as SECURE192. And rather than disable everything
except TLS1.2, disable TLS1.0 and TLS1.1. This should mean it connects
to TLS1.3.
2018-12-13 12:04:01 +00:00
Jim Hague 2759d727e5 Minor speeling fix. 2018-12-13 11:54:41 +00:00
Jim Hague fa9d8885f0 Fix problems with GnuTLS pinset handling.
Pinset validation now seems to work.
2018-12-13 11:03:31 +00:00
Willem Toorop 91a3a3db36 More specific return codes, more logging 2018-12-12 16:12:07 +01:00
Jim Hague 45be26642b Fix dane query handling and verify error reporting.
Verify error is flags, not values. And deiniting a dane_query that is
NULL segfaults.
2018-12-12 15:01:07 +00:00
Jim Hague b51c7384e6 Implement _getdns_decode_base64() for GnuTLS.
Use primitives in libnettle.
2018-12-12 15:00:03 +00:00
Jim Hague 0dec4a6f21 Correct format string, fixing type error in specifier.
I was wondering why the error output did appear.
2018-12-12 14:59:13 +00:00
Jim Hague 35b4969216 Abstract out OpenSSL specific parts of getdns_pubkey_pin_create_from_string().
The only OpenSSL function is decoding Base64.
2018-12-11 18:03:00 +00:00
Jim Hague bf011d9294 Add GnuTLS DANE library to configure detection when using GnuTLS. 2018-12-11 18:02:03 +00:00
Jim Hague aa49a935c7 Fixed error detection in certificate verification. 2018-12-11 17:59:44 +00:00
Jim Hague ab69a9a7da Merge branch 'feature/abstract-tls' of https://github.com/banburybill/getdns into feature/abstract-tls 2018-12-11 15:01:44 +00:00
Jim Hague 0a9f155cc9
Merge pull request #4 from wtoorop/feature/abstract-tls-willem
Enable ed25519, ecdsa and cookies with gnutls/libnettle
2018-12-11 15:01:12 +00:00
Jim Hague 2c6ec5e0be Implement setting up pinset for DANE. Verification to come. 2018-12-11 14:59:21 +00:00
Willem Toorop ab700e70fe DNS Cookies with libnettle too 2018-12-11 15:13:17 +01:00
Willem Toorop a6ab7ffe41 ed25519 and ecdsa support with libnettle 2018-12-11 15:05:09 +01:00
Jim Hague ff7ffc246c Rename TLS Interface DANE init to pinset init. That's what it's actually used for. 2018-12-11 12:46:05 +00:00
Jim Hague 1acd880f26 Correct error return value from stub. 2018-12-07 17:56:12 +00:00
Jim Hague fee864c25c Implement setting cipher/curve lists.
Set the priority string to a concatenation of the connection cipher and curve strings, falling back to the context ones if the connection value isn't specified. Also get context.c to specify NULL for default context list and the opportunistic list for the connection, moving these library-specific quantities into the specific implementation.
2018-12-07 16:55:17 +00:00
Willem Toorop bb99321e57 More constness for issue #410 2018-12-07 16:34:03 +01:00
Willem Toorop 8a7226baee Move from debugging to logging for
- upstream_stats & stub system
2018-12-07 14:02:17 +01:00
Willem Toorop bdfdd99645 Anticipate different openssl versions 2018-12-07 14:00:47 +01:00
Jim Hague 511dfc75ef Implement _getdns_tls_context_set_min_proto_1_2().
Add a flag to the context (so, it's actually got something useful there!) and check the connection version on a successful handshake.
This means we need to access the context from a connection, so add a pointer to the context to the connection.
2018-12-07 11:11:33 +00:00
Jim Hague 64f0d6aaa8 Rename _getdns_tls_connection_verify() to _getdns_tls_connection_certificate_verify().
I managed to mislead myself about what it did, which suggests the name should be clearer.
2018-12-07 11:09:20 +00:00
Jim Hague b0c057e8ae Update dependencies for GnuTLS.
In practice a 'make depend' is required before building with either OpenSSL or GnuTLS.
2018-12-06 16:35:43 +00:00
Jim Hague 46c49cbcfe Modify getdns_server_mon to use GnuTLS or OpenSSL.
Untested.
2018-12-06 16:32:20 +00:00
Jim Hague 72d9b91a2e Extract non-OpenSSL specific code from pubkey-pinning.c, and move it back to common source.
OpenSSL-specific items are in pubkey-pinning-internal.c.
2018-12-06 14:09:30 +00:00
Jim Hague e73ab48687 Extract non-OpenSSL specific code from anchor.c, and move it back to common source.
OpenSSL-specific items are in anchor-internal.c.
2018-12-06 14:07:32 +00:00
Jim Hague 91764fb6b0 Correct checking of connection validation result. 2018-12-06 11:04:00 +00:00
Jim Hague c6dffa1239 Add use of libnettle, and enable val_secalgo routines from existing Nettle implementation.
Link to the openssl val_secalgo implementation and use that, after adjusting the source of Nettle includes.

GnuTLS uses Nettle itself, so this is not adding a new dependency.
2018-12-06 10:41:58 +00:00
Jim Hague b2312aee12 Implement hostname authentication. 2018-12-05 17:20:28 +00:00
Jim Hague f64aa8703d First pass at a mostly stubbed GnuTLS implementation.
This works enough to do a TLS lookup.
2018-12-05 11:25:32 +00:00
Willem Toorop 46f0b06f24 Start release processes for getdns-1.5.0 2018-12-04 14:17:20 +01:00
Willem Toorop c80aa72725 ED25519 & ED448 support 2018-12-03 15:35:03 +01:00
Willem Toorop ea55b12a08 getdns_query for addresses with qname but no qtype 2018-12-03 14:52:58 +01:00
Willem Toorop 30a3a6b026 Longer timeout for recursing_6 test 2018-12-03 14:33:56 +01:00
Willem Toorop 390e383a1a ED25519 & ED448 DNSSEC validation support 2018-12-03 14:33:21 +01:00
Willem Toorop 6d066f95f9 Merge branch 'features/trust_anchors_backoff_time' into develop 2018-12-03 12:51:00 +01:00
Willem Toorop 4b688443f4 Sync with unbound 2018-12-03 12:50:37 +01:00
Willem Toorop a1692359f3 RFE #408: Retry fetching of TA after backoff time 2018-12-03 12:27:31 +01:00
Willem Toorop 1e7da76901 Bugfix getdnsapi/stubby#140 fallback on getentropy failure 2018-11-30 14:50:06 +01:00
Willem Toorop 5986d0497f Merge branch 'features/dnssec_extension' into develop 2018-11-30 14:23:49 +01:00
Willem Toorop c1f51815ba RFE #408: "dnssec" extension requiring DNSSEC
When this extension is set, GETDNS_DNSSEC_INDETERMINATE status will no
longer be returned.
2018-11-30 14:20:12 +01:00
Jim Hague 153e766edf tls.h uses struct mem_funcs in types-internal.h. 2018-11-27 18:04:14 +00:00
Jim Hague c4a3f75844 Correct make depend generation for TLS directory. 2018-11-27 18:03:27 +00:00
Jim Hague e60d852637 Common OpenSSL digester selection. 2018-11-27 16:55:33 +00:00
Willem Toorop e3b007a43a Issue #410: Document ownership with getdns_context_get_api_information()
+ const for extensions and namespaces
TODO: Look at other cases that are not const for no good reason.

Thanks Stefan Bühler
2018-11-27 16:59:47 +01:00
Jim Hague c101a7a021 Abstract context DANE initialisation. 2018-11-27 15:41:23 +00:00
Jim Hague 26bcddd029 Abstract cookie SHA256 calculation. 2018-11-27 15:31:33 +00:00
Jim Hague af962228fc Abstract maximum digest length. 2018-11-27 15:31:05 +00:00
Jim Hague 0cdede21df Abstract SHA1 calculation. 2018-11-27 15:29:48 +00:00
Jim Hague 5e390a4b23 Revise all TLS interfaces to pass in GetDNS memory functions where necessary.
This means we can remove OpenSSL_free() calls from request-internal.c and util-internal.c.
2018-11-27 14:41:46 +00:00
Jim Hague bc3106af94 Abstract out HMAC functions in request-internal.c. 2018-11-27 11:49:12 +00:00
Jim Hague 4ec93a3df0 Add Doxygen for remaining tls.h functions. 2018-11-26 11:32:18 +00:00
Jim Hague 27a7e4e28f Attempt minimal autoconf changes to use GnuTLS instead of OpenSSL.
I could waste the rest of the available time trying to turn configure.ac into something that cleanly ignores OpenSSL, uses GnuTLS instead and retains all the options. Or even better scrap the whole autoconf mess and start again.

But in the interests of prototyping, do something quick and dirty. This means GnuTLS must for now be configured thus:

$ CFLAGS="-g" ../configure --enable-stub-only --with-gnutls --disable-gost --disable-ecdsa --disable-edns-cookies

to evade other items with hardcoded OpenSSL checks in them.
2018-11-23 17:49:06 +00:00
Jim Hague 2267863a53 Attempt to improve the preprocessor horror that is util/val_secalgo.h.
Convert the main util/val_secalgo.h to a plain interface. Move the preprocessor redefines into validator/val_secalgo.h, and move THAT under openssl, because it is OpenSSL implementation specific at present - you can compile with NSS and Nettle if config allows.
2018-11-23 16:28:55 +00:00
Willem Toorop 2d76a5fd52 We had complaints for serving the root, so..
TCP only full recursion test now starting from K-root
	(because other roots are unreliable TCP-wise)
2018-11-22 12:16:19 +01:00
Willem Toorop b90ba236ae tls_ciphersuites, tls_cipher_list, tls_curve_list,
tls_min_version & tls_max_version settings must cause
	failure when not supported by the TLS library.  Not during
	configure time, but during connection setup so it doesn't
	hamper alternative transports.
2018-11-22 11:37:28 +01:00
Willem Toorop 6b10570842 DNSSEC bugfix found with static analysis
* Fix for DNSSEC bug in finding most specific key when
  trust anchor proves non-existance of one of the labels
  along the authentication chain other than the non-
  existance of a DS record on a zonecut.
2018-11-22 10:21:48 +01:00
Willem Toorop 4ff9816e39 google now supports DoT 2018-11-21 17:00:03 +01:00
Willem Toorop 73868643d2 Fix compile warnings 2018-11-21 16:07:47 +01:00
Willem Toorop 1904ee7318 Enhancement getdnsapi/stubby#56 & getdnsapi/stubby#130
Configurable TLS version
2018-11-21 15:02:28 +01:00
Jim Hague e7593541ef Ensure that compat/getentropy* don't get used, and so drag in OpenSSL. 2018-11-20 17:37:46 +00:00
Jim Hague 4f67491971 Remove unnecessary OpenSSL include in dnssec.c. 2018-11-20 17:36:56 +00:00
Jim Hague 05f9d30e89 Move anchor.c to under openssl. 2018-11-20 16:57:48 +00:00
Jim Hague f3e0f2b9e6 Split OpenSSL specific bits of keyraw.hc into keyraw-internal.hc.
All usage is internal to val_secalgo.c, which is already in openssl.
2018-11-20 16:51:17 +00:00
Jim Hague da94b52f74 Move val_secalgo.c to openssl.
It contains ports other than OpenSSL (NSS and NETTLE), but we're not worrying about those for our purposes at present.
2018-11-20 16:21:06 +00:00
Jim Hague 4eb845bc58 Move internal-only functions from public pubkey-pinning interface.
The interface now only exposes functions used by the main getdns code.
2018-11-20 15:55:34 +00:00
Jim Hague ff9cde2087 Remove SSL type from pubkey-pinning interface. 2018-11-20 15:49:26 +00:00
Jim Hague 756eda96d8 Remove ssl_dane dir from dependency generation search. 2018-11-20 15:47:56 +00:00
Jim Hague cfa78707a3 Add openssl subdir to distribution. 2018-11-20 15:35:59 +00:00
Willem Toorop 6a5e96d4e1 tls_ciphersuites + bugfix in strdup2!! 2018-11-20 16:13:57 +01:00
Jim Hague 52421be5f4 Correct error checking result of _getdns_tls_context_set_ca(). 2018-11-20 15:12:10 +00:00
Jim Hague 1b0a09a23f Wrap hostname/certificate verification.
This removes the last OpenSSL items from stub.c.
2018-11-20 14:53:31 +00:00
Willem Toorop e5a53fb1d2 Bumb version 2018-11-20 13:57:13 +01:00
Jim Hague fb73bcb77e Correct return value error from _getdns_tls_connection_(read|write)(). 2018-11-20 12:43:17 +00:00
Jim Hague 2e8c48544b Move pubkey-pinning implementation under openssl/. 2018-11-19 13:55:02 +00:00
Jim Hague aba0e2fb4c Move non-TLS-library specific parts of tls.h to ~/src/tls.h and have it include lib-specific tls-internal.h.
Update dependencies.
2018-11-19 09:49:54 +00:00
Jim Hague 5d353d9efb To aid proof-of-concept work, insist on OpenSSL 1.1.1 or later.
Remove ssl_dane as now surplus to requirements.
2018-11-16 17:58:29 +00:00
Jim Hague 0fd6fd4c5c Replace (one instance of) SSL_get_peer_certificate(). 2018-11-16 17:09:26 +00:00
Jim Hague 4b8c9d1bd7 Replace SSL_get_version(). 2018-11-15 17:53:37 +00:00
Jim Hague 09019bee75 Replace SSL_write(). 2018-11-15 17:53:29 +00:00
Jim Hague e7453522d5 Replace SSL_read(). 2018-11-15 17:51:52 +00:00
Jim Hague e22c01e212 tls_do_handshake: move handshake and check for new session into abstraction layer. 2018-11-15 14:28:04 +00:00
Jim Hague ffd1136e94 tls_create_object(): Move setting client state and auto-retry into connection_new and add setting connection session. 2018-11-15 13:23:00 +00:00
Jim Hague d9fdd4c10d Abstracting TLS; let's start with context only.
Change data types in context.h and fix up context.c. Do minimal fixups to stub.c.
2018-11-15 11:01:13 +00:00
Willem Toorop 12589d85c2 Wild guess at OpenSSL without engine support 2018-06-12 17:00:45 +02:00
Willem Toorop 9b4e8e9e91 X509_get_notAfter not in OpenSSL 1.1.1 anymore 2018-06-12 16:37:46 +02:00
Willem Toorop 884f6ddc5e DS is always a delegation and never at the apex 2018-06-10 16:57:40 +02:00
Willem Toorop 25231aa686 Fix finding signer of NSEC and NSEC3s
Thanks Philip Homburg
2018-06-08 21:39:59 +02:00
Willem Toorop 000fa94ae2 Sync ldns & utils with unbound 2018-05-22 12:44:13 +02:00
Willem Toorop 799bd2f6b1 Bugfix #399: Reinclude <linux/sysctl.h> in getentropy_linux.c 2018-05-15 08:11:55 +02:00
Willem Toorop f9ab894936 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2018-05-11 13:29:59 +02:00
Willem Toorop 8c108fb761 Merge branch 'release/1.4.2' 2018-05-11 13:29:24 +02:00
Willem Toorop e481273ff4 Last minute update 2018-05-11 13:20:08 +02:00
wtoorop 0510fb00d3
Merge pull request #397 from ehmry/tcp_sendto
No TCP sendto without TCP_FASTOPEN
2018-05-11 12:04:49 +01:00
wtoorop fa133fcb92
Merge pull request #393 from saradickinson/bugfix/windows_certs
Temporary fix for https://github.com/getdnsapi/stubby/issues/87. Dete…
2018-05-11 11:52:18 +01:00
wtoorop 7fe45a7012
Merge pull request #396 from saradickinson/bugfix/windows_certs
Temporary fix for https://github.com/getdnsapi/stubby/issues/87. Dete…
2018-05-11 11:51:33 +01:00
Willem Toorop 86e5c39159 Release 1.4.2
-----BEGIN PGP SIGNATURE-----
 
 iQIxBAABCAAbBQJa9XQrFBx3aWxsZW1AbmxuZXRsYWJzLm5sAAoJEOX4+CEvd6SY
 QjYP/1hDH9Y1+JZFVdcDk0JLrMhrhfnPq1RdefiEzXPwcoFvbahwb7G5ARXQCkUz
 dgiJoae1euaCeQQyscJ83Vv9zxRetxCquuaA6j3eeiR3HtVJr6ayGfg1JPHcgO+O
 S7IJkUuRcpSB7PK4f/FqyrnrJNSFUfN25y9WvXOS5mJBq1OX8QhqWHN63uHXKVQt
 lfipQE/WiQic07a1bObNJcdmot4M6cCa6QcSc1JS37dvvHCHZc0HQox/VCUJpqrr
 rx1hbRCZFZ3B+DY4Fded4rIZSYG9Y/J64X7IW5hdv2z2G//Q9YBf16rkzz6xcpA/
 CIniaFXNliaugkHD7Nag/D32yMpUhDnJt2BloNQodZNMPRzerfLj9R8IKOjjM+py
 vEe+xCyrs7s7TKyK9nSacyJ5BWZDE1vOKDF1tNHK9KzJ4YtfGtmxjjmB1VytNy6O
 BXs3ml/VSgVgBZbmcevWDXn6anByacKADDkiyVJ9PRCL2+qFOt3CR3t8GWlCwK5O
 GvrKmNkeUYfjyw03qCXXJ54Ti6xrmBJPcUeBE1NdTF7OgYhSyImhQqAnInG/Z3ZU
 c1j7pKYw2LNQ7F/CaW+AQ4HpizltIHRiBHhMvaArhp4idvyFMTr1YV7MrCWixqpx
 2fGSVuaLSYGOxsqM7m2lrbTckIESBAxX+f4vGj2nxP9qzna0
 =DfcS
 -----END PGP SIGNATURE-----

Merge tag 'v1.4.2'

Release 1.4.2
2018-05-11 12:45:26 +02:00
Willem Toorop 0d283fc63f 1.4.2 release 2018-05-11 12:02:49 +02:00
Willem Toorop 48e0ea013c Include Stubby - v0.2.3 release 2018-05-11 11:56:00 +02:00
Willem Toorop 6c99e7b8a6 Bugfix getdnsapi/stubby#106: Core dump when ...
printing certain configuration. Thanks Han Vinke
2018-05-11 11:28:52 +02:00
Willem Toorop 98b1ff624a Memory loss with empty string bindata's 2018-05-11 11:23:19 +02:00
Emery Hemingway a6ec2b2449 No TCP sendto without TCP_FASTOPEN 2018-05-08 14:58:17 +02:00
Willem Toorop 5a816f3d51 Include systemd and contrib dir with stubby 2018-05-04 15:29:14 +02:00
Willem Toorop 9d48f1cf97 Update Stubby 2018-05-04 15:21:05 +02:00
Willem Toorop 9b7999ecf2 Update stubby 2018-05-04 15:19:33 +02:00
Willem Toorop 7331717990 Fix for Fallback to current (working) directory (for appdata_dir). 2018-05-04 15:30:27 +02:00
Willem Toorop 7e2a896410 Update stubby 2018-05-04 11:28:09 +02:00
Willem Toorop 99bfe4a287 Fallback to current (working) directory (for appdata_dir).
To improve integration with system and service managers like systemd
See also getdnsapi/stubby#106
2018-05-04 10:40:49 +02:00
Willem Toorop caab2e8592 Bump versions and include release/0.2.3 Stubby release branch 2018-05-03 17:21:58 +02:00
Willem Toorop 23d2affebf More ChangeLog entries 2018-05-03 15:14:12 +02:00
Willem Toorop 2a110043da Just some notes about packages 2018-05-03 14:35:01 +02:00
Willem Toorop 3c355d425b Warnings are errors :( 2018-05-03 12:15:48 +02:00
Willem Toorop 101d602739 Travis output showed it was a bracket issue 2018-05-03 11:48:07 +02:00
Willem Toorop de7f007bf3 Without dl_iterate_phdr for now... 2018-05-03 11:40:44 +02:00
Willem Toorop f5c588c955 Need _GNU_SOURCE before config.h 2018-05-03 11:30:28 +02:00
Willem Toorop f0f101511b _GNU_SOURCE needed for struct dl_phdr_info from link.h 2018-05-03 11:21:11 +02:00
Willem Toorop 4f050facc3 Bugfix #394: Update src/compat/getentropy_linux.c
in order to handle ENOSYS (not implemented) fallback.
Thanks Brent Blood
2018-05-02 14:32:12 +02:00
Willem Toorop 6c075e2ad8 Bugfix #395 : Clarify that libidn2 dependency is for version 2.0.0 or higher 2018-05-02 14:01:00 +02:00
Willem Toorop 9c01968048 DS and DNSKEY lookups for tld and sld immediately
Resolves issue getdnsapi/stubby#99
2018-05-01 17:07:16 +02:00
Willem Toorop 7fecf5a93d Allow NSEC spans starting from (unexpanded) wildcards 2018-05-01 13:19:24 +02:00
Willem Toorop a834d32718 Fix negative reversed IPv4 test
which assumes 1.1.1.1.in-addr.arpa does not exist
2018-04-23 14:05:02 +02:00
Willem Toorop 1b5b0ca799 Force trailing '\0' with string config settings
Because even though it is added when parsing from JSON, it will be lost when the bindata is copied into a dict with getdns_dict_set_bindata.
2018-04-23 15:11:20 +02:00
saradickinson ced112ca74 Temporary fix for https://github.com/getdnsapi/stubby/issues/87. Detect and ignore duplicate certs in the root store. 2018-04-05 18:35:07 +01:00
Willem Toorop a820c0124d Merge branch 'develop' 2018-03-12 12:25:58 +01:00
Willem Toorop 81ea235d50 Merge branch 'release/1.4.1' into develop 2018-03-12 12:25:25 +01:00
Willem Toorop 75f59b9dfc Bump version 2018-03-12 12:05:09 +01:00
Willem Toorop 3d2ac4c16c Change git source for yxml submodule
Resolved issue getdnsapi/stubby#84
2018-03-09 11:37:37 +01:00
Willem Toorop ef0a77e061 Forgot the dash before the rc1 again 2018-03-05 16:34:50 +01:00
Willem Toorop 7548b095bc Doxygen fixes 2018-03-05 16:12:49 +01:00
Willem Toorop 1e9a7849de Spelling corrections in the spec 2018-03-05 16:08:00 +01:00
Willem Toorop 06e1c741e8 PR #387: Compile with OpenSSL with deprecated APIs disabled.
Thanks Rosen Penev
2018-03-05 15:40:16 +01:00
Willem Toorop 1bc056ee70 PR #386 in ChangeLog 2018-03-05 12:47:51 +01:00
Willem Toorop c45b3ed9db Merge branch 'release/1.4.1-max_udp_backoff_value' into release/1.4.1 2018-03-05 12:43:32 +01:00
Willem Toorop 8a2fc5f5a9 max_udp_backoff should not be public
At least, not with this point release
2018-03-05 12:42:27 +01:00
Robert Groenenberg eec6ec29dd [UDP] try upstreams in round-robin fashion when all yupstreams have failed 2018-03-05 12:03:20 +01:00
Robert Groenenberg f787c87137 Reset back_off on successful query 2018-03-05 12:02:01 +01:00
Robert Groenenberg a0fb2c8424 Limit back_off value to avoid very long retry interval 2018-03-05 12:01:52 +01:00
Willem Toorop d1aa3922fe Bugfix #388 2018-03-05 11:53:03 +01:00
Willem Toorop fd5e0cdc02 Merge branch 'bugfix/388-endless-fallback-loop' into release/1.4.1 2018-03-05 11:52:36 +01:00
Willem Toorop 9da06230d9 DNSSEC issues from PR #389 2018-03-05 11:51:31 +01:00
Willem Toorop e93b583a26 Merge branch 'devel/dnssec_issues' into release/1.4.1 2018-03-05 11:41:55 +01:00
Willem Toorop 1dd5f4dc16 PR #384: Fix minor spelling and formatting. Thanks dkg 2018-03-05 11:34:32 +01:00
Willem Toorop c057ca52e4 Merge remote-tracking branch 'dkg/spelling' into release/1.4.1 2018-03-05 11:30:33 +01:00
Willem Toorop bedc4ba0bb Bugfix #382: Parallel install of getdns_query and getdns_server_mon 2018-03-05 11:30:18 +01:00
Willem Toorop 0d6b127684 Merge branch 'bugfix/382-parallel-install-tools' into release/1.4.1 2018-03-05 11:27:24 +01:00
Willem Toorop 984aeefab2 Setup branch for the 1.4.1 release 2018-03-05 11:26:20 +01:00
Willem Toorop 0ff1839a6f Upstream reset on searchpath retry 2018-03-02 23:31:33 +01:00
Willem Toorop b178f94505 Don't retry an already tried upstream 2018-03-02 15:56:00 +01:00
Willem Toorop e29cfb6b6a Query for DS i.s.o. SOA to find zonecuts
Because of broken setups that have zonecuts without SOA:

```
$ drill -T www.gslb.kpn.com A
.	518400	IN	NS	i.root-servers.net.
com.	172800	IN	NS	a.gtld-servers.net.
kpn.com.	172800	IN	NS	ns1.kpn.net.
kpn.com.	172800	IN	NS	ns2.kpn.net.
gslb.kpn.com.	3600	IN	NS	gss1.kpn.com.
gslb.kpn.com.	3600	IN	NS	gss2.kpn.com.
www.gslb.kpn.com.	10	IN	A	145.7.170.135
```

but

```
$ drill gslb.kpn.com SOA
;; ->>HEADER<<- opcode: QUERY, rcode: NXDOMAIN, id: 48303
;; flags: qr rd ra ; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;; gslb.kpn.com.	IN	SOA

;; ANSWER SECTION:

;; AUTHORITY SECTION:

;; ADDITIONAL SECTION:

;; Query time: 8 msec
;; SERVER: 185.49.140.100
;; WHEN: Fri Mar  2 14:13:21 2018
;; MSG SIZE  rcvd: 30
```
2018-03-02 14:14:28 +01:00
Willem Toorop abc69f96fe Follow unsigned SOA's as insecure zonecut indication
Should resolve issue #385
2018-03-02 11:15:45 +01:00
Daniel Kahn Gillmor 9301f8970c Fix minor spelling and formatting.
These issues were found with the codespell tool.
2018-02-23 14:12:11 -08:00
Willem Toorop 1fbb022b88 Bugfix#382 Do not install tools in parallel 2018-02-22 16:05:34 +01:00
Willem Toorop 8797280429 Merge branch 'devel/tpkg-maintenance' into develop 2018-02-22 15:16:31 +01:00
Willem Toorop e705109f22 Fix tpkg dependencies 2018-02-22 15:02:11 +01:00
Willem Toorop 75297b17ae Fixes from running servers with valgrind 2018-02-22 14:45:56 +01:00
Willem Toorop 65e610f26e Unit test maintenance, to:
- remove obsolete tests
- test better for parallel installs
- run custom servers through valgrind
2018-02-22 14:44:13 +01:00
Willem Toorop 21155d5aa9 Merge branch 'develop' 2018-02-22 10:24:43 +01:00
Willem Toorop 7bace705b1 Merge branch 'release/1.4.0' into develop 2018-02-21 16:59:40 +01:00
Willem Toorop a037398156 Bump version 2018-02-21 16:45:26 +01:00
Willem Toorop 5f2add4c09 Merge branch 'bugfix/localhost-on-freebsd-jails' into release/1.4.0 2018-02-21 15:33:27 +01:00
Willem Toorop 6325dae563 Run localhost unit tests on local localhost address 2018-02-21 13:40:19 +01:00
Willem Toorop a150c6d927 implied source ($<) not defined in explicit rules 2018-02-21 12:17:51 +01:00
Willem Toorop f2c531265b libidns2 doesn't detect locale that well... 2018-02-13 16:58:12 +01:00
Willem Toorop 9999907593 update Stubby + other dist tarball fixes 2018-02-13 15:05:29 +01:00
Willem Toorop a1c30563bf Update ChangeLog 2018-02-12 17:14:56 +01:00
Willem Toorop 5a420a2aed Bump versions 2018-02-12 17:14:45 +01:00
Willem Toorop 223e85bc02 Merge branch 'features/tls_curves_list' into release/1.4.0 2018-02-12 16:04:49 +01:00
Willem Toorop 0c3b6fb2f6 Symbols & constants 2018-02-12 15:57:28 +01:00
Willem Toorop 1ebd54a1de Utils from unbound update 2018-02-12 15:54:43 +01:00
Willem Toorop 31e5cd5ab6 sldns update 2018-02-12 15:54:01 +01:00
Willem Toorop 9a4e389946 Better #ifdef select when to use X509_check_host 2018-02-12 15:46:42 +01:00
Willem Toorop 401aa2e3b8 Specify the supported curves with TLS 2018-02-12 15:40:17 +01:00
Willem Toorop c3e4061fe2 hostname auth with libressl 2018-02-09 15:18:44 +01:00
Willem Toorop b914b63e18 Merge branch 'feature/monitor-tool' into release/1.4.0 2018-02-08 14:06:40 +01:00
Willem Toorop c033e3f1a3 Merge branch 'libressl' into release/1.4.0 2018-02-08 14:04:02 +01:00
Jim Hague 088d775117 In Keepalive test, send the maximum possible timeout value to the server.
The response will then show the server's value.
2018-02-08 12:35:45 +00:00
Willem Toorop f7278ca696 Make getdns_server_mon work with libressl 2018-02-08 12:38:50 +01:00
Willem Toorop 8e8dd34e85 Merge branch 'release/1.4.0-merge-PR-377' into release/1.4.0 2018-02-08 12:07:34 +01:00
Willem Toorop bf1f01c87e Syntactic mod to minimizing changes with before PR
So changes are highlighted in side-by-side views.
2018-02-08 12:02:48 +01:00
Willem Toorop 7af885396f Merge branch 'release/1.4.0' into release/1.4.0-merge-PR-377 2018-02-08 11:46:28 +01:00
Willem Toorop 87fec7f9b4 Merge branch 'feature/monitor-tool' into release/1.4.0 2018-02-07 17:11:28 +01:00
Willem Toorop a72359e058 Comply to new style transport logging 2018-02-07 17:08:55 +01:00
Willem Toorop 7d4ccabc7f Merge branch 'bugfix/opportunistic_fallabck' into release/1.4.0-merge-PR-377 2018-02-07 17:00:25 +01:00
Willem Toorop ca7c2fe00e Merge branch 'devel/spki_pinset_via_tlsa_checking' into release/1.4.0 2018-02-07 16:50:43 +01:00
Willem Toorop 0eba73a945 LibreSSL like OpenSSL < 1.0.2 2018-02-07 16:42:11 +01:00
Willem Toorop c28a293c9f "Pinset validation failure" error when it occurred 2018-02-07 14:38:31 +01:00
Willem Toorop 9c5a93bbdf Merge branch 'develop' into devel/spki_pinset_via_tlsa_checking 2018-02-07 14:12:24 +01:00
Willem Toorop e944203e55 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2018-02-07 13:50:53 +01:00
Willem Toorop 82c00eb0a5 version.bind CH TXT for getdns_query 2018-02-07 13:50:29 +01:00
Jim Hague 13d7a730ee Further mitigate cache effects for OOOR by adding random label to delay lookup.
It turns out that delay.getdnsapi.net only pays attention to the left-most label.
2018-02-07 12:41:24 +00:00
wtoorop 7e915b0601
Merge pull request #379 from getdnsapi/devel/tcp-server-stability
Devel/tcp server stability

Thanks @maddie & @ArchangeGabriel
2018-02-02 10:44:55 +01:00
Jim Hague a25f832d8a Remove timeout argument from keepalive test.
The client doesn't send a timeout value to the server, so there's no point having this argument.
2018-02-01 16:04:22 +00:00
Willem Toorop ec8b8ba903 One more fixing the fixes fix that slipped through 2018-01-31 14:41:13 +01:00
Willem Toorop 9bc98272a1 Fixing the fixes 2018-01-31 14:33:31 +01:00
Willem Toorop 97b056c355 Prevent erred TCP connection to be rescheduled ...
for reading (or writing) when an reply comes in.

Thanks Maddie!
2018-01-30 15:21:46 +01:00
Willem Toorop 1f401f7253 Do not return freed netreqs! 2018-01-30 12:40:47 +01:00
Willem Toorop 2e03d3799c Memory leak on some TLS creation error cases 2018-01-30 12:23:23 +01:00
Jim Hague 3b5657e580 Reduce delay on OOOR delayed lookup.
A delay of 1000ms was causing frequent lookup timeouts e.g. on 9.9.9.9. We hypothesise that the delay causes an internal timeout in the server to fire. So reduce the delay to a smaller value that seems to leave the test working but reduces the incidence of timeouts.

We observe this still leaves timeouts on TLS connections to 9.9.9.9. These seem to occur only on TLS connections, and reducing the delay much further does not alter the observed behaviour. We guess there is something else going on there.
2018-01-29 10:17:54 +00:00
Sara Dickinson 7e3439efbc Improve handling of opportunistic back-off. If other transports are working, don’t forcibly promote failed upstreams just wait for the re-try timer.
Clean up logs.
2018-01-24 13:13:14 +00:00
Jim Hague 1d211013e6 Update top level README to include getdns_server_mon in its outline of tools. 2018-01-23 17:55:15 +00:00
Willem Toorop 4f37d2b933 No wildcard expansions allowed for RRs used in DNSSEC proofs
Signatures of DNSKEYs, DSs, NSECs and NSEC3s can not be wildcard expansions when used with DNSSEC proofs.
Only direct queries for those types are allowed to be wildcard expansions.

This in response to https://unbound.net/downloads/CVE-2017-15105.txt, although getdns was not vulnerable for this specific issue.
2018-01-23 16:50:05 +01:00
Jim Hague 037f6039c8 Improve AsciiDoc table formatting. 2018-01-23 13:53:08 +00:00
Jim Hague 01ea1d6a22 Note TLS 1.3 is experimental. At least until we find a stable test server. 2018-01-23 13:47:31 +00:00
Jim Hague b0661b9d9f Add a tool README.
Use AsciiDoc for this, as the GitHub table support in Markdown is woeful. But AsciiDoc is always better than Markdown anyway.
2018-01-23 13:45:55 +00:00
Jim Hague 8ba53f10b6 Correct RTT warning and critical default thresholds. 2018-01-23 13:45:09 +00:00
Jim Hague fcaa4f9845 Reflow usage message entry. 2018-01-23 12:37:14 +00:00
Jim Hague f3b2f83879 More output tittivating. Make verbose by default in non-monitoring mode. 2018-01-23 12:14:40 +00:00
Jim Hague a4f17760ab Revise rcode_text() to get text from getdns, and add rrtype_text(). 2018-01-23 12:13:59 +00:00
Jim Hague 7e884e2cd0 Rename concurrent to OOOR (Out Of Order Responses). 2018-01-23 11:30:12 +00:00
Jim Hague bedd3a02cf Revise concurrency test to use <n>.delay.getdnsapi.net.
This gives more secure results than the previous method.
2018-01-22 17:39:25 +00:00
Jim Hague 1e774a95f5 Don't rely on GCC extensions. 2018-01-22 16:49:53 +00:00
Jim Hague 8c3047dbe0 Add 'concurrent' test
The concurrent test works by sending a known good query synchronously,
and then sending asynchronous queries for three random TLDs followed by
the known good query. The latter should be answerable from cache, and so
give a result before at least one of the random TLDs.
2018-01-22 16:49:53 +00:00
Willem Toorop d38f233a80 Track readbuf free's
As tcp_connection_destroy() might be called more than once per connection (depending on outstanding work)
2018-01-22 16:56:48 +01:00
Jim Hague f9e4c9f853 Revise output.
If in monitoring mode, make output conform to Nagios norms. This starts with the probe type and result, so we need to save output generated during the operation and print it at the end.

If not in monitoring mode, make the formatting more expansive.
2018-01-22 14:36:54 +00:00
Jim Hague 0291e205fd Add TLS 1.3 test.
Add a new item tls_version to call_reporting, containing the OpenSSL version string for the name of the protocol used for the connection.

The test does a normal lookup, but first sets the cipher list to TLS1.3 only ciphers. This will cause a Bad Context error at search time, so we can tell if the underlying OpenSSL library lacks TLS 1.3. The check the call reporting for a TLS version of "TLSv1.3".
2018-01-19 15:56:40 +00:00
Jim Hague 62ad159f15 Update dnssec-validate. Check we can retrieve info for bogus domain, and remove must use TCP flag.
Run a second query with the CD bit set and check that succeeds.
2018-01-19 14:51:46 +00:00
Jim Hague 3fd4f7f240 Add 'dnssec-validate' test.
This test checks whether the server does DNSSEC validation. If it manages to find an A record for dnssec-failed.org, it doesn't.
2018-01-19 14:51:46 +00:00
Jim Hague 1a3025a405 If server does not return expected TXT in qname-min, return UNKNOWN not WARNING. 2018-01-18 17:17:16 +00:00
Jim Hague ea035fa82e Correct some code formatting. 2018-01-18 17:16:28 +00:00
Jim Hague f5322c701d Add more missing make targets causing test 105 to fail.
It's amazing how fiddly it is to add a single executable/source file to the build.
2018-01-18 11:49:16 +00:00
Jim Hague add818fea2 Remove dependency on timegm() when using OpenSSL < 1.0.2.
Convert dates to Julian and diff. This is basically what ASN1_TIME_diff() does internally.

And that's quite enough near-pointless polishing here.
2018-01-18 10:55:44 +00:00
Jim Hague 00c17dca14 Add to certificate time conversion to cope with pre-1.0.2 OpenSSL. Also tag printed time with UTC.
The time parse with pre-1.0.2 is a best effort, and relies on timegm() to convert struct tm in UTC to time_t. There being attractive alternative. Isn't C time handling grotty?
2018-01-17 18:38:28 +00:00
Willem Toorop 155b035cd8 Forgot to surround surround yaml include with defines 2018-01-17 17:07:36 +01:00
Jim Hague 760269acbd Make internal types POSIX-compliant by not naming them *_t.
See: http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html#tag_22_02_12_01

The change tacitly ignores the colossal number of coach and horses the entire world, including getdns, has stampeded through this POSIX hope for decades, but simply hopes for some small recognition when the Recording Angel tots up the damages.
2018-01-17 15:35:56 +00:00
Jim Hague 6bd0f8b980 Encode exit status words in () to make it clear that it's not part of the sentence.
'Server validates OK' -> 'Server validates (OK)'
2018-01-17 15:24:17 +00:00
Jim Hague 3666d994a7 Add 'keepalive' test and supporting changes to getdns library.
Checking for server support for keepalive means we need to know if the server did send a keepalive option to the client. This information is not currently exposed in getdns, so add a flag 'server_keepalive_received' to call_reporting. This is 0 if not received, 1 if received. If received, the actual timeout is in 'idle timeout in ms', though watch out for the overflow alternative.
2018-01-17 15:17:20 +00:00
Jim Hague a4ff6de985 Add 'tls-padding' test. 2018-01-16 12:59:03 +00:00
Jim Hague fdafb458ef Decide we don't want return_both_v4_and_v6 on queries. 2018-01-16 12:19:33 +00:00
Jim Hague b8424e494d Fix up some small usage typos, and don't report result if issuing test usage message. 2018-01-16 11:05:16 +00:00
Jim Hague 5ea0edf262 Update usage. 2018-01-15 17:42:57 +00:00
Jim Hague 8dc3a84735 Add options specifying transport. 2018-01-15 17:42:43 +00:00
Jim Hague 3438c68591 Prefix TLS-only options with 'tls-'. 2018-01-15 13:26:09 +00:00
Jim Hague 08b5976f9c Decouple from getdns config. This is now a pure getdns client. 2018-01-15 13:19:48 +00:00
Jim Hague 3298b5cd50 Extract common processing into search_check() and parse_search_check(). 2018-01-15 12:37:57 +00:00
Jim Hague cb7af33488 Some tests imply TLS. Explicitly make sure these always go over TLS. 2018-01-15 11:28:11 +00:00
Jim Hague 77a5a15cdf Minor output corrections. 2018-01-15 11:02:14 +00:00
Jim Hague 22996bf07d If TLS auth name given, lookup is to go over TLS. 2018-01-15 11:00:12 +00:00
Jim Hague c0d7d2c279 Print exit status at end of main output line. 2018-01-15 10:27:10 +00:00
Jim Hague 5d4bc8bc96 Add rtt test. 2018-01-15 10:16:26 +00:00
Jim Hague b9312e790f Correct certificate expiry custom threshold handling. 2018-01-15 10:01:01 +00:00
Jim Hague 3258fdfd5a Tabs? Spaces? Currently both, switch to spaces only. 2018-01-14 23:28:55 +00:00
Jim Hague 379662a3f3 Add plain lookup test. 2018-01-14 13:41:44 +00:00
Jim Hague 60118e9241 Improve cert-valid argument order to most likely first. 2018-01-13 14:56:55 +00:00
Jim Hague e7618321ce Add cert-valid test. 2018-01-12 18:21:38 +00:00
Jim Hague e597daa4c0 Add 'auth' test. 2018-01-12 17:23:42 +00:00
Jim Hague 3152a4112e Protect more #includes.
Somewhat illogical, really. A lot are standard headers.
2018-01-12 16:34:23 +00:00
Jim Hague 305daab9aa Add first version of getdns_server_mon.
Currently only QNAME minimisation check is working.
2018-01-12 16:11:48 +00:00
Norbert Copones 0fa6d1fe2d src/stub.c: LibreSSL has hostname verification turned on by default 2018-01-12 05:44:27 +08:00
Willem Toorop d44237554d No warnings from danessl allowed 2018-01-11 12:40:01 +01:00
Willem Toorop dd433ede68 Merge branch 'develop' into devel/spki_pinset_via_tlsa_checking 2018-01-10 14:36:43 +01:00
Willem Toorop a746ea5e08 Dependencies 2018-01-10 14:36:33 +01:00
Willem Toorop 6b4446c7cd Suppress compiler warnings in danessl library 2018-01-10 14:34:25 +01:00
Willem Toorop 712617e568 Dead assignment (without stub debugging) 2018-01-10 13:54:18 +01:00
Willem Toorop 7c5bdd5431 Use danessl submodule when OpenSSL version between 1.0.0 and 1.1.0 2018-01-10 12:47:14 +01:00
Jim Hague a906710269 Add missing function sufficient to compile Stubby on Xenial and Mac.
This includes the select and poll default event loops, some missing getdns source files and pleasingly now results in a warning-free build.
2018-01-08 18:59:54 +00:00
Jim Hague 1ecc7b3c26 Initial version of CMake build.
This is just a basic build of the library. No options are support, and  the only builds tested are Xenial and MacOS (the latter using the Brew openssl package, and so requiring -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2l option on the cmake command line).

Using the library is untested.
2018-01-08 15:36:35 +00:00
Willem Toorop 9e34588f19 logic error 2018-01-08 16:04:40 +01:00
Willem Toorop 546b75a9b1 libidn2 support. Thanks Paul Wouters 2018-01-08 12:54:48 +01:00
Willem Toorop a1e5cc44a0 Add https://github.com/vdukhovni/ssl_dane submodule 2018-01-08 10:33:25 +01:00
Willem Toorop 608189710c Log printing in getdns_query 2018-01-04 16:35:22 +01:00
Willem Toorop 2471f43dea Less logging with successful authenticated upstreams 2018-01-04 16:15:50 +01:00
Willem Toorop 540735a956 Check pins with DANE functions when available 2018-01-04 15:58:09 +01:00
Willem Toorop fe7d6678cf Merge branch 'develop' 2017-12-22 12:43:06 +01:00
Willem Toorop 2ff1bf6152 Merge branch 'release/1.3.0' into develop 2017-12-22 12:42:47 +01:00
Willem Toorop 25a31e6b35 Bump version 2017-12-21 17:06:43 +01:00
Willem Toorop 03d4950470 We need to set transport list before first query
(this needs to be reviewed...)
2017-12-21 16:49:19 +01:00
Willem Toorop 9aa1d067d2 Detect dnsmasq and skip the unit test that fails with it
This actually resolves issue #300
Thanks Tim Rühsen and Konomi Kitten
2017-12-21 16:21:10 +01:00
Willem Toorop aa419a88d0 Skip some more truncation issues with dnsmasq 2017-12-21 16:01:48 +01:00
Willem Toorop 81ffa2f48d Skip test that breaks with dnsmasq
when SKIP_DNSMASQ_ISSUE variable is test.
Helps out a little with issue #300
2017-12-21 15:45:58 +01:00
Willem Toorop 0ef910b9ee read_buf's may remain on canceled tcp requests 2017-12-21 14:53:54 +01:00
wtoorop efb0539c15
Merge pull request #368 from getdnsapi/devel/tls_settings
TLS settings have tls_ prefixed name
2017-12-21 14:25:01 +01:00
Willem Toorop 97cc67d026 s/CApath/tls_ca_path/g s/CAfile/tls_ca_file/g 2017-12-21 13:08:01 +01:00
wtoorop f173f4667f
Merge pull request #367 from getdnsapi/features/set_cipher_list
Features/set cipher list
2017-12-21 13:00:08 +01:00
Willem Toorop ae38a29a50 Upstream specific tls_cipher_list's 2017-12-21 12:30:15 +01:00
Willem Toorop 8f88981efe rename set_cipher_list() to set_tls_cipher_list() 2017-12-21 11:35:05 +01:00
Willem Toorop 7fe3bd6a1f getdns_context_set_ciphers_list() 2017-12-20 13:13:02 +01:00
Willem Toorop 2bd5df4959 Update to Stubby v0.2.1 2017-12-20 09:53:11 +01:00
Willem Toorop d35fae5038 Bump version (to 1.3.0-rc2), update ChangeLog 2017-12-20 09:43:45 +01:00
Willem Toorop 274bc9bc4a Merge branch 'develop' into release/1.2.2 2017-12-20 09:37:56 +01:00
wtoorop 76d8f11b44
Merge pull request #366 from hardfalcon/develop
Add support for TLS 1.3 and Chacha20-Poly1305
2017-12-20 09:36:59 +01:00
wtoorop 7b20414ee0
Merge pull request #365 from saradickinson/fix_windows_build
Fix windows build
2017-12-19 11:25:33 +01:00
Pascal Ernster 65c7a738eb
Add support for TLS 1.3 and Chacha20-Poly1305
Add support for TLS 1.3 (requires OpenSSL 1.1.1) and Chacha20-Poly1305 (requires OpenSSL 1.1).

Older OpenSSL versions will simply ignore ciphersuite specifications they don't understand and use the subset which they do unterstand.

Note that "EECDH" does *not* select anonymous cipher suites (as opposed to "kECDHE").
2017-12-15 20:01:30 +00:00
Sara Dickinson 00d3232ba4 Fix windows build 2017-12-15 16:53:23 +00:00
Willem Toorop ac17d4ebed We need a specific install location for tests builds ...
to not load default library
2017-12-14 11:53:15 +01:00
wtoorop 9c35fa1643
Merge pull request #364 from saradickinson/move_macos_script
Update makefile because a file in Stubby was moved
2017-12-13 16:35:32 +01:00
Willem Toorop 2b5b59537f Getting Stubby ready to merge PR #364 2017-12-13 16:33:37 +01:00
Willem Toorop fd16d7b5eb Bugfix in stubby.c (copy/paste error) 2017-12-13 15:59:42 +01:00
Willem Toorop 0615457dfa Resolve constant conflict 2017-12-13 15:43:36 +01:00
Willem Toorop 9f566de65d DNSSEC segfault issue 2017-12-13 15:41:08 +01:00
Sara Dickinson d232353f93 Update makefile because a file in Stubby was moved 2017-12-13 14:22:52 +00:00
Willem Toorop d7864ee0df Stubby disabling DNSSEC validation update 2017-12-13 14:52:49 +01:00
Willem Toorop 2c66487635 Merge branch 'devel/dnssec_meta_queries' into release/1.2.2 2017-12-13 14:52:00 +01:00
Willem Toorop 5f1a2f8659 Merge branch 'features/CA_verify_locations' into release/1.2.2 2017-12-13 14:49:42 +01:00
Willem Toorop cfeaefbe3f Merge branch 'features/resolvconf' into release/1.2.2 2017-12-13 14:44:06 +01:00
Willem Toorop 825e2fd15f Bump version 2017-12-13 14:42:18 +01:00
Willem Toorop 090b076d96 Zero configuration DNSSEC meta queries on existing transports
Should fix bug #356
2017-12-13 13:08:24 +01:00
Willem Toorop a63e5edb86 trust-anchor meta queries need to be done opportunistic too
In anticipation of DANE authenticated upstreams
2017-12-13 12:58:24 +01:00
Willem Toorop e691312a3f Schedule DNSSEC meta queries against existing context 2017-12-13 12:50:03 +01:00
Willem Toorop 362d168380 no_dnssec_checking_disabled extension for internal use only 2017-12-13 12:36:02 +01:00
Willem Toorop d4ec98ae6d ChangeLog for previous commit 2017-12-13 11:55:49 +01:00
Willem Toorop d5518bad67 Return which extensions are set
(for programs (Stubby) to know whether a context will do native dnssec validation or not)
2017-12-13 11:12:49 +01:00
Willem Toorop da3f023d8f set_CApath() and set_CAfile() for alt verify locs 2017-12-12 15:10:37 +01:00
Willem Toorop 26877d4494 Include sys/stat.h (from config.h) +
+ introduce GETDNS_RETURN_IO_ERROR return code
  (forgot to mention that in previous commit)
2017-12-12 12:38:55 +01:00
Willem Toorop 96ed06c6a9 Initialize context with given resolv.conf and hosts files
- getdns_context_create with set_from_os set will simply call these
  functions with the defaults

+ filechg_check is simplified somewhat (reducting memory management)
+ get OpenSSL version version via get_api_information()
2017-12-12 12:24:31 +01:00
Willem Toorop 01197f10ff Merge branch 'develop' into features/resolvconf 2017-11-29 15:25:50 +01:00
wtoorop b105faad7d
Merge pull request #360 from getdnsapi/bugfix/private_ecs_with_family
Bugfix #359: edns_client_subnet_private should set family
2017-11-28 16:59:37 +01:00
Willem Toorop 17d23ddb99 Restore running all unit tests again 2017-11-28 16:58:58 +01:00
Willem Toorop 8c87028d77 Only get root-anchors.xml when BOGUS root dnskey...
did have signatures which did not validate
2017-11-28 16:58:12 +01:00
Willem Toorop 2a39b6e2e8 Handle the uninitialized memory error the brutal way
Because clang (or valgrind with clang) is just wrong here
2017-11-28 16:51:28 +01:00
Willem Toorop 72eb8628d0 Report on single unit tests too 2017-11-28 16:44:08 +01:00
Willem Toorop 543435d89d Clang bitfield issue 2017-11-28 16:40:17 +01:00
Willem Toorop 025f1cdff3 set_from_os last to initialize ...
... because it is initialized with values from context itself!
I.e. context->tls_backoff_time, context->tls_connection_retries and context->log are used to initialize upstreams in upstreams_create() called from set_from_os
2017-11-28 16:04:23 +01:00
Willem Toorop 30e440d35c Access of freed memory in stub DNSSEC cleanup code
Should fix the latest core dump reported in getdnsapi/stubby#34
2017-11-27 15:26:45 +01:00
Willem Toorop 323239be58 Scan valgrind logs for errors too 2017-11-27 15:02:32 +01:00
Willem Toorop 27847b9a0a Initialize context->sys_ctxt! 2017-11-23 13:23:00 +01:00
Willem Toorop 6afb02b2f1 Bugfix #359: edns_client_subnet_private should set family
Thanks Daniel Areiza
2017-11-23 13:20:42 +01:00
Willem Toorop c3cdf496e3 Meta queries to upstreams from resolvconf setting 2017-11-23 12:48:48 +01:00
Willem Toorop c0a3babe0a Separate sys_ctxt for meta queries 2017-11-23 12:44:40 +01:00
Willem Toorop 3e16075563 Test getdns_context_create2 with getdns_query 2017-11-23 12:26:40 +01:00
Willem Toorop ed6c7a6b58 getdns_context_create2 and family that set an ...
... alternative resolvconf file
2017-11-22 15:49:30 +01:00
Willem Toorop a7a6240202 Set default resolvconf and hosts during configure 2017-11-22 15:01:38 +01:00
Willem Toorop 3a1cb30c28 BOGUS answer because unable to fetch root DNSKEY...
... should not cause segfault
2017-11-21 15:38:49 +01:00
Willem Toorop 3098ed6fca Merge branch 'develop' 2017-11-11 10:24:55 +08:00
Willem Toorop 8821c1c8cf Merge branch 'release/1.2.1' into develop 2017-11-11 10:24:25 +08:00
Willem Toorop f2f08514ce Set date in ChangeLog 2017-11-11 00:42:25 +08:00
Willem Toorop bf034eb3cd Bump version 2017-11-11 00:28:17 +08:00
Willem Toorop 6aa732b54d Update Stubby 2017-11-11 00:26:18 +08:00
Willem Toorop 260416a859 Ignore SIGPIPE signal (for not suddenly stopping) 2017-11-10 10:42:17 +01:00
Willem Toorop 6f20016889 default_trust_anchor_location in api_information
instead of trust_anchor_file
2017-11-10 10:35:41 +01:00
wtoorop 81bfa68440
Merge pull request #355 from saradickinson/bugfix/create_runstatedir
Add DESTDIR to runstatedir creation path
2017-11-08 12:48:50 +01:00
Sara Dickinson 26eb5b8969 Add DESTDIR to runstatedir creation path 2017-11-08 11:38:52 +00:00
Willem Toorop 5fe979c2e6 Update ChangeLog and configure.ac 2017-11-03 20:26:45 +01:00
Willem Toorop f6517fd3e2 Update Stubby to v0.1.5 2017-11-03 20:12:28 +01:00
wtoorop 168d83ac19
Merge pull request #353 from getdnsapi/devel/errno_handling
Handle more harmless I/O error cases +
2017-11-03 20:00:40 +01:00
Willem Toorop 439f41149b Last rename + explicit EMFILE check replacement 2017-11-03 16:42:38 +01:00
Willem Toorop 9b019b8c6e Check errno is not 0 before testing errors 2017-11-03 16:29:43 +01:00
Willem Toorop 4508ec77fb Few more renames 2017-11-03 16:26:19 +01:00
Willem Toorop 3b7b83e309 Review comments from Jim 2017-11-03 15:41:31 +01:00
Willem Toorop a8fac29a66 Handle more harmless I/O error cases +
- never exit on I/O errors
- never stop listening on I/O errors
- extended platfrom.[ch] with _getdns_strerror()
2017-11-03 13:50:13 +01:00
wtoorop b683cc4870
Merge pull request #352 from saradickinson/bugfix/make_runstatedir
Make sure the runstatedir exists
2017-11-03 13:42:52 +01:00
wtoorop e078f3c51a
Merge pull request #351 from getdnsapi/devel/dnssec_maintenance
Devel/dnssec maintenance
2017-11-03 11:11:23 +01:00
Sara Dickinson 4b8ea64140 Make sure the runstatedir exists 2017-11-02 16:55:25 +00:00
wtoorop c3b86ccc21
Merge pull request #350 from banburybill/features/piddir
Add configure --with-piddir. Use this for runstatedir.
2017-11-02 15:24:44 +01:00
Willem Toorop 546fc1d404 Update ChangeLog 2017-11-02 15:14:07 +01:00
Willem Toorop 843ba4b036 Merge branch 'develop' into devel/dnssec_maintenance 2017-11-02 15:07:16 +01:00
Willem Toorop 5dbfdd4ddb Update ChangeLog 2017-11-02 15:06:56 +01:00
Jim Hague 2d0d1c9e6f Add configure --with-piddir. Use this for runstatedir.
You need autoconf 2.70 (or 2.69 plus patch as in Debian) for runstatedir to be automatically in the configure script. This adds a always-present config option.
2017-11-02 13:21:50 +00:00
Willem Toorop 2434336ead Include all RRSIGs in validation chain
Because we don't know algorithm support of other validators.

But still canonicalize the RRset with the one used to validate just because we can.
2017-11-02 12:42:26 +01:00
Willem Toorop 7e103217c6 unsigned RRs in authority section with BIND
when +CD flag is used
2017-11-01 16:47:28 +01:00
Willem Toorop 270c3d654f Support DNSSEC validation without support records 2017-11-01 15:28:46 +01:00
Willem Toorop b4ae4b7121 Cannot fetch DNSKEY when in DNSKEY callback ...
for the same name in full recursion
2017-11-01 15:01:58 +01:00
Willem Toorop 4669956391 retry full recursion bogus answers only when...
dnssec validation was requested in the first place
2017-11-01 10:59:55 +01:00
Willem Toorop 09b4f6d57d One more _getdns_perror 2017-10-31 16:22:09 +01:00
Willem Toorop e2b26609d4 Stubby back to develop branch 2017-10-27 13:03:49 +02:00
Willem Toorop 725f5d486a Credit Remi Gacogne 2017-10-27 09:58:25 +02:00
wtoorop 24f7ae3ea6 Merge pull request #348 from rgacogne/stubby-libbsd-link
Fix a linking issue in stubby when libbsd is present
2017-10-27 09:57:48 +02:00
Remi Gacogne 8e12d86fc3
Fix a linking issue in stubby when libbsd is present
When libbsd is found on the system during the configure, the result
of `pkg-config --cflags libbsd-overlay` is added to `CFLAGS`:

`-DLIBBSD_OVERLAY -isystem /usr/include/bsd`

The result of `pkg-config --libs libbsd-overlay` is added to `LIBS`,
but not to `STUBBY_LIBS`, which is used when linking stubby.

Because of the new `CFLAGS`, the preprocessor replaces the call to
`getopt()` in stubby.c with a call to `bsd_getop()`:

```
 #ifdef LIBBSD_OVERLAY
 #undef getopt
 #define getopt(argc, argv, optstr) bsd_getopt(argc, argv, optstr)
 #endif
```

But since `-lbsd` has not been added to `STUBBY_LIBS`, the linking of
stubby fails with an unresolved symbol:

```
../libtool --tag=CC --mode=link gcc -o stubby stubby.lo convert_yaml_to_json.lo gbuffer.lo -lyaml  libgetdns.la
libtool: link: gcc -o .libs/stubby .libs/stubby.o .libs/convert_yaml_to_json.o .libs/gbuffer.o  -lyaml ./.libs/libgetdns.so
/usr/bin/ld: .libs/stubby.o: undefined reference to symbol 'bsd_getopt@@LIBBSD_0.0'
/usr/lib/libbsd.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
```

Simply adding the result of `pkg-config --libs libbsd-overlay` to
`STUBBY_LIBS` in addition to `LIBS` fixes the issue.
2017-10-22 17:36:45 +02:00
Sara Dickinson cb6af78944 Merge pull request #347 from saradickinson/update_stubby_commit
Update stubby to use the 0.1.4 release
2017-10-20 08:38:40 -07:00
Sara Dickinson d3b13c2bc9 Update stubby to use the 0.1.4 release 2017-10-20 16:22:03 +01:00
Sara Dickinson 5d581baae1 Merge pull request #345 from getdnsapi/devel/robustness
Devel/robustness
2017-10-20 07:30:17 -07:00
Willem Toorop 12272dda36 Merge branch 'develop' into devel/robustness 2017-10-20 16:10:35 +02:00
Willem Toorop f26fd6c8ee Merge branch 'features/mingw-win10-perror' into develop 2017-10-20 16:07:46 +02:00
Willem Toorop 971d876c70 Dependencies 2017-10-20 15:59:42 +02:00
Willem Toorop b2d32430f6 Merge branch 'develop' into features/mingw-win10-perror 2017-10-20 15:57:50 +02:00
Willem Toorop fc073267f1 Dead assignment 2017-10-19 14:14:37 +02:00
Willem Toorop f8e1ed78b8 Make upstream_reset static (and not shared between .c files) 2017-10-19 12:48:58 +02:00
Willem Toorop 5ce764ab70 Merge branch 'devel/robustness' into devel/robustness_bugfix 2017-10-19 12:37:53 +02:00
Willem Toorop 272d0cf0ef Allow clearing of upstreams 2017-10-19 12:35:10 +02:00
Sara Dickinson ddade192a3 Merge branch 'devel/robustness' of https://github.com/getdnsapi/getdns into devel/robustness_bugfix 2017-10-19 10:37:08 +01:00
Sara Dickinson 8886c5317d Fix 2 bugs:
- backoff time was not incrementing correctly
- best authentication information state was not being kept for shutdowns during setup (needed if e.g. hostname authentication failed during handshake).
2017-10-19 10:36:46 +01:00
Willem Toorop 87879783ec Postpone dealing with upstream derenferencing issue 2017-10-18 14:33:59 +02:00
Willem Toorop eedd1a1448 Eat incoming garbage on statefull transports
Can deal with timed out queries that are answered anyway.
+ reset the upstream on failure always
  (since requests are rescheduled for fallback by upstream_failed now anyway)
2017-10-17 16:58:01 +02:00
Willem Toorop fa597399e2 Update stubby 2017-10-17 15:14:09 +02:00
Willem Toorop dc5a78b154 Printing something which is not on stack
(causing segfault in some cases)
2017-10-17 14:19:59 +02:00
Willem Toorop f83c8e217e Decrease assumptions based on network_by_query_id 2017-10-17 13:47:29 +02:00
Willem Toorop ee4feb0cc6 Clean parallel builds too 2017-10-17 13:32:56 +02:00
Willem Toorop 11e4635f2b Dependencies 2017-10-17 13:32:41 +02:00
Willem Toorop ce4c44830d Unused variables 2017-10-16 15:26:00 +02:00
Willem Toorop 968d94d2be atomic netreq removal from write_queue in upstream_write_cb 2017-10-16 14:17:49 +02:00
Jim Hague a4fa9ad4eb Merge branch 'develop' into features/mingw-win10-perror 2017-10-10 15:17:52 +01:00
wtoorop 6afcc97b87 Merge pull request #341 from banburybill/features/mingw-win10
Fix Stubby stopping listening to UDP on Win10 mingw64 builds
2017-10-09 15:53:10 +02:00
Jim Hague 4ca8ee008b Add _getdns_perror(). On Windows this reports Winsock errors. 2017-10-06 18:15:18 +01:00
Jim Hague 34f4e13833 Have separate Windows DEBUG_NL() similar to DEBUG_ON().
This removes a build warning.
2017-10-06 16:24:56 +01:00
Jim Hague 4b5303e6fb Merge branch 'features/mingw-win10' into features/mingw-win10-warnings 2017-10-06 15:28:10 +01:00
Jim Hague 5e415b60b6 Add missing platform.h include. 2017-10-06 15:04:49 +01:00
Jim Hague 74eaf4b03e Previous commit omitted platform.h. 2017-10-06 14:38:59 +01:00
Jim Hague eb6da94e25 Convert one more poll() to _getdns_poll(). 2017-10-06 12:07:47 +01:00
Jim Hague dc7daede40 Move Windows/Unix functions into new platform.h. 2017-10-06 12:07:15 +01:00
Jim Hague 0874a0a472 Use PRI format strings in wire2str.c and remove ARG_LL. 2017-10-05 19:17:12 +01:00
Jim Hague 8a291d4dce Revise autoconf checking for sigset_t.
The previous strategy for Windows of checking for sigset_t and if it failed repeating the check with -D_POSIX did not work as expected. Autoconf found the second instance of the test, thought it was the same as the first, and used the cached result from the first. It was only because a typo did not reset CFLAGS back, so always adding _POSIX, that this worked with mingw.

Change instead to checking for sigset_t and if that fails for _sigset_t, and in config.h if sigset_t does not exist but _sigset_t does then typedef _sigset_t to sigset_t. Also amend the implementation of sigfillset() to cast to sigset_t not _sigset_t; it may not be just mingw that doesn't have sigfilleset().

Also, ensure signal.h is one of the headers included when checking for sigset_t. It's the header Posix says sigset_t is defined in...
2017-10-05 19:15:41 +01:00
Jim Hague 59e6ec80fe Fix configure runtime error.
Error was:
checking for DSA_SIG_new... yes
../configure: line 13315: test: too many arguments
2017-10-05 15:04:40 +01:00
Jim Hague ff7c85ab20 Fix build errors introduced by a0c3134. 2017-10-05 12:43:35 +01:00
Jim Hague a70efd118d Fix build warnings about inet_ntop() not being declared on Win10/MinGW. 2017-10-05 12:36:03 +01:00
Jim Hague 0895522734 Merge branch 'develop' into features/mingw-win10 2017-10-05 10:52:06 +01:00
Jim Hague 1eae1ad96b Fix problem where Stubby stops listening to UDP on Win10.
Winsock can return ECONNRESET when receiving UDP via recvfrom() if an ICMP Port Unreachable has been received. Rather than treat the socket as being in error and closing it, just ignore the error.
2017-10-04 17:42:06 +01:00
Jim Hague 757becc812 write() on a socket is equivalent to send() with flag value of 0. 2017-10-04 17:32:52 +01:00
Jim Hague a0c313412d Adjust Unix socket/Winsock handling.
Centralise it into util-internal.h, remove duplicate definitions from mdns, and add new pseudo-functions _getdns_closesocket(), _getdns_poll() and _getdns_socketerror(). Convert error values to simple values and convert error checking to use _getdns_socketerror() and the simple values. The simple values can also be used with the result from getsockopt() with SO_ERROR in stub.c.
2017-10-04 17:31:33 +01:00
Willem Toorop ffc72ff253 Rearrange includes for finding inet_ntop on Windows
+ make sure stubby is linked with initial LDFLAGS (i.e. static) as well
2017-10-03 17:09:33 +02:00
wtoorop d5efa01d06 Merge pull request #339 from banburybill/features/mingw-win10
Check for implementations of sigemptyset, sigfillset and sigaddset an…
2017-10-03 16:38:13 +02:00
Willem Toorop 3e221ebed5 Fix parallel make install's 2017-10-02 16:36:07 +02:00
Willem Toorop b22666d667 Bump version 2017-10-02 16:34:12 +02:00
Jim Hague 4acce42720 Check for implementations of sigemptyset, sigfillset and sigaddset and add if not present.
mingw64 doesn't have them and compilation fails at link time.
2017-10-02 14:15:16 +01:00
Willem Toorop 8a4497ff4b Merge branch 'release/1.2.0' 2017-09-29 22:47:39 +02:00
Willem Toorop c786ba03d2 Merge branch 'release/1.2.0' into develop 2017-09-29 22:47:19 +02:00
Willem Toorop 8ddab4813b Date and README.md update 2017-09-29 22:46:31 +02:00
Willem Toorop 7509f691f3 Update Stubby README.md 2017-09-29 22:16:16 +02:00
Willem Toorop 3f05242bce yaml dir has moved 2017-09-29 11:47:15 +02:00
Willem Toorop 6aa73c9374 Thank Travis Burtrum for finding the auth bug 2017-09-29 11:41:58 +02:00
Willem Toorop d1aebd3c24 Don't test hostname auth without support in libssl 2017-09-29 11:07:43 +02:00
Willem Toorop 6b04ed8551 Bumb version 2017-09-28 22:28:39 +02:00
Willem Toorop 23daf9aac3 Fix TLS authentication 2017-09-28 22:17:36 +02:00
Willem Toorop a9ba50dff1 Fail transport test on failures 2017-09-28 22:17:06 +02:00
Willem Toorop e75cf0b7a3 A missing symbol fails on macos 2017-09-28 20:21:10 +02:00
Willem Toorop c3df13b27c PATH_MAX can be in sys/limits.h too..
and must have a fallback value
2017-09-28 19:45:16 +02:00
Willem Toorop a86e21b48a Fix reading files on windows with stubby too 2017-09-28 15:19:07 +02:00
Willem Toorop 52a4500792 Signedness error 2017-09-28 15:13:57 +02:00
Willem Toorop 15eec724a5 Portable CR to CRLF conversion 2017-09-28 15:09:55 +02:00
Willem Toorop 078c50f1b2 fread with mingw32 compiled can return < file sz,
because it automatically converts \r\n into \n
2017-09-28 15:09:16 +02:00
Willem Toorop b9260f8fca Install Windows format stubby.yml on Windows 2017-09-27 16:24:32 +02:00
Willem Toorop 3ab01cf45d Dont do yaml tpkg test 2017-09-27 13:27:24 +02:00
Willem Toorop cefeed2b47 PRIsz usage like PRIu64 etc. 2017-09-27 13:15:12 +02:00
Willem Toorop 7ac289f726 dependencies 2017-09-27 13:07:11 +02:00
Willem Toorop a7fc760141 Dependencies 2017-09-27 12:47:01 +02:00
Willem Toorop bf2e08e2df Move yaml config handling to Stubby 2017-09-27 12:45:13 +02:00
Willem Toorop ca3f28843c Comments from Andreas 2017-09-25 09:24:53 +02:00
Willem Toorop 0eda8e1deb Today release candidate, not actual release 2017-09-22 14:56:18 +02:00
Willem Toorop 1ebbd8d52d Include yaml in build tarball 2017-09-22 12:45:01 +02:00
Willem Toorop f26669df68 Make a -rc1 tarball 2017-09-22 12:37:40 +02:00
Willem Toorop e2f1c8d13c Release today 2017-09-22 12:28:29 +02:00
Willem Toorop 114b5785f7 Doxygen documentation for Zero configuration DNSSEC
+ rename of getdns_context_(get|set)_trust_anchor_*()
         to getdns_context_(get|set)_trust_anchors_*()
2017-09-22 12:25:56 +02:00
Willem Toorop a3bfee7d0a Issues from unit tests 2017-09-22 11:12:27 +02:00
Willem Toorop da2aa634d3 Make appdata_dir configurable +
settings via getdns_context_config()
2017-09-21 17:06:29 +02:00
Willem Toorop 1b47ce4d10 Slightly different function prototypes 2017-09-21 12:38:49 +02:00
Willem Toorop edba5b77f8 Updated ChangeLog 2017-09-21 12:33:44 +02:00
Willem Toorop 90a187a1ac New recommendations regarding trust anchor management 2017-09-21 12:33:19 +02:00
Willem Toorop 712f62a4c1 Things that came out of compiling on Windows 2017-09-21 11:03:38 +02:00
Willem Toorop 8897bdf18f dependencies 2017-09-20 15:55:24 +02:00
Willem Toorop ac86b41fab Update stubby 2017-09-20 15:46:35 +02:00
Willem Toorop 7c229c40cd Merge branch 'features/zeroconf-dnssec' into release/v1.2.0 2017-09-20 15:45:27 +02:00
Willem Toorop fbc1526f47 Merge branch 'devel/compile-on-windows' into release/v1.2.0 2017-09-20 15:40:31 +02:00
Willem Toorop d880d4222b Merge remote-tracking branch 'jim/features/yaml' into release/v1.2.0 2017-09-20 15:40:02 +02:00
Willem Toorop 905cf290d4 Bump version, update ChangeLog 2017-09-20 15:38:07 +02:00
Willem Toorop e6536bb2ef Typo 2017-09-20 15:18:43 +02:00
Willem Toorop 36943a4380 A dnsreq is bogus if any of its netreqs is 2017-09-20 14:42:35 +02:00
Willem Toorop 17d7ee79f2 Fix NULL pointer dereference 2017-09-20 12:44:14 +02:00
Willem Toorop f0f2afbca7 Fetch TA before resolve for full recursion too 2017-09-20 12:40:59 +02:00
Willem Toorop e2abb8aff4 Fetch TA when ZONE or APP TASRC and bogus answer 2017-09-20 11:44:21 +02:00
Willem Toorop 34d35f9e79 Track updating TA's with root DNSKEY rrset 2017-09-20 10:30:13 +02:00
Willem Toorop e2ffaf3e07 Less activity to detect XML verify failure 2017-09-18 11:49:43 +02:00
Willem Toorop 737f49d2cc Setup libunbound ta's after processing XML 2017-09-18 09:59:22 +02:00
Willem Toorop 463855d274 Writability test for application data 2017-09-16 18:16:21 +02:00
Willem Toorop 40295075ad Update stubby submodule 2017-09-14 17:34:39 +02:00
Willem Toorop 8980929150 Check whether -D_POSIX is needed for sigset_t 2017-09-14 17:16:54 +02:00
Willem Toorop aa74c0a3d5 One more pleasing travis fix 2017-09-14 16:43:10 +02:00
Willem Toorop e6051976dd travis specific fixed 2017-09-14 16:32:53 +02:00
Willem Toorop 57e6487d76 Some more fixes specific to travis 2017-09-14 16:02:37 +02:00
Willem Toorop 96c6e49ae5 Use the on windows compilable stubby 2017-09-14 15:26:40 +02:00
Willem Toorop 6d29f7fb65 Fix issues accumulated when tpkg didn't work 2017-09-14 15:14:00 +02:00
Willem Toorop 8c4ed6294e Merge branch 'develop' into features/zeroconf-dnssec 2017-09-14 12:27:47 +02:00
Willem Toorop 836c651539 Initial fixes from John to compile getdns on Windows 2017-09-14 12:25:25 +02:00
Willem Toorop f31eb517e0 Lazy TA and time checking 2017-09-14 11:47:02 +02:00
Jim Hague dcc6cd36c6 Merge pull request #2 from saradickinson/features/yaml
Change extension from .yaml to .yml
2017-09-13 17:56:47 +01:00
Jim Hague 80b2eacc26 Merge branch 'develop' into features/yaml 2017-09-13 16:55:11 +00:00
Jim Hague b20aedd182 Update the getdns_yaml2*() Doxygen comments. 2017-09-13 17:42:24 +01:00
Sara Dickinson 8618e4b731 Change extension from .yaml to .yml 2017-09-13 17:41:16 +01:00
Jim Hague 8139201f12 Allow YAML input to be just a list or scalar as well as a map.
This allows getdns_yaml2list(), getdns_yaml2bindata() and getdns_yaml2int() to work as expected.

Update the YAML test to check these.
2017-09-13 17:29:41 +01:00
wtoorop 22d1345491 Merge pull request #333 from saradickinson/variable_tls_backoff
Variable tls backoff
2017-09-13 17:00:56 +02:00
Jim Hague 019ce4afe5 Merge pull request #1 from saradickinson/features/yaml
Updates to makefiles for s/stubby.conf/stubby.yaml
2017-09-13 16:00:06 +01:00
Willem Toorop 92a0db58da Merge remote-tracking branch 'upstream/develop' into features/zeroconf-dnssec 2017-09-13 16:56:33 +02:00
Sara Dickinson 8fab939d2c Merge branch 'features/yaml' of https://github.com/banburybill/getdns into features/yaml 2017-09-13 15:53:47 +01:00
wtoorop 645c6f31cc Merge pull request #335 from banburybill/develop
Add '-f' to tpkg usage message.
2017-09-13 16:52:12 +02:00
Jim Hague 0c39696b64 Add '-f' to tpkg usage message. 2017-09-13 15:50:20 +01:00
Sara Dickinson 8f683ef3c9 Merge branch 'develop' of https://github.com/getdnsapi/getdns into variable_tls_backoff 2017-09-13 15:50:17 +01:00
Sara Dickinson 8c331d580a Improve usage of getdns to make file extension clearer 2017-09-13 15:48:42 +01:00
Jim Hague 9e47919f42 Merge commit 'a9029581bc18870e8a1b84f77e546500bad7ec0e' into features/yaml 2017-09-13 15:46:47 +01:00
wtoorop a9029581bc Merge pull request #334 from banburybill/develop
Fix capturing exit code of a test.
2017-09-13 16:13:08 +02:00
Jim Hague 57c40b147d Fix capturing exit code of a test.
tpkg was not capturing the exit code of the test, but the exit code of the write_result actions.
2017-09-13 15:02:36 +01:00
Jim Hague 9683a64f73 Add test 255-yaml-config with basic test of getdns_yaml2dict. 2017-09-13 15:01:13 +01:00
Sara Dickinson f0190e4f03 Add 2 missing parameters from the config output 2017-09-13 13:02:01 +01:00
Willem Toorop 8f3ce9af35 Configurable zero configuration DNSSEC parameters 2017-09-13 14:00:54 +02:00
Jim Hague eabad34af9 Add libyaml dependency to README, and note how to remove it. 2017-09-13 12:51:16 +01:00
Jim Hague c74e8353a8 Move to clang-friendly way of marking unused function parameters as used. 2017-09-13 12:50:18 +01:00
Jim Hague 6d6e66c5a8 Add libyaml to dependencies for Travis. 2017-09-13 12:49:39 +01:00
Sara Dickinson 453b94269b Updates to makefiles for s/stubby.conf/stubby.yaml 2017-09-13 12:45:56 +01:00
Sara Dickinson f53e5645d9 Improve the comments about the new backoff handling.
Remove unnecessary log.
2017-09-13 10:00:56 +01:00
Jim Hague 6c95f4177d Add YAML configuration option.
Add new extra functions getdns_yaml2(dict|list|bindata|value)(). These are like their getdns_str2() counterparts, but take YAML input rather than JSON.

YAML introduces a new dependency, on libyaml. YAML can be disabled at configuration time, in which case the dependency is removed.

Modify getdns_query such that if a configuration file name includes ".yaml" it will be processed as a YAML configuration, not a JSON configuration.

Internally, getdns_yaml2*() work by passing the YAML string through a simple translation to JSON. At present, this translation assumes that configuration is the only use case, and so will error if the outer layer of the YAML input is not a map. This in effect means that at present all getdns_yaml2*() functions apart from getdns_yaml2dict() will give an error on the YAML translation to JSON.
2017-09-12 16:47:57 +01:00
Sara Dickinson b760a2ced2 Refine the logging levels to match the errors given when backing off, etc. 2017-09-12 15:01:02 +01:00
Sara Dickinson 729af1d159 Allow backed-off upstreams to be re-instated if all our upstreams are unusable (e.g. if the network is down).
But limit re-tries for a given netreq to the total number of upstreams before failing. This should (roughly) allow 2 retries per upstream of the correct transport before bailing out. Otherwise we are stuck in a loop retrying forever!
2017-09-12 13:47:56 +01:00
Willem Toorop 8aa46b305d Merge branch 'develop' into features/zeroconf-dnssec 2017-09-11 11:09:58 +02:00
Sara Dickinson 42945cfc08 Make the backoff time incrementally increase until the upstream starts working again 2017-09-08 17:28:37 +01:00
wtoorop 10133a71f3 Merge pull request #330 from saradickinson/1.2_stuff
First pass at fixing problems when connections to servers are lost.
2017-09-06 15:41:43 +02:00
Sara Dickinson 2e4e3873e4 First pass at fixing problems when connections to servers are lost.
Need to reset connection state if connections fail at setup and on read/write if there are no more messages queued.
This means we will back-off servers that fail, so we should think about using a shorter backoff default in stubby
because otherwise temporarily loss of the network connection will mean having to restart stubby.
Also some minor changes to logging.
2017-09-06 11:05:08 +01:00
Willem Toorop c6d40d9adc Merge branch 'develop' into features/zeroconf-dnssec 2017-09-04 16:43:37 +02:00
Willem Toorop d2c685f3ca Update ChangeLog, prepare for release today 2017-09-04 10:21:23 +02:00
Willem Toorop d2c258158f Flag for live logging 2017-09-04 10:04:17 +02:00
Willem Toorop 48209a038c Fix things that came out of static analysis 2017-09-02 12:47:04 +02:00
Willem Toorop 084286513f Fix permissions 2017-09-02 12:18:57 +02:00
Willem Toorop f25ae85030 Get keys from correct position 2017-09-02 12:10:50 +02:00
Willem Toorop d340305dcc Show tpkg execution live 2017-09-02 11:38:20 +02:00
Willem Toorop 2b07f221c4 And actually copy over results 2017-09-02 11:22:01 +02:00
Willem Toorop bf31b2f7db Collect report from static analysis 2017-09-02 11:20:21 +02:00
Willem Toorop 21f538f60c Forgot ; 2017-09-01 17:00:34 +02:00
Willem Toorop bf23968226 Final for loop initializations elimination 2017-09-01 16:50:31 +02:00
Willem Toorop 70ec5ea4d0 Some more for loop initializations 2017-09-01 16:34:06 +02:00
Willem Toorop 5c8765fefe No variable initializations in for loops 2017-09-01 16:23:26 +02:00
Willem Toorop 98379bbd38 Add RR type DOA
Without rdata yet, just to pass unit tests
2017-09-01 16:10:56 +02:00
Willem Toorop 062b88c991 Bumb version 2017-09-01 15:26:25 +02:00
Willem Toorop 2ed2871549 Merge branch 'develop' into features/zeroconf-dnssec 2017-08-30 15:09:39 +02:00
Willem Toorop fe6d2c9749 /* fallthrough */ must be first comment before case 2017-08-24 13:58:13 +02:00
Willem Toorop 5a94081634 Make switch/case fallthroughs explicit
+1 fallthrough bugfix in getdns_query
2017-08-24 13:51:58 +02:00
Willem Toorop 1aef5fb3e4 Bumb version + ChangeLog 2017-08-24 13:29:16 +02:00
Willem Toorop 4ecf9ad8c6 The submodule update --init only for git checkouts 2017-08-24 11:36:20 +02:00
Willem Toorop 2084841fcf Merge branch 'patch-1' of https://github.com/paulehoffman/getdns into devel/paulehoffman-patch-1 2017-08-24 11:35:09 +02:00
Willem Toorop bef36d12f1 Stubby submodule on v0.1.2 release tag 2017-08-24 11:31:05 +02:00
Sara Dickinson a6669482d8 Merge pull request #329 from getdnsapi/devel/without-stubby
Devel/without stubby
2017-08-23 15:25:27 +01:00
Willem Toorop 4ed82b6521 Tweak README 2017-08-23 16:12:18 +02:00
Willem Toorop 3e07bb519c Remove systemd (because it moved to stubby repo) 2017-08-23 16:10:47 +02:00
Willem Toorop f949f4a136 Sync with unbound 2017-08-22 12:42:52 +02:00
Willem Toorop 516570e1f8 Include stubby (building) in tpkg testing 2017-08-22 12:16:48 +02:00
wtoorop c570114bf6 Merge pull request #328 from saradickinson/bugfix/fastopen_fallback
Fix issue on macOX 10.10 where TCP fast open is detected but not impl…
2017-08-22 12:05:41 +02:00
Willem Toorop 2c8e7461da Update stubby module to develop branch 2017-08-22 11:47:04 +02:00
Willem Toorop 6024f9d72e Merge branch 'develop' into devel/without-stubby 2017-08-22 11:27:11 +02:00
Willem Toorop e57011a3ea Compile without stubby by default
And with stubby from repo (as submodule) when --with-stubby is specified
2017-08-22 11:25:47 +02:00
Sara Dickinson 33ff6a95ac Fix issue on macOX 10.10 where TCP fast open is detected but not implemented causing TCP to fail. The fix allows fallback to regular TCP in this case and is also more robust for cases where connectx() fails for some reason. 2017-08-18 17:59:49 +01:00
wtoorop 665c3f6fb5 Merge pull request #326 from saradickinson/docs/fix_wiki_links
Fix all the outdated links to wiki pages in the README.md
2017-08-18 15:57:20 +02:00
wtoorop 8e321a0e77 Merge pull request #325 from saradickinson/docs/fix_return_call_reporting
Minor updates on return_call_reporting. Fix the name in the API spec …
2017-08-18 15:56:24 +02:00
wtoorop f03ac9ab7b Merge pull request #324 from saradickinson/docs/fix_set_from_os
Remove mention of using the second bit in set_from_os to init OpenSSL…
2017-08-18 15:56:13 +02:00
wtoorop da7083f55a Merge pull request #316 from wtoorop/devel/roadblocks_and_valchains
Devel/roadblocks and valchains
2017-08-18 15:55:56 +02:00
wtoorop 5701fb99c9 Merge pull request #321 from neilcook/stub_fixes
Stub fixes
2017-08-18 15:53:23 +02:00
wtoorop ae0dd866aa Merge pull request #313 from MelindaShore/develop
Modified Dockerfile to check out getdns master
2017-08-18 15:52:49 +02:00
Sara Dickinson 9d86928900 Fix all the outdated links to wiki pages in the README.md 2017-08-04 14:50:04 +01:00
Sara Dickinson 8311dc9049 Minor updates on return_call_reporting. Fix the name in the API spec and add a know issue that it isn’t fully supported in recursive mode.
Also remove known issue that stub doesn’t limit in outstanding queries as this is now supported.
2017-08-04 14:31:05 +01:00
Sara Dickinson 05016e3a3a Remove mention of using the second bit in set_from_os to init OpenSSL as this no longer applies 2017-08-04 14:17:50 +01:00
Neil Cook 1555c432f5 Fix array bounds bug in upstream_select 2017-07-31 22:51:24 +01:00
Neil Cook 2d7d6581b4 Ensure netreq->fd is set to -1 after close()/closesocket()
If netreq->fd is not set to -1, then multiple functions close the
same socket. This causes major issues in multithread code where the
socket must not be closed multiple times as it may be owned by a
different thread.
2017-07-31 22:48:09 +01:00
Paul Hoffman c6c1b5cfa2 Make building instructions clearer
... and add packages for Ubuntu.
2017-07-16 10:53:56 +02:00
Willem Toorop e11dc92df1 Hopefully the last warning 2017-07-15 18:38:31 +02:00
Willem Toorop 84430e02cd Actually working roadblocks and getting validation chains 2017-07-15 17:48:24 +02:00
Willem Toorop bceb6c8c87 Resubmit netreqs when roadblocks need to be avoided 2017-07-15 11:14:35 +02:00
Willem Toorop c5acb3769b Exit with error when answers were bogus 2017-07-06 21:28:34 +02:00
Willem Toorop d589adf120 Use -V option in transport tests 2017-07-06 12:19:14 +02:00
Willem Toorop d402603f4a Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2017-07-06 12:13:30 +02:00
Willem Toorop 4478745955 No output from getdns_query to stdout except the result (unless -V is used)
Resolves issue #315
2017-07-06 12:08:09 +02:00
Sara Dickinson 28c41c3495 Move the SYNC/ASYNC response text to after the dict so the dict is the first thing output and can be parsed without stripping this text (request from user). 2017-07-06 12:03:35 +02:00
Willem Toorop 44065bead8 Initial windows work 2017-07-06 00:26:21 +02:00
Willem Toorop 9c78f8ecc8 Merge branch 'develop' into features/zeroconf-dnssec 2017-07-03 22:43:47 +02:00
Willem Toorop 1b731271af Bump version 2017-07-03 16:23:25 +02:00
Willem Toorop 7151e6fd44 Deal with leaking timeouts (between sync and async loop) 2017-07-01 01:01:17 +02:00
Willem Toorop 11138ff678 Also register application set trust anchors 2017-07-01 01:00:40 +02:00
Willem Toorop 59ff5e8178 0 terminate xml files 2017-07-01 00:45:09 +02:00
Willem Toorop 2b20f35e0e Write fetched trust anchor 2017-07-01 00:05:20 +02:00
Willem Toorop 8ec1f8eae9 Happy Eyeballs 2017-06-30 22:51:03 +02:00
Willem Toorop f9bdedbf84 Reconnect on pipelining failure 2017-06-30 22:00:14 +02:00
Willem Toorop 4a5f03ebbe Anticipate surplus reads 2017-06-30 21:14:02 +02:00
Willem Toorop 77d13f885e unused function warning 2017-06-30 11:08:20 +02:00
Willem Toorop 61561dd527 Fix warnings & dependencies 2017-06-30 10:45:51 +02:00
Willem Toorop 3e6c5775ff Fetch and equip context with trust-anchors 2017-06-30 10:18:07 +02:00
Willem Toorop 742588dd6f Merge branch 'develop' into hackathon/zeroconf-dnssec 2017-06-29 11:09:30 +02:00
Melinda Shore 146638ab94 Modified Dockerfile to check out getdns master and to use unbound-anchor to install dnssec trust root 2017-06-28 22:11:30 -08:00
wtoorop 45884a2dd7 Merge pull request #310 from getdnsapi/features/getdns_context_set_logfunc
A configurable log function
2017-06-28 22:55:45 +02:00
Willem Toorop 91ccbcd7df Typo? 2017-06-28 21:45:54 +02:00
wtoorop 280e72a0fe Merge pull request #311 from MelindaShore/develop
Basic Dockerfile for stubby.
2017-06-28 21:28:31 +02:00
Willem Toorop 78f027aaab The event loop bugfix 2017-06-28 21:24:35 +02:00
Willem Toorop 19479d4089 Merge branch 'develop' into features/getdns_context_set_logfunc 2017-06-28 21:22:55 +02:00
Willem Toorop f47606b643 Bump version 2017-06-28 21:21:15 +02:00
Willem Toorop 264135e799 Reintroduct timestamps and replace GETDNS_DAEMON: with STUBBY: 2017-06-28 21:09:40 +02:00
Willem Toorop 8235250fb6 Rename SYSTEM_DAEMON in LOG_UPSTREAM_STATS 2017-06-28 20:57:53 +02:00
Willem Toorop fb267938c3 Start with fetching root-anchors remotely
Also lays the foundation for looking up upstreams by name and DANE authentication of upstreams.
2017-06-28 20:35:30 +02:00
Sara Dickinson 55acf6662c Fix for outputting the address string in the DAEMON log 2017-06-28 17:58:38 +01:00
wtoorop 101f24a6da Merge pull request #309 from getdnsapi/bugfix/detect_connection_reset
Respond to socket errors
2017-06-28 11:37:14 +02:00
Willem Toorop 195f4c59c8 Fix for the constants declaration issue 2017-06-27 07:49:01 +02:00
Melinda Shore b0c55d540f Basic Dockerfile for stubby. 2017-06-26 17:17:16 -08:00
Willem Toorop 04e554086a A configurable log function
Currently used only for DAEMON_DEBUG
2017-06-27 00:23:22 +02:00
Willem Toorop ce43942cbe Respond to socket errors 2017-06-26 16:57:23 +02:00
Willem Toorop ff1ebbf671 Hmmm... this time the warning does make sense 2017-06-22 13:09:45 +02:00
Willem Toorop 2962baa050 Old (not so smart) compiler warns for uninitialized variable 2017-06-22 12:48:22 +02:00
Willem Toorop 69b3f6f558 Remove unnecessary initialization (scan-build) 2017-06-22 12:43:33 +02:00
Willem Toorop e2f1d3badb Dependencies 2017-06-22 12:41:01 +02:00
Willem Toorop 4a1008e02c New deps for anchor.lo 2017-06-22 12:28:07 +02:00
Willem Toorop 7ea3beaa6a Equip context with xml read trust anchors 2017-06-22 12:27:20 +02:00
Willem Toorop 6b70160659 getdnsify function names, even though they're static 2017-06-22 10:30:13 +02:00
Willem Toorop a2cf568190 RFC7958 root-anchors.xml parsing 2017-06-22 00:36:26 +02:00
Willem Toorop 631bf3fffc Copy yxml in distributions too 2017-06-20 16:07:25 +02:00
Willem Toorop a7ed88fbed Add yxml as submodule 2017-06-20 16:00:37 +02:00
Willem Toorop e496d13777 Start with getting files from user area 2017-06-20 15:38:32 +02:00
Willem Toorop b0af051809 Initialize in correct order 2017-06-20 12:20:11 +02:00
Willem Toorop 4275ea6ffa Merge branch 'develop' into hackathon/zeroconf-dnssec 2017-06-20 10:06:00 +02:00
Willem Toorop ac084db231 Don't build libtool stubby if installed directly 2017-06-19 12:19:14 +02:00
Willem Toorop 5e1cceca82 Stubby is installed from getdns_query directly 2017-06-19 12:12:09 +02:00
Willem Toorop a07290a9b0 Bugfix for parallel make install 2017-06-19 12:06:34 +02:00
Willem Toorop 606b83d857 Bump version 2017-06-15 21:43:23 +02:00
wtoorop 5fccd97d85 Merge pull request #308 from wtoorop/devel/issue-306
Devel/issue 306
2017-06-15 21:35:12 +02:00
Willem Toorop 9a273cf144 Get rid of superfluous struct member query_id 2017-06-15 21:24:40 +02:00
Willem Toorop 1d87437854 ERROR all outstanding netreqs whith a failed statefull upstream
Remove the currently processed netreq first, so it can be retries with another upstream/transport.
We MUST add netreq to the netreqs_by_query_id map even before we write to it, to have a reliable store of taken query ids.
2017-06-15 21:15:00 +02:00
Willem Toorop d9158e639b Clear netreq_by_query_id on upstream failure
But don't error the specific netreq then!
2017-06-15 17:21:05 +02:00
Willem Toorop 64d1063dec Dashes in front of release candidates! 2017-06-14 16:31:45 +02:00
Willem Toorop e2be41d352 Don't segfault on IPv6 unavailability
Resolved issue #306?  Review needed!
Shoud upstream_failed cancel all the netreqs?
2017-06-14 15:36:53 +02:00
Willem Toorop e00100b388 s/recieve/receive/ 2017-06-09 11:24:51 +02:00
Willem Toorop a34e4338ce Find out what went wrong 2017-06-09 08:49:52 +02:00
Willem Toorop 9b548a76c9 Resync with Unbound 2017-06-08 14:48:22 +02:00
Willem Toorop 360f3bdc3c Not certain when actual release is 2017-06-08 14:10:10 +02:00
Willem Toorop 878a229bea Don't test OARC servers 2017-06-08 14:06:58 +02:00
Willem Toorop 4e52316704 Include systemd directives too 2017-06-08 12:11:43 +02:00
Willem Toorop 6f01d466dc Update ChangeLog 2017-06-08 12:08:44 +02:00
Willem Toorop 874af14cea Rename setup script in Makefile too 2017-06-08 11:45:49 +02:00
wtoorop c76b977782 Merge pull request #307 from saradickinson/feature/stubby_homebrew
1) Add a stubby-setdns script (for MAC OS X only at the moment) to su…
2017-06-08 11:44:26 +02:00
Sara Dickinson d2e8ac9e61 Change script name so it is specific for macOS (which is the new ‘official’ name for Mac OS X!)
Add the copyright statement to the stubby-setdns-macos.sh file
2017-06-07 17:00:21 +01:00
Sara Dickinson 305a6f6b6a 1) Add a stubby-setdns script (for MAC OS X only at the moment) to support Homebrew formula
2) Remove the OARC server from the default config. So now only include the servers that commit to not logging user data. Can make this clearer once we have a yaml config file.
3) Update makefile to include stubby.conf and stubby-setdns in dist tarball
2017-06-02 11:52:56 +01:00
Willem Toorop a9464993dd bugfix #286 reschedule reused listening addresses 2017-06-01 16:24:24 +02:00
Willem Toorop 8cef8b1f95 Use libtool from correct location 2017-06-01 15:32:50 +02:00
Willem Toorop bc0052d4bb Bumb version 2017-06-01 15:26:18 +02:00
Willem Toorop d319e0a88b Copy stubby config file too 2017-06-01 15:16:25 +02:00
Willem Toorop c5d000b552 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2017-05-23 16:04:39 +02:00
Willem Toorop 8c27d285a8 Dependencies 2017-05-23 16:04:31 +02:00
wtoorop 9a48664b51 Merge pull request #305 from hodarh/coverage
Improve code coverage in unit tests
2017-05-23 15:29:10 +02:00
Hoda Rohani 1e99398576 travis doesn't support ipv6? 2017-05-22 16:59:07 +02:00
Hoda Rohani 69408816b4 Merge remote-tracking branch 'origin/develop' into coverage 2017-05-22 09:48:18 +02:00
wtoorop 3f8cdf19c2 Merge pull request #304 from getdnsapi/devel/parallel-builds
Devel/parallel builds
2017-05-19 12:54:05 +02:00
Hoda Rohani 21fe94c06e copy transport test to tpkg and extend more to check tsig
add unit test for tls connection
2017-05-18 09:30:51 +02:00
Willem Toorop 67d787d74a Merge branch 'develop' into hackathon/zeroconf-dnssec 2017-05-12 15:39:02 +02:00
Willem Toorop 3d4193fa41 Actually start building! 2017-05-10 23:04:31 +02:00
Willem Toorop 760b813333 Schedule resource depletion tpkg's sequentually 2017-05-10 23:01:57 +02:00
Hoda Rohani 053845332d adding more get functions to the tests 2017-05-10 16:47:51 +02:00
Willem Toorop b2d09e0171 Don't run resource depletion tests in parallel 2017-05-10 16:43:46 +02:00
Willem Toorop 6ca0b8b481 Run tpkg tests in parallel too 2017-05-10 16:35:32 +02:00
Willem Toorop e152842573 Fail event-loops-unit-tests tpkg when tests fail 2017-05-10 14:39:59 +02:00
Willem Toorop 1eae032743 tpkg tests build in parallel 2017-05-10 14:35:01 +02:00
Willem Toorop e127365900 Parallel testing support 2017-05-10 14:10:29 +02:00
Hoda Rohani 6ec0f2e021 add get functions to check the values 2017-05-08 12:49:59 +02:00
Hoda Rohani 2ac13e0807 Merge pull request #302 from getdnsapi/devel/rr-types
Devel/rr types
2017-05-02 17:58:03 +02:00
Willem Toorop 1ff6771c47 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2017-05-02 17:36:41 +02:00
Willem Toorop db856f5227 Allow for simultaneous jobs
Resolves issue #166
2017-05-02 17:34:50 +02:00
Willem Toorop ed08025c38 A better approach for the Windows strdup issue 2017-05-02 17:22:06 +02:00
Willem Toorop dab93cd197 TSIG and TKEY parsing by gldns 2017-05-02 16:28:55 +02:00
Willem Toorop 1e44ea7bd8 NSAP-PTR rdata is STR after all 2017-05-02 16:10:08 +02:00
Willem Toorop 16d97b607c Add missing RR types SMIMEA and AVC
+ fix rdata of TA RR type
2017-05-02 15:54:12 +02:00
Willem Toorop 352fef644e Check for unimplemented RR types 2017-05-02 15:20:57 +02:00
Willem Toorop 37fa7a1f07 Test correct rr-types output 2017-05-02 15:08:25 +02:00
Willem Toorop dbbf778ae8 TALINK 2017-05-02 15:04:57 +02:00
Willem Toorop 4c73b5e156 EID and NIMLOC 2017-05-02 14:59:02 +02:00
Willem Toorop ad53010cd2 NSAP-PTR 2017-05-02 14:50:39 +02:00
Willem Toorop 3b465d3600 Another small bug in str2wire function 2017-05-02 14:29:47 +02:00
Hoda Rohani 628ac10ae7 Merge pull request #301 from getdnsapi/devel/empty-rdata
Devel/empty rdata
2017-05-02 14:26:11 +02:00
Willem Toorop d1d95f4955 OPENPGPKEY support 2017-05-02 14:11:45 +02:00
Willem Toorop 066ef2ddaa Fix TAG rdata type presentation format 2017-05-02 14:01:21 +02:00
Willem Toorop cc9451d364 More rr-dict coverage by removing unused funcs 2017-05-02 12:55:51 +02:00
Willem Toorop 2a6c4b35cb Fix unit tests to allow for fixed IPSECKEY 2017-05-02 12:14:20 +02:00
Willem Toorop dbc1719206 Zero sized gateways with IPSECKEY gateway_type 0 2017-05-02 11:44:47 +02:00
wtoorop e9183386f1 Merge pull request #299 from dkg/systemd
Provide guidance for integration with systemd
2017-05-01 10:34:26 +02:00
Daniel Kahn Gillmor e845ef8968 Provide guidance for integration with systemd
Stubby needs to be able to bind to privileged ports, but otherwise
shouldn't need root capabilities.

systemd makes it easy to set the minimal capability set while
otherwise launching the daemon as a non-privileged user.

Ship these files upstream for distributors to deploy.
2017-04-27 12:10:41 -07:00
Hoda Rohani 80897d2b86 reorder rrs 2017-04-26 14:45:07 +02:00
Hoda Rohani 9438f5576c Merge branch 'develop' of https://github.com/getdnsapi/getdns into develop 2017-04-26 14:33:24 +02:00
Hoda Rohani 62fa69c461 Issue 108: Create a test to check all RR types 2017-04-26 14:32:30 +02:00
Willem Toorop 23fc764411 getdns_context_set_follow_redirects() is supported since 1.0.0 2017-04-24 14:24:12 +02:00
wtoorop 3b9caec245 Merge pull request #298 from saradickinson/update_readme
Minor Update to README
2017-04-24 14:01:27 +02:00
Sara Dickinson efea1a2506 Fix a couple of headers 2017-04-20 16:30:39 +01:00
Sara Dickinson 628bf7da47 Small updates to README to make Doxygen documentation more prominent and Update the Stubby text 2017-04-20 16:24:12 +01:00
Hoda Rohani 6f7f6046eb Extend server capabilities with valgrind 2017-04-19 12:34:01 +02:00
Hoda Rohani 193bc618a5 Merge branch 'develop' of https://github.com/getdnsapi/getdns into develop 2017-04-19 12:09:10 +02:00
Hoda Rohani 6f3db561f3 Bugfix in converting IPs in str2dict
+ tpkg test for server capabilities
2017-04-19 12:07:55 +02:00
Willem Toorop a670606849 Rearrange doxygen into subject groups 2017-04-13 20:30:59 +02:00
Willem Toorop b4eecd59ab Merge branch 'develop' into release/1.1.0 2017-04-13 15:46:24 +02:00
Willem Toorop 02516c4079 Two last warnings 2017-04-13 15:45:59 +02:00
Willem Toorop 05268f45b0 Bump version 2017-04-13 11:48:40 +02:00
Willem Toorop eb8fe6184a getdnsapi.net DNS over TLS ips to match the name 2017-04-13 11:47:44 +02:00
Willem Toorop d5dcdac58c Validate tls_auth_name
Deals with issue #270
2017-04-13 11:19:22 +02:00
Willem Toorop 691d1a77e6 Fix VS Code analysis warning
Should settle issue #239
2017-04-13 10:59:20 +02:00
Willem Toorop eb69cc8695 Merge branch 'develop' into release/1.1.0 2017-04-13 10:50:27 +02:00
Hoda Rohani 6c4af3af93 unintiallized array 2017-04-13 09:44:08 +02:00
Willem Toorop 6026cb1450 1.1.0-rc3 2017-04-12 23:08:20 +02:00
Willem Toorop 0da79ae77a Fix to compile with libressl. Thanks phicoh. 2017-04-12 23:05:17 +02:00
wtoorop 8dd37006c7 Merge pull request #284 from Hrish1/patch-1
Some mispelled words corrected
2017-04-12 22:53:36 +02:00
wtoorop 0857926965 Merge pull request #283 from wtoorop/devel/doxygen
Devel/doxygen
2017-04-12 22:53:21 +02:00
wtoorop 9aaafd8cca Merge pull request #285 from saradickinson/feature/update_stubby.conf
Feature/update stubby.conf
2017-04-12 22:52:58 +02:00
Willem Toorop 8c45f1fded All remaining doxygen documentation
Existing documentation needs to be reviewed too though...
2017-04-12 22:50:17 +02:00
Sara Dickinson 6e66754795 Nope - just add uncensored as the yeti servers would require a different trust anchor 2017-04-12 18:19:34 +01:00
Hrish1 b5739434ef Some mispelled words corrected 2017-04-12 20:05:31 +05:30
Willem Toorop 2226c722a9 Extra context setters 2017-04-12 12:35:46 +02:00
Willem Toorop 68a87e4cee Event loop extension functions documentation 2017-04-12 11:21:25 +02:00
Willem Toorop 708e520989 Spelling fixes from Andreas Schulze 2017-04-11 23:33:24 +02:00
Willem Toorop a060e723f2 Doxygen documentation for everything in getdns.h 2017-04-11 23:29:33 +02:00
Sara Dickinson ce7ee62355 Should we update stubby.conf to include 2 of the new test servers? 2017-04-11 15:24:10 +01:00
Willem Toorop d28283a850 Merge remote-tracking branch 'upstream/develop' into devel/doxygen 2017-04-10 12:17:59 +02:00
Willem Toorop e6696d9557 getdns_context_unset_edns_maximum_udp_payload_size 2017-04-06 20:53:18 +02:00
Willem Toorop c9b3e3cf7b Allow cleanup of naked idle timeouts 2017-04-06 20:50:34 +02:00
Willem Toorop a27915ccc9 One more ChangeLog update 2017-04-06 19:47:15 +02:00
Willem Toorop 2d011e3d19 Merge branch 'features/unset_max_udp_payload_sz' into release/1.1.0 2017-04-06 19:40:35 +02:00
Willem Toorop f0ee920227 Bump version, update ChangeLog 2017-04-06 16:13:15 +02:00
wtoorop f251f8aeda Merge pull request #282 from wtoorop/bugfix/issue-272
Bugfix/issue 272
2017-04-06 15:55:24 +02:00
Willem Toorop c2edc94a3a Clear timeout event when getting dnssec chain
With full recursion
2017-04-06 15:18:12 +02:00
Willem Toorop e35a2182a9 missing #include 2017-04-06 12:24:27 +02:00
Willem Toorop 4ceec33d08 Do something about TLS renegotiation. 2017-04-06 11:46:10 +02:00
Willem Toorop e08d3592a0 Schedule timeout when collecting for dnssec chain 2017-04-06 11:20:08 +02:00
Willem Toorop f8c7d8b5d5 Network request submission and callback reporting 2017-04-05 22:43:27 +02:00
Willem Toorop 2220c1a48d Options for request debugging 2017-04-05 17:53:39 +02:00
Willem Toorop 67baa1d651 getdns_context_unset_edns_maximum_udp_payload_size 2017-04-05 12:37:48 +02:00
Willem Toorop edecca8b63 smime verification of root-anchors.xml in ~/.getdns 2017-03-27 09:21:29 -05:00
wtoorop fe49bc1c69 Merge pull request #279 from dkg/feature/padding-policy
Implement sensible default padding policy.
2017-03-27 08:19:31 -05:00
wtoorop d5005a8ac0 Merge pull request #278 from dkg/getdns-query-transport-cleanup
getdns-query: S is no longer a valid transport label.
2017-03-26 14:53:53 -05:00
Daniel Kahn Gillmor f2a90925bc getdns-query: S is no longer a valid transport label. 2017-03-26 14:38:43 -05:00
Daniel Kahn Gillmor 9de4d6537b Implement sensible default padding policy.
This commit changes the semantics of tls_query_padding_blocksize()
slightly.  Where previously both 0 and 1 meant "no padding", this
commit changes 1 to mean "pad using a sensible policy".

At NDSS 2017's DNS privacy workshop, I presented an empirical study of
DNS padding policies:

https://www.internetsociety.org/events/ndss-symposium/ndss-symposium-2017/dns-privacy-workshop-2017-programme#session3

The slide deck is here:
https://dns.cmrg.net/ndss2017-dprive-empirical-DNS-traffic-size.pdf

The resulting recommendation from the research is that a simple
padding policy is relatively cheap and still protective of metadata
when DNS traffic is encrypted:

 * queries should be padded to a multiple of 128 octets
 * responses should be padded to a multiple of 468 octets

Since getdns is only currently doing queries over tls, we only have to
implement the first part of this policy :)
2017-03-26 14:37:28 -05:00
Willem Toorop f4fe2cb6c5 Merge branch 'develop' into hackathon/zeroconf-dnssec 2017-03-26 10:46:50 -05:00
wtoorop 148dfabf88 Merge pull request #276 from huitema/develop
Fixing the select and poll event loops for Windows
2017-03-26 10:20:48 -05:00
Willem Toorop 03efb66991 Keep connections open with sync requests too 2017-03-26 10:16:25 -05:00
huitema 6f0b08a400 Fixing the select event loop so it does not give up for naked timers in Windows.
Making sure the poll event loop works on windows.
Fixing the poll event loop so it does not give up for naked timers in Windows.
2017-03-26 10:07:44 -05:00
Willem Toorop 8864dfce92 Merge branch 'develop' into hackathon/zeroconf-dnssec 2017-03-25 20:37:36 -05:00
Willem Toorop 007208a122 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2017-03-25 20:22:54 -05:00
Willem Toorop 9fa6ab5994 Clang pragma's with clang only 2017-03-25 20:22:34 -05:00
Melinda Shore 01eedd5ea8 Merge pull request #275 from getdnsapi/devel/cert_in_call_reporting
Have the peer certificate in call_reporting
2017-03-25 19:58:16 -05:00
Willem Toorop b3e5c5fb30 Merge branch 'develop' into hackathon/zeroconf-dnssec 2017-03-25 19:52:55 -05:00
Willem Toorop b7d16e3c89 One more leak 2017-03-25 17:00:02 -05:00
Willem Toorop 6316c558bc typo 2017-03-25 21:45:08 +01:00
Willem Toorop 3eb6ebf5e4 Fix memory leak 2017-03-25 21:33:30 +01:00
Willem Toorop 5f6e47d091 Only equip with peer cert when transport is TLS 2017-03-25 21:26:05 +01:00
Willem Toorop a2efd8f6c1 Report peer certificate in call_reporting 2017-03-25 19:36:20 +01:00
Willem Toorop 767ca21bc0 Debugging for anchor management 2017-03-25 19:02:51 +01:00
Willem Toorop ed0b655af0 Update doxygen 2017-03-25 06:45:02 -05:00
Willem Toorop e4d4e97542 Suppress unused parameter warnings when we can't help it 2017-03-23 16:59:03 +01:00
huitema 0560500e34 Merge pull request #10 from wtoorop/devel/huitema-develop
Devel/huitema develop
2017-03-23 07:45:53 -07:00
Willem Toorop 15b451d71b Recommit parts of "Minor fixes in MDNS code to make sure it does work after the recent loop tightening." 2017-03-23 13:09:34 +01:00
Willem Toorop b32ee619f1 Merge branch 'develop' into devel/huitema-develop 2017-03-23 13:05:09 +01:00
Willem Toorop b80ccba02c Revert "Minor fixes in MDNS code to make sure it does work after the recent loop tightening."
This reverts commit c653e8502c.
2017-03-23 13:04:11 +01:00
Willem Toorop 2a496969cd Fixes for mdns 2017-03-23 12:53:44 +01:00
Willem Toorop c275b205d3 Create doxygen tagfile 2017-03-23 10:58:18 +01:00
Christian Huitema c653e8502c Minor fixes in MDNS code to make sure it does work after the recent loop tightening.
Suppressing the warning about mapping the 64 bit timeout value to a 32 bit integer,
based on the comments that the "maximum timeout used in practice is 6553500ms." If that
really is the case, we do not need to support 64 bit integers in the dict structure.
2017-03-22 15:50:26 -07:00
huitema 95da0b46e0 Merge pull request #9 from getdnsapi/develop
Align with develop branch
2017-03-22 10:10:00 -07:00
Willem Toorop f67314c1c1 Unbound event API without header compile fix 2017-03-22 14:36:16 +01:00
Willem Toorop 426fc238da Fixes for FreeBSD warnings when compiling tests
/usr/local/include/check.h:454:75: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
     _ck_assert_failed(__FILE__, __LINE__, "Assertion '"#expr"' failed" , ## __VA_ARGS__, NULL)
/usr/local/include/check.h:454:75: warning: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Wgnu-zero-variadic-macro-arguments]
2017-03-22 14:10:15 +01:00
Willem Toorop b2ac3849b7 Fxies for two NetBSD compiler warnings
ubkey-pinning.c -o pubkey-pinning.lo
./pubkey-pinning.c: In function '_getdns_verify_pinset_match':
./pubkey-pinning.c:385: warning: 'prev' may be used uninitialized in this function
IX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c ./context.c -o context.lo
./context.c: In function '_getdns_upstream_shutdown':
./context.c:760: warning: comparison between signed and unsigned
2017-03-22 13:50:11 +01:00
Willem Toorop 3d45a77884 Mention how to enable MDNS in ChangeLog 2017-03-22 12:35:23 +01:00
Willem Toorop b48a92c8f5 Max OS-X and FreeBSD multicast portability 2017-03-22 12:33:13 +01:00
Willem Toorop 29c1c9524e Include unbound includes rerouting in dist tarball
+ don't try to install getdns-*.tgz spec anymore
2017-03-22 12:32:26 +01:00
Willem Toorop a7c824c756 Update changelog and documentation 2017-03-22 11:52:07 +01:00
Willem Toorop 5d12545391 Bugfix in handling UDP backing off 2017-03-22 10:52:55 +01:00
Willem Toorop fa99b206e8 Updated readme & new groups for doxygen 2017-03-21 12:28:48 +01:00
Willem Toorop b838cbfe1c Bumb version 2017-03-20 23:22:55 +01:00
Willem Toorop fe446a0d66 Minor fixes 2017-03-20 23:17:44 +01:00
wtoorop 52e3d2e1b0 Merge pull request #265 from saradickinson/feature/new_settings
Feature/new settings
2017-03-20 22:25:52 +01:00
wtoorop 1ad8047443 Merge pull request #267 from wtoorop/features/mdns-client
Features/mdns client
2017-03-20 22:15:57 +01:00
Willem Toorop a5876d57fe Dependencies 2017-03-20 21:58:45 +01:00
Willem Toorop a77a335370 Comment out dead assignement
To silence static code analysis
2017-03-20 21:57:57 +01:00
Willem Toorop 24abf43de1 Fit mdns code with pending dns netreqs on EMFILE 2017-03-20 21:33:19 +01:00
Willem Toorop ed0d4d044c Merge remote-tracking branch 'upstream/develop' into features/mdns-client 2017-03-20 16:42:24 +01:00
Willem Toorop a3fe958387 Sync with unbound 2017-03-20 16:41:57 +01:00
wtoorop b8c5f9131f Merge pull request #266 from wtoorop/features/limit_outstanding_queries
Features/limit outstanding queries
2017-03-20 16:27:33 +01:00
Willem Toorop 0048066a2a Test op coding practices 2017-03-20 16:15:02 +01:00
Willem Toorop 0891e16147 Pend netreqs when out of filedescriptors 2017-03-20 15:20:17 +01:00
Willem Toorop 8b09633c94 Bug and mem-leak fix 2017-03-20 11:03:15 +01:00
Christian Huitema ed66edf52a Making sure that the project compiles on Windows when HAVE_MDNS_SUPPORT is present.
Moving the 2 additional LRU functions from mdns.c to lruhash.c
Defining the 2 additional functions in lruhash.h
2017-03-17 12:19:54 -07:00
Sara Dickinson 1cf39c9134 Typo 2017-03-17 18:33:33 +00:00
Sara Dickinson d8f4aebdee Merge branch 'feature/parallel_upstreams' into feature/new_settings 2017-03-17 17:48:52 +00:00
Sara Dickinson 915689141b Fix symbol order 2017-03-17 17:47:30 +00:00
Sara Dickinson 68eadedc10 Fix rogue bracket 2017-03-17 17:35:47 +00:00
Sara Dickinson 6f7bad5d73 Add new configuration parameters for TLS back off time and connection retries 2017-03-17 17:26:18 +00:00
Sara Dickinson dd76132a92 Implement round robin for UDP. Not sure this is the best option though. Noticed it results in more timeouts if one resolver isn't responding because it is retried more frequently. Willem - please review. 2017-03-17 17:16:14 +00:00
Sara Dickinson 1d4e3dd790 Update the name of the new option to 'round_robin_upstreams' 2017-03-17 16:53:03 +00:00
Sara Dickinson 6734a00d59 Improve the logging 2017-03-17 11:25:47 +00:00
Sara Dickinson 2a1a6768cb Add unit test and catch a typo 2017-03-16 16:26:34 +00:00
Sara Dickinson f0f3c43552 - Add a new mode where for TLS (and infact TCP too) the upstream selection simply cycles over all the upstreams rather than treating them as an ordered list and always using the first open one.
- Make IP field in debug output fixed width
- Collect all the one line config options at the top of the stubby.conf file to make it easier to read
2017-03-16 14:51:46 +00:00
Willem Toorop 5ea181172a Reschedule pending netreqs 2017-03-15 15:16:42 +01:00
Willem Toorop 14c9f3aafc Track netreqs "in flight" 2017-03-14 17:17:56 +01:00
Willem Toorop b8f43c8acd Mention the number of simultaneous queries in error (and success) 2017-03-14 15:20:56 +01:00
Willem Toorop 0655a08fa7 Unit test for set_limit_outstanding_queries 2017-03-14 15:03:43 +01:00
huitema d511ce24de Merge pull request #8 from wtoorop/features/mdns-client
Features/mdns client
2017-03-13 13:44:54 -07:00
huitema 8365f40147 Merge pull request #7 from wtoorop/devel/huitema-develop
Update of your develop branch
2017-03-13 13:39:09 -07:00
Willem Toorop 639239f45c Schedule dnsreqs with absolute timeout/expiry time 2017-03-13 14:20:47 +01:00
Willem Toorop a4fa931e85 Merge branch 'devel/huitema-develop' into features/mdns-client 2017-03-09 15:20:30 +01:00
Willem Toorop c4a93b2c53 Newline at end of mdns.c 2017-03-09 15:19:57 +01:00
Willem Toorop 79ce0cff85 Make mdns compile on Linux 2017-03-09 14:36:20 +01:00
Willem Toorop f1968d1e2c Merge branch 'devel/ub-symbol-mapping' into features/mdns-client 2017-03-09 13:09:56 +01:00
Willem Toorop 82c92f8dc7 Better dependency rewriting 2017-03-09 13:02:05 +01:00
Willem Toorop f751de696a Import lruhash and lookup3 from unbound 2017-03-09 12:08:53 +01:00
Willem Toorop 5b5123a79d HAVE_PTHREAD instead of HAVE_PTHREADS like unbound 2017-03-09 11:46:15 +01:00
Willem Toorop 5a2ee50de3 Have a define for any debugging 2017-03-09 11:40:39 +01:00
Willem Toorop dd656b7421 More comprehensible auxiliary directory names
(in src/util)
2017-03-09 10:44:38 +01:00
Willem Toorop 0ecaf163d9 Update original source directly 2017-03-08 23:14:24 +01:00
Willem Toorop e02442eb98 Original val_secalgo files + symbol mapping 2017-03-08 23:04:52 +01:00
Willem Toorop ec685e900d Map rbtree symbols 2017-03-08 22:10:22 +01:00
Willem Toorop 028dd0bf3c Configure option to enable draft mdns support 2017-03-08 21:25:39 +01:00
Willem Toorop de1ab4c8a4 Merge branch 'develop' into huitema-develop 2017-03-06 16:07:12 +01:00
Christian Huitema 4058529081 First version of the MDNS multicast client that actually works. 2017-03-03 16:52:02 -08:00
Melinda Shore 5f3de12644 Merge pull request #262 from wtoorop/features/base64_bindata
Features/base64 bindata
2017-02-28 15:01:43 -09:00
Willem Toorop 09baade016 Print pinsets Bas64 too
+ bugfix in reading base64
+ base64 pinsets in stubby.conf
2017-02-28 07:28:18 -08:00
Willem Toorop 6a9e2f4a56 Base64 primitive in json input 2017-02-27 16:22:52 -08:00
Willem Toorop bbd2fb8cf0 Although safe, a bit scary 2017-02-27 14:30:44 -08:00
wtoorop 94e1f48f58 Merge pull request #261 from saradickinson/feature/stubby_updates
Feature/stubby updates
2017-02-27 14:25:15 -08:00
Christian Huitema 03307a7b71 Code almost complete for the MDNS multicast + cache.
Of course, we still need a lot of testing.
2017-02-23 17:55:31 -08:00
Sara Dickinson 7c8605c3b1 And fix the whitespace... 2017-02-23 17:03:00 +00:00
Sara Dickinson f71dd2bf71 Re-order so checks pass! 2017-02-23 16:50:29 +00:00
Sara Dickinson ebdf657fd7 Change pins for IPv6 addresses for Sinodun privacy servers!
Improve logging of auth failure
2017-02-23 16:48:16 +00:00
Sara Dickinson ff4ecd5b39 Couple of extra output messages so Stubby users in strict mode know why the authentication failed 2017-02-23 15:38:45 +00:00
Sara Dickinson 1b7aef5a88 Add a new GETDNS_RETURN code for the case where no upstream is considered valid and hence a query cannot even be scheduled. Only applies when using purely stateful transports. This can happen when using Stubby if there are problems with connections to upstreams. 2017-02-23 14:49:17 +00:00
Sara Dickinson 356408955d Update the SPKI pin in the stubby.conf file for the Sinodun/Surfnet servers. 2017-02-23 13:55:43 +00:00
Sara Dickinson 09df4e2d5d Fix spacing error in stubby help output 2017-02-23 13:55:43 +00:00
Willem Toorop 4b6962cd9a Use __FUNC__ instead of function for protability
It is #defined to __FUNCTION__ or to __func__ depending on what configure detected.
2017-02-19 09:55:10 +01:00
Willem Toorop b3a06f1944 A bit more consistency in user_callback usage 2017-02-19 09:47:41 +01:00
Willem Toorop 8fccd66813 cancel_outstanding_requests by transaction_id
to prevent double frees as side effect of getdns_dns_req being canceled by user callbacks.
2017-02-19 09:39:10 +01:00
Melinda Shore c7ae2f5011 Merge pull request #260 from wtoorop/devel/fixed_eventloop
Devel/fixed eventloop
2017-02-18 12:59:18 -09:00
Willem Toorop ba7dfbeec0 Misplaced event clear in stub.c 2017-02-18 15:56:06 +01:00
Willem Toorop cbb407ae1e Merge branch 'develop' into devel/fixed_eventloop 2017-02-18 13:32:17 +01:00
Willem Toorop 09a727eadb git ignore tpkg tests cruft 2017-02-18 13:18:14 +01:00
Willem Toorop 74b1f77357 Cancel get validation chain getdns_dns_reqs
And miscellaneous little other scheduling fixes and optimizations
2017-02-18 13:16:25 +01:00
Willem Toorop a453678094 Debug the call to poll 2017-02-18 10:07:04 +01:00
Willem Toorop 7e9956b19e Call cancel callbacks only when callback exists 2017-02-17 23:39:35 +01:00
Willem Toorop 6ed3d77523 Cancel child validation chain dns_reqs on ...
parent dns_req cancelation.
2017-02-17 23:35:50 +01:00
Willem Toorop 990800d9f9 Bugfix poll_eventloop initialization error 2017-02-17 13:16:06 +01:00
Willem Toorop df45a2f1c7 Dependencies 2017-02-16 23:03:31 +01:00
Willem Toorop 91dd991348 Cancel requests without callback 2017-02-16 22:55:15 +01:00
Willem Toorop a6859a08d3 Remove getrlimit from poll_eventloop
No use to check for this limit, because the filedescriptor is already open.
2017-02-16 22:48:16 +01:00
Willem Toorop d20bbde25e Fixed time allocation and free for fd_events 2017-02-16 22:41:37 +01:00
Willem Toorop f6d46689b6 Fixed time allocation and free for to_events 2017-02-16 16:26:41 +01:00
Willem Toorop 2d35993c83 Timeout events in array 2017-02-16 15:22:57 +01:00
Willem Toorop e87e907128 Constants for Edward Curves 2017-02-16 11:01:48 +01:00
wtoorop 17a5a5db92 Merge pull request #258 from wtoorop/devel/_vfixed_gbuffers
A special bit for the snprintf style modus operandi of fixed gldns gbuffer's
2017-02-16 10:51:20 +01:00
Willem Toorop 445470d831 Rename a gldns function 2017-02-16 10:32:17 +01:00
Melinda Shore c72d74a0fa Merge pull request #259 from wtoorop/devel/fixed_eventloop
Devel/fixed eventloop
2017-02-15 10:25:45 -09:00
Willem Toorop e4eddca259 Reference event_info directly 2017-02-15 15:10:11 +01:00
Willem Toorop 7b6b0ff642 No helper copy variables 2017-02-15 14:57:30 +01:00
Willem Toorop c805d40585 Clean in place executed unit tests 2017-02-15 14:04:34 +01:00
Willem Toorop b2fe9673de Fix realloc pfds set error + callback order error 2017-02-15 13:08:47 +01:00
Willem Toorop 04f6a2b13b Fixed dependencies 2017-02-15 12:47:55 +01:00
Willem Toorop 840ba8c85d Reference fixes jsmn 2017-02-15 12:46:48 +01:00
Willem Toorop b7c2e53a82 Off by one problem? 2017-02-15 12:21:29 +01:00
Willem Toorop 3e8822e0e2 Fix uninitialized data error in valgrind check 2017-02-15 11:43:07 +01:00
Willem Toorop c936f0c51d Other allocs and frees with custom mem funcs too 2017-02-15 10:56:19 +01:00
Willem Toorop 7484b8c37b Initialize default eventloop with custom mem funcs 2017-02-15 10:22:41 +01:00
Christian Huitema 6d3e0c7ca2 Rewrote the continuous query organization to use the LRU cache instead of an RB tree. 2017-02-14 11:30:29 -10:00
Willem Toorop 549de0de60 Use of custom mem funcs by uthash 2017-02-14 13:41:58 +01:00
Christian Huitema 1587e2f8f5 Code to manage the MDNS cache using LRUHASH 2017-02-13 18:28:46 -10:00
Willem Toorop 30e1683d2f Deal with windows vsnprintf in config.h 2017-02-13 12:32:10 +01:00
Willem Toorop 60443fb7fd Choice of poll or select based default event loop 2017-02-13 11:56:25 +01:00
Willem Toorop 2b9987014d Special _vfixed gbuffer property
For snprintf style buffers which position can go beyond capacity
2017-02-08 13:51:25 +01:00
Christian Huitema 93d6f2b18f Intermediate commit, after definition of the MDNS context 2017-02-06 18:23:35 -10:00
Christian Huitema 4c71d6239f Fixing potential bug for comparision function net_req_query_id_cmp on 64 bits architectures. 2017-01-21 14:49:58 -08:00
Christian Huitema 4ccfa2a781 Preparing fix for 64 bit warning in net_req_query_id_cmp 2017-01-21 14:46:38 -08:00
Christian Huitema 83ec9b74e9 Merge branch 'develop' of https://github.com/huitema/getdns into develop
Conflicts:
	src/jsmn
2017-01-20 19:57:11 -08:00
Christian Huitema 31eee9c7d1 Intermediate commit of context.h, mdns.[ch] 2017-01-20 19:44:05 -08:00
Christian Huitema abd0244aba Fixing a potential bug in the RB tree for netreq_by_id 2017-01-20 19:33:12 -08:00
huitema b72781a395 Merge pull request #6 from getdnsapi/develop
Aligning with main branch
2017-01-18 16:28:59 -08:00
Neil Cook dad4aaf6d8 correctly allocate and free memory for eventloop hashes 2017-01-18 15:31:01 +00:00
Neil Cook fd3e0c01f7 call default_time_cb with -1 instead of index 2017-01-18 15:12:56 +00:00
Neil Cook 69d1bd6de5 Merge pull request #2 from wtoorop/devel/fixed_eventloop
Devel/fixed eventloop
2017-01-18 13:44:40 +00:00
Willem Toorop f1c44dc15c Merge branch 'develop' into devel/1.1.0 2017-01-18 14:40:32 +01:00
Willem Toorop 17da80a828 Feed poll with millisecond timeout 2017-01-18 14:29:32 +01:00
Willem Toorop 45ee18e285 Merge branch 'fixed_eventloop' of https://github.com/neilcook/getdns into neilcook-fixed_eventloop 2017-01-18 12:05:32 +01:00
Willem Toorop 7bf953b2bd Merge branch 'huitema-develop' into develop 2017-01-18 12:00:33 +01:00
Willem Toorop f4cd8f6b47 Fix constants 2017-01-13 22:38:23 +01:00
Willem Toorop 7c1c4c52d6 Merge branch 'release/1.1.0-alpha3' into develop 2017-01-13 22:10:17 +01:00
Willem Toorop 9c9c52aacc Merge branch 'develop' into release/1.1.0-alpha3 2017-01-13 22:08:59 +01:00
Willem Toorop b564c8d96f Few things for the scroll-spy README on the website 2017-01-13 21:34:06 +01:00
Willem Toorop 9320364053 Fix two more sign-compare warnings 2017-01-13 21:28:07 +01:00
Willem Toorop bb369ec7d9 Document limits of syncronous functions
As agreed in conversation with pull request #246
2017-01-13 21:12:48 +01:00
Willem Toorop 155ceede4c Unuser variables with --without-libidn 2017-01-13 20:49:26 +01:00
Willem Toorop e80d3340c6 Coverage linking + missing constant in str2int 2017-01-13 20:43:04 +01:00
Willem Toorop cf3d4a4b2e Create SHA256 with distro 2017-01-13 20:29:19 +01:00
Willem Toorop 8a66ba0185 Bump version, update ChangeLog 2017-01-13 20:22:49 +01:00
Willem Toorop cd199def68 Cookies and roadblock avoidance on by default
per RFC7873 and RFC8027
2017-01-13 19:45:54 +01:00
Willem Toorop 25849645d4 Don't crash with missing trust-anchors 2017-01-13 13:42:16 +01:00
Willem Toorop bb0ad001e7 Fix non existant domain names 2017-01-13 12:59:16 +01:00
Willem Toorop 9a3b01ed62 DSA support with OpenSSL 1.1.0 2017-01-13 12:48:15 +01:00
Christian Huitema 53d73d2f90 Implementing the ARC4_LOCK/UNLOCK functions for Windows. 2017-01-13 12:24:46 +01:00
Willem Toorop 835eaa855b autoclean for cleaning with autoconf initialization 2017-01-11 15:08:35 +01:00
Christian Huitema 99fb7100ea Placing all MDNS code under ifdef HAVE MDNS SUPPORT to minimize risk in main branch. 2016-12-22 20:30:14 -08:00
Christian Huitema 1d24c90768 Fixing bad declaration in mdns.h 2016-12-22 20:07:31 -08:00
Christian Huitema 2e46a4b136 Adding missing directives for mdns.c, .o, .lo in make file. 2016-12-22 19:37:49 -08:00
Christian Huitema f1b8b25afa Implementation of basic MDNS support 2016-12-22 15:51:47 -08:00
Neil Cook 7ebf3924b5 Copy event pointer out of event hash table before callbacks, because it might be deleted 2016-12-16 10:36:21 +00:00
Neil Cook 5e26137eda Fix default_eventloop_run OR instead of AND and hash table iteration safety 2016-12-15 13:40:40 +00:00
Neil Cook efb50939bc Merge pull request #1 from wtoorop/devel/fixed_eventloop
Devel/fixed eventloop
2016-12-15 11:20:45 +00:00
Willem Toorop 9b715d4743 Suppress compile warnings 2016-12-15 09:53:49 +01:00
Willem Toorop da527358c0 Merge branch 'develop' into devel/fixed_eventloop 2016-12-15 09:45:16 +01:00
wtoorop d3b7a30651 Merge pull request #218 from neilcook/openssl_init
call SSL_library_init() just once and lock with mutexes
2016-12-15 08:29:58 +01:00
wtoorop 7e1c8c59b7 Merge pull request #242 from wtoorop/bugfix/replace__FUNCTION__
Use __func__ var when supported
2016-12-15 08:26:01 +01:00
wtoorop be29a01b20 Merge pull request #243 from wtoorop/bugfix/1.1.0-alpha3/replace__FUNCTION__
Use __func__ var when supported
2016-12-15 08:25:51 +01:00
Neil Cook 0d39563978 Consisten use of TIMEOUT_FOREVER 2016-12-14 17:50:39 +00:00
Neil Cook c1d5ae9a25 set event id in add_event rather than calling function 2016-12-14 17:04:09 +00:00
Neil Cook e9e6ff013b Fix travis compiler warnings/errors 2016-12-14 16:49:24 +00:00
Neil Cook 326b6bb410 remove redundant debugging 2016-12-14 16:10:44 +00:00
Neil Cook 5cc4028d63 cleanup poll.h include for non-windows 2016-12-14 15:54:10 +00:00
Neil Cook d3b097fffe Rewrite default_eventloop to use hash tables instead of arrays 2016-12-14 15:52:44 +00:00
Neil Cook a9386e621a max_fds and max_timeouts part of default eventloop structure 2016-12-14 15:50:55 +00:00
Neil Cook 8b4c90eaf4 move default eventloop from select to poll, make max fds dependent on value from getrlimit not FD_SETSIZE 2016-12-14 15:50:55 +00:00
Christian Huitema e01c85ef2f Implementing the ARC4_LOCK/UNLOCK functions for Windows. 2016-12-12 12:25:10 -08:00
huitema 79b47028b1 Merge pull request #5 from getdnsapi/develop
Merge pull request #241 from huitema/develop
2016-12-12 11:34:51 -08:00
Willem Toorop 80219a4195 Merge branch 'bugfix/replace__FUNCTION__' into bugfix/1.1.0-alpha3/replace__FUNCTION__ 2016-12-12 14:20:31 +01:00
Willem Toorop 5f6b93f7f2 Use __func__ var when supported
And let debugging messages compile with -Wpedantic -Werror too
2016-12-12 13:55:10 +01:00
Willem Toorop 600036da73 Merge branch 'develop' into release/1.1.0-alpha3 2016-12-12 12:08:49 +01:00
wtoorop 8f833c7000 Merge pull request #240 from saradickinson/bugfix/key_pinning
Bugfix/key pinning
2016-12-12 11:58:23 +01:00
wtoorop 4518a3d672 Merge pull request #241 from huitema/develop
Fixing VS code analysis issues in dnssec.c and in arc4random.c
2016-12-12 10:33:35 +01:00
Sara Dickinson 83a0b944b5 Fix another stupid error.... 2016-12-11 17:10:44 +00:00
Sara Dickinson d584c6e3f5 Clean more compile warnings. 2016-12-11 16:58:18 +00:00
Sara Dickinson cfc7d18c85 Ug. Fix stupid mistake with string array. 2016-12-11 16:57:52 +00:00
Christian Huitema b91e13b13b Fixing VS studio analysis issues in Get DNS code. 2016-12-10 16:03:17 -08:00
huitema a4badbb058 Merge pull request #4 from getdnsapi/develop
Sync the main branch fixes of Dec 9.
2016-12-09 17:32:41 -08:00
Sara Dickinson ef12b0e764 Fix some compiler warnings on OS X 2016-12-09 17:15:28 +00:00
Sara Dickinson 5d8894495a Remove unnecessary test 2016-12-09 17:03:41 +00:00
Sara Dickinson 7567869f2c Improve transport tests by using the calll_reporting output to check the transport and authentication status
Add cases for self-signed certs.
2016-12-09 17:03:41 +00:00
Sara Dickinson 7b58dc25a6 - Fix bug where a self signed cert + only a pinset would not authenticate
- Add OARC servers with pinset only to stubby.conf
- Move Authentication strings to types_internal for use in call_debugging
- Add connection counts to call_debugging
-
2016-12-09 17:03:41 +00:00
Willem Toorop 1264099be7 Pedantic warnings and XTRA_CFLAGS for tools too 2016-12-09 14:02:27 +01:00
Willem Toorop 8b454afb80 dependencies 2016-12-09 13:57:42 +01:00
Willem Toorop 07c14dc1cc Merge branch 'develop' into release/1.1.0-alpha3 2016-12-09 13:57:37 +01:00
Willem Toorop bb9ae2dfa1 Fix use of potentially uninitialized variable next 2016-12-09 13:53:22 +01:00
Willem Toorop 9fb11368a5 dependencies 2016-12-09 13:52:00 +01:00
Willem Toorop 37cced78fc Merge branch 'develop' into release/1.1.0-alpha3 2016-12-09 13:27:55 +01:00
Willem Toorop 4345905a81 Address things that came out of VS static analysis
Except for the stack usage cases
2016-12-09 12:57:47 +01:00
Willem Toorop 3428412629 Some more minor merge fixes 2016-12-09 12:13:36 +01:00
Willem Toorop 5cc67ff554 Merge branch 'develop' into merge-develops 2016-12-09 12:05:42 +01:00
Willem Toorop 9895486e5f Merge branch 'develop' of git://github.com/huitema/getdns into huitema-develop 2016-12-09 11:21:43 +01:00
Willem Toorop 1a26b884ee Check for -W* support before use 2016-12-09 00:16:24 +01:00
Willem Toorop 86341fea08 -Wpedantic -Werror via XTRA_CFLAGS and make 2016-12-08 23:41:49 +01:00
Willem Toorop 6e9b1b5f53 One more unused when no TCP_FASTOPEN 2016-12-08 23:25:53 +01:00
Willem Toorop 26db6202a5 -Werror fixes for clang 2016-12-08 23:15:56 +01:00
Willem Toorop 8de9976a2b Some more unused variables in stub only mode 2016-12-08 22:56:02 +01:00
Willem Toorop eeca7b32b1 One more unused variable 2016-12-08 22:46:53 +01:00
Willem Toorop 55cdd8fed3 Fix pedantic warnings in unit tests 2016-12-08 22:33:10 +01:00
Christian Huitema 26eaf255c5 Fixing the bulk of the compilation warnings in the GetDNS code 2016-12-08 12:37:35 -08:00
Willem Toorop 2281accd38 Extra fixes for pedantic warnings 2016-12-08 16:36:23 +01:00
Willem Toorop 9d48c47980 Merge branch 'develop' into release/1.1.0-alpha3 2016-12-08 16:31:47 +01:00
Willem Toorop fbb4eb717a Unit tests fail on pedantic warnings 2016-12-08 16:28:21 +01:00
Willem Toorop 39f854d2b3 Fixes for pedantic warnings 2016-12-08 16:27:43 +01:00
Willem Toorop ce41258b14 Compile with extra warnings by default 2016-12-08 16:26:48 +01:00
Willem Toorop 8f75e4ed8d Few more things to work with CFLAGS=-Wextra 2016-12-08 15:17:27 +01:00
Willem Toorop f31b2fa233 Merge branch 'develop' into release/1.1.0-alpha3 2016-12-08 15:06:25 +01:00
Willem Toorop 743e04bfd6 Replace ((uint64_t)-1) with TIMEOUT_FOREVER 2016-12-08 14:44:24 +01:00
Willem Toorop 3629d558cd getdns_query fixes for CFLAGS=-Wextra 2016-12-08 14:40:06 +01:00
Willem Toorop a5748be5fb Unit test fixes for CFLAGS=-Wextra 2016-12-08 14:39:38 +01:00
Willem Toorop 473da8966b Library fixed for CFLAGS=-Wextra 2016-12-08 14:05:58 +01:00
wtoorop 984fbf5042 Merge pull request #237 from huitema/develop
Fix the potential clipping of idle_timeout value in calls to upstream_reschedule_events()
2016-12-08 12:21:16 +01:00
Willem Toorop 21303fa40a Sync gldns with unbound's sldns 2016-12-08 11:07:37 +01:00
Christian Huitema 50b064a292 Fixing potential clipping of idle_timeout value in call to upstream_reschedule_events 2016-12-07 15:40:24 -08:00
huitema 4549bb5723 Merge pull request #2 from getdnsapi/develop
Merge pull request #233 from huitema/develop
2016-12-07 09:55:46 -08:00
wtoorop 1221171438 Merge pull request #234 from saradickinson/stubby_enhancements
Stubby enhancements
2016-12-07 14:41:59 +01:00
wtoorop c824316340 Merge pull request #233 from huitema/develop
Remainder of changes for Christian's Windows port.
2016-12-07 10:32:33 +01:00
huitema 702fe1f5d9 Update default_eventloop.c 2016-12-06 12:32:44 -08:00
Sara Dickinson 691d32cf80 Improve README entry on stubby. Add a link to dnsprivacy.org (Willem - is this set up yet?)
Add sample Strict config file into the source with a pointer from the README. Not sure about installing this yet as opportunistic seems a better default...?
2016-12-06 15:59:40 +00:00
Sara Dickinson 471e8725e2 Change the default profile for Stubby to use TLS then UDP/TCP
- this will only try over TLS a few times before backing off to clear text
  - but makes the default  for Stubby opportunistic privacy (Willem - WDYT?)
Also use padding and ECS privacy by default for Stubby.
More debugging to help users when there are failures or fallbacks.
Also remove a few help options from Stubby that don't apply
Add -v to output version on getdns_query/stubby
2016-12-06 14:44:40 +00:00
Christian Huitema dee33f53b6 Reminder of changes required by the Windows port. This solves the issues 228, 229, 230 and 232. 2016-12-05 11:38:59 -08:00
huitema 598d7d103e Merge pull request #1 from getdnsapi/develop
Merge pull request #231 from huitema/develop
2016-12-05 10:57:43 -08:00
Sara Dickinson 576e38977f More logging changes to stubby to correctly report profile, transport and stats for TCP and UDP when used as fallbacks.
Reporting UDP stats every 100 responses or timeouts to give user some indication UDP is being used.
2016-12-05 18:05:04 +00:00
wtoorop fd97d2724d Merge pull request #231 from huitema/develop
Fixing several issues in function set_os_defaults_windows that preven…
2016-12-05 11:02:07 +01:00
Christian Huitema 0d13ae6d72 Fixing several issues in function set_os_defaults_windows that prevent working on Windows. 2016-12-04 17:26:38 -08:00
Sara Dickinson 1ba2e5bf4d Add stubby to readme.
Add transport to stubby log.
2016-11-20 11:19:08 +00:00
wtoorop 133426b7db Merge pull request #221 from saradickinson/hackathon
Minor logging updates
2016-11-13 13:19:15 +09:00
Sara Dickinson b0e5f87984 Minor logging updates 2016-11-13 13:14:03 +09:00
saradickinson 4ebe5411ec Merge pull request #219 from dkg/pinning-non-ee-cert
Allow public key pins higher in the chain than the EE cert
2016-11-12 18:59:24 +09:00
Daniel Kahn Gillmor 73165b235f Allow public key pins higher in the chain than the EE cert
This resolves an old TODO; we'd never tested pinning any certs higher
than the end-entity cert before.
2016-11-12 16:53:21 +09:00
Willem Toorop c2bcd1ca72 Line up OPT rdata names with add_opt_parameters 2016-11-12 14:31:27 +09:00
Sara Dickinson 1593129b85 Fix mishandling of auth state for name mismatch 2016-11-09 16:41:40 +00:00
Neil Cook b857e3d7f1 call SSL_library_init() just once and lock with mutexes 2016-11-08 11:51:27 +00:00
Willem Toorop 57e2a18f94 Minor fixes to make it compile on Windows again 2016-11-03 15:35:53 +01:00
Willem Toorop 258e59242b Merge remote-tracking branch 'upstream/develop' into release/1.1.0-alpha3 2016-11-03 14:27:50 +01:00
Willem Toorop cef2e3e5d4 Merge remote-tracking branch 'upstream/develop' into develop 2016-11-03 14:25:23 +01:00
wtoorop ef80f463c2 Update README.md
Properly format MS-Windows build instructions.
Thanks Christian Huitema
2016-11-03 14:19:49 +01:00
Willem Toorop c54a22d95b Binary API changed 2016-11-02 13:43:09 +01:00
Willem Toorop 4bf93de12b More conventional function prototypes for servers 2016-11-02 13:40:02 +01:00
Willem Toorop bc9ebd5ae2 RFC3986 IPv6 address/port parsing for str2dict
Resolves issue #215, but does not deal with RFC3986 formatted IPv6 addresses in config files yet.
2016-10-31 13:47:22 +01:00
Willem Toorop 6e5b62c555 Allow conventional IPv6 address/port parsing
from getdns_query
2016-10-31 13:36:05 +01:00
wtoorop 9569e3607e Merge pull request #216 from wtoorop/develop
Openssl 1.1.0 support (for the 1.0.0 release)
2016-10-31 11:36:58 +01:00
Willem Toorop 6fe4b5a6d9 Merge remote-tracking branch 'upstream/develop' into develop 2016-10-31 11:24:06 +01:00
Willem Toorop f66bb6a812 Ignore stubby ;) 2016-10-31 11:22:16 +01:00
Willem Toorop c0f20a9023 Merge branch 'develop' into release/1.1.0-alpha3 2016-10-31 11:12:26 +01:00
Willem Toorop 72788cb172 OpenSSL 1.1.0 version of CRYPTO_w_lock in pinning
Thanks volkommenheit
2016-10-31 11:04:36 +01:00
Willem Toorop bb3d741f7a OpenSSL 1.1 support 2016-10-31 10:24:07 +01:00
Willem Toorop 2b682bc3a9 Merge remote-tracking branch 'upstream/develop' into release/1.1.0-alpha3 2016-10-27 16:17:44 +02:00
wtoorop 45643b6da5 Merge pull request #213 from neilcook/arc4locks
pthread-based locking for arc4random
2016-10-27 15:55:38 +02:00
Neil Cook db6cee94fa Fix HAVE_PTHREADS define in configure.ac 2016-10-26 15:47:44 +00:00
Neil Cook 393b24fe89 pthread-based locking for arc4random 2016-10-26 14:32:35 +00:00
Willem Toorop 3fa34dcfca Mention the actual missing dependencies 2016-10-26 15:52:22 +02:00
Willem Toorop 4ea4f68467 Get_suffix, no '\0' in returned strings
Resolves issue #203
2016-10-26 15:29:07 +02:00
Willem Toorop cbe451274b Bump version 2016-10-25 11:09:37 +02:00
Willem Toorop 24de66e6ce Merge branch 'bugfix/auth_retry' into release/1.1.0-alpha3 2016-10-25 11:09:07 +02:00
Sara Dickinson a0ae9130cc Fix issue with session re-use making authentication appear to fail 2016-10-21 14:18:24 +01:00
Willem Toorop bc70b29416 Stubby release 2016-10-19 07:30:31 -05:00
Willem Toorop 732844eeaa Correct default config 2016-10-16 09:46:02 -05:00
Willem Toorop 05fb6edfcb Linking to allow running stubby from src/tools 2016-10-16 05:39:04 -05:00
Willem Toorop 838375fe66 Run stubby in foreground by default 2016-10-16 05:32:05 -05:00
saradickinson 3cea710dc5 Merge pull request #210 from wtoorop/features/stubby
Features/stubby
2016-10-16 10:24:25 +01:00
Willem Toorop 0fa8152bb6 Bump version to alpha 2
-a2 (with dash) to be semver format compliant
2016-10-15 06:07:33 -05:00
Willem Toorop ec04dc21ee Stubby defaults in help text 2016-10-14 10:14:38 -05:00
Willem Toorop 3d356bd35e Stubby runs in background by default 2016-10-14 09:51:17 -05:00
Willem Toorop 58b5ead67a Make stubby act as stubby 2016-10-14 08:24:25 -05:00
Willem Toorop 3f965e68c0 Stubby is getdns_query with a different name 2016-10-14 12:02:23 +02:00
Willem Toorop 47e718eeb8 OpenSSL 1.1 support 2016-10-13 23:04:50 +02:00
Willem Toorop c84ff93e4f Anticipate Mac OS X glibtoolize 2016-08-25 12:40:02 +02:00
saradickinson 1d34fcbdd5 Merge pull request #206 from saradickinson/feature/upstream_handling
Feature/upstream handling
2016-08-10 18:48:00 +02:00
Sara Dickinson f156f2f24a Had to change some preprocessor checks to get all the options to compile 2016-08-08 17:07:46 +01:00
Sara Dickinson 6f9bfffe9f Catch another error path for failed connections 2016-08-08 16:12:33 +01:00
Sara Dickinson fdbefa17ec Add timer for back off on upstream (use 1 hr). Reset as new upstream when re-instated. 2016-08-05 17:25:27 +01:00
Sara Dickinson a1461d51ec Add abbreviated logging mode for daemon 2016-08-05 14:10:55 +01:00
Sara Dickinson 0432fe37c4 Tinker with upstream keepalive 2016-08-04 16:10:23 +01:00
saradickinson 7f2fcca80d Merge pull request #205 from saradickinson/merge/doc_changes
Merge/doc changes
2016-08-04 17:08:10 +02:00
Sara Dickinson b1cc7750df Merge commit '5c6f03632613aaa3b29972844b16ff0b11f8f8d8' into merge/doc_changes 2016-08-04 16:02:44 +01:00
Sara Dickinson 5c6f036326 Further updates 2016-07-21 20:25:31 +02:00
Willem Toorop 8ba8f774a9 Merge branch 'develop' into release/v1.1.0a1 2016-07-21 12:30:01 +02:00
Willem Toorop 96060ed6ae Update README, credit Andrew 2016-07-21 12:24:41 +02:00
Willem Toorop 3372f6cf26 update release-procedure.txt 2016-07-21 12:19:39 +02:00
Willem Toorop a1e73b98a6 Merge remote-tracking branch 'upstream/release/v1.1.0a1' into release/v1.1.0a1 2016-07-21 11:38:37 +02:00
Willem Toorop a7e5f65f65 Merge branch 'develop' into release/v1.1.0a1 2016-07-21 11:35:03 +02:00
Willem Toorop 412c9190f8 Merge branch 'andrew-develop' into develop 2016-07-21 11:31:15 +02:00
Willem Toorop 5389a84173 Merge remote-tracking branch 'upstream/develop' into develop 2016-07-18 15:27:35 +02:00
wtoorop b4a6fe0499 Merge pull request #201 from jelu/h-type-fix
Use type and not struct
2016-07-18 15:02:50 +02:00
Jerry Lundström 8c54142790 Use type and not struct 2016-07-17 11:44:34 +02:00
Andrew Sullivan 17670cbf97 Reorganise README for a new user to the project. Remove some things that are fixed/altered. 2016-07-16 14:13:34 -04:00
Willem Toorop a7dc50f865 Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-14 20:09:07 +02:00
Willem Toorop 22c1eb7f3f Update list of contributors 2016-07-14 20:08:02 +02:00
Melinda Shore 0a030bd8ae Merge pull request #199 from wtoorop/release/v1.1.0a1
Release/v1.1.0a1
2016-07-14 09:22:17 -07:00
Melinda Shore ac6e50f24a Merge pull request #198 from wtoorop/release/v1.0.0b2
Release/v1.0.0b2
2016-07-14 09:13:42 -07:00
Willem Toorop 903605570b Doxygen documentation of the new prototypes 2016-07-14 17:57:17 +02:00
Willem Toorop c57f8874ec Lib versioning for 1.1.0 2016-07-14 16:25:32 +02:00
Willem Toorop 612c4b1547 Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-14 16:24:52 +02:00
Willem Toorop d67507fff8 Actually do lib versioning too! 2016-07-14 16:24:02 +02:00
Willem Toorop 94292f5bc7 Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-14 16:22:53 +02:00
Willem Toorop f685a0c8b8 Unsigned expression >= 0 is always true 2016-07-14 16:18:50 +02:00
Willem Toorop d9a089a6a0 Update .so versioning 2016-07-14 16:00:55 +02:00
Willem Toorop 0736453bed Doxygen fixes 2016-07-14 15:53:53 +02:00
Willem Toorop 255cc9ab36 First bit of set_from_os loads OS defaults 2016-07-14 15:42:49 +02:00
Willem Toorop 7c7c58604f Update ChangeLog 2016-07-14 15:24:59 +02:00
Willem Toorop 65a46e1026 Update ChangeLog 2016-07-14 15:20:13 +02:00
Willem Toorop 84458d68c4 Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-14 15:19:28 +02:00
Willem Toorop 9cb38bc822 Release today 2016-07-14 15:18:27 +02:00
Willem Toorop e857f680ce Dependencies (but this time good) 2016-07-14 15:05:46 +02:00
Willem Toorop 0340b74604 Dependencies 2016-07-14 15:04:19 +02:00
Willem Toorop 8b31ad5df1 Logic error 2016-07-14 15:03:47 +02:00
Willem Toorop 80ea8637d1 Recover src/tools 2016-07-14 14:50:26 +02:00
Willem Toorop ebba1d4cce Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-14 14:45:16 +02:00
Willem Toorop d59dfb6609 New commits in src/test/jsmn 2016-07-14 14:33:24 +02:00
Willem Toorop 99d8672bee Fix few possible NULL dereference issues 2016-07-14 14:24:32 +02:00
Willem Toorop 689fc02fd2 Allow errors while setting up listeners 2016-07-14 14:14:15 +02:00
Willem Toorop bae426a0e2 Unread assignment 2016-07-14 14:09:08 +02:00
Willem Toorop 906a8d68c2 fix for converting empty lists and dicts 2016-07-14 14:06:00 +02:00
Willem Toorop 2485c11e32 Include jsmn in dist tarball 2016-07-14 14:02:29 +02:00
Willem Toorop ea69d31dba move getdns_query to src/tools 2016-07-14 13:54:58 +02:00
Willem Toorop af70671641 parentheses around comparison in operand of ‘&’ 2016-07-14 13:46:12 +02:00
Willem Toorop b4e7a82e11 EDNS0 padding is RFC 2016-07-14 13:40:49 +02:00
Willem Toorop 74b57d4679 Resync utils with unbound source 2016-07-14 13:33:11 +02:00
Willem Toorop 470fb7a5fb !0 is not necessarily 1 2016-07-14 11:42:21 +02:00
Willem Toorop fed4818c27 Fix idle_timeout without keepalive for TLS 2016-07-14 11:03:33 +02:00
wtoorop 79f92cedd2 Merge pull request #197 from saradickinson/feature/upstream_handling
Feature/upstream handling
2016-07-14 10:58:32 +02:00
Sara Dickinson 6c73144b50 Minor logging updates 2016-07-13 17:39:26 +01:00
saradickinson d25d60cc3e Merge pull request #195 from wtoorop/release/v1.1.0a1
Release/v1.1.0a1
2016-07-13 16:46:54 +01:00
saradickinson 9a81791bc9 Merge pull request #196 from wtoorop/release/v1.0.0b2
Release/v1.0.0b2
2016-07-13 16:40:15 +01:00
Willem Toorop 504cb8a783 Merge branch 'develop' into release/v1.1.0a1 2016-07-13 15:55:17 +02:00
Willem Toorop b26d69384f Merge branch 'develop' into release/v1.0.0b2 2016-07-13 15:52:14 +02:00
Willem Toorop 31f1375b8e Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-13 15:30:28 +02:00
Willem Toorop 9f7ceeded3 Don't SSL_library_init() on every context create
It will not be called when the second bit from the set_from_os parameter is set.
This deals with issue #117
2016-07-13 15:28:08 +02:00
Willem Toorop be97bd1d71 Mv getdns_context_set_listen_addresses in the lib
Also, check for request_id +
cancel a reply by specifying NULL as response to getdns_reply
2016-07-13 14:50:44 +02:00
Willem Toorop 69b607176c Move getdns_context_config into the library 2016-07-11 20:42:50 +02:00
Willem Toorop 7cbbad67aa Merge branch 'release/v1.0.0b2' into release/v1.1.0a1 2016-07-11 16:06:52 +02:00
Willem Toorop a523838cc6 set_listen_addresses does not change listen_list 2016-07-11 16:05:05 +02:00
Willem Toorop b98d91f745 Daemon edns0 handling bugfix 2016-07-11 15:43:42 +02:00
Willem Toorop 7e614bc534 More conventional server DNSSEC behaviour
+ documentation of behaviour
2016-07-11 15:13:40 +02:00
Willem Toorop d0f01b6bc4 Default values for extensions in context 2016-07-07 14:47:38 +02:00
Sara Dickinson 105d7acfa9 Just re-read RFC7858 and realised that TLS does support idle connections without keepalive. It is just TCP that doesn't. 2016-07-04 17:02:18 +01:00
Sara Dickinson 5e1575dabc Correct the logic for upstream back off 2016-07-04 17:02:18 +01:00
Sara Dickinson 8fa84c836a Initial re-work of stateful transport selection and timeout/error handling. Also update transport test to avoid timeout. 2016-07-04 17:02:14 +01:00
Willem Toorop e0eb39a295 Move str2getdns type functions in the library 2016-07-04 16:57:27 +02:00
Willem Toorop df540ad5ca Bumb version 2016-07-04 16:13:30 +02:00
Willem Toorop f1b2dbeaa7 Merge branch 'devel/str2dict-maintenance' into release/v1.0.0b2 2016-07-04 15:54:49 +02:00
Willem Toorop cc104320e8 Get RR types and classes from constant names 2016-07-04 15:54:05 +02:00
Willem Toorop 92fd79ff55 Update Changelog 2016-07-04 14:50:02 +02:00
Willem Toorop 91f3494a8a Bumb version to 1.0.0b2 2016-07-04 14:49:45 +02:00
Willem Toorop b99b7511ec Generalize str2ipaddr_dict conversion 2016-07-04 12:58:23 +02:00
wtoorop a55c8ab377 Merge pull request #194 from saradickinson/documentation/doxygen_updates2
Make just the src/getdns files part of doxygen by default.
2016-07-04 12:47:57 +02:00
wtoorop 4e6e6e314a Merge pull request #193 from saradickinson/bugfix/transport_test2
Bugfix/transport test2
2016-07-04 12:43:26 +02:00
Sara Dickinson ecb169c705 Add notes on transport implementation irregularities 2016-07-02 15:44:32 +01:00
Melinda Shore 0e36a3b852 Merge pull request #192 from wtoorop/bugfix/transport_test
Bugfix/transport test
2016-07-01 16:26:26 -08:00
Sara Dickinson ec09d6b8a4 Make just the src/getdns files part of doxygen by default.
Add documentation to cover getdns_extra.h. Re-org of functions to align better with getdns.h Also some work on the README.
2016-07-01 17:53:45 +01:00
Sara Dickinson 03a994af50 Fix recursing_6 test 2016-06-30 15:10:41 +01:00
saradickinson 3f29bfa212 Merge pull request #1 from wtoorop/bugfix/transport_test
Own root server with TCP only full recursion test
2016-06-29 11:36:46 +01:00
Willem Toorop 080b338a8f Explain own root server necessity in transport_7
Also query for the consistently large record and not the DNSKEY (which is sometimes large and sometimes not)
2016-06-29 12:32:51 +02:00
Melinda Shore 8318766593 Merge pull request #191 from wtoorop/devel/decompose-getdns_query
Devel/decompose getdns query
2016-06-28 16:36:13 -08:00
Willem Toorop cfaf15f54c When reply comes before request schedule ...
... transaction_id will not be set.
Is this problematic?
2016-06-28 16:53:26 +02:00
Willem Toorop dd03a29b00 Small memory leak fix in set_listen_addresses 2016-06-28 16:34:17 +02:00
Willem Toorop ed9912fae2 On the fly listen_addresses with getdns_query 2016-06-28 15:48:31 +02:00
Willem Toorop ce415a6e2a setup server debugging messages 2016-06-28 15:06:02 +02:00
Willem Toorop 62750b505f Own root server with TCP only full recursion test 2016-06-28 14:39:51 +02:00
wtoorop 61bcf0e5b7 Merge pull request #186 from saradickinson/documentation/doxygen_updates
Initial pass at updating Doxygen modules for getdns.h. Also add info …
2016-06-28 12:05:54 +02:00
wtoorop 66b7bb2ca1 Merge pull request #190 from saradickinson/bugfix/transport_test
Split the recursive transport test 6 into 3 and add a shorter timeout…
2016-06-28 11:54:58 +02:00
wtoorop 771a7dd43c Merge pull request #189 from wtoorop/devel/codebase-maintenance
s/inline static/static inline/g

Small change and "static inline" is the only portable (C99) construct
2016-06-28 11:49:14 +02:00
Willem Toorop dc7bc4d116 Add and remove listen addresses
Following the algorithm suggested by Shane Kerr:

   # figure out the new addresses to add and the old ones to remove
   to_add, to_remove = compare_addresses(current_set, new_set)

       # add our new addresses
       added = []
          for address in to_add:
                  if set_up_address(address) == SUCCESS:
                          added.add(address)
            else:
                    # if we have an error, remove any of those addresses
                    # that we have added so far and return error
                    for address in added:
                                tear_down_address(address)
                return BIG_FAT_FAILURE

               # git rid of our old addresses
               for address in to_remove:
                      tear_down_address(address)
           cancel_current_io(address)

       return SUCCESS
2016-06-28 11:03:25 +02:00
Sara Dickinson b277aef435 Remove build warnings 2016-06-27 11:53:39 +01:00
Sara Dickinson 75b0fef741 Update some type/value names and revert to original order of declarations with manual ordering within the page 2016-06-25 18:09:56 +01:00
Sara Dickinson d3309e89e8 Initial pass at updating Doxygen modules for getdns.h. Also add info on using context_create multithreaded.
- this is a rough first pass at making the oxygen Modules page more consistent and user navigable
  as a handy index into getdns
- I think a further re-org is needed in a later update, also haven't touched getdns_extra.h yet
- Added a few functions descriptions too, but still many functions without comments... a WIP
- Updated man page for context_create with multi-threaded instructions as a short term fix
2016-06-25 18:09:56 +01:00
Sara Dickinson 3ee5cf32b6 Split the recursive transport test 6 into 3 and add a shorter timeout to the fail case to stop the overall test timing out. 2016-06-25 15:57:14 +01:00
Willem Toorop a57b19332a track connections per listener
so they can be dealt with when a listener has to go.
Connections are kept in a double linked list.
Prev links are pointers to the next pointer, to deal with the list handle (i.e. the first next pointer) in a uniform way.
2016-06-23 17:05:32 +02:00
Willem Toorop 9c7f6faf76 Don't TCP idle timeout with queries to be answered 2016-06-23 16:26:20 +02:00
Willem Toorop 50416ecc7f Make getdns_query daemon work again 2016-06-23 15:26:19 +02:00
Willem Toorop 32c6e1fdee Merge branch 'develop' into devel/decompose-getdns_query 2016-06-23 15:06:20 +02:00
Willem Toorop 734a6625c4 s/inline static/static inline/g 2016-06-23 15:03:46 +02:00
wtoorop b56fbbb604 Merge pull request #187 from rwgroenenberg/call_reporting_timeout
Return call_reporting info in case of timeout, so that we can see which server did not respond.
2016-06-23 14:11:32 +02:00
wtoorop a435932b04 Features/call reporting timeout (#1)
* Timed out and canceled netreqs are finished too

* Minor code duplication elemination

* Blah typo

* Embarrassing logic error
2016-06-23 14:02:55 +02:00
wtoorop 11f5eac21f Merge pull request #188 from rwgroenenberg/CentOS6_build
Build fails with autoconf 2.63, works with 2.68.

Muchas gracias
2016-06-23 13:58:32 +02:00
Robert Groenenberg 03fcfc006f Build fails with autoconf 2.63, works with 2.68.
Found on CentOS 6.6. With autoconf268 (available from EPEL repo) it works.
Looking at the update description of autoconf 2.64, the problem _might_ be fixed with that version already.
2016-06-22 14:40:21 +02:00
Willem Toorop f5d31cd93c Some minor getdns_query memory leak fixes 2016-06-21 16:31:07 +02:00
Willem Toorop 3cc369a27d Move serving requests out of getdns_query 2016-06-21 16:14:54 +02:00
Robert Groenenberg 60c6c8d8ca Fixed build 2016-06-21 13:19:11 +02:00
Robert Groenenberg 3634fff4dd Return call_reporting info in case of timeout, so that we can see
which server did not respond.
2016-06-20 18:39:15 +02:00
Willem Toorop 09b4ef9e9c Let getdns_query use the default eventloop
instead of a custom eventloop
2016-06-17 17:07:41 +02:00
Willem Toorop 2555980b41 Forgot to update symbols 2016-06-17 17:07:26 +02:00
Willem Toorop 2873645068 get current (pluggable) eventloop from context
So applications can schedule events against it...
2016-06-17 16:50:47 +02:00
Willem Toorop 22095f23f6 Bugfix: cannot override targets in Makefile 2016-06-17 16:37:41 +02:00
Willem Toorop 0f16860dbd Move configuring contexts with a dict out 2016-06-17 16:01:36 +02:00
wtoorop 6d63f74d18 Merge pull request #185 from saradickinson/feature/transport_testing
Minor testing updates:
2016-06-17 12:32:28 +02:00
Sara Dickinson 497d87a028 Correct the name to resolution_type 2016-06-17 11:25:21 +01:00
Sara Dickinson 3c7758fdbc Minor testing updates:
- add option to use IPv6 for manual transport tests
- add recursion mode to call_reporting
2016-06-16 10:47:43 +01:00
Willem Toorop 4fde05380f Yet another pass at fixing dependencies
pretty sure it will work this time though...
2016-06-16 11:12:11 +02:00
wtoorop ddf69b4883 Merge pull request #184 from saradickinson/bugfix/tls_connection_timeout
Quick fix for TLS timeouts not re-using a connection.  Better solutio is needed.

Also minor fixes in getdns_query:

    spurious semicolon (caused build warning)
    build warning for initialised variable
    have getdns_query honour the CLASS in the incoming query
2016-06-16 11:07:26 +02:00
Willem Toorop d70bd5e637 A dependency fix that actually works! 2016-06-16 11:01:46 +02:00
Sara Dickinson c0187a19ea Quick fix for TLS timeouts not re-using a connection. Better solution is needed.
Also minor fixes in getdns_query:
 - spurious semicolon (caused build warning)
 - build warning for initialised variable
 - have getdns_query honour the CLASS in the incoming query
2016-06-15 17:15:13 +01:00
Willem Toorop 1608244556 Dependency fix 2016-06-15 16:56:20 +02:00
Willem Toorop 8eea955f56 Dependencies
Including the decomposed getdns_str2dict
2016-06-15 16:47:40 +02:00
Willem Toorop ff77af148e Move str2dict conversion out of getdns_query 2016-06-15 15:53:43 +02:00
Willem Toorop c74bfb5339 Pass NULL to select when timeout is infinite 2016-06-15 11:04:11 +02:00
Willem Toorop ea226b882d To run tpkg tests directly from clean git repo 2016-06-14 12:52:54 +02:00
Melinda Shore 20ba3958fa Merge pull request #181 from wtoorop/features/getdns_service
Features/getdns service
2016-06-09 10:03:34 -08:00
Willem Toorop 2ed28badfd Replies without answer don't have a canonical name 2016-06-09 16:47:00 +02:00
Willem Toorop e228f526a3 when nothing else, result[canonical_name] is qname 2016-06-09 16:12:06 +02:00
wtoorop 3b1d7a3b26 Merge pull request #182 from guillemj/libbsd
Use libbsd when available

Tested on Linux/OS-X/FreeBSD/NetBSD
Works perfectly. Thanks!
2016-06-09 15:39:17 +02:00
Willem Toorop 49840c9a85 Some more uniform _getdns_rrset usage 2016-06-09 15:03:51 +02:00
Willem Toorop e27bfcedb6 Merge branch 'develop' into devel/getdns_rrset 2016-06-09 14:13:11 +02:00
wtoorop cdc0fc04e2 Merge pull request #183 from wtoorop/develop
DNSSEC wildcard validation issue
2016-06-09 11:03:15 +02:00
Willem Toorop 27110e0943 DNSSEC wildcard validation issue 2016-06-09 10:44:25 +02:00
Guillem Jover 1fb763761b Use libbsd when available
Use the libbsd (https://libbsd.freedesktop.org/) overlay to transparently
use the bsd compatibility layer without needing any actual code changes.

Remove now unnecessary direct access to libbsd includes. And remove
checks for unused functions.
2016-06-09 02:42:22 +02:00
Willem Toorop 8679633cd9 One more _getdns_rrset caused dnssec fix 2016-06-08 16:03:45 +02:00
Willem Toorop 6e7f66b216 Sorting of SRVs according to RFC2782
Could be optimized... but alas
2016-06-08 12:44:23 +02:00
Willem Toorop 457a4bec92 develop merge fix 2016-06-08 10:57:03 +02:00
Willem Toorop 490aac1b48 Merge branch 'develop' into features/getdns_service 2016-06-08 10:21:29 +02:00
Willem Toorop 2d22b8729d Locks must be >= 0 2016-06-07 17:21:10 +02:00
Willem Toorop e16efbbeee Small bugs from the _getdns_rrset move 2016-06-07 17:08:35 +02:00
Willem Toorop cf675a9284 Add srv_addresses when query was for SRV
Moved _getdns_rrset iterators to rr-iter.[ch] in the process
2016-06-07 16:52:10 +02:00
Melinda Shore 15a2c1b591 Merge pull request #179 from getdnsapi/features/create_dict_with_json
A daemon mode for getdns_query
2016-06-06 19:42:24 -08:00
Willem Toorop 3af8a917a2 TSIG spec contains colon too 2016-06-01 17:00:05 +02:00
Willem Toorop a100aff4de Free allocated qname after query 2016-05-31 16:55:59 +02:00
Willem Toorop cc39d51a4c Query with the correct extensions! 2016-05-31 15:40:22 +02:00
Willem Toorop ff4545dae0 Listening sockets should use SO_REUSEADDR 2016-05-31 15:14:50 +02:00
Willem Toorop 6781899247 Allow keys without quotes in json dicts 2016-05-31 15:02:17 +02:00
Willem Toorop 2bb254c898 A DNSSEC resolver validates without DO too 2016-05-31 13:17:16 +02:00
Willem Toorop 40477d3f00 CNAME loops protection 2016-05-30 17:02:28 +02:00
Willem Toorop 2b81be8859 Better servfail serving in getdns_query daemon 2016-05-30 16:37:38 +02:00
Willem Toorop aedf4454f5 Configure options for tracing messages
(and a secret hidden one to keep connections open)
2016-05-30 16:36:43 +02:00
Willem Toorop 2c43afe338 SERVFAIL should contain the query name... 2016-05-30 11:25:07 +02:00
Willem Toorop 1fb91028ad Oopsy 2016-05-26 17:05:06 +02:00
Willem Toorop 89d2f74d24 First fixes that came out of deckard testing 2016-05-26 17:02:21 +02:00
Willem Toorop e01211d6b4 Debug setting that keeps connections open 2016-05-25 15:57:37 +02:00
Willem Toorop e25e697970 Merge remote-tracking branch 'upstream/develop' into features/create_dict_with_json 2016-05-25 15:12:48 +02:00
Willem Toorop 4334da370e Recursing available on bogus answer too
provided the resolution mode is RECURSING
2016-05-25 14:53:33 +02:00
wtoorop 5e74185327 Merge pull request #172 from saradickinson/feature/unit_test_updates_2
Feature/unit test updates 2
2016-05-25 13:49:00 +02:00
Willem Toorop 888cba625c DNSSEC extensions overwrite curtom headers
to make roadblock avoidance work in daemon mode
2016-05-23 16:40:26 +02:00
Willem Toorop 9e0127e74c Don't allow primitive keys (yet)
They cannot handle the colon very well (yet)
2016-05-23 15:54:53 +02:00
Willem Toorop 5b832e457c Allow dns_root_servers to be given by bindata too 2016-05-23 15:53:36 +02:00
Willem Toorop 95718c9474 Mention format of the settings 2016-05-23 15:03:51 +02:00
Willem Toorop 77af32d121 Two more missing unofficial settings options 2016-05-23 14:43:05 +02:00
Willem Toorop eef421fb63 Allow configuration passed on command line too 2016-05-23 14:33:56 +02:00
Willem Toorop 7b861ecbbc Allow arbitrary bindata with json dict primitives 2016-05-23 12:41:46 +02:00
Willem Toorop acad529654 Default extensions settings via config file 2016-05-23 12:22:23 +02:00
Willem Toorop 584193eb39 Stub daemon mode forwards the request header 2016-05-23 11:35:50 +02:00
Willem Toorop 4479d06ebd Allow keys without quotes in config file
+ help text that show config file option
2016-05-23 11:27:27 +02:00
Willem Toorop 938eef1b00 String bindata's secretly contain final '\0' 2016-05-22 21:58:50 +02:00
Willem Toorop 7b47e82eae DNSSEC in server working with recursive mode too 2016-05-22 20:49:52 +02:00
Willem Toorop 382a5ec452 getdns_query daemon pass through header options
(Enables DNSSEC for stub mode, but not for recursive)
2016-05-22 18:23:15 +02:00
Willem Toorop 959f1e5496 listen_addresses setting in config file 2016-05-22 17:35:14 +02:00
Willem Toorop 14a950bc29 getdns_query -C for settings via config file 2016-05-22 15:35:32 +02:00
Sara Dickinson 9c8e07a06a Merge branch 'develop' of https://github.com/getdnsapi/getdns into feature/unit_test_updates_2 2016-05-20 16:07:52 +01:00
Sara Dickinson 84d6da8ef6 Fix ups after Willems review 2016-05-20 16:01:23 +01:00
Willem Toorop e8db20a722 Merge branch 'develop' into features/create_dict_with_json 2016-05-20 15:04:08 +02:00
Melinda Shore 0fa3f09ca2 Merge pull request #176 from getdnsapi/devel/bsd-fixes
Devel/bsd fixes
2016-05-19 20:12:42 -08:00
Willem Toorop 7f30aba6bd Only merge non empty lcov info files 2016-05-19 21:15:24 +02:00
Willem Toorop 028ceb7ebf Merge branch 'develop' into devel/bsd-fixes 2016-05-19 21:13:47 +02:00
Willem Toorop b4fceaa008 Enable setting FD_SETSIZE 2016-05-19 17:05:41 +02:00
Willem Toorop f806ffdc70 Anticipate BSD make in tpkg's 2016-05-19 15:56:19 +02:00
Willem Toorop 0bc8eb65b3 Sort symbols the same on all systems 2016-05-19 15:24:01 +02:00
Willem Toorop 4c3888b18e jsmn.h is relative to $(srcdir) too 2016-05-18 15:56:54 +02:00
Willem Toorop 7fd9d1e342 const-info.h is relative to $(srcdir) 2016-05-18 15:47:57 +02:00
Willem Toorop 11a063bad0 Parse IPv4, IPv6 and dnames as primitives 2016-05-18 15:21:24 +02:00
Sara Dickinson 98d636b99d Updates to unit tests and tpkg 2016-05-16 17:56:48 +01:00
Sara Dickinson 5f225d6be3 Add TLS session resumption 2016-05-16 17:41:55 +01:00
Melinda Shore d8b2b776a8 Merge pull request #171 from wtoorop/devel/tpkg-xtra-configure-params
Devel/tpkg xtra configure params
2016-05-13 21:00:16 -08:00
Melinda Shore 35f639faf1 Merge pull request #170 from wtoorop/devel/clang-static-checking
Static checking
2016-05-13 20:42:21 -08:00
Willem Toorop 1d5446f117 First pass at parsing getdns dicts in text format 2016-05-11 12:07:27 +02:00
Willem Toorop 22328703cc Convert constant name to value 2016-05-09 15:17:26 +02:00
Willem Toorop 4159360ee5 Pass run-all.sh params to tpkg's configure calls 2016-05-09 14:13:37 +02:00
Willem Toorop 4b7e79cc35 TCP server now also working 2016-05-06 17:30:05 +02:00
Willem Toorop 78a6a47b05 Anticipate new pretty print format in tpkg tests 2016-05-04 15:25:18 +02:00
Willem Toorop e6b5a29196 jsmn submodule via https 2016-05-04 11:11:30 +02:00
Willem Toorop a80afd357e Initial UDP only server for getdns_query
Provide listening addresses in the same way as upstreams,
but with the initial character '~' instead of '@'.
2016-05-04 09:38:26 +02:00
Willem Toorop 5085af0d28 Abit more leniency in what to accept for upstreams
address_type no longer necessary
instead of address dicts, just bindata is now also ok
2016-05-03 14:52:30 +02:00
Willem Toorop 9f3ad7d603 Add our version of jsmn as submodule 2016-05-03 13:38:40 +02:00
Willem Toorop c14c6fe993 Print dname's as primitive type 2016-05-03 13:35:01 +02:00
Willem Toorop 240bb76bd5 Merge branch 'develop' into devel/clang-static-checking 2016-04-29 16:33:06 +02:00
Willem Toorop 066c0b3837 Merge branch 'features/canonical_dnssec_chain' into upstream/develop 2016-04-29 16:24:58 +02:00
Willem Toorop a8dbb3dd51 Static checking fixes 2016-04-29 12:00:17 +02:00
Willem Toorop 9ac9e0e6d0 Need target everything for tpkg 340 2016-04-29 11:48:39 +02:00
Willem Toorop 84570a5f0a Static checking with the clang analyzer 2016-04-29 11:47:20 +02:00
Melinda Shore 65fe25dcd6 Merge pull request #167 from wtoorop/features/send_query_packet
Set header bits (and opcode) with a header extension
2016-04-28 11:06:55 -08:00
Willem Toorop d09698496d Fail on scheduling errors 2016-04-28 15:02:27 +02:00
Willem Toorop 234d6d1b06 Dependencies 2016-04-28 14:39:26 +02:00
Willem Toorop 6e0d8de885 tpkg for the header extension 2016-04-28 14:28:22 +02:00
Willem Toorop b12aeb80fb Allow for tpkg test with configured srcdir
By temporarily moving the configured files aside while building
2016-04-28 14:26:29 +02:00
Willem Toorop 04b3830fb6 Set OPCODE in header too 2016-04-28 13:44:28 +02:00
Willem Toorop d841582d67 Setting header bits through extensions working 2016-04-26 15:54:58 +02:00
Willem Toorop 25cc88e1a2 First pass at sending packets 2016-04-25 17:21:04 +02:00
Willem Toorop 8fc89d01cb Post devel/scheduling_bug_detection merge cleanups 2016-04-22 14:43:17 +02:00
Willem Toorop af8e27f059 Merge branch 'devel/scheduling_bug_detection' into features/canonical_dnssec_chain 2016-04-22 14:42:25 +02:00
Willem Toorop d61e64c9c7 Fix callbacks during scheduling in DNSSEC code too 2016-04-22 14:09:18 +02:00
Willem Toorop 15271d0438 Account for callbacks fired during scheduling 2016-04-21 15:16:38 +02:00
Willem Toorop 0bd4026898 Detect freed memory usage with recursive queries
Only when using unbound-event-api and doing queries for names in /etc/hosts
2016-04-21 12:37:09 +02:00
Willem Toorop c05f963719 Fail on debugging detected errors 2016-04-21 12:24:53 +02:00
Willem Toorop 4849329818 dnssec_return_full_validation_chain extension
That also returns all records that had to be proofed secure in canonical form in the "validation_chain".
2016-04-18 22:06:12 +02:00
Willem Toorop e1126c9cf8 Canonicalize dnssec chain
When validated
2016-04-18 15:36:39 +02:00
Melinda Shore 102d55d4a5 Merge pull request #163 from wtoorop/devel/issue-160-bugfix
Devel/issue 160 bugfix
2016-04-13 19:56:30 -08:00
Willem Toorop 516f211843 Fire idle timeouts immediately with sync requests 2016-04-13 12:06:51 +02:00
Willem Toorop 57954ad41e Small bugfix in checking complete requests async 2016-04-11 15:33:08 +02:00
Willem Toorop da577a463d set upstream loop to the sync loop for sync reqs
And reset to the async loop when sync request was finished, rescheduling the upstream->event.
Note that finished_event is scheduled against the async loop always.
2016-04-11 14:49:44 +02:00
wtoorop 8c97e67ceb Merge pull request #162 from pusateri/develop
Add a pkg-config file for the getdns_ext_event library.
2016-04-08 10:26:45 -03:00
Tom Pusateri a4b641790b Add a pkg-config file for the getdns_ext_event library. 2016-04-07 16:22:56 -03:00
Melinda Shore 0a7f80ccbe Merge pull request #161 from wtoorop/develop
minor openssl 1.1.0 bugfix
2016-04-05 16:06:29 -08:00
Willem Toorop d2d4a849f4 Merge remote-tracking branch 'upstream/develop' into develop 2016-04-05 15:50:50 -03:00
Willem Toorop e4b0d08fad Minor bugfix for use with openssl 1.1.0 2016-04-05 13:15:59 -03:00
wtoorop bbb498c680 Merge pull request #159 from shane-kerr/coverage
Modified version of the "run-all.sh" which collects coverage information and produces a report.
2016-04-02 16:49:02 -03:00
Shane Kerr af8139e957 Modified version of the "run-all.sh" which collects coverage information and produces a report. 2016-04-02 15:44:46 -03:00
wtoorop ef03943c35 Merge pull request #158 from shane-kerr/patch-1
Update README.md
2016-04-02 12:47:58 -03:00
Shane Kerr 575b53ab03 Update README.md
Reversed order of one flag to remove dependency in documentation.
2016-04-02 11:48:22 -03:00
Willem Toorop c53b15bd9a target-fetch-policy only with unbound-event-api 2016-03-31 07:49:40 -03:00
Willem Toorop cab13ce32a Rename version into 1.0.0b1 2016-03-31 06:22:14 -03:00
Willem Toorop d0ff4c9d6b Update ChangeLog 2016-03-30 12:33:49 -03:00
Willem Toorop 8d05fd7c1b FD_SETSIZE can be unsigned 2016-03-30 11:57:01 -03:00
Willem Toorop 79e44053d3 Don't include ub event defs twice 2016-03-30 11:43:11 -03:00
Willem Toorop f3bc6360bf Do definitions once 2016-03-30 11:37:16 -03:00
Willem Toorop c9fab8c242 target-fetch-policy for more resilient recursion 2016-03-30 10:56:46 -03:00
Willem Toorop 64dfed2a07 Merge branch 'develop' into release/v1.0.0beta 2016-03-29 20:40:50 +02:00
Willem Toorop fc32b300f3 Start with beta release 2016-03-29 20:37:06 +02:00
wtoorop 4e0073ae6f Merge pull request #157 from gmadkat/develop
Added code to read the domain from the registry and use it if search …
2016-03-29 16:13:04 +02:00
gmadkat af7f384cf3 Added code to read the domain from the registry and use it if search suffixes are missing 2016-03-27 22:37:54 -07:00
Melinda Shore 1f45bf7e43 Merge pull request #154 from wtoorop/devel/no-sync-side-effects
No more side effects with synchronous calls
2016-03-24 10:53:05 -08:00
Melinda Shore 4b033c766b Merge pull request #156 from wtoorop/devel/std-suffix-handling
Devel/std suffix handling
2016-03-24 10:52:36 -08:00
Melinda Shore 5b41c67d7a Merge pull request #155 from wtoorop/devel/codebase-maintenance2
Devel/codebase maintenance2
2016-03-24 10:03:15 -08:00
Willem Toorop 7df26b6068 Merge branch 'devel/codebase-maintenance2' into release/v1.0.0beta 2016-03-24 16:53:15 +01:00
Willem Toorop 4187636f41 Merge branch 'devel/std-suffix-handling' into release/v1.0.0beta 2016-03-24 16:53:05 +01:00
Willem Toorop 4298e7dce6 Merge branch 'devel/no-sync-side-effects' into release/v1.0.0beta 2016-03-24 16:52:49 +01:00
Willem Toorop fdd3992f65 openssl 1.1 support 2016-03-24 14:02:18 +01:00
Willem Toorop e10e774d32 Reversed IPv6 lookup can take a while 2016-03-24 11:46:42 +01:00
Willem Toorop e4955d69ef Updates from unbound 2016-03-24 11:14:14 +01:00
Willem Toorop 0d66f91c91 getdns_query option for APPEND_NAME_TO_SINGLE_LABEL_FIRST 2016-03-23 23:31:23 +01:00
Willem Toorop e7c77290cc GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST 2016-03-23 23:27:27 +01:00
Willem Toorop b0ecda5d2e No more side effects with synchronous calls
(and upstreams that keep connections open)
2016-03-23 22:13:31 +01:00
Melinda Shore efc42481d5 Merge pull request #153 from wtoorop/features/follow_redirects
getdns_context_set_follow_redirects()
2016-03-23 07:11:19 -08:00
Willem Toorop 09476f1ca9 getdns_context_set_follow_redirects() 2016-03-23 11:32:38 +01:00
Melinda Shore 735892cb99 Merge pull request #152 from wtoorop/devel/codebase-maintenance
Devel/codebase maintenance
2016-03-22 20:42:57 -08:00
Willem Toorop e934c100a2 Merge branch 'develop' into devel/codebase-maintenance 2016-03-22 13:22:13 +01:00
wtoorop 17ba786cea Merge pull request #151 from gmadkat/develop
Added search suffix for Windows from registry

Thank you Gowri!
2016-03-22 13:17:29 +01:00
Willem Toorop 091d41dfe0 5th time's a charm 2016-03-22 10:16:15 +01:00
Willem Toorop 255e60cdcd Old valgrind travis-ci (test mode 4) 2016-03-22 10:07:59 +01:00
Willem Toorop 532c26d7c8 Old valgrind travis-ci (test mode 3) 2016-03-22 10:00:56 +01:00
Willem Toorop ede4afc7b6 Old valgrind travis-ci (test mode 2) 2016-03-22 09:53:40 +01:00
Willem Toorop 213a3dc5d8 Old version valgrind tpkg (test mode) 2016-03-22 09:37:01 +01:00
gmadkat 5d2a05f5e0 Added search suffix for Windows from registry 2016-03-21 21:10:57 -07:00
Willem Toorop d2e62acf0d What options can I use with travis valgrind? 2016-03-21 17:03:53 +01:00
Willem Toorop 620de476df Don't show all leak kinds 2016-03-21 16:51:40 +01:00
Willem Toorop d35b7ff174 Small memory leak in getdns_query 2016-03-21 16:42:53 +01:00
Willem Toorop 29323f8d94 valgrind unit tests 2016-03-21 16:35:13 +01:00
Willem Toorop 0d9d5a5eb7 Bugfix unitialized memory access with root lookups 2016-03-21 15:39:33 +01:00
Willem Toorop 468f2997ff dependencies update 2016-03-21 15:32:55 +01:00
Willem Toorop c057f65b28 list_append_list not used 2016-03-21 15:15:55 +01:00
Willem Toorop 90beaaff1d Use non-copying list_append_this_dict 2016-03-21 14:56:09 +01:00
Willem Toorop ba2da45819 Non copying list_append functions 2016-03-21 14:19:37 +01:00
Willem Toorop eea6ad7beb append_bindata was also used marginally 2016-03-21 13:13:48 +01:00
Willem Toorop 4e0ee15b73 dict_set_this_bindata not used anywhere 2016-03-21 13:07:20 +01:00
Willem Toorop 4551f0850b Use non-copying dict_set_list 2016-03-21 12:50:43 +01:00
Willem Toorop 6f157854ce Use non-copying dict_set_dict 2016-03-21 11:55:21 +01:00
Willem Toorop fc5f16dbcb Non copying dict_set functions 2016-03-21 11:54:55 +01:00
wtoorop b687a97334 Merge pull request #150 from gmadkat/develop
Update README.md
2016-03-21 09:53:55 +01:00
wtoorop d9bcc26c36 Merge pull request #149 from saradickinson/feature/stub-debug-cleanup
Feature/stub debug cleanup
2016-03-18 17:22:55 +01:00
Willem Toorop e4e3dde61f Don't breakup the sync vs async schedule
to accentuate changes.
2016-03-18 13:30:49 +01:00
Sara Dickinson c1f15fc0ac Minor tweaks 2016-03-18 12:02:40 +00:00
Sara Dickinson c08371ebb0 First pass at updating DEBUG_STUB output 2016-03-18 11:34:51 +00:00
Willem Toorop 5469442eaa Execute all tests allways (even if one fails) 2016-03-17 17:13:20 +01:00
Willem Toorop 186dbca7ce Dependencies 2016-03-17 17:02:17 +01:00
Willem Toorop ab742b34b6 Miscelaneous scheduling fixes and improvements 2016-03-17 16:49:05 +01:00
Willem Toorop 94c73b6ec8 Write libcheck logfiles via env variables 2016-03-17 16:40:30 +01:00
Willem Toorop e36ece2b88 Configure option to disable the unbound event API 2016-03-17 16:37:31 +01:00
Willem Toorop e241101c12 ldns and bc not needed anymore for travis tests 2016-03-16 14:10:12 +01:00
Melinda Shore 8c335522e1 Merge pull request #148 from wtoorop/features/dnssec_return_all_statuses
A dnssec_return_all_statuses extension
2016-03-14 20:09:08 -08:00
Melinda Shore 28edb1dc5a Merge pull request #147 from wtoorop/devel/check_separate_logfiles
Write unit test log's to separate log files
2016-03-14 20:08:10 -08:00
Melinda Shore cf451d2b2b Merge pull request #146 from wtoorop/devel/direct_root_servers
Devel/direct root servers
2016-03-14 20:06:07 -08:00
Melinda Shore 69a7c1f9ba Merge pull request #145 from wtoorop/features/wire2reply
Features/wire2reply
2016-03-14 20:04:52 -08:00
Melinda Shore 4b5c61145a Merge pull request #144 from wtoorop/devel/default_eventloop
Devel/default eventloop
2016-03-14 20:02:57 -08:00
Willem Toorop 4fca5fe08c A dnssec_return_all_statuses extension
that returns all all dnssec replies regardless their status.
When used on its own or in combination with just dnssec_return_status,
     it will return BOGUS replies, but those replies will have "dnssec_status": GETDNS_DNSSEC_BOGUS
     The response dict "status" will be GETDNS_RESPSTATUS_GOOD then.
When used on in combination with dnssec_return_only_secure,
     it will return BOGUS and INSECURE replies (reflected in their "dnssec_status")
     The response dict "status" can be any of the status that the dnssec_return_only_secure extenstion returns,
     so either GETDNS_RESPSTATUS_GOOD when at least one reply was secure,
     GETDNS_RESPSTATUS_NO_SECURE_ANSWERS when all replies were insecure,
     or GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS when all replies were bogus.
2016-03-14 12:23:12 +01:00
Willem Toorop 8ccba5e204 Write unit test log's to separate log files
For each tested event loop
2016-03-14 11:59:05 +01:00
Willem Toorop d938c433ab Set root servers without temporary file 2016-03-14 11:33:06 +01:00
Willem Toorop f95a052e55 Rewrite DNS proxy in transport/timeout test suites
To use the new DNS packet conversion functions.
This looses the dependency on ldns for unit tests too.
2016-03-14 10:41:32 +01:00
Willem Toorop 02d14351fc Convert pkts wireformat <-> getdns_dict <-> string 2016-03-14 10:02:01 +01:00
Willem Toorop 7550980be8 Loose bc dependency with tpkg 2016-03-10 14:37:00 +01:00
Willem Toorop 36e620d769 TCP handling on windows 2016-03-09 15:37:47 +01:00
Willem Toorop a83c54387d Reuse sync eventloop per context
So recursive resolution can depend on and continue with outstanding queries it depends on
2016-03-09 11:16:19 +01:00
Willem Toorop 70cc65f786 Replace default append_name setting
to GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE
2016-03-09 10:37:05 +01:00
Willem Toorop aeeadde299 Synchronous with pluggable event APIs again 2016-03-07 16:35:43 +01:00
Willem Toorop ebb892def1 Revert "Run context's event loop when doing sync requests"
This reverts commit d50860c089.
2016-03-04 12:08:46 +01:00
Willem Toorop 75ee40b98f Small improvements for ub_loop's 2016-03-04 11:52:50 +01:00
Willem Toorop 8e4dd05379 Anticipate magic number 2016-03-02 12:38:29 +01:00
Willem Toorop 4230961e9f Basic usage of unbound pluggable event loop 2016-03-01 16:29:37 +01:00
wtoorop 8f66d69286 Merge pull request #143 from wtoorop/bugfix/memory_leaks
Fix memory leak with getdns_get_api_information()
2016-02-26 12:26:53 +01:00
wtoorop c70a5b108f Merge pull request #142 from wtoorop/bugfix/load_gost
load gost algorithm if digest is seen before key algorithm
2016-02-26 12:26:42 +01:00
Willem Toorop 6fd05675aa Fix memory leak with getdns_get_api_information()
Thanks Robert Groenenberg.
2016-02-26 12:24:45 +01:00
Willem Toorop 4a4339f023 load gost algorithm if digest is seen before key algorithm 2016-02-26 12:20:16 +01:00
gmadkat f5e9640ee8 Update README.md
For OS X, libtool already exists, it is installed in OS X as glibtool to avoid a name conflict with an existing OS X tool.
2016-02-24 11:03:01 -05:00
wtoorop 0a7acff783 Merge pull request #141 from wtoorop/features/validate_at_specified_moment
Offline dnssec validation at a given point in time
2016-02-11 12:08:47 +01:00
Willem Toorop 707b0d21c8 bugfix: don't reset skew 2016-02-11 11:27:03 +01:00
Willem Toorop 045d0d481c Offline dnssec validation at a given point in time 2016-02-11 11:24:22 +01:00
wtoorop e5e2cbfd86 Merge pull request #140 from ln5/docu
Correct return value in documentation for getdns_pretty_print_dict().
2016-02-05 16:06:04 +01:00
Linus Nordberg f837e32204 Correct return value in documentation for getdns_pretty_print_dict(). 2016-02-05 15:47:26 +01:00
Willem Toorop a0896ac4bf Rearange link lib order for mingw 2016-02-04 15:25:01 +01:00
Willem Toorop e6f5cdb45b Merge branch 'develop' into devel/default_eventloop 2016-02-04 15:17:25 +01:00
wtoorop 60be402062 Merge pull request #139 from ln5/parsing-resolvconf
Don't treat "domain" or "search" as a nameserver.
Thank you Linus
2016-02-04 10:06:40 +01:00
Linus Nordberg 466302131e Don't treat "domain" or "search" as a nameserver.
Continue the while fgets() loop as soon as we're done with "domain" or
"search".

Simplify the logic of the function by removing the if else constructs.
2016-02-03 14:57:09 +01:00
gmadkat 8336500585 Update README.md
Add more detailed build directions for Windows and mingw
2016-02-03 00:17:07 -05:00
wtoorop 9424eed85a Merge pull request #138 from gmadkat/develop
Added a wincrypt adapter to read CA trust certs from Windows CA store(with review changes by Sara (and Willem)
2016-02-01 17:13:38 +01:00
unknown db4207f60d More review changes and made comments C style, req Willem. 2016-02-01 11:02:24 -05:00
unknown 170795ad06 More review changes and made comments C style, req Willem. 2016-02-01 10:56:45 -05:00
unknown f5290b6a68 add change from Sara to return if a cert conversion or add to store fails 2016-01-31 00:13:09 -05:00
unknown 504881fc6f Minor fixes to compile and run the CA trust store adapter from Windows to openopenSSL 2016-01-27 16:30:50 -05:00
gmadkat 9d7fcba575 Merge pull request #1 from saradickinson/feature/wincrypt
Improve Windows CA handling code
2016-01-27 10:42:30 -05:00
Sara Dickinson 111794158c Improve Windows CA handling code 2016-01-27 12:50:16 +00:00
unknown 7e9563faed Added a wincrypt adapter to read CA trust certs from Windows CA store and feed them into openssl for TLS hostname authentication 2016-01-23 18:47:03 -05:00
Willem Toorop 7fe2d5b346 Linking order matters on Windows 2016-01-20 15:16:03 +01:00
Willem Toorop 24b58074bf Prevent chain checks to be performed too early 2016-01-20 13:09:18 +01:00
Willem Toorop d50860c089 Run context's event loop when doing sync requests 2016-01-20 11:10:53 +01:00
Willem Toorop ca36c879a0 Set unbound target fetch policy to on demand only 2016-01-20 10:21:05 +01:00
Willem Toorop ae2b16665b Setup getdns eventloop in libunbound
When unbound supports this
2016-01-19 16:52:11 +01:00
Willem Toorop 0c0868517c Remove leftover debugging printfs 2016-01-12 16:57:17 +01:00
Willem Toorop fed8cc51ed Initial TCP support for Windows 2016-01-12 16:54:42 +01:00
Willem Toorop 61c0a51ec5 Disable clearing ub_fd too (for windows) 2016-01-12 16:43:25 +01:00
Willem Toorop 2a6318afd2 Disable scheduling ub_fd() 2016-01-12 16:38:10 +01:00
Willem Toorop 4fd8d3dddd Replace mini_event extension by default_eventloop
* default_eventloop was prototyped in getdns_query and is still in there as my_eventloop
  * It interfaces directly with the scheduling primitives of getdns.
  * It can operate entirely from stack and does not have to do
    any memory allocations or deallocations.

* Adapted configure.ac to allow libunbound to be linked with Windows
  (with the removal of winsock_event.c we have no symbol clashed anymore)

* Added STUB_TCP_WOULDBLOCK return code in stub_resolving helper functions,
  to anticipate dealing with edge triggered event loops (versus level triggered). (i.e. Windows)
2016-01-12 15:52:14 +01:00
Willem Toorop 39f7e87f1a Get rid of unkown format specifiers on windows 2016-01-11 12:11:17 +01:00
Willem Toorop a970dd420f Deal with Windows vsnprintf behaviour
+ a better situated DEBUG_STUB statement in getdns_query
2016-01-10 12:29:37 +01:00
Willem Toorop 6d7645705a Increase FD_SETSIZE on windows 2016-01-10 12:28:30 +01:00
saradickinson b39ddf01d0 Merge pull request #136 from saradickinson/bugfix/pinsets
Bug fix for segmentation fault when using NULL pin. Unit test to come…
2016-01-07 17:25:22 +00:00
Sara Dickinson f8b041cd40 Bug fix for segmentation fault when using NULL pin. Unit test to come in later update. 2016-01-07 17:17:09 +00:00
Willem Toorop cf387ca3f2 Fixes for cross compiling 2016-01-07 15:32:23 +01:00
wtoorop fa1fa55110 Merge pull request #134 from wtoorop/devel/sync_ldns
Bring gldns in sync with upstream unbound's sldns
2016-01-05 15:25:03 +01:00
Willem Toorop 4d67db5b83 Bring gldns in sync with upstream unbound's sldns 2016-01-05 14:17:28 +01:00
wtoorop 6dba2b98a0 Merge pull request #133 from wtoorop/features/stub-only-getdns_query
Features/stub only getdns query
2016-01-05 13:25:18 +01:00
Willem Toorop 16a82eede2 Deal with roadblock avoid. + stub-only at run time
And make the single usage function validate_extension static
2016-01-05 12:38:35 +01:00
Willem Toorop a58037904f Default is stub when compiling stub only 2016-01-05 12:30:58 +01:00
wtoorop b5d1dfd9e7 Merge pull request #132 from saradickinson/bugfix/api_info
Fix output of get_api_settings functions
2016-01-05 10:39:27 +01:00
Sara Dickinson 1f9424ccf2 Fix output of get_api_settings functions 2016-01-05 09:25:49 +00:00
Willem Toorop f0bd64d57a Pretty print "bad_dns" list with constant names 2015-12-31 12:40:20 +01:00
Willem Toorop 03425d192d Miscellaneous Makefile issues 2015-12-31 11:53:46 +01:00
Willem Toorop 6b2d9a2d70 Unused var compile warning in certain conditions 2015-12-31 11:26:29 +01:00
wtoorop 867d4d0db6 Update README.md 2015-12-30 15:42:24 +01:00
Willem Toorop 84c40ca464 Update README, ChangeLog and bumb version 2015-12-30 15:36:28 +01:00
Willem Toorop 08c0c4d6e4 Fixes from testing on different platforms 2015-12-30 14:39:11 +01:00
Willem Toorop 9b97eb9361 Update dependencies 2015-12-30 14:18:19 +01:00
Willem Toorop 1128ebdd54 Unit test fail with unimplemented follow_redirect 2015-12-30 14:10:36 +01:00
Willem Toorop 68fbb93cd6 Release candidate 2 2015-12-30 13:56:53 +01:00
Willem Toorop 8c46e969d6 Notify for not implemented namespaces and ...
follow_redirects.
2015-12-30 13:55:45 +01:00
Willem Toorop 2a9dd53d8d Complement getdns_query documentation
+ +specify_class extension
2015-12-30 13:38:14 +01:00
Willem Toorop 11b0346ded Miscelaneous TSIG bugfixes 2015-12-30 12:25:58 +01:00
Willem Toorop 853bc6c150 Merge branch 'features/suffix_handling' into develop 2015-12-30 10:51:37 +01:00
Willem Toorop f84c67282d Merge branch 'features/add_warning_for_bad_dns' into develop 2015-12-30 10:51:26 +01:00
Willem Toorop d85d395770 Options to getdns_query to test suffix appending 2015-12-30 10:44:08 +01:00
Willem Toorop 875ef3f9d4 Successive suffix append retries 2015-12-29 23:06:02 +01:00
Willem Toorop 89b6c04d4f First query append 2015-12-29 17:34:14 +01:00
Willem Toorop 54498cd556 Distinct between suffix and suffixes more clearly 2015-12-29 16:23:04 +01:00
Willem Toorop ebe3d361ea Returning strings does include the null byte 2015-12-29 16:17:17 +01:00
Willem Toorop 5a388386b4 Store suffixes in wireformat 2015-12-29 16:00:15 +01:00
Willem Toorop f91e263f09 Simplify _set_string functions 2015-12-29 15:57:55 +01:00
Willem Toorop f3e3e47e15 Implement bad_dns extension 2015-12-29 14:10:18 +01:00
Willem Toorop ad23c446b6 Complement ChangeLog and bump versions 2015-12-24 16:57:48 +01:00
Willem Toorop d79884f10a Replace ssize_t with int in conversion funcs tpkg 2015-12-24 16:22:38 +01:00
Willem Toorop 240b34e215 Missing file removals with distclean 2015-12-24 16:22:03 +01:00
Willem Toorop 0b1e0e6d0f Definite December 2015 version of spec 2015-12-24 16:05:04 +01:00
Willem Toorop 2fa7fbefa4 Update spec to December 2015 version 2015-12-24 15:47:55 +01:00
Willem Toorop 3e2464af6d Changes that came out of portability tests 2015-12-24 15:28:12 +01:00
Willem Toorop a09a051ed5 New code, new dependencies... 2015-12-24 15:01:45 +01:00
Willem Toorop a2bdfb2f22 Merge branch 'features/windows-support' into develop 2015-12-24 14:44:18 +01:00
Willem Toorop 9d3905459e Miscellaneous fixes to compile on windows
Also without warnings.
2015-12-24 14:41:50 +01:00
saradickinson b777552f34 Merge pull request #131 from saradickinson/feature/pubkey-pinning
Feature/pubkey pinning
2015-12-24 10:13:53 +00:00
Willem Toorop caba5f19d5 Merge branch 'develop' into features/windows-support 2015-12-24 11:01:26 +01:00
Sara Dickinson f94798b237 Final mixups 2015-12-24 10:00:15 +00:00
Willem Toorop 05efbd79de Merge branch 'features/dns_root_servers' into develop 2015-12-24 10:51:50 +01:00
Willem Toorop 8bde787703 Use mkstemp instead of tmpnam to eliminate warning 2015-12-24 10:50:58 +01:00
Willem Toorop 71b2a44945 Remove root_servers comment leftovers 2015-12-23 21:19:52 +01:00
Sara Dickinson 3afba25dad Update test case and changeling 2015-12-23 18:00:44 +00:00
Sara Dickinson a5027981d9 Change how the aliasing is done so the tpkg tests will pass 2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor 2a50f4d2ac Set tls_auth_failed when any present authentication mechanism fails
We used to only have hostnames available.  now we have pubkey_pinsets
available as well.

We want upstream->tls_auth_failed to be 1 when any authentication
mechanism we've been asked for fails (and also when we haven't been
given any authentication mechanism at all).
2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor 57a04f61db Allow AUTHENTICATION_REQUIRED w/o hostname when pubkey pinset is available 2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor 77802808ce rename GETDNS_AUTHENTICATION_HOSTNAME with GETDNS_AUTHENTICATION_REQUIRED 2015-12-23 18:00:43 +00:00
Sara Dickinson 792ecd65b8 Add missing constant to const-info.c 2015-12-23 18:00:43 +00:00
Sara Dickinson 2ce806c05b Tinker with debug statements/comments. 2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor a9eb9ccca9 Check that the pinset matches if it is configured
if the upstream is configured to allow fallback, this will not be a
fatal error, but it will still be checked.

Future work:

 * verify any certs higher in the chain than the end-entity cert
 * deal with raw public keys
 * in the fallback case, report to the user whether the pinset match failed
2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor d09675539e Provide access to the pinsets during the TLS verification callback
We do this by associating a getdns_upstream object with the SSL object
handled by that upstream.

This allows us to collapse the verification callback code to a single
function.

Note that if we've agreed that fallback is ok, we are now willing to
accept *any* cert verification error, not just HOSTNAME_MISMATCH.
This is fine, because the alternative is falling back to cleartext,
which would be worse.

We also always set SSL_VERIFY_PEER, since we might as well try to do
so; we'll drop the verification error ourselves if we know we're OK
with falling back.
2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor 614d317fd8 getdns_query: add -K option to attach pinsets to getdns_contexts. 2015-12-23 18:00:43 +00:00
Daniel Kahn Gillmor 0d2256df09 set and return the pubkey_pinsets on the upstream resolvers 2015-12-23 17:59:50 +00:00
Daniel Kahn Gillmor b305f073fe add functions to translate between getdns_list and sha256_pin linked list 2015-12-23 17:59:50 +00:00
Daniel Kahn Gillmor 4dbe1813e4 added simple sha256 public key pinning linked list to getdns_upstream 2015-12-23 17:59:50 +00:00
Daniel Kahn Gillmor 5e64f1262b add getdns_pubkey_pinset_sanity_check() 2015-12-23 17:59:50 +00:00
Daniel Kahn Gillmor 91f04ecd5e add getdns_pubkey_pin_create_from_string() 2015-12-23 17:59:50 +00:00
Daniel Kahn Gillmor 4047bd09da define _DEFAULT_SOURCE as well as _BSD_SOURCE for glibc version 2.20 and up
in recent versions of feature_test_macros(7), it says of _BSD_SOURCE:

    Since glibc 2.20, this macro is deprecated.  It now has the same
    effect as defining _DEFAULT_SOURCE, but generates a compile-time
    warning   (unless   _DEFAULT_SOURCE   is   also  defined).   Use
    _DEFAULT_SOURCE  instead.    To   allow   code   that   requires
    _BSD_SOURCE  in  glibc  2.19  and earlier and _DEFAULT_SOURCE in
    glibc 2.20 and later to compile without  warnings,  define  both
    _BSD_SOURCE and _DEFAULT_SOURCE.
2015-12-23 17:57:49 +00:00
Willem Toorop ce1185166c Merge branch 'features/dns_root_servers' into develop 2015-12-23 17:41:40 +01:00
Willem Toorop 29b033c14c off-by-one bugfixes 2015-12-23 17:38:36 +01:00
Willem Toorop fbae577a54 Setting of root servers
test with

	getdns_query -f yeti.key -R yeti.hints nlnetlabs.nl A +dnssec_return_status

where yeti.key comes from:

	https://raw.githubusercontent.com/BII-Lab/Yeti-Project/master/domain/named.cache

and yeti.hints from:

	https://raw.githubusercontent.com/BII-Lab/Yeti-Project/master/domain/KSK.pub
2015-12-23 17:15:45 +01:00
Willem Toorop 746c26dafc Update Makefile dependencies 2015-12-23 12:26:39 +01:00
Willem Toorop 8ebb047693 Merge branch 'features/conversion_functions' into develop 2015-12-23 12:13:44 +01:00
Willem Toorop f9c2f96996 Fixes for miscelanous little zone parse errors
Hopefully the tpkg test is more deterministic now too...
2015-12-23 12:06:09 +01:00
Willem Toorop 11cd892662 Clean boundries on wireformat scans 2015-12-22 19:14:18 +01:00
Willem Toorop e4fa06a57b getdns_fp2rr_list conversion function
+ private conversion functions that respect custom memory handlers
+ converage of more different example functions in 260-conversion-functions test package
2015-12-22 18:37:24 +01:00
Willem Toorop 0cb513e9b7 Doc of (|_buf|_scan) style conversion funcs
+ (|_buf|_scan) versions of most of the conversion directions.
+ mk-const-info handles new return_t's defines
2015-12-22 16:04:43 +01:00
Willem Toorop 6519a05780 all debug config option for broadest src coverage
With the 300 tpkg test
2015-12-22 11:43:06 +01:00
Willem Toorop fe7a1e89e3 Constify new work 2015-12-22 11:32:15 +01:00
Willem Toorop 5bbcbb97a1 Merge branch 'develop' into features/conversion_functions 2015-12-22 11:28:27 +01:00
Willem Toorop 0a809cb7d8 Allow truncated answers to be returned 2015-12-22 10:56:20 +01:00
Willem Toorop ee2a1fbfe6 Merge branch 'features/tsig' into develop 2015-12-22 01:08:25 +01:00
Willem Toorop 8a8a017fc5 Validate received TSIG reply 2015-12-22 01:03:31 +01:00
Willem Toorop 6c1e00fc3f Send TSIG 2015-12-21 22:11:16 +01:00
wtoorop 8eeb3a6650 Merge pull request #129 from saradickinson/feature/edns-tcp-keepalive
Implement client side edns-tcp-keepalive

Great work!  Thanks!
2015-12-21 20:20:27 +01:00
Sara Dickinson f55721d261 Update unit test. Since 0 is the default, it can be set via the function. 2015-12-21 17:36:59 +00:00
Sara Dickinson 746a827baa Implement client side edns-tcp-keepalive 2015-12-21 17:05:56 +00:00
wtoorop eb6c6e3f67 Merge pull request #128 from saradickinson/feature/STARTTLS_removal2
Feature/starttls removal2

Excellent!  Thanks!
2015-12-21 16:38:10 +01:00
Willem Toorop 98dc4018c3 Setting & getting of tsig info per upstream 2015-12-21 12:22:59 +01:00
Sara Dickinson 91a73ab3d0 cleanup 2015-12-18 16:22:09 +00:00
Sara Dickinson 4165e874de Fix tests 2015-12-18 16:14:54 +00:00
Sara Dickinson 13ddf9ad83 Update constants 2015-12-18 16:14:54 +00:00
Sara Dickinson 3e97e1f032 Fix make file 2015-12-18 16:14:54 +00:00
Sara Dickinson c5b839bda8 remove STARTTLS 2015-12-18 16:14:54 +00:00
gmadkat 7c766e5284 Update configure.ac 2015-12-18 10:40:12 -05:00
Willem Toorop bc2ec7cee3 Specify TSIG parameters with getdns_query 2015-12-18 15:16:48 +01:00
Willem Toorop 95e9fa1f35 Better/shorter tpkg descriptions 2015-12-18 14:09:30 +01:00
Willem Toorop 0129550130 Dependencies 2015-12-18 14:04:16 +01:00
Willem Toorop 54f3179c0e Fix libmini_event getting context's mem funcs 2015-12-18 13:57:20 +01:00
Willem Toorop c8a9da69ea Fix libuv.c dependencies 2015-12-18 13:50:17 +01:00
Willem Toorop 5663f914fb Mode debug marco's to own header
To reduce dependency location fixes in test directory.
2015-12-18 13:40:52 +01:00
Willem Toorop e60afbdf0c Leave space with builddir recplacements
in make depend
2015-12-18 13:21:14 +01:00
Willem Toorop 296491f906 tpkg tests do their own autoreconf & libtoolize 2015-12-18 13:15:45 +01:00
Willem Toorop 8eab1530bf Fix make depend from builddir != srcdir 2015-12-18 13:14:27 +01:00
Willem Toorop 0d156abf5a Dependencies 2015-12-18 12:24:06 +01:00
Willem Toorop 638b841855 tpkg for dependencies checking 2015-12-18 12:22:54 +01:00
Willem Toorop 17d44a769c Test & fix installing 2015-12-18 11:13:22 +01:00
Willem Toorop 34af4a22f2 Get rid of tpkg help files
The fewer files to maintain the better
2015-12-18 11:03:54 +01:00
Willem Toorop 94cc17ff16 Wrong help text of symbols checkining tpkg 2015-12-18 10:46:11 +01:00
gmadkat 8da3775e22 Update README.md 2015-12-17 21:13:40 -05:00
Willem Toorop 5a65d2b693 Look further then you nose Willem! 2015-12-17 15:46:31 +01:00
Willem Toorop d3d2dbc1d3 inet_ntop and inet_pton from compat 2015-12-17 15:36:43 +01:00
Willem Toorop b839b97ac2 Oops... reverted syntax/style to agressively 2015-12-17 13:07:39 +01:00
Willem Toorop a2e15a169d Revert syntactic/style changes
So actual changes aren't obfuscated
2015-12-17 12:37:33 +01:00
Willem Toorop 4f37fb1e93 Fix mk-const-info problem with travis 2015-12-16 16:19:50 +01:00
Willem Toorop 71d8a50519 tpkg to warn if consts and symbols are out of sync 2015-12-16 15:48:09 +01:00
wtoorop 46ad6a82ed Merge pull request #127 from saradickinson/feature/rename_call_debugging
Rename return_call_debugging to return_call_reporting. Update index.h…
2015-12-16 15:29:16 +01:00
Sara Dickinson fc4e4f23df Rename return_call_debugging to return_call_reporting. Update index.html with change of content. 2015-12-16 14:20:35 +00:00
Willem Toorop 16b62f43eb Merge branch 'develop' into features/conversion_functions 2015-12-16 13:53:25 +01:00
wtoorop 69b54be99c Merge pull request #126 from saradickinson/feature/mac_tfo
Enable TFO by default if possible, add MAC OSX TFO support
Looks good, thanks.
2015-12-16 13:45:14 +01:00
Willem Toorop e747efe415 Merge branch 'develop' into features/conversion_functions 2015-12-16 12:42:32 +01:00
Willem Toorop 1ef4db8e9d Unique NSEC and NSEC3 rrsets in "validation_chain" 2015-12-16 12:40:32 +01:00
Willem Toorop d09e892285 Convert rr_dict with missing rdata to wire format
In wireformat this then means no rdata.
This is needed with the zonecut indicating DSes returned in the validation chain.
2015-12-16 12:02:53 +01:00
Willem Toorop 2c2359af61 Remove duplicate records in RRset before verifying
As suggested in RFC4034 section 6.3
2015-12-16 10:47:15 +01:00
Sara Dickinson 438870785a Improve config check for TFO 2015-12-15 18:11:45 +00:00
Willem Toorop b0aae6b51d Repeating and special rdata field 2 wireformat 2015-12-15 00:07:05 +01:00
Willem Toorop 0433c47466 Fix memory leak when deleting list items 2015-12-15 00:04:33 +01:00
Willem Toorop de269a4695 Wireformat writing for special rdata fields 2015-12-14 15:25:37 +01:00
Willem Toorop 4ae24761c7 Rename special wireformat parsing funcs
in aticipation of the special writing to wireformat functions
2015-12-14 12:38:25 +01:00
Willem Toorop 7baec89d4c Don't misuse getdns_data_type for something else 2015-12-14 12:13:06 +01:00
Sara Dickinson 736d9f20bf Enable TCP FastOpen by default and add support for OSX implementation of TFO. 2015-12-13 17:44:31 +00:00
Willem Toorop aadd4dc8bb Add conversion functions test package 2015-12-13 15:59:36 +01:00
Willem Toorop 5ae854b8bf Fix dict to wire of repeating rdata fields 2015-12-13 15:58:45 +01:00
Willem Toorop 75b0ae669a Fix rdf iter of single RR wireformat 2015-12-13 15:58:21 +01:00
Willem Toorop 61cd25d862 Merge branch 'develop' into features/conversion_functions 2015-12-11 12:22:34 +01:00
Willem Toorop f88214ab76 Correct include path on json pointer test 2015-12-11 12:21:58 +01:00
Willem Toorop 3752bf0a46 Merge branch 'develop' into features/conversion_functions 2015-12-11 11:59:27 +01:00
Willem Toorop c0831dd598 Move json pointers test to tpkg test 2015-12-11 11:56:44 +01:00
Willem Toorop c1b4694931 Setup test env from individually ran test packages 2015-12-11 11:05:52 +01:00
Willem Toorop aa1c38eb4f Merge branch 'features/tpkg' into develop 2015-12-10 17:34:01 +01:00
Willem Toorop 426d59d767 Disable IPv6 only test, because travis containers
don't support IPv6 :-(.

See: https://blog.travis-ci.com/2015-11-27-moving-to-a-more-elastic-future

Disabled test: getdns_context_set_upstream_recursive_servers_10
2015-12-10 16:49:55 +01:00
Willem Toorop de490408cd Use the verisign IPv6 upstream
google's sometimes timeouts...
2015-12-10 16:26:40 +01:00
Willem Toorop 69aed75d57 Travid in containers 2015-12-10 15:53:43 +01:00
Willem Toorop 1bb5320957 What am I thinking! 2015-12-10 15:39:26 +01:00
Willem Toorop 155b2b0d7a Small path mistake 2015-12-10 15:35:34 +01:00
Willem Toorop 2675554f6a Don't configure before running tests
+ run tests in a separate directory
2015-12-10 15:32:29 +01:00
Willem Toorop 45d12a9f0b travis doesn't have libuv-dev 2015-12-10 14:14:43 +01:00
Willem Toorop 5a4628e6fe tpkg based testing 2015-12-10 11:55:32 +01:00
Willem Toorop 91d638e4cd ignore getdns.pc 2015-12-09 16:13:32 +01:00
Willem Toorop 47dc07e940 First go at conversion to and from rr_dicts 2015-12-09 12:04:00 +01:00
Willem Toorop c53f074fdf Propagate consts with debugging symbols 2015-12-08 09:39:28 +01:00
Willem Toorop d67949d1e7 iterators go over const wireformat data 2015-12-07 16:43:41 +01:00
gmadkat 0d6d8116bc Update README.md 2015-12-04 17:01:10 -05:00
gmadkat e582f0f23e Update README.md 2015-12-04 16:23:05 -05:00
unknown 22a8550caa Bug fix in get_os_defaults, clean up code in winsock_event, add code to handle event handling differences in Winsock2 2015-12-04 16:12:43 -05:00
Willem Toorop dd836b2a11 Conversion functions prototypes 2015-12-03 14:54:38 +01:00
Willem Toorop 9eae0968a7 Merge branch 'neilcook-pkg-config' into develop 2015-12-03 14:11:14 +01:00
Willem Toorop 5c5feeed05 Merge branch 'pkg-config' of https://github.com/neilcook/getdns into neilcook-pkg-config 2015-12-03 14:10:34 +01:00
Neil Cook acf2fea365 pkg-config support 2015-12-02 13:15:16 -05:00
Claus Assmann 93f9f4c7d3 configure problem with getdns-0.5.1 on OpenBSD
Sorry for not using "github" to report a problem but I don't have
an account there...

Anyway, it seems the order of the libraries ssl and crypto is wrong:
with -lcrypto -lssl configure fails to find ub_fd():
: undefined reference to `SRP_Calc_A'
changing it to
-lssl -lcrypto
resolves the problem (and matches the order elsewhere,
e.g., unbound).
2015-11-26 11:42:02 +01:00
Willem Toorop 10a28817d0 Bumb versions, but 0.5.1 should have been 0.6.0 2015-11-26 11:19:22 +01:00
unknown 2d58ed465c Changes for Windows, Fix configure.ac to take in a winsock option to configure and generafigure, add ifdef's to stub out windows code for other platforms. 2015-11-22 22:38:13 -05:00
Willem Toorop 157f988791 Bumb versions, set release date 2015-11-18 17:32:50 +02:00
Willem Toorop 08bf613cde Prevent segfault with failed TLS handshake?
Need proper review for this patch!  Sara?
2015-11-15 12:46:21 -05:00
Willem Toorop 95618bb3a7 Merge branch 'release/v0.5.1' of github.com:getdnsapi/getdns into release/v0.5.1 2015-11-14 20:01:48 -05:00
Willem Toorop afe5db6b55 Get validation chain avoiding roadblocks 2015-11-14 20:00:13 -05:00
wtoorop dace6f2453 Merge pull request #123 from saradickinson/bugfix/call_debugging_and_transports
Fix bug with call_debugging reporting of UDP and add a getter for tls…
2015-11-13 16:42:57 +01:00
Sara Dickinson 508127a856 Add missing file.... 2015-11-13 14:47:03 +00:00
Sara Dickinson d75ba83013 Fix bug with call_debugging reporting of UDP and add a getter for tls_authentication 2015-11-13 13:28:43 +00:00
Willem Toorop 1bb2daff1e ub_setup_recursing not used without libunbound 2015-11-11 14:03:16 +01:00
Willem Toorop f3f854b35f Few more ChangeLog thins 2015-11-11 13:52:02 +01:00
Willem Toorop b9f8f94361 Update ChangeLog and check versions 2015-11-11 12:40:23 +01:00
wtoorop b3ce2cd897 Merge pull request #122 from dkg/develop
move EDNS_PADDING_OPCODE to assigned codepoint
2015-11-06 06:53:26 +09:00
Daniel Kahn Gillmor 69de906746 move EDNS_PADDING_OPCODE to assigned codepoint
in
https://www.ietf.org/mail-archive/web/dns-privacy/current/msg01067.html
, Tim Wicinski says:

> The EDNS Option Code for padding (aka draft-mayrhofer-edns0-padding)
> is '12'
2015-11-06 06:29:01 +09:00
wtoorop 638bc9f7b1 Merge pull request #121 from saradickinson/feature/hackathon1
Fix seg fault on timeout
2015-11-05 17:37:43 +09:00
saradickinson 1a72454b88 Remove debug 2015-11-05 14:41:23 +09:00
saradickinson 5f60683f57 Fix seg fault on timeout 2015-11-05 14:41:23 +09:00
Willem Toorop e7439cdaae Revert "Revert "why do we link libgetdns.so to dlopen?""
This reverts commit 8b96cd2f40.
2015-11-05 09:25:17 +09:00
Willem Toorop 8b96cd2f40 Revert "why do we link libgetdns.so to dlopen?"
This reverts commit c0bd844403.
2015-11-05 07:56:38 +09:00
Daniel Kahn Gillmor c0bd844403 why do we link libgetdns.so to dlopen?
i noticed that libgetdns.so is being linked against libdl, but i don't
think we're using dlopen or any of the other functions exported from
ldl.

fwict, ./configure is adding -ldl because of m4/acx_openssl.m4, which
claims:

	# openssl engine functionality needs dlopen().
	BAKLIBS="$LIBS"
	AC_SEARCH_LIBS([dlopen], [dl])
	if test "$LIBS" != "$BAKLIBS"; then
		LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
	fi

However, we're not using OpenSSL Engine support directly.  If some
library user wants to initialize openssl's engine support, they should
be able to do that with OpenSSL itself, and then they should be able to
get libcrypto and/or libssl to use libdl directly.

On some minimal systems, libcrypto and libssl might be built without
engine support at all; in that case, libgetdns is adding a superfluous
dependency to the linker.

I don't know the what the getdns policy is about tweaking the files in
m4/, but maybe the following patch can be safely applied?
2015-11-05 07:54:47 +09:00
Willem Toorop c7f4fc3625 Fix disabling roadblock avoidance with configure 2015-11-05 07:43:33 +09:00
Willem Toorop 26566a3b00 Merge branch 'develop' of github.com:getdnsapi/getdns into develop 2015-11-04 23:25:49 +01:00
Willem Toorop 7f4bdc0868 Bumb versions 2015-11-04 23:25:38 +01:00
Willem Toorop eb4ba438f7 return_validation_chain + roadblock_avoidance bug 2015-11-05 07:11:51 +09:00
Willem Toorop 8a6f7d5b90 Merge branch 'develop' into features/dnssec_roadblock_avoidance 2015-11-04 17:49:21 +09:00
Willem Toorop 0c3eb08f4d Merge branch 'features/call_debug' into develop 2015-11-04 16:23:22 +09:00
Willem Toorop 3a19050413 Code review changes
Commented inline on github
2015-11-04 16:18:22 +09:00
wtoorop 7230031c0a Merge pull request #119 from dkg/ietf94-privacy-hackathon
Thank you dkg!  Great work!

Interestingly you've put the configuration of those two features at "context" level.  Since both options (just like cookies) relate to upstreams, I think they should be configurable per upstream as well  (perhaps using the context settings as the defaults, over-loadable by those upstream options).  With my cookie implementation, I've implemented activation with an extension, but cookies also relate to upstreams, so perhaps they should be enableable per upstream as well (and have a global over-loadable setting in context).

Cheers,
-- Willem
2015-11-02 16:26:25 +09:00
Gowri 1bccd56244 Name change on test server certificate 2015-11-02 03:05:17 +01:00
Daniel Kahn Gillmor c322a8a330 add -P flag to getdns_query for EDNS padding policy 2015-11-01 15:49:56 +09:00
Daniel Kahn Gillmor 83bf5ab08b actually implement tls_query_padding_blocksize
since no DNS OPT value has been allocated, i chose a random value in
the experimental/local range.
2015-11-01 15:49:56 +09:00
Daniel Kahn Gillmor 1457c1a2b5 stash tls_query_padding_blocksize in the dns_req from the context 2015-11-01 15:49:56 +09:00
Daniel Kahn Gillmor b3128652f4 add tls_query_padding_blocksize property for getdns_context
This is a parameter to the getdns_context that tells the context how
much to pad queries that go out over TLS.

It is not yet functional in this commit, but the idea is to pad each
outbound query over TLS to a multiple of the requested blocksize.

Because we only have a set amount of pre-allocated space for dynamic
options (MAXIMUM_UPSTREAM_OPTION_SPACE), we limit the maximum
padding blocksize.

This is a simplistic padding policy.  Suggestions for improved padding
policies are welcome!
2015-11-01 15:49:56 +09:00
Daniel Kahn Gillmor 8291cdb455 add -c flag for EDNS Client Subnet privacy to getdns_query 2015-11-01 15:49:56 +09:00
Daniel Kahn Gillmor 05585281eb add test for context update callback for edns_client_subnet_private 2015-11-01 15:49:56 +09:00
Daniel Kahn Gillmor df3725e635 added edns_client_subnet_private to getdns_context
https://tools.ietf.org/html/draft-ietf-dnsop-edns-client-subnet-04

Using the above spec, an intermediate resolver may forward a chunk of
the client's IP address to the authoritative resolver.

Setting edns_client_subnet_private to a getdns_context in stub mode
will indicate to the next-hop recursive resolver that the client
wishes to keep their address information private.
2015-11-01 15:49:50 +09:00
Willem Toorop b062974fb1 ub_setup_recursion also for non roadblock avoidance 2015-11-01 15:48:31 +09:00
Daniel Kahn Gillmor 0b388872ea clarify per-query options vs. per-upstream options
Sending DNS cookies was overwriting any existing options (DNS OPT) in
the outbound query.

Also, DNS cookies may not be the only option that gets set
per-upstream (instead of per-query).

This changeset establishes a set of per-query options (established at
the time of the query), and a buffer of additional space for adding
options based on the upstream is in use.

The size of this buffer is defined at configure time (defaults to 3000
octets).

Just before a query is sent out, we add the per-upstream options to
the query.

Note: we're also standardizing the query in tls too, even though we're
not sending any upstream options in that case at the moment
(edns_cookies are much weaker than TLS itself)
2015-11-01 15:47:22 +09:00
Daniel Kahn Gillmor 3e90795680 enable talking to servers with ECDSA certs
There is no clear reason to reject servers that don't have RSA certs.
We should accept ECDSA certs as well.

(also, clean up comments about opportunistic TLS)
2015-11-01 15:47:03 +09:00
Willem Toorop af6947cbb3 Merge branch 'develop' into features/dnssec_roadblock_avoidance 2015-11-01 15:34:21 +09:00
Willem Toorop 8b9041325b Bugfix don't grow upstreams memory
upstreams have internal references and cannot be realloc'ed easily
2015-11-01 15:23:26 +09:00
jad 30043d2ba5 corrected name 2015-11-01 13:09:18 +09:00
jad 51eb2fdf55 working prototype 6 2015-11-01 12:47:49 +09:00
Willem Toorop ae2cc39a36 Full roadblock avoidance functionality 2015-11-01 12:28:43 +09:00
jad f5662bbf32 working prototype 5 2015-11-01 11:43:12 +09:00
jad 2d20e18b8a working prototype 4 2015-11-01 11:14:45 +09:00
jad 25f7f2182b working prototype 3 2015-11-01 11:04:03 +09:00
jad 80864655d7 Working prototype 2 2015-11-01 10:51:00 +09:00
jad a85b17c885 working prototype 1 2015-11-01 10:24:02 +09:00
Willem Toorop 58885e04d7 dnssec_roadblock_avoidance extension 2015-10-31 21:04:08 +09:00
Willem Toorop 35c803208b Bit more concise and clear confusing code text 2015-10-31 18:24:24 +09:00
Willem Toorop fb6642d6a5 Print response dict when there is one 2015-10-31 17:59:14 +09:00
Willem Toorop 521e46879b Document that thing that we keep forgetting about 2015-10-31 17:15:36 +09:00
Willem Toorop 9ce441e59a --enable-debug-sched for getdns_query too 2015-10-31 16:24:49 +09:00
Willem Toorop de59b700ce Fix libidn really absent + NetBSD fixes 2015-10-29 19:13:39 +01:00
Willem Toorop 0a717f5d51 Warning with older (less intelligent) compiles 2015-10-29 16:25:07 +01:00
Willem Toorop d691973571 Bumb versions for 0.5.0 release 2015-10-29 15:43:00 +01:00
Willem Toorop 8c3d348f05 Help text typo 2015-10-27 16:43:25 +01:00
Willem Toorop 3c5f2d4c4d Merge branch 'v0.5.0' of github.com:getdnsapi/getdns into v0.5.0 2015-10-27 16:39:09 +01:00
wtoorop a8351f80e6 Merge pull request #117 from saradickinson/bugfix/tls_ciphers
Fix error that was not allowing cipher suite fallback for opportunist…
2015-10-27 16:38:25 +01:00
Sara Dickinson e397d1e020 Fix error that was not allowing cipher suite fallback for opportunistic TLS. 2015-10-25 15:28:20 +00:00
Willem Toorop 4cbdfde0e6 Typo fix 2015-10-22 16:26:32 +02:00
Willem Toorop c613743644 Update spec to 0.701 2015-10-22 15:12:15 +02:00
Willem Toorop 973fcbddcc Don't assume mini_event loop 2015-10-22 14:38:34 +02:00
Willem Toorop 47b77c948a Fix small memory leak when switching event loops 2015-10-22 14:16:53 +02:00
Willem Toorop 98a2c497d2 ldns CFLAGS for tests (+ make deps) 2015-10-22 13:46:23 +02:00
Willem Toorop fbc3b2d6a8 Use the NOT_IMPLEMENTED return code! 2015-10-22 12:13:40 +02:00
Willem Toorop b88c74b4c8 Synchronize with October 2015 spec 2015-10-22 12:02:04 +02:00
Willem Toorop 276b4c6cd8 Update dependencies and add Andrew Cathrow to team 2015-10-22 11:32:20 +02:00
Willem Toorop d601443c7e Bump versions and ChangeLog for 0.5.0rc1 2015-10-21 17:19:50 +02:00
Willem Toorop 31a07752f0 New non API functions + consts in getdns_extra.h 2015-10-21 17:02:50 +02:00
Willem Toorop ebd94f48cf Anticipate missing X509_V_ERR_HOSTNAME_MISMATCH 2015-10-21 16:01:40 +02:00
Willem Toorop 7647005285 Report memory errors in json-pointers test 2015-10-21 16:01:16 +02:00
Willem Toorop 3cc44ffcb1 Merge remote-tracking branch 'sara/feature/tls_auth_api' into features/tls_auth_api 2015-10-21 15:34:57 +02:00
Sara Dickinson 3be47edbb3 More cleanup 2015-10-16 18:40:33 +01:00
Sara Dickinson b74c62066c Cleanup 2015-10-16 18:31:57 +01:00
Sara Dickinson 689447509a Change port used for TLS to 853 2015-10-16 17:00:14 +01:00
Sara Dickinson 28ffb2fdf6 Add ls_authentication to API 2015-10-16 17:00:14 +01:00
Sara Dickinson 6b4ee4ed31 Block authenticated requests on unauthenticated connection 2015-10-16 17:00:14 +01:00
Sara Dickinson af617e92a7 Implement authenticaiton fallback on a given upstream (needs more work). Also need API option to set auth requirement. 2015-10-16 17:00:14 +01:00
Sara Dickinson e710286e45 Start work on better authentication 2015-10-16 16:57:13 +01:00
Willem Toorop d859e93c7e Don't fail on missing tgz in spec 2015-10-08 13:39:24 +02:00
Willem Toorop d0a80925c2 Bugfixes for setting with json pointers
+ scratchpad for developing/debugging
2015-10-08 12:54:30 +02:00
Willem Toorop 3373ed5056 Merge json pointer branch from spec repo
(including examples)
2015-10-07 13:15:07 +02:00
Willem Toorop 5e269b69fa Reverse example 2015-10-06 23:07:57 +02:00
Willem Toorop 820a657297 Check getdns_dict_remove_name parameters 2015-10-06 13:12:33 +02:00
Willem Toorop f632ef8939 The tree example with json pointers 2015-10-06 12:29:15 +02:00
Willem Toorop 51bfa9c86a Simple example rewritten 2015-10-06 11:57:18 +02:00
Willem Toorop 3aca772220 Off-by-one error 2015-10-06 09:46:59 +02:00
Willem Toorop e3947d7110 getdns_dict_remove_name with json pointers
+ improved json pointers symantics
2015-10-05 17:18:32 +02:00
Willem Toorop f6619d28d8 JSON pointer setters 2015-10-02 15:26:05 +02:00
Willem Toorop 40269a241c Merge branch 'develop' into features/json-pointers 2015-10-02 12:47:10 +02:00
Willem Toorop 65663e6da8 DNSSEC zonecut finding issues
Thanks Theogene Bucuti
2015-10-02 12:45:32 +02:00
Willem Toorop 6a0d1a968d Multi-level json pointers (retry)
+ synchronous-concise example
2015-10-01 15:43:17 +02:00
Willem Toorop 074344fbf9 Multi level json pointer lookups + example 2015-10-01 15:16:12 +02:00
Willem Toorop ca50a984c8 1 level JSON pointer reference lookup 2015-09-30 16:05:19 +02:00
Willem Toorop 3bec89bee5 Native crypto, no ldns dependency anymore
Except for the unit tests.

libexpat was never a dependency for libunbound (it is for unbound-anchor).
Extend contributors section in README.md to mention everyone who has contributed to the repository too.
2015-09-29 14:03:48 +02:00
Willem Toorop 8dfb7454d6 Signature inception and expiry checking 2015-09-28 13:48:51 +02:00
Willem Toorop 7bf481d812 ldns still (but only) needed for unit tests 2015-09-28 11:44:39 +02:00
Willem Toorop 59f4feb5e6 Native DS with DNSKEY compare + rm ldns dependency 2015-09-25 14:28:47 +02:00
Willem Toorop d8cc7b1ba3 Native signature verification 2015-09-25 11:48:58 +02:00
Willem Toorop 2e4c0928f7 Import unbound's crypto 2015-09-23 16:48:54 +02:00
Willem Toorop fda5394540 Verify raw buffer (still with ldns) 2015-09-23 16:03:59 +02:00
Willem Toorop 8b414c8570 Sort RR's to validate 2015-09-22 12:27:17 +02:00
Willem Toorop e47bd33ec0 Determine validation buffer size 2015-09-21 17:13:44 +02:00
Willem Toorop bf7f44dcb7 Put rrs to validate in rrset 2015-09-21 12:59:30 +02:00
Willem Toorop f673e12106 Memory management for _getdns_verify_rrsig 2015-09-21 12:36:41 +02:00
Willem Toorop 5db5a8b5e6 Correct some comment text 2015-09-18 09:53:27 +02:00
Willem Toorop 145e6928bd develop branch is always one version further 2015-09-09 12:48:10 +02:00
Willem Toorop 505bcf028b Merge branch 'v0.3.3' into develop 2015-09-09 12:46:05 +02:00
Willem Toorop dbc53e773d 0.3.3 quickfix release 2015-09-09 12:45:29 +02:00
Willem Toorop bb29789d24 Merge branch 'v0.3.3' into develop 2015-09-08 12:01:08 +02:00
Willem Toorop a543c23926 Spelling 2015-09-08 11:24:45 +02:00
Willem Toorop 84ad5850c9 get_api_information():version_string also for RCs 2015-09-08 11:20:52 +02:00
Willem Toorop 46ea366f5f Fix dnssec validation of direct CNAME queries
Thanks Simson L. Garfinkel.
2015-09-08 10:52:04 +02:00
Willem Toorop 560f168460 Have a release candidate first 2015-09-08 10:31:06 +02:00
Willem Toorop 6c7c5c9281 Bumb version 2015-09-04 16:20:21 +02:00
Willem Toorop 15cda6a21d Fix readme 2015-09-04 16:19:33 +02:00
Willem Toorop c3b59e76fa Merge branch 'v0.3.3' into develop 2015-09-04 16:14:41 +02:00
Willem Toorop b5ac8c1b50 Don't alter events before clearing... 2015-09-04 16:13:49 +02:00
Willem Toorop 87b7c6a834 Merge branch 'v0.3.2' into develop 2015-09-04 11:04:08 +02:00
Willem Toorop 75f1aa6ccd Typo 2015-09-04 11:02:39 +02:00
Willem Toorop 53e23f1358 Revert "Revert "Merge pull request #112 from saradickinson/features/tls_auth""
This reverts commit 6d29e6044e.
2015-09-04 10:56:30 +02:00
Willem Toorop 22f48c3cda Merge branch 'v0.3.2' into develop 2015-09-04 10:52:02 +02:00
Willem Toorop b7b90cafaf Mention libtoolize -ci in README.md 2015-09-04 10:37:02 +02:00
Willem Toorop a3f02905b0 thread instead of a process for ub_fd() signalling 2015-09-04 10:33:08 +02:00
Willem Toorop afdf25340c Prepare for 0.3.2 release 2015-09-03 15:39:44 +02:00
Willem Toorop 0e66d28be8 Set processing flag around user callbacks
To fix destroying contexts from user callbacks in stub mode.
The complete test suite runs in stub mode now too.
2015-09-03 15:07:29 +02:00
Willem Toorop 9586418522 Merge branch 'shane-kerr-master' into v0.3.2 2015-09-03 14:21:09 +02:00
Willem Toorop 7793629515 Merge branch 'shane-kerr-master' into develop 2015-09-03 14:20:13 +02:00
Willem Toorop 5f73fded75 Simplify list creation a little bit 2015-09-03 13:14:34 +02:00
Willem Toorop b1489eac1f One more priv_ name renamed to _ 2015-09-03 13:13:57 +02:00
Shane Kerr 0f1dd9cdd2 Fix directory creation documentation for anchor file 2015-09-03 10:31:41 +00:00
Willem Toorop cbb668379f One more string2bindata case... 2015-09-03 12:15:22 +02:00
Willem Toorop cbc8b1e303 Let travis make libtool too 2015-08-28 13:44:36 +02:00
Willem Toorop d8d57ab9ad ignore libtoolize generated files 2015-08-28 13:42:14 +02:00
Willem Toorop c41627ae0d Remove libtool generated files too
Reinstall with libtoolize -cif
2015-08-28 13:40:41 +02:00
Willem Toorop 6d13ec19cd --with-getdns_query configure option +
make pub target (for signing and hashing dist tarball) +
make megaclean target (for erasing all source and git reset --hard)
2015-08-28 13:33:02 +02:00
Willem Toorop 2347d7d775 This is 0.3.2 release candidate 1 2015-08-28 11:18:07 +02:00
Willem Toorop 8ca93a22de --enable-stub-only configure option 2015-08-28 11:09:32 +02:00
Willem Toorop 15943b1b49 Bump versions 2015-08-27 14:40:19 +02:00
Willem Toorop d58d90752b HAVE_LIB* only after include "config.h" 2015-08-27 14:38:23 +02:00
Willem Toorop a8d2e489ad Allow --without-libidn configure option 2015-08-27 14:24:01 +02:00
Willem Toorop 3034e0c62a Mention new contributors in README 2015-08-27 13:59:20 +02:00
Willem Toorop 15efffb625 Document changes since 0.3.1 2015-08-27 13:53:02 +02:00
Willem Toorop 6d29e6044e Revert "Merge pull request #112 from saradickinson/features/tls_auth"
This reverts commit d436165a88, reversing
changes made to 7c902bf73c.
2015-08-27 13:31:22 +02:00
Willem Toorop 55aa759730 Don't spawn extra process for recursion calls 2015-08-27 13:22:24 +02:00
Willem Toorop 6446643396 Get lines via custom eventloop 2015-08-26 22:25:42 +02:00
Willem Toorop 32e4e8fa9d Debug custom event loop 2015-08-26 17:01:28 +02:00
Willem Toorop 4ecf6b23dc First round of bugfixes in custom eventloop 2015-08-26 16:13:25 +02:00
Willem Toorop c86df63b7a Custom event loop in getdns_query 2015-08-26 14:32:46 +02:00
Willem Toorop f312a6cfc5 Revert "plain_mem_funcs_user_arg need not be exposed"
This reverts commit d0ff5d8fea.

It does need to be exposed and is used inderectly through GETDNS_MALLOC which uses MF_PLAIN which is an alias for plain_mem_funcs_user_arg.
2015-08-24 14:37:02 +02:00
Willem Toorop d0ff5d8fea plain_mem_funcs_user_arg need not be exposed 2015-08-24 14:15:31 +02:00
Willem Toorop 015e387ea5 Final internal symbols rename to _getdns prefix 2015-08-19 16:33:19 +02:00
Willem Toorop b9e8455e27 Internal symbols always prefixed with _getdns 2015-08-19 16:30:15 +02:00
Willem Toorop 1f638ccd0b Internal getdns_mini_event to _getdns_mini_event 2015-08-19 16:26:39 +02:00
Willem Toorop fcd595298a Rename all priv_getdns internal symbols to _getdns 2015-08-19 16:22:38 +02:00
Willem Toorop 7971152742 Make all private functions static 2015-08-19 16:15:26 +02:00
Willem Toorop 450aabefcc Make util symbols private (i.e. prefix _getdns) 2015-08-19 16:07:01 +02:00
Willem Toorop 09492cbf46 _getdns_nsec3_hash_label without ldns 2015-08-19 15:19:02 +02:00
Willem Toorop 6350b4fad4 --without-libunbound option to configure 2015-08-19 10:47:46 +02:00
Willem Toorop 972ebf55d0 Merge branch 'features/str_without0byte' into develop 2015-08-17 16:30:54 +02:00
wtoorop d436165a88 Merge pull request #112 from saradickinson/features/tls_auth
Features/tls auth
2015-08-17 12:53:38 +02:00
Willem Toorop 7c902bf73c Fix fallback failures fix ;) 2015-08-17 12:35:10 +02:00
wtoorop 9476263b1b Merge pull request #111 from saradickinson/bugfix/transport_timeouts
Fix transport fallback failures. Add manual regression test script.
2015-08-17 12:30:53 +02:00
Sara Dickinson dc7d7e7689 Fix openssl dependancy 2015-08-15 16:35:30 +01:00
Sara Dickinson 2404cc2c8e Extend regression test 2015-08-15 15:27:58 +01:00
Sara Dickinson 262263dbf4 More detail in documentation 2015-08-15 15:11:29 +01:00
Sara Dickinson 45de1f65b3 Update docs with details of OS X certificate handling. 2015-08-15 14:40:16 +01:00
Sara Dickinson dbad8a9003 Restrict transport list to 1 entry for each valid transport 2015-08-15 14:40:16 +01:00
saradickinson cb1dff1ac7 Add ability to verify server certificate using hostname for TLS/STARTTLS
NOTE: This implementation will only work for OpenSSL v1.0.2 and later.
Doing it for earlier versions is totally insane:

  https://wiki.openssl.org/index.php/Hostname_validation
2015-08-15 14:40:15 +01:00
Sara Dickinson 8beace7036 Fix location in manual test script. Add build/ to .gitignore 2015-08-15 14:36:36 +01:00
Sara Dickinson ab60211020 Fix fallback failures. Add manual regression test script. 2015-08-12 11:42:02 +01:00
Willem Toorop 3cbef7ee9e Fix make distclean 2015-07-19 17:52:09 +02:00
Willem Toorop 37880d6869 second attemt fixing travis 2015-07-19 17:39:54 +02:00
Willem Toorop f302102301 Try to make travis work... 2015-07-19 17:35:27 +02:00
wtoorop 75352891e7 Merge pull request #109 from dkg/develop
improve documentation

Looks good! Thanks!
2015-07-19 17:26:27 +02:00
Willem Toorop 488820286e Let travis do autoreconf 2015-07-19 17:22:24 +02:00
Daniel Kahn Gillmor 55b7ebac48 ignore autoconf-generated files 2015-07-19 12:22:11 +02:00
Daniel Kahn Gillmor 0dc08a30ce tell emacs users how to follow coding conventions 2015-07-19 12:22:11 +02:00
Daniel Kahn Gillmor 540ffb8a4a report manpage date based on the name of the API
This links the manual pages to the API "string version", and avoids
problems with reproducibility (the man pages should not get modified
simply because they are built in a different month, or because they
were built with a different locale).

Gbp-Pq: Name 0001-report-manpage-date-based-on-the-name-of-the-API.patch
2015-07-19 12:22:10 +02:00
Daniel Kahn Gillmor 319a20a66c improve documentation
improve the documentation of the getdns_upstream objects.
2015-07-19 12:22:10 +02:00
Willem Toorop d52b10e703 Fix builddir/srcdir for tests 2015-07-19 12:15:28 +02:00
Willem Toorop e91f7d53b5 Correct getdns_extra.h location for tests too 2015-07-19 11:48:24 +02:00
Willem Toorop ac6e0b641d rm autoconf generated files from repo 2015-07-19 11:40:03 +02:00
Willem Toorop 44b8e44c07 Fix srcdir/buildir locations for version.lo 2015-07-19 11:35:29 +02:00
Willem Toorop e2170cb115 Fix srcdir/buildir locations 2015-07-19 11:28:42 +02:00
Willem Toorop 0c5dd59035 Fix upstream/transport array in 1 upstream dict 2015-07-19 09:43:12 +02:00
Willem Toorop 898fc15b6b Zero size only for non-repeating remaining data 2015-07-18 18:04:11 +02:00
Willem Toorop 16da0a01b5 Prepare for emergency release 2015-07-18 17:39:19 +02:00
Willem Toorop 276e9fa5f3 Zero size only allowed for non repeating rdfs 2015-07-18 16:59:00 +02:00
Willem Toorop 4f0cf62d37 Set release date 2015-07-17 18:10:57 +02:00
Willem Toorop 433daf7f53 0.3.0 in configure 2015-07-17 18:10:02 +02:00
Willem Toorop 7c83d0f295 {API 0.604] July 2015 release 2015-07-17 18:07:36 +02:00
Willem Toorop 9daaa1638c One more event callback setting before clearance 2015-07-14 13:42:40 +02:00
Willem Toorop d4e932890a Do not reset event callbacks before clearing 2015-07-14 11:54:25 +02:00
Willem Toorop 3c80a8a1af Check destruction of upstreams in correct way 2015-07-14 11:11:06 +02:00
Willem Toorop 587b320d95 DNS tree was upside down (wording in comments)
According to RFC1034 Section 4.2.1., the zone's apex is at the top and delegations at the bottom.
2015-07-14 10:49:00 +02:00
Willem Toorop 554f015931 Deschedule idle_timeouts on context destroy 2015-07-14 10:44:15 +02:00
Willem Toorop 6f21d89e2a Lookup DS only, for no sigs INSECURE 2015-07-14 10:22:42 +02:00
Willem Toorop a8adf662d1 Fix memory leak setting transports 2015-07-13 16:39:43 +02:00
Willem Toorop 5c61954427 Fix geting recursive_upstream_servers 2015-07-13 16:22:39 +02:00
Willem Toorop 17faffa664 Ignore 2 more autoconf generated files 2015-07-13 15:42:48 +02:00
Willem Toorop c7d40e2cbc Strings in bindata's without '\0' byte 2015-07-13 15:41:40 +02:00
Willem Toorop 12567f5338 Fix compiling with --enable-debug-sched 2015-07-13 11:09:56 +02:00
Willem Toorop 431415bd3d rm debugging fprintf leftover 2015-07-10 10:18:00 +02:00
Willem Toorop 0d2f3a5bd9 functions and defines to get versions
About the library and the API
In both strings and in numbers
2015-07-10 00:57:58 +02:00
Willem Toorop 2884abe870 Allow alternative trust anchors + ...
Switch freely between stub and recursive resolving
2015-07-10 00:05:26 +02:00
Willem Toorop 4987a27264 Pretty print TLDs 2015-07-10 00:04:14 +02:00
Willem Toorop 2dab8dd4d6 Fix handling of non specific trust anchors and ...
unsported DS digest types
2015-07-09 23:11:56 +02:00
Willem Toorop 254699ad8b Constants must be in searchable order 2015-07-09 23:11:28 +02:00
Willem Toorop cacd8951ff getdns_query -k to test for root trust anchor
has exit status 0 on success, 1 otherwise.
2015-07-09 23:10:22 +02:00
Willem Toorop 70857ccc74 Proper handling of system stub query timeouts 2015-07-09 23:09:39 +02:00
Willem Toorop 4135f633ac Fix invalid memory reads 2015-07-09 15:40:00 +02:00
Willem Toorop d9fca20f18 Update consts, symbols and dependencies 2015-07-09 14:40:13 +02:00
Willem Toorop bb20de43bd Update EDNS0 COOKIE option code 2015-07-09 14:30:11 +02:00
Willem Toorop c30f64497e Update ChangeLog 2015-07-09 14:27:22 +02:00
Willem Toorop 423fbdf546 Prepare for 0.3.0 release 2015-07-09 14:05:45 +02:00
Willem Toorop cea8ae4d11 [API 0.602] getdns_context_set_dns_transport_list
And the getdns_context_set_idle_timeout() functions.
2015-07-09 14:00:26 +02:00
Willem Toorop ec476a9129 getdns_root_trust_anchor up in getdns.h.in
So it is on the same spot as where it is in the original specification.
This to ease comparing getdns.h with the API's getdns_code_only.h
2015-07-09 10:37:02 +02:00
Willem Toorop 098e0f19c4 Don't skip points zone cuts with trusted keys
A new keyset must be authenticated at every zone cut.
A keyset from an ancecter of the immediate zone may never be used
to authenticate RRsets within a zone.

(Review from Wouter)
2015-07-09 08:15:38 +02:00
Willem Toorop d87d951874 set ds_signer only when actually signed 2015-07-08 17:15:27 +02:00
Willem Toorop d4849dc0ba Fix read of uninitialized memory
Not a dangerous one though, but still...
2015-07-08 15:36:39 +02:00
Willem Toorop e8030b34d2 query_len not used 2015-07-08 15:05:40 +02:00
Willem Toorop 201b6af9a2 clang compiler warnings + 1 bug!
Bug is countring insecure answers in util-internal.c
found by clang warning reporting
2015-07-08 13:07:24 +02:00
Willem Toorop 2918c8b472 DSes with best digest + INSECURE on unsupportd alg
Adaptations to function ds_authenticates_keys.

With multiple DSes, only the ones with the highest (supported)
digest type will be used to authenticate DNSKEYs.

NO_SUPPORTED_ALGORITHMS will be returned if there were
DSes for a key in the DNSKEY set, but none of them has a supported
digest or algorithm.  This leads to dnssec_status INSECURE.
2015-07-08 12:21:04 +02:00
Willem Toorop a5bacfefcf memory leak fixes 2015-07-08 11:07:44 +02:00
Willem Toorop 51a04f8f6c RSAMD5 is deprecated 2015-07-08 00:18:19 +02:00
Willem Toorop 3b45255d1e Try only closest trust anchors 2015-07-08 00:10:10 +02:00
Willem Toorop e48b0c7fd7 INSECURE when NSEC3 iteration count too high
Fix from Wouter's review
2015-07-07 22:33:53 +02:00
Willem Toorop 4b53d70199 Review from Wouter minor issues 2015-07-07 14:52:32 +02:00
Willem Toorop e571883811 Fix test for NODATA address_sync lookup
hampster.com no longer suitable anymore.
2015-07-07 11:46:52 +02:00
Willem Toorop 83425f959e Review comments from Wouter
Thanks!
2015-07-07 11:15:38 +02:00
Willem Toorop 43980e9020 [API 0.601] CSYNC RR type 2015-07-06 14:14:46 +02:00
Willem Toorop af23930725 CSYNC rr type 2015-07-06 12:45:08 +02:00
Willem Toorop 55444d07a2 Documentation in comments as a review guideline 2015-07-06 11:57:16 +02:00
Willem Toorop 70edb60f09 Some comment about google public dns 2015-07-04 13:14:16 +02:00
Willem Toorop 0e977ee4fb rearrangements for documentational reasons
+ a fix for opt_out bug
2015-07-04 13:01:16 +02:00
Willem Toorop 7e3fbe547a Check NSEC3 CE to be without delegations
(no DNAME, no NS or, if NS then also SOA)
2015-07-04 10:53:31 +02:00
Willem Toorop f59b32414c Three NSEC3 related things:
- Better checking for type bits
- NSEC3 Insecure proofs for opt-out on head's
- NSEC3 wildcard NODATA proof
2015-07-04 10:23:02 +02:00
Willem Toorop 99f0026961 Allow remaining data RDF to be zero size
Usefull for NSECs on empty non terminals!
2015-07-04 08:09:50 +02:00
Willem Toorop 682f10b271 NSEC3s on empty non terminals
bitmap might even not be present.
2015-07-04 00:08:03 +02:00
Willem Toorop 2c09ff2541 Deal with synthesized CNAMEs from DNAMEs 2015-07-03 23:44:15 +02:00
Willem Toorop 4d4f235f76 NSEC handling complete 2015-07-03 22:50:29 +02:00
Willem Toorop a66232153a Some more NSEC conditional checks
(from studying unbound code)
2015-07-03 00:44:53 +02:00
Willem Toorop af49184fd5 A single RRSIG per RRSET in validation_chain 2015-07-02 17:30:37 +02:00
Willem Toorop d47c533b64 getdns_validate_dnssec validate replies in turn 2015-07-02 15:31:31 +02:00
Willem Toorop ae580575d0 Only validate NOERROR & NXDOMAIN 2015-07-02 12:59:28 +02:00
Willem Toorop e3fe89c802 Turn on specific debugging with configure options 2015-07-02 12:49:50 +02:00
Willem Toorop f066d5ef73 Merge branch 'features/native-stub-dnssec' into develop
Conflicts:
	configure.ac
	src/stub.c
2015-07-02 10:27:27 +02:00
Willem Toorop 6cffc4792b Validate replies with getdns_validate_dnssec
You can feed it the replies_tree as the records to validate list
2015-07-02 00:25:41 +02:00
Willem Toorop f92dd5ac0d getdns_validate_dnssec with new DNSSEC code 2015-07-01 21:50:47 +02:00
Willem Toorop 2b3aa84337 getdns_query show output of getdns_validate_dnssec 2015-07-01 14:38:24 +02:00
Willem Toorop 41cf772fb3 Trust anchors in wireformat in context 2015-06-30 14:43:52 +02:00
Willem Toorop 996b09ba2b Reminder for single RRSIG per RRSET return
With the dnssec_return_validation_chain extension
2015-06-30 00:12:30 +02:00
Willem Toorop 3cd9caa704 Evaluate DNSSEC only with stub resolution 2015-06-29 23:48:46 +02:00
Willem Toorop 8d5ac3afde Store dnsreq->name in wire format 2015-06-29 23:32:49 +02:00
Willem Toorop 407ecffb67 dnssec_status in netreqs 2015-06-29 22:23:01 +02:00
wtoorop 93e0237273 Merge pull request #106 from saradickinson/features/transport_fixups
Features/transport fixups
2015-06-29 21:09:47 +02:00
Sara Dickinson 8bb01c46ad Turn TFO off by default. Strange crash found if TCP is not available. 2015-06-29 17:39:14 +01:00
Sara Dickinson e5a80943e2 Turn fast open on by default. Fix build warning. 2015-06-29 11:54:31 +01:00
Sara Dickinson e20d679bc8 Improve TCP close handling and sync connection closing 2015-06-29 09:09:13 +01:00
wtoorop 9ac1ea39b8 Merge pull request #105 from saradickinson/features/transport_fallback
Features/transport fallback
2015-06-29 09:21:31 +02:00
Willem Toorop 2b83bddd4d More sense making parameter names for is_subdomain 2015-06-29 09:18:53 +02:00
Willem Toorop 4e45d31413 No wildcard NSEC3 check on opt-out 2015-06-28 13:41:48 +02:00
Willem Toorop 170218c350 Expand dname rdata fields before compare 2015-06-27 23:47:47 +02:00
Willem Toorop f6c1a48b6e Validaton of wildcard answers 2015-06-27 23:28:23 +02:00
Sara Dickinson 8c61ecd024 Finally fix problem with upstream walking that was causing intermittent crash. And fix sync idle timeouts. Again. 2015-06-26 16:14:04 +01:00
Sara Dickinson 8925fb22fc More bug fixes and tidy up 2015-06-26 14:27:21 +01:00
Willem Toorop 0411668cb4 blah 2015-06-26 11:39:44 +02:00
Sara Dickinson ddd90e29c5 Fix idle_timeout bug 2015-06-26 08:19:22 +01:00
Willem Toorop fe4b7095b3 Set has_ta before unbound context initialization 2015-06-26 00:29:20 +02:00
Willem Toorop 19b79b066f NSEC NXDOMAIN + NSEC3 denial of exist. validation 2015-06-26 00:26:40 +02:00
Sara Dickinson cb5bbac26d Do better with unbound transport mapping and fix problems with sync fallback 2015-06-25 20:21:00 +01:00
Willem Toorop ea69d30e64 Validation of signed responses
+ start with unsigned responses (only the NSEC NOERROR case)
2015-06-25 10:04:19 +02:00
Sara Dickinson 8819d29535 Implement TCP fallback and hack for lack of sync idle timeout. 2015-06-24 18:49:34 +01:00
Sara Dickinson c9a0ffc7a5 Improve error reporting in getdns_query. 2015-06-23 17:01:43 +01:00
Willem Toorop c7c7884350 Generalize getdns_rrset for raw pkt, not netreq 2015-06-23 16:41:34 +02:00
Willem Toorop 1babc715b7 Init context->dnssec_trust_anchors with default 2015-06-23 16:40:47 +02:00
Sara Dickinson c425f96e0b Fix TLS handshake for sync messages. 2015-06-23 15:39:56 +01:00
Willem Toorop 5c01df226c Init netreq dnssec status at netreq init time 2015-06-23 16:39:30 +02:00
Willem Toorop 3631cd658a get_val_chain for all possible scenarios 2015-06-23 00:00:20 +02:00
Sara Dickinson 67e282edd1 More work on transport/upstream fallback. TLS and UDP fallback not working yet.... Probably need to maintain a current upstream for each transport to get this working properly 2015-06-22 18:02:28 +01:00
Sara Dickinson 57b163c790 Fix bug in STARTTLS timeout 2015-06-22 14:31:19 +01:00
Sara Dickinson b73b5b2792 Fix some bugs... 2015-06-21 16:55:12 +01:00
Sara Dickinson 635cf9e182 Re-factor of internal handing of transport list. 2015-06-19 18:28:29 +01:00
Willem Toorop e328f848eb getdns_rrset and iterators 2015-06-19 18:02:16 +02:00
wtoorop d819bc901b Merge pull request #104 from saradickinson/features/transport_api
Commit addition of transport list to the API.
2015-06-18 22:02:46 +02:00
Sara Dickinson 0acdcc34b0 Changelog, idle_timeout test, formatting 2015-06-18 17:29:23 +01:00
Sara Dickinson 68dfb15706 Add context idle timeout 2015-06-18 17:11:11 +01:00
Sara Dickinson 8dd8d90e74 Commit addition of transport list to the API.
- set and get functions are added.
- Existing transport functions retained for backwards compatibility.
- Basic combinations work as before, but underlying functional changes and cleanup are not complete yet...
- Context level options for timeouts and max_transactions_per_tcp_connection coming soon...
2015-06-17 17:18:09 +01:00
Willem Toorop 129e340e8e Collect validation chains for RRs without sigs 2015-06-17 14:46:44 +02:00
Willem Toorop 39639a86c4 Make dname_equal reusable
+ some symbol renames
2015-06-16 16:11:51 +02:00
Willem Toorop 4445a5f9cc Include rdata size with compressed names 2015-06-12 15:45:50 +02:00
Willem Toorop 731cc37434 Another redundant ldns reference 2015-06-12 15:45:37 +02:00
Willem Toorop 97f0dddb1e remove ldns dependency from rr-dict.c
Only dnssec.c left
2015-06-12 13:51:36 +02:00
Willem Toorop 4f78dbfe7d fix --disable-native-stub-dnssec option 2015-06-11 15:47:39 +02:00
Willem Toorop ae1db39a33 Native stub validation 2015-06-11 15:40:44 +02:00
Willem Toorop c28f6ee595 rm of superfluous ldns_rr to getdns_dict funcs 2015-06-11 12:17:47 +02:00
Willem Toorop fd385454b4 rm a few more leftover ldns references 2015-06-11 12:04:59 +02:00
Willem Toorop e820452aaa Rm 2 outdated ldns usage cases 2015-06-11 11:21:12 +02:00
Willem Toorop cc970b8a8d Merge branch 'master' into develop 2015-06-11 11:15:24 +02:00
wtoorop b0715161ff Merge pull request #103 from getdnsapi/homebrew-docs
Update README to reflect homebrew updates
2015-06-11 11:13:56 +02:00
ngoyal ed4f049524 Update README to reflect homebrew updates 2015-06-03 15:39:16 -04:00
Willem Toorop d5f70ab904 rm spurious execute bits +unit test to detect them
Thanks Paul Wouters
2015-05-26 14:16:27 +02:00
Willem Toorop 42bdaaa69d We already redefined minievent symbols 2015-05-21 15:02:51 +02:00
Willem Toorop c2c1a4d1bf Credit Anthony Kirby for the manpage fixes 2015-05-21 12:29:04 +02:00
Willem Toorop 596ea19fdf Merge branch 'develop' into v0.2.0 2015-05-21 12:28:05 +02:00
Willem Toorop ccca2e237a Merge branch 'master' into develop 2015-05-21 12:27:36 +02:00
wtoorop 7d83d63236 Merge pull request #100 from anthonykirby/master
docs: fix index param for getdns_list_set_xxx

Acknowledged!  Thanks again
2015-05-21 12:25:57 +02:00
Willem Toorop 77393a3da3 Bumb version to 0.2.0 2015-05-21 11:24:16 +02:00
Willem Toorop 8983e33fac Mention Benno as a contributer 2015-05-20 16:14:08 +02:00
Anthony Kirby 198e8baf69 docs: fix index param for getdns_list_set_xxx
the second parameter for these 4 functions is an index, not a name
(looks like cut'n'paste from getdns_dict_set_xxx)
2015-05-19 15:17:00 +01:00
Willem Toorop aaebeff9e2 Merge branch 'develop' into v0.2.0 2015-05-19 12:30:20 +02:00
Willem Toorop 0ac1a0da82 Merge branch 'master' into develop 2015-05-19 12:29:52 +02:00
wtoorop 6475e5d0ea Merge pull request #99 from anthonykirby/master
docs: clarify how extensions are specified

Absolutely, thanks Anthony
2015-05-19 12:29:16 +02:00
Anthony Kirby 7c0268b42c docs: clarify how extensions are specified
The way that extensions are described in documentation can make it appear to a naive user that they are function names.  Quoting the strings makes it clearer that they are just strings.

(it's obvious in retrospect, but I needed to look at the source to get this)
2015-05-19 11:07:20 +01:00
Willem Toorop 71fa069f3b Enlist Rushi in contributors section. 2015-05-14 09:13:06 +02:00
Willem Toorop f78ad93853 Update Makefile's, constants and symbols 2015-05-13 23:30:14 +02:00
Willem Toorop e6f28d62b3 Stable native stub, so version 0.2.0 2015-05-13 23:24:36 +02:00
wtoorop 06a3105dd6 Merge pull request #98 from saradickinson/bugfix/starttls
Fix intermittent crash for STARTTLS
2015-05-13 19:41:38 +02:00
Sara Dickinson 894cb1555b Fix intermittent crash for STARTTLS 2015-05-13 17:15:56 +01:00
Willem Toorop 98b3364b65 uniform debugging method + disable stub debugging 2015-05-13 12:47:17 +02:00
Willem Toorop 011b504496 Fix misplaced freeaddrinfo 2015-05-13 12:39:24 +02:00
Willem Toorop 5d97f9d496 Thanks Robert Edmonds 2015-05-12 21:15:35 +02:00
Willem Toorop 80865e0e88 Preparing for a new minor release... 2015-05-12 20:53:03 +02:00
Willem Toorop b89b625321 autoreconf -fi on FreeBSD to get libtool 2.4.6 2015-05-12 20:47:23 +02:00
Willem Toorop a6f2a0c6c4 libversion based on ABI not API 2015-05-12 17:09:25 +02:00
wtoorop 802c693ee5 Merge pull request #97 from saradickinson/features/async_tls
Features/async tls
Thank you Sara!
2015-05-12 17:05:10 +02:00
saradickinson 3ac5e660f9 Address few minor bugs pointed out by willem 2015-05-11 22:01:31 +02:00
Willem Toorop 35b73f5107 Mention run once 2015-05-11 13:24:39 +02:00
Willem Toorop 01d4275336 Run once with libevent! 2015-05-08 13:12:06 +02:00
Sara Dickinson 9a7bfdd45b Add trivial stub_debug functions. 2015-05-03 15:39:21 +01:00
Sara Dickinson 9d967317d3 Improve the timeout handling for TLS. 2015-05-03 15:11:46 +01:00
Sara Dickinson 01adce8299 Organise code in stub.c and add some utility methods. 2015-05-02 18:08:45 +01:00
Sara Dickinson d6d83b219d Make sure UDP only uses 1 upstream per IP address. Fix a couple of other bugs. 2015-04-30 19:07:49 +01:00
Sara Dickinson 450a3bc6ff Fix STARTTLS fallback. 2015-04-30 14:52:16 +01:00
Sara Dickinson 7905eda8b7 Some clean up of connection handling. Still a problem with STARTTLS fallback that needs fixing. 2015-04-30 12:24:13 +01:00
Willem Toorop 393b847668 autoreconf + ChangeLog for Daniel's libversion fix 2015-04-30 11:57:32 +02:00
Daniel Kahn Gillmor f61a3d0fce Fix libversion numbering
Version 0.1.7 built libgetdns.so.0 instead of libgetdns.so.1.  This
broke anything depending on the package keeping the same SONAME from
0.1.6 to 0.1.7.

The problem stems from a broken libversion in upstream's configure.ac.

This is worked around in 0.1.8 by another change to GETDNS_LIBVERSION,
but the change isn't correct either, since interfaces have been added
again (in partcular, the GETDNS_TRANSPORT_TLS_* constants have been
added, which affects the API at least, for tools trying to compile
against the newer version).

Note that the commentary in configure.ac about how to update
libversion is correct up to a point, but then breaks things badly.
This patch removes that as well.

Here is the canonical reference for how to update libversion:

https://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
2015-04-30 11:33:39 +02:00
Sara Dickinson 79b3412fbf Add another transport option as proof of concept for STARTTLS. 2015-04-29 19:20:25 +01:00
Sara Dickinson b533bc59c5 Fix bug when fallback not available 2015-04-27 16:37:16 +01:00
Sara Dickinson 4e6e66fc77 Get sync messages working with new async code. 2015-04-27 15:32:57 +01:00
Sara Dickinson 3de15ad782 Change internal transport handling to use a list, not a fixed type 2015-04-24 16:29:08 +01:00
Sara Dickinson f2ae55858f First pass at making handshake async. Lots of issues with this code still
- timeouts are not being rescheduled on fallback
- several error cases are not being handled correctly (e.g. 8.8.8.8) and a user callback is not always called
- the fallback mechanism is not generic (specific to tls to tcp)
2015-04-23 17:46:31 +01:00
Willem Toorop 29b378ab16 release v0.1.8
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVNB2sAAoJEOX4+CEvd6SYQVkP/1AgRoUw+5BM6gm+z5J4heXg
 W9EpICfKn2BTC8JVwVOzA3LHJZ95tosNv+fy0faK0n7jByvT4ySl4V/k2W9JSd/S
 bhDR5A1zyfYJdLTDONdkwXki9H90MW69lRGfh+zb0VHzFwi/10xQqYlUatF0IxY3
 Vg4L0PBaUC4UsQevjJNxDJQkr4Q5hJph9jLyij7Zfty/rqjDIZoQpZgMeoZIr9xI
 v51lnlG0ss6lnSRUkM1Nta3mFsXhTDNAhe8/pPUP+lWXceXqCWK63vJGf6Lp3LN4
 gw/COsGnQdiUIbfRGWWGXuqG4c52SAK+ZE9D01bOeLJHw2S8IuA8oFvXdwfGcvYQ
 /gax26lguWk4IrgWIHTRalZJbn+mTNG/DXqrpOuw+BWp3prdoJmyvtOc0rLX1OB2
 ueDDphPg/kSiSknnMmrUgHC2elWewsZCFhx5Umy149ONQK85AQ08DAtJP5dHsXzi
 Om/wuvbuzhoHtPV9YZZYcTa6uSVWaMLHLVJ5K9ifTJEvIKk4pVwbsFS5XIZAVEig
 yGmSsngTQP4w3LdFZSCk3FRu0D+y60sG++Gs1X2X+TsLP/6ZoOL0lYEkPwGfHsvL
 dhgG+iNUgSKmLwrpyI7c1DD1ZlpZluomjQQ5evfogHOmZC22AJvuNQI6hJY1pvXQ
 AU+pzxUfo8947+nEJxMR
 =qFXQ
 -----END PGP SIGNATURE-----

Merge tag 'v0.1.8'

release v0.1.8
2015-04-19 23:28:49 +02:00
Willem Toorop 6d4c0afdeb Correct library version bump
Also the mistake in the last version
2015-04-19 22:07:11 +02:00
Willem Toorop 034150cb42 Bump version & update ChangeLog for 0.1.8 release 2015-04-19 21:36:24 +02:00
Willem Toorop 2a6fc74314 netinet/in.h and openssl/ssl.h from config.h 2015-04-18 22:30:56 +02:00
Willem Toorop 0ba6af3523 upstreams_cleanup from upstreams_dereference 2015-04-18 22:17:28 +02:00
Willem Toorop 84c5b67ee0 Re-enable printing of json with getdns_query 2015-04-18 09:53:50 +02:00
Willem Toorop b26f09d1aa autoreconf -if # For convenience... 2015-04-18 09:35:46 +02:00
Sara Dickinson 6c7ffc4e4e 1) Fix enum mapping error.
2) Also add detection of TLS 1.2 in openssl during configure and warn that it if not available then TLS will not be available. Using TLS_ONLY in stub mode will then error with BAD_CONTEXT. TLS/TCP will fallback to TCP.

3) Explicitly disallow use of TLS_ONLY in RECURSIVE mode since it isn't supported yet. TLS/TCP will fallback to TCP.

4) Fix for MAC OS X build where openssl not linked correctly
2015-04-17 18:38:13 +01:00
Sara Dickinson ab4fb8d9e9 Enable GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN for libunbound. Should only be used in stub mode.
GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN still just does TCP.
Also some tidy up of new transport types.
2015-04-17 15:50:08 +01:00
Sara Dickinson 99c1973fae Cleanup of TLS code 2015-04-16 18:05:51 +01:00
saradickinson 99aa79b48f First pass at TLS implementation - needs work! 2015-04-16 18:05:27 +01:00
377 changed files with 65205 additions and 63090 deletions

9
.dir-locals.el Normal file
View File

@ -0,0 +1,9 @@
;; emacs local configuration settings for getdns source
;; surmised by dkg on 2015-07-19 10:10:51+0200
((c-mode
(indent-tabs-mode . t)
(tab-width . 8)
(c-basic-offset . 8)
(c-file-style . "linux"))
)

18
.gitattributes vendored Normal file
View File

@ -0,0 +1,18 @@
/.dir-locals.el export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.gitmodules export-ignore
/.indent.pro export-ignore
/.travis.yml export-ignore
/getdns.pmdoc export-ignore
/gldns/compare.sh export-ignore
/gldns/import.sh export-ignore
/project-doc export-ignore
/src/test/tpkg export-ignore
/src/test/README export-ignore
/src/tools/Dockerfile export-ignore
/src/tools/README.adoc export-ignore
/src/util/import.sh export-ignore
/src/mk-const-info.c.sh export-ignore
/src/mk-symfiles.sh export-ignore
/README export-ignore

33
.gitignore vendored
View File

@ -1,5 +1,7 @@
*~
.DS_Store
build*/
tests*/
getdns*.tar.gz
*.o
*.so
@ -14,6 +16,9 @@ config.status
autom4te.cache
missing
libtool
config.guess
config.sub
install-sh
spec/example/example-all-functions
spec/example/example-reverse
spec/example/example-simple-answers
@ -26,14 +31,40 @@ src/test/tests_dict
src/test/tests_list
src/test/tests_stub_async
src/test/tests_stub_sync
src/test/tests_json-pointers
src/test/tests_dnssec
src/test/tests_namespaces
src/test/check_getdns
src/test/check_getdns_event
src/test/check_getdns_uv
src/test/check_getdns_ev
src/test/getdns_query
src/test/scratchpad
src/test/scratchpad.c
src/tools/getdns_query
src/tools/getdns_server_mon
src/stubby
doc/*.3
src/getdns/getdns.h
*.log
src/Doxyfile
src/getdns/getdns_extra.h
src/version.c
aclocal.m4
configure
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
src/config.h.in
getdns.pc
getdns_ext_event.pc
/src/test/tpkg/result.*
/src/test/tpkg/.done-*
/src/test/tpkg/.tpkg.var.master
/src/test/tpkg/scan-build-reports/
/src/test/tpkg/install/
/src/test/tpkg/build/
/src/test/tpkg/build-stub-only/
/src/test/tpkg/build-event-loops/

16
.gitmodules vendored Normal file
View File

@ -0,0 +1,16 @@
[submodule "src/test/jsmn"]
path = src/jsmn
url = https://github.com/getdnsapi/jsmn.git
branch = getdns
[submodule "src/yxml"]
path = src/yxml
url = https://github.com/getdnsapi/yxml.git
branch = master
[submodule "stubby"]
path = stubby
url = https://github.com/getdnsapi/stubby.git
branch = develop
[submodule "src/ssl_dane"]
path = src/ssl_dane
url = https://github.com/getdnsapi/ssl_dane
branch = getdns

View File

@ -1,13 +1,27 @@
sudo: false
dist: bionic
language: c
compiler:
- gcc
- clang
before_script:
- sudo apt-get update
- sudo apt-get install libunbound-dev libldns-dev libidn11-dev check libevent-dev
addons:
apt:
packages:
- libssl-dev
- libunbound-dev
- libidn2-0-dev
- libyaml-dev
- check
- libevent-dev
- libev-dev
- libuv-dev
- valgrind
- clang
- wget
- openssh-client
- libgnutls28-dev
script:
- ./configure --with-libevent
- make
- sudo PATH=$PATH make install
- make test
- sudo make uninstall
- mkdir tests
- cd tests
- ../src/test/tpkg/run-all.sh
# - ../src/test/tpkg/run-one.sh 290-transports.tpkg -V

1180
CMakeLists.txt Normal file

File diff suppressed because it is too large Load Diff

618
ChangeLog
View File

@ -1,3 +1,619 @@
* 2023-??-??: Version 1.7.4
* Issue #536: Broken trust anchor files are silently ignored
Thanks Stéphane Bortzmeyer
* 2022-12-22: Version 1.7.3
* PR #532: Increase CMake required version 3.5 -> 3.20, because we
need cmake_path for Absolute paths in pkg-config (See Issue #517)
Thanks Gabriel Ganne
* Updated to Stubby 0.4.3 quickfix release
* 2022-08-19: Version 1.7.2
* Updated to Stubby 0.4.2 quickfix release
* 2022-08-19: Version 1.7.1
* Always send the `dot` ALPN when using DoT
* Strengthen version determination for Libidn2 during cmake processing
(thanks jpbion).
* Fix for issue in UDP stream selection in case of timeouts.
Thanks Shikha Sharma
* Fix using asterisk in ipstr for any address. Thanks uzlonewolf.
* Issue stubby#295: rdata not correctly written for validation for
certain RR type. Also, set default built type to RelWithDebInfo and
expose CFLAGS via GETDNS_BUILD_CFLAGS define and via
getdns_context_get_api_information()
* Issue #524: Bug fixes from submodules' upstream?
Thanks Johnnyslee
* Issue #517: Allow Absolute path CMAKE_INSTALL_{INCLUDE,LIB}DIR in
pkg-config files. Thanks Alex Shpilkin
* Issue #512: Update README.md to show correct PGP key location.
Thanks Katze Prior.
* 2021-06-04: Version 1.7.0
* Make TLS Handshake timeout max 4/5th of timeout for the query,
just like connection setup timeout was, so fallback transport
have a chance too when TCP connection setup is less well
detectable (as with TCP_FASTOPEN on MacOS).
* Issue #466: Memory leak with retrying queries (for examples
with search paths). Thanks doublez13.
* Issue #480: Handling of strptime when Cross compiling with CMake.
A new option to FORCE_COMPAT_STRPTIME (default disabled) will
(when disabled) make cmake assume the target platform has a POSIX
compatible strptime when cross-compiling.
* Setting of the number of milliseconds send data may remain
unacknowledged by the peer in a TCP connection (when supported
by the OS) with getdns_context_set_tcp_send_timeout()
Thanks maciejsszmigiero.
* Issue #497: Fix typo in CMAKE included files, so Stubby can use
TLS v1.3 with chipersuites options ON. Thanks har-riz.
* Basic name compression on server replied messages. Thanks amialkow!
This alleviates (but might not completely resolve) issues #495 and
#320 .
* Eventloop extensions back to the old names libgetdns_ext_event,
libgetdns_ext_ev and libgetdns_ext_uv.
* Compilation warning fixes. Thanks Andreas!
* 2020-02-28: Version 1.6.0
* Issues #457, #458, #461: New symbols with libnettle >= 3.4.
Thanks hanvinke & kometchtech for testing & reporting.
* Issue #432: answer_ipv4_address and answer_ipv6_address in reply
and response dicts.
* Issue #430: Record and guard UDP max payload size with servers.
* Issue #407: Run only offline-tests option with:
src/test/tpkg/run-offline-only.sh (only with git checkouts).
* Issue #175: Include the packet the stub resolver sent to the
upstream the call_reporting dict. Thanks Tom Pusateri
* Issue #169: Build eventloop support libraries if event libraries
are available. Thanks Tom Pusateri
* 2019-12-20: Version 1.6.0-beta.1
* Migration of build system to cmake. Build now works on Ubuntu,
Windows 10 and macOS.
Some notes on minor differences in the new cmake build:
* OpenSSL 1.0.2 or higher is now required
* libunbound 1.5.9 is now required
* Only libidn2 2.0.0 and later is supported (not libidn)
* Windows uses ENABLE_STUB_ONLY=ON as the default
* Unit and regression tests work on Linux/macOS
(but not Windows yet)
* 2019-04-03: Version 1.5.2
* PR #424: Two small trust anchor fetcher fixes
Thanks Maciej S. Szmigiero
* Issue #422: Enable server side and update client side TCP Fast
Open implementation. Thanks Craig Andrews
* Issue #423: Fix insecure delegation detection while scheduling.
Thanks Charles Milette
* Issue #419: Escape backslashed when printing in JSON format.
Thanks boB Rudis
* Use GnuTLS instead of OpenSSL for TLS with the --with-gnutls
option to configure. libcrypto (from OpenSSL) still needed
for Zero configuration DNSSEC.
* DOA rr-type
* AMTRELAY rr-type
* 2019-01-11: Version 1.5.1
* Introduce proof of concept GnuTLS implementation. Incomplete support
for Trust Anchor validation. Requires GnuTLS DANE library. Currently
untested with GnuTLS prior to 3.5.19, so configure demands a minumum
version of 3.5.0.
* Be consistent and always fail connection setup if setting ciphers/curves/
TLS version/cipher suites fails.
* Refactor OpenSSL usage into modules under src/openssl.
Drop support for LibreSSL and versions of OpenSSL prior to 1.0.2.
* PR #414: remove TLS13 ciphers from cipher_list, but
only when SSL_CTX_set_ciphersuites is available.
Thanks Bruno Pagani
* Issue #415: Filter out #defines etc. when creating
symbols file. Thanks Zero King
* 2018-12-21: Version 1.5.0
* RFE getdnsapi/stubby#121 log re-instantiating TLS
upstreams (because they reached tls_backoff_time) at
log level 4 (WARNING)
* GETDNS_RESPSTATUS_NO_NAME for NODATA answers too
* ZONEMD rr-type
* getdns_query queries for addresses when a query name
without a type is given.
* RFE #408: Fetching of trust anchors will be retried
after failure, after a certain backoff time. The time
can be configured with
getdns_context_set_trust_anchors_backoff_time().
* RFE #408: A "dnssec" extension that requires DNSSEC
verification. When this extension is set, Indeterminate
DNSSEC status will not be returned.
* Issue #410: Unspecified ownership of get_api_information()
* Fix for DNSSEC bug in finding most specific key when
trust anchor proves non-existance of one of the labels
along the authentication chain other than the non-
existance of a DS record on a zonecut.
* Enhancement getdnsapi/stubby#56 & getdnsapi/stubby#130:
Configurable minimum and maximum TLS versions with
getdns_context_set_tls_min_version() and
getdns_context_set_tls_max_version() functions and
tls_min_version and tls_max_version configuration parameters
for upstreams.
* Configurable TLS1.3 ciphersuites with the
getdns_context_set_tls_ciphersuites() function and
tls_ciphersuites config parameter for upstreams.
* Bugfix in upstream string configurations: tls_cipher_list and
tls_curve_list
* Bugfix finding signer for validating NSEC and NSEC3s, which
caused trouble with the partly tracing DNSSEC from the root
up, introduced in 1.4.2. Thanks Philip Homburg
* 2018-05-11: Version 1.4.2
* Bugfix getdnsapi/stubby#87: Detect and ignore duplicate certs
in the Windows root CA store.
* PR #397: No TCP sendto without TCP_FASTOPEN
Thanks Emery Hemingway
* Bugfix getdnsapi/stubby#106: Core dump when printing certain
configuration. Thanks Han Vinke
* Bugfix getdnsapi/stubby#99: Partly trace DNSSEC from the root
up (for tld and sld), to find insecure delegations quicker.
Thanks UniverseXXX
* Bugfix: Allow NSEC spans starting from (unexpanded) wildcards
Bug was introduced when dealing with CVE-2017-15105
* Bugfix getdnsapi/stubby#46: Don't assume trailing zero with
string bindata's. Thanks Lonnie Abelbeck
* Bugfix #394: Update src/compat/getentropy_linux.c in order to
handle ENOSYS (not implemented) fallback.
Thanks Brent Blood
* Bugfix #395: Clarify that libidn2 dependency is for version 2.0.0
or higher. Thanks mire3212
* 2018-03-12: Version 1.4.1
* Bugfix #388: Prevent fallback to an earlier tries upstream within a
single query. Thanks Robert Groenenberg
* PR #387: Compile with OpenSSL with deprecated APIs disabled.
Thanks Rosen Penev
* PR #386: UDP failover improvements:
- When all UDP upstreams fail, retry them (more or less) equally
- Limit maximum UDP backoff (default to 1000)
This is configurable with the --with-max-udp-backoff configure
option.
Thanks Robert Groenenberg
* Bugfix: Find zonecut with DS queries (instead of SOA queries).
Thanks Elmer Lastdrager
* Bugfix #385: Verifying insecure NODATA answers (broken since 1.2.1).
Thanks hanvinke
* PR #384: Fix minor spelling and formatting. Thanks dkg.
* Bugfix #382: Parallel install of getdns_query and getdns_server_mon
* 2018-02-21: Version 1.4.0
* .so revision bump to please fedora packaging system.
Thanks Paul Wouters
* Specify the supported curves with getdns_context_set_tls_curves_list()
An upstream specific list of supported curves may also be given
with the tls_curves_list setting in the upstream dict with
getdns_context_set_upstream_recursive_servers()
* New tool getdns_server_mon for checking upstream recursive
resolver's capabilities.
* Improved handling of opportunistic back-off. If other transports
are working, dont forcibly promote failed upstreams just wait for
the re-try timer.
* Hostname authentication with libressl
Thanks Norbert Copones
* Security bugfix in response to CVE-2017-15105. Although getdns was
not vulnerable for this specific issue, as a precaution code has been
adapted so that signatures of DNSKEYs, DSs, NSECs and NSEC3s can not
be wildcard expansions when used with DNSSEC proofs. Only direct
queries for those types are allowed to be wildcard expansions.
* Bugfix PR#379: Miscelleneous double free or corruption, and corrupted
memory double linked list detected issue, with serving functionality.
Thanks maddie and Bruno Pagani
* Security Bugfix PR#293: Check sha256 pinset's
with OpenSSL native DANE functions for OpenSSL >= 1.1.0
with Viktor Dukhovni's danessl library for OpenSSL >= 1.0.0
don't allow for authentication exceptions (like self-signed
certificates) otherwise. Thanks Viktor Dukhovni
* libidn2 support. Thanks Paul Wouters
* 2017-12-21: Version 1.3.0
* Bugfix #300: Detect dnsmasq and skip unit test that fails with it.
Thanks Tim Rühsen and Konomi Kitten
* Specify default available cipher suites for authenticated TLS
upstreams with getdns_context_set_tls_ciphers_list()
An upstream specific available cipher suite may also be given
with the tls_cipher_list setting in the upstream dict with
getdns_context_set_upstream_recursive_servers()
* PR #366: Add support for TLS 1.3 and Chacha20-Poly1305
Thanks Pascal Ernster
* Bugfix #356: Do Zero configuration DNSSEC meta queries over on the
context configured upstreams. Thanks Andreas Schulze
* Report default extension settings with
getdns_context_get_api_information()
* Specify locations at which CA certificates for verification purposes
are located: getdns_context_set_tls_ca_path()
getdns_context_set_tls_ca_file()
* getdns_context_set_resolvconf() function to initialize a context
upstreams and suffices with a resolv.conf file.
getdns_context_get_resolvconf() to get the file used to initialize
the context's upstreams and suffixes.
getdns_context_set_hosts() function to initialize a context's
LOCALNAMES namespace.
getdns_context_get_hosts() function to get the file used to initialize
the context's LOCALNAMES namespace.
* get which version of OpenSSL was used at build time and at run time
when available with getdns_context_get_api_information()
* GETDNS_RETURN_IO_ERROR return error code
* Bugfix #359: edns_client_subnet_private should set family
Thanks Daniel Areiza & Andreas Schulze
* Bugfix getdnsapi/stubby#34: Segfault issue with native DNSSEC
validation. Thanks Bruno Pagani
* 2017-11-11: Version 1.2.1
* Handle more I/O error cases. Also, when an I/O error does occur,
never stop listening (with servers), and
never exit (when running the built-in event loop).
* Bugfix: Tolerate unsigned and unused RRsets in the authority section.
Fixes DNSSEC with BIND upstream.
* Bugfix: DNSSEC validation without support records
* Bugfix: Validation of full recursive DNSKEY lookups
* Bugfix: Retry to validate full recursion BOGUS replies with zero
configuration DNSSEC only when DNSSEC was actually requested
* Bugfix #348: Fix a linking issue in stubby when libbsd is present
Thanks Remi Gacogne
* More robust scheduling; Eliminating a segfault with long running
applications.
* Miscellaneous Windows portability fixes from Jim Hague.
* Fix Makefile dependencies for parallel install.
Thanks ilovezfs
* 2017-09-29: Version 1.2.0
* Bugfix of rc1: authentication of first query with TLS
Thanks Travis Burtrum
* A function to set the location for library specific data,
like trust-anchors: getdns_context_set_appdata().
* Zero configuration DNSSEC - build upon the scheme
described in RFC7958. The URL from which to fetch
the trust anchor, the verification CA and email
can be set with the new getdns_context_set_trust_anchor_url(),
getdns_context_set_trust_anchor_verify_CA() and
getdns_context_set_trust_anchor_verify_email() functions.
The default values are to fetch from IANA and to validate
with the ICANN CA.
* Update of Stubby with yaml configuration file and
logging from a certain severity support.
* Fix tpkg exit status on test failure. Thanks Jim Hague.
* Refined logging levels for upstream statistics
* Reuse (best behaving) backed-off TLS upstreams when non are usable.
* Let TLS upstreams back-off a incremental amount of time.
Back-off time starts with 1 second and is doubled each failure, but
will not exceed the time given by getdns_context_set_tls_backoff_time()
* Make TLS upstream management more resilient to temporary outages
(like laptop sleeps)
* 2017-09-04: Version 1.1.3
* Small bugfixes that came out of static analysis
* No annotations with the output of getdns_query anymore,
unless -V option is given to increase verbosity
Thanks Ollivier Robert
* getdns_query will now exit with failure status if replies are BOGUS
* Bugfix: dnssec_return_validation_chain now also works when fallback
to full recursion was needed with dnssec_roadblock_avoidance
* More clear build instructions from Paul Hoffman. Thanks.
* Bugfix #320.1: Eliminate multiple closing of file descriptors
Thanks Neil Cook
* Bugfix #320.2: Array bounds bug in upstream_select
Thanks Neil Cook
* Bugfix #318: getdnsapi/getdns/README.md links to nonexistent wiki
pages. Thanks James Raftery
* Bugfix #322: MacOS 10.10 (Yosemite) provides TCP fastopen interface
but does not have it implemented. Thanks Joel Purra
* Compile without Stubby by default. Stubby now has a git repository
of its own. The new Stubby repository is added as a submodule.
Stubby will still be build alongside getdns with the --with-stubby
configure option.
* 2017-07-03: Version 1.1.2
* Bugfix for parallel make install
* Bugfix to trigger event callbacks on socket errors
* A getdns_context_set_logfunc() function with which one may
register a callback log function for certain library subsystems
at certain levels. Currently this can only be used for
upstream stastistics subsystem.
* 2017-06-15: Version 1.1.1
* Bugfix #306 hanging/segfaulting on certain (IPv6) upstream failures
* Spelling fix s/receive/receive. Thanks Andreas Schulze.
* Added stubby-setdns-macos.sh script to support Homebrew formula
* Include stubby.conf in the districution tarball
* Bugfix #286 reschedule reused listening addresses
* Bugfix #166 Allow parallel builds and unit-tests
* NSAP-PTR, EID and NIMLOC, TALINK, AVC support
* Bugfix of TA RR type
* OPENPGPKEY and SMIMEA support
* Bugfix TAG rdata type presentation format for CAA RR type
* Bugfix Zero sized gateways with IPSECKEY gateway_type 0
* Guidance for integration with systemd
* Also check for memory leaks with advances server capabilities.
* Bugfix convert IP string to IP dict with getdns_str2dict() directly.
* 2017-04-13: Version 1.1.0
* bugfix: Check size of tls_auth_name.
* Improvements that came from Visual Studio static analysis
* Fix to compile with libressl. Thanks phicoh.
* Spelling fixes. Thanks Andreas Schulze.
* bugfix: Reschedule request timeout when getting the DNSSEC chain.
* getdns_context_unset_edns_maximum_udp_payload_size() to reset
to default IPv4/IPv6 dependent edns max udp payload size.
* Implement sensible default edns0 padding policy. Thanks DKG.
* Keep connections open with sync requests too.
* Fix of event loops so they do not give up with naked timers with
windows. Thanks Christian Huitema.
* Include peer certificate with DNS-over-TLS in combination with
the return_call_reporting extension.
* More fine grained control over TLS upstream retry and back off
behaviour with getdns_context_set_tls_backoff_time() and
getdns_context_set_tls_connection_retries().
* New round robin over the available upstreams feaure.
Enable with getdns_context_set_round_robin_upstreams()
* Bugfix: Queue requests when no sockets available for outgoing queries.
* Obey the outstanding query limit with STUB resolution mode too.
* Updated stubby config file
* Draft MDNS client implementation by Christian Huitema.
Enable with --enable-draft-mdns-support to configure
* bugfix: Let synchronous queries use fds > MAX_FDSETSIZE;
By moving default eventloop from select to poll
Thanks Neil Cook
* bugfix: authentication failure for self signed cert + only pinset
* bugfix: issue with session re-use making authentication appear to fail
* 2017-01-13: Version 1.0.0
* edns0_cookies extension enabled by default (per RFC7873)
* dnssec_roadblock_avoidance enabled by default (per RFC8027)
* bugfix: DSA support with OpenSSL 1.1.0
* Initialize OpenSSL just once in a thread safe way
* Thread safety with arc4random function
* Improvements that came from Visual Studio static analysis
Thanks Christian Huitema
* Conventional RFC3986 IPv6 [address]:port parsing from getdns_query
* bugfix: OpenSSL 1.1.0 style crypto locking
Thanks volkommenheit
* configure tells *which* dependency is missing
* bugfix: Exclude terminating '\0' from bindata's returned by
getdns_get_suffix(). Thanks Jim Hague
* Better README.md. Thanks Andrew Sullivan
* 2016-10-19: Version 1.1.0-a2
* Improved TLS connection management
* OpenSSL 1.1 support
* Stubby, Server version of getdns_query that by default listens
on 127.0.0.1 and ::1 and reads config from /etc/stubby.conf
and $HOME/.stubby.conf
* 2016-07-14: Version 1.1.0a1
* Conversion functions from text strings to getdns native types:
getdns_str2dict(), getdns_str2list(), getdns_str2bindata() and
getdns_str2int()
* A getdns_context_config() function that configures a context
with settings given in a getdns_dict
* A a getdns_context_set_listen_addresses() function and companion
getdns_reply() function to construct simple name servers.
* Relocate getdns_query to src/tools and build by default
* Enhancements to the logic used to select connection based upstream
transports (TCP, TLS) to improve robustness and re-use of
connections/upstreams.
* 2016-07-14: Version 1.0.0b2
* Collect coverage information from the unit tests
Thanks Shane Kerr
* pkg-config for the getdns_ext_event library
Thanks Tom Pusateri
* Bugfix: Multiple requests on the same upstream with a transport
that keeps connections open in synchronous stub mode.
* Canonicalized DNSSEC chain with dnssec_return_validation_chain
(when validated)
* A dnssec_return_full_validation_chain extension which includes
then validated resource records.
* Bugfix: Callbacks fired while scheduling (answer from cache)
with the unbound plugable event API
* header extension to set opcode and flags in stub mode
* Unit tests that cover more code
* Static checking with the clang analyzer
* getdns_pretty_print_dict prints dname's as primitives
* Accept just bindata's instead of address dicts.
Allow misshing "address_type" in address dicts.
* TLS session resumption
* -C <config file> option to getdns_query to configure context
from a json like formatted file. The output of -i (print API
information) can be used as config file directly.
Settings may also be given in this format as arguments of
the getdns_query command directly.
* DNS server mode for getdns_query. Enable by providing addresses
to listen on, either by giving "-z <listen address>" options or by
providing "listen_addresses" in the config file or settings.
* Bugfixes from deckard testing: CNAME loop protection.
* "srv_addresses" in response dict with getdns_service()
* use libbsd when available
Thanks Guillem Jover
* Bugfix: DNSSEC wildcard validation issue
* Bugfix: TLS timeouts not re-using a connection
* A getdns_context_get_eventloop(), to get the current
(pluggable) eventloop from context
* getdns_query now uses the default event loop (instead of custom)
* Return call_reporting info in case of timeout
Thanks Robert Groenenberg
* Bugfix: Build fails with autoconf 2.63, works with 2.68.
Thanks Robert Groenenberg
* Doxygen output for getdns.h and getdns_extra.h only
* Do not call SSL_library_init() from getdns_context_create() when
the second bit from the set_from_os parameter is set.
* 2016-03-31: Version 1.0.0b1
* openssl 1.1.0 support
* GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST default suffix handling
* getdns_context_set_follow_redirects()
* Read suffix list from registry on Windows
* A dnssec_return_all_statuses extension
* Set root servers without temporary file (libunbound >= 1.5.8 needed)
* Eliminate unit test's ldns dependency
* pkts wireformat <-> getdns_dict <-> string
conversion functions
* Eliminate all side effects when doing sync requests
(libunbound >= 1.5.9 needed)
* Bugfix: Load gost algorithm if digest is seen before key algorithm
Thanks Jelte Janssen
* Bugfix: Respect DNSSEC skew.
* Offline dnssec validation for any given point in time
* Correct return value in documentation for getdns_pretty_print_dict().
Thanks Linus Nordberg
* Bugfix: Don't treat "domain" or "search" as a nameserver.
Thanks Linus Nordberg
* Use the default CA trust store on Windows (for DNS over TLS).
* Propagate eventloop to unbound when unbound has pluggable event loops
(libunbound >= 1.5.9 needed)
* Replace mini_event extension by default_eventloop
* Bugfix: Segfault on NULL pin
* Bugfix: Correct output of get_api_settings
* Bugfix: Memory leak with getdns_get_api_information()
Thanks Robert Groenenberg.
* 2015-12-31: Version 0.9.0
* Update of unofficial extension to the API that supports stub mode
TLS verification. GETDNS_AUTHENTICATION_HOSTNAME is replaced by
GETDNS_AUTHENTICATION_REQUIRED (but remains available as an alias).
Upstreams can now be configured with either a hostname or a SPKI pinset
for TLS authentication (or both). If the GETDNS_AUTHENTICATION_REQUIRED
option is used at least one piece of authentication information must be
configured for each upstream, and all the configured authentication
information for an upstream must validate.
* Remove STARTTLS implementation (no change to SPEC)
* Enable TCP Fast Open when possible. Add OSX support for TFO.
* Rename return_call_debugging to return_call_reporting
* Bugfix: configure problem with getdns-0.5.1 on OpenBSD
Thanks Claus Assmann.
* pkg-config support. Thanks Neil Cook.
* Functions to convert from RR dicts to wireformat and text format
and vice versa. Including a function that builds a getdns_list
of RR dicts from a zonefile.
* Use the with the getdns_context_set_dns_root_servers() function
provided root servers in recursing resolution modus.
* getdns_query option (-f) to read a DNSSEC trust anchor from file.
* getdns_query option (-R) to read a "root hints" file.
* Bugfix: Detect and prevent duplicate NSEC(3)s to be returned with
dnssec_return_validation_chain.
* Bugfix: Remove duplicate RRs from RRsets when DNSSEC verifying
* Client side edns-tcp-keepalive support
* TSIG support + getdns_query syntax to specify TSIG parameters
per upstream: @<ip>[^[<algorithm>:]<name>:<secret in Base64>]
* Bugfix: Allow truncated answers to be returned in case of missing
fallback transport.
* Verify upstream TLS pubkeys with pinsets; A getdns_query option
(-K) to attach pinsets to getdns_contexts.
Thanks Daniel Kahn Gillmor
* Initial support for Windows. Thanks Gowri Visweswaran
* add_warning_for_bad_dns extension
* Try and retry with suffixes giving with getdns_context_set_suffix()
following directions given by getdns_context_set_append_name()
getdns_query options to set suffixes and append_name directions:
'-W' to append suffix always (default)
'-1' to append suffix only to single label after failure
'-M' to append suffix only to multi label name after failure
'-N' to never append a suffix
'-Z <suffixes>' to set suffixes with the given comma separated list
* Better help text for getdns_query (printed with the '-h' option)
* Setting the +specify_class extension with getdns_query
* Return NOT_IMPLEMENTED for not implemented namespaces, and the
not implemented getdns_context_set_follow_redirects() function.
* 2015-11-18: Version 0.5.1
* Bugfix: growing upstreams arrow.
* Bugfix: Segfault on timeout in specific conditions
* Bugfix: install getdns_extra.h from build location
* Bugfix: Don't let cookies overwrite existing EDNS0 options
* Don't link libdl
* The EDNS(0) Padding Option (draft-mayrhofer-edns0-padding).
When using DNS over TLS, query sizes will be padded to multiples
of a block size given with:
getdns_context_set_tls_query_padding_blocksize()
* An EDNS client subnet private option, that will ask a EDNS client
subnet aware resolver to not reveal any details about the
originating network. See: draft-ietf-dnsop-edns-client-subnet
Set with: getdns_context_set_edns_client_subnet_private()
* The return_call_debugging extension. The extension will also return
the transport used on top of the information about the request which
is described in the API spec.
* A dnssec_roadblock_avoidance extension. When set, the library will
work in stub resolution mode and try to get a by DNSSEC validation
assessed answer. On BOGUS answers the library will retry rescursive
resolution mode. This is the simplest form of passive roadblock
detection and avoidance: draft-ietf-dnsop-dnssec-roadblock-avoidance.
Use the --enable-draft-dnssec-roadblock-avoidance option to configure
to compile with this extension.
* 2015-10-29: Version 0.5.0
* Native crypto. No ldns dependency anymore.
(ldns still necessary to be able to run tests though)
* JSON pointer arguments to getdns_dict_get_* and getdns_dict_set_*
to dereference nested dicts and lists.
* Bugfix: DNSSEC code finding zone cut with redirects + pursuing unsigned
DS answers close to the root. Thanks Theogene Bucuti!
* Default port for TLS changed to 853
* Unofficial extension to the API to allow TLS hostname verification to be
required for stub mode when using only TLS as a transport.
When required a hostname must be supplied in the
'hostname' field of the upstream_list dict and the TLS cipher suites are
restricted to the 4 AEAD suites recommended in RFC7525.
* 2015-09-09: Version 0.3.3
* Fix clearing upstream events on shutdown
* Fix dnssec validation of direct CNAME queries.
Thanks Simson L. Garfinkel.
* Fix get_api_information():version_string also for release candidates
* 2015-09-04: Version 0.3.2
* Fix returned upstreams list by getdns_context_get_api_information()
* Fix some autoconf issues when srcdir != builddir
* Fix remove build date from manpage version for reproducible builds
* Fix transport fallback issues plus transport fallback unit test script
* Fix string bindata's need not contain trailing zero byte
* --enable-stub-only configure option for stub only operation.
Stub mode will be the default. Removes the dependency on libunbound
* --with-getdns_query compiles and installs the getdns_query tool too
* Fix assert on context destruction from a callback in stub mode too.
* Use a thread instead of a process for running the unbound event loop.
* 2015-07-18: Version 0.3.1
* Fix repeating rdata fields
* 2015-07-17: Version 0.3.0
* Unit test for spurious execute bits. Thanks Paul Wouters.
* Added new transport list options in API. The option is now an ordered
list of GETDNS_TRANSPORT_UDP, GETDNS_TRANSPORT_TCP,
GETDNS_TRANSPORT_TLS, GETDNS_TRANSPORT_STARTTLS.
* Added new context setting for idle_timeout
* CSYNC RR type
* EDNS0 COOKIE option code set to 10
* dnssec_return_validation_chain for negative and insecure responses.
* dnssec_return_validation_chain return a single RRSIG on each RRSET
(whenever possible)
* getdns_validate_dnssec() accept replies from the replies_tree
* getdns_validate_dnssec() asses negative and insecure responses.
* Native stub dnssec validation
* Implemented getdns_context_set_dnssec_trust_anchors()
* Switch freely between stub and recursive mode
* getdns_query -k shows default trust anchors
* functions and defines to get library and API versions in string
and numeric values: getdns_get_version(), getdns_get_version_number(),
getdns_get_api_version() and getdns_get_api_version_number()
* 2015-05-21: Version 0.2.0
* Fix libversion numbering: Thanks Daniel Kahn Gillmor
* run_once method for the libevent extension
* autoreconf -fi on FreeBSD always, because of newer libtool version
suitable for FreeBSD installs too. Thanks Robert Edmonds
* True asynchronous processing of the new TLS transport options
* GETDNS_TRANSPORT_STARTTLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN
transport option.
* Manpage fixes: Thanks Anthony Kirby
* 2015-04-19: Version 0.1.8
* The GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN and
GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN
DNS over TLS transport options.
* 2015-04-08: Version 0.1.7
* Individual getter functions for context settings
* Fix: --with-current-date function to make build deterministically
@ -103,7 +719,7 @@
* Build from separate build directory
* Anticipate libunbound not returning the answer packet
* Pretty print bindata's representing IP addresses
* Anticipate absense of implicit DSO linking
* Anticipate absence of implicit DSO linking
* Mention getdns specific options to configure in INSTALL
Thanks Paul Hoffman
* Mac OSX package built instructions for generic user in README.md

397
INSTALL
View File

@ -1,397 +0,0 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
(Options specific to getdns are listed at the end of this document.)
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf limitation. Until the limitation is lifted, you can use
this workaround:
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
getdns-specific Options
=======================
`--with-libidn=pathname'
path to libidn (default: search /usr/local ..)
`--with-libldns=pathname'
path to libldns (default: search /usr/local ..)
`--with-libunbound=pathname'
path to libunbound (default: search /usr/local ..)
`--with-libevent'
path to libevent (default: search /usr/local ..)
`--with-libuv'
path to libuv (default: search /usr/local ..)
`--with-libev'
path to libev (default: search /usr/local ..)
`--with-trust-anchor=KEYFILE'
Default location of the trust anchor file.
[default=SYSCONFDIR/unbound/getdns-root.key]

View File

@ -1,210 +0,0 @@
#
# @configure_input@
#
#
# Copyright (c) 2013, Verisign, Inc., NLnet Labs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the names of the copyright holders nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package = @PACKAGE_NAME@
version = @PACKAGE_VERSION@@RELEASE_CANDIDATE@
tarname = @PACKAGE_TARNAME@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
distdir = $(tarname)-$(version)
bintar = $(distdir)-bin.tar.gz
prefix = @prefix@
datarootdir=@datarootdir@
exec_prefix = @exec_prefix@
bindir = @bindir@
docdir = @docdir@
srcdir = @srcdir@
INSTALL = @INSTALL@
default:
cd src && $(MAKE) $@
all : default
install: all
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/AUTHORS $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/ChangeLog $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/COPYING $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/INSTALL $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/LICENSE $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/NEWS $(DESTDIR)$(docdir)
$(INSTALL) -m 644 $(srcdir)/README.md $(DESTDIR)$(docdir)
$(INSTALL) -m 755 -d $(DESTDIR)$(docdir)/spec
$(INSTALL) -m 644 $(srcdir)/spec/index.html $(DESTDIR)$(docdir)/spec
$(INSTALL) -m 644 $(srcdir)/spec/getdns*tgz $(DESTDIR)$(docdir)/spec
cd src && $(MAKE) $@
cd doc && $(MAKE) $@
@echo "***"
@echo "*** !!! IMPORTANT !!!! libgetdns needs a DNSSEC trust anchor!"
@echo "***"
@echo "*** For the library to be able to perform DNSSEC, the root"
@echo "*** trust anchor needs to be present in presentation format"
@echo "*** in the file: "
@echo "*** @TRUST_ANCHOR_FILE@"
@echo "***"
@echo "*** We recomend using unbound-anchor to retrieve and install"
@echo "*** the root trust anchor like this: "
@echo "*** mkdir /etc/unbound"
@echo "*** unbound-anchor -a \"@TRUST_ANCHOR_FILE@\""
@echo "***"
@echo "*** We strongly recommend package maintainers to provide the"
@echo "*** root trust anchor by installing it with unbound-anchor"
@echo "*** at package installation time from the post-install script."
@echo "***"
uninstall:
rm -rf $(DESTDIR)$(docdir)
cd doc && $(MAKE) $@
cd src && $(MAKE) $@
doc: FORCE
cd doc && $(MAKE) $@
example:
cd spec/example && $(MAKE) $@
test:
cd src && $(MAKE) $@
getdns_query:
cd src && $(MAKE) $@
clean:
cd src && $(MAKE) $@
cd doc && $(MAKE) $@
cd spec/example && $(MAKE) $@
rm -f *.o
depend:
cd src && $(MAKE) $@
distclean:
cd src && $(MAKE) $@
rmdir src 2>/dev/null || true
cd doc && $(MAKE) $@
rmdir doc 2>/dev/null || true
cd spec/example && $(MAKE) $@
rmdir spec/example 2>/dev/null || true
rmdir spec 2>/dev/null || true
rm -f config.log config.status Makefile libtool
rm -fR autom4te.cache
rm -fR m4
dist: $(distdir).tar.gz
bindist: $(bintar)
$(bintar): $(distdir)
chown -R 0:0 $(distdir) 2>/dev/null || true
cd $(distdir); ./configure; make
tar chof - $(distdir) | gzip -9 -c > $@
rm -rf $(distdir)
$(distdir).tar.gz: $(distdir)
chown -R 0:0 $(distdir) 2>/dev/null || true
tar chof - $(distdir) | gzip -9 -c > $@
rm -rf $(distdir)
$(distdir):
mkdir -p $(distdir)/m4
mkdir -p $(distdir)/src
mkdir -p $(distdir)/src/getdns
mkdir -p $(distdir)/src/test
mkdir -p $(distdir)/src/extension
mkdir -p $(distdir)/src/compat
mkdir -p $(distdir)/src/util
mkdir -p $(distdir)/src/gldns
mkdir -p $(distdir)/doc
mkdir -p $(distdir)/spec
mkdir -p $(distdir)/spec/example
cp $(srcdir)/configure.ac $(distdir)
cp $(srcdir)/configure $(distdir)
cp $(srcdir)/AUTHORS $(distdir)
cp $(srcdir)/ChangeLog $(distdir)
cp $(srcdir)/COPYING $(distdir)
cp $(srcdir)/INSTALL $(distdir)
cp $(srcdir)/LICENSE $(distdir)
cp $(srcdir)/NEWS $(distdir)
cp $(srcdir)/README.md $(distdir)
cp $(srcdir)/Makefile.in $(distdir)
cp $(srcdir)/install-sh $(distdir)
cp $(srcdir)/config.sub $(distdir)
cp $(srcdir)/config.guess $(distdir)
cp libtool $(distdir)
cp $(srcdir)/ltmain.sh $(distdir)
cp $(srcdir)/m4/*.m4 $(distdir)/m4
cp $(srcdir)/src/*.in $(distdir)/src
cp $(srcdir)/src/*.[ch] $(distdir)/src
cp $(srcdir)/src/*.symbols $(distdir)/src
cp $(srcdir)/src/extension/*.[ch] $(distdir)/src/extension
cp $(srcdir)/src/extension/*.symbols $(distdir)/src/extension
cp $(srcdir)/src/getdns/*.in $(distdir)/src/getdns
cp $(srcdir)/src/getdns/getdns_*.h $(distdir)/src/getdns
cp $(srcdir)/src/test/Makefile.in $(distdir)/src/test
cp $(srcdir)/src/test/*.[ch] $(distdir)/src/test
cp $(srcdir)/src/test/*.sh $(distdir)/src/test
cp $(srcdir)/src/test/*.good $(distdir)/src/test
cp $(srcdir)/src/compat/*.[ch] $(distdir)/src/compat
cp $(srcdir)/src/util/*.[ch] $(distdir)/src/util
cp $(srcdir)/src/gldns/*.[ch] $(distdir)/src/gldns
cp $(srcdir)/doc/Makefile.in $(distdir)/doc
cp $(srcdir)/doc/*.in $(distdir)/doc
cp $(srcdir)/doc/manpgaltnames $(distdir)/doc
cp $(srcdir)/spec/*.html $(distdir)/spec
cp $(srcdir)/spec/*.tgz $(distdir)/spec
cp $(srcdir)/spec/example/Makefile.in $(distdir)/spec/example
cp $(srcdir)/spec/example/*.[ch] $(distdir)/spec/example
rm -f $(distdir)/Makefile $(distdir)/src/Makefile $(distdir)/src/getdns/getdns.h $(distdir)/spec/example/Makefile $(distdir)/src/test/Makefile $(distdir)/doc/Makefile $(distdir)/src/config.h
distcheck: $(distdir).tar.gz
gzip -cd $(distdir).tar.gz | tar xvf -
cd $(distdir) && ./configure
cd $(distdir) && $(MAKE) all
cd $(distdir) && $(MAKE) check
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
@remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`"; \
if test "$${remaining}" -ne 0; then
echo "@@@ $${remaining} file(s) remaining in stage directory!"; \
exit 1; \
fi
cd $(distdir) && $(MAKE) clean
rm -rf $(distdir)
@echo "*** Package $(distdir).tar.gz is ready for distribution"
Makefile: $(srcdir)/Makefile.in config.status
./config.status $@
configure.status: configure
./config.status --recheck
.PHONY: all distclean clean default doc test
FORCE:

430
README.md
View File

@ -1,116 +1,156 @@
getdns API
==========
getdns
======
# Overview of getdns
* Date: 2015-01-14
* GitHub: <https://github.com/getdnsapi/getdns>
getdns is an implementation of a modern asynchronous DNS API specification
originally edited by Paul Hoffman. It is intended to make all types of DNS
information easily available to application developers and non-DNS experts.
The project home page at [getdnsapi.net](https://getdnsapi.net) provides
documentation, binary downloads and new regarding the getdns API
implementation. This implementation is licensed under the New BSD License
(BSD-new).
getdns is an implementation of a modern asynchronous DNS API; the specification was originally edited by Paul Hoffman. It is intended to make all types of DNS information easily available to application developers and non-DNS experts.
## Why you might want getdns
Traditional access to DNS data from applications has several limitations:
* APIs require applications to have considerable sophistication about DNS data and data types
* Some kinds of data about the response (notably, the resource record set time to live) is not exposed via any API, so applications need to process raw protocol responses to get such data
* APIs are often blocking, meaning asynchronous access is not possible without some work
* Sophisticated uses of the DNS (things like IDNA and DNSSEC validation) require considerable application work, possibly by application developers with little experience with the vagaries of DNS.
getdns also provides an experimental DNS Privacy enabled client called 'stubby' - see below for more details.
## Motivation for providing the API
The developers are of the opinion that DNSSEC offers a unique global infrastructure for establishing and enhancing cryptographic trust relations. With the development of this API we intend to offer application developers a modern and flexible interface that enables end-to-end trust in the DNS architecture, and which will inspire application developers to implement innovative security solutions in their applications.
### API Documentation
Note that this implementation offers additional functionality to supplement that in the [official getdns API](https://getdnsapi.net/documentation/spec/). Some additions are convenient utility functions but other functionality is experimental prior to be being recommended for inclusion in the official API. The [Doxygen documentation](https://getdnsapi.net/doxygen/modules.html) provides the details of the full API for this implementation.
## License
This implementation is licensed under the New BSD License (BSD-new).
Obtaining and getting started with getdns
=========================================
The project home page at [getdnsapi.net](https://getdnsapi.net) provides documentation, binary downloads, and news regarding the getdns API implementation. This README file captures the goals and direction of the project and the current state of the implementation.
If you are just getting started with the library take a look at the section below that describes building and handling external dependencies for the library.
### Examples
Once it is built you should take a look at `spec/example` to see how the library is used.
# Download
Download the sources from our [github repo](https://github.com/getdnsapi/getdns)
or from [getdnsapi.net](https://getdnsapi.net) and verify the download using
the checksums (SHA1 or MD5) or using gpg to verify the signature. Our keys are
available from the [pgp keyservers](http://keyserver.pgp.com)
available from the [openpgp keyserver](https://keys.openpgp.org/)
* willem@nlnetlabs.nl, key id E5F8F8212F77A498
* gwiley@verisign.com, key id 9DC3D572A6B73532
* `willem@nlnetlabs.nl`, key id E5F8F8212F77A498
The [getdns-api mailing list](http://www.vpnc.org/mailman/listinfo/getdns-api)
is a good place to engage in discussions regarding the design of the API.
# Releases
If you are just getting started with the library take a look at the section
below that describes building and handling external dependencies for the
library. Once it is built you should take a look at src/examples to see how
the library is used.
This file captures the goals and direction of the project and the current state
of the implementation.
The goals of this implementation of the getdns API are:
* Provide an open source implementation, in C, of the formally described getdns API by getdns API team at <https://getdnsapi.net/spec.html>
* Initial support for FreeBSD, OSX, Linux (CentOS/RHEL, Ubuntu) via functional "configure" script
* Initial support to include the Android platform
* Include examples and tests as part of the build
* Document code using doxygen
* Leverage github as much as possible for project coordination
* Coding style/standards follow the BSD coding style <ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/style>
Non-goals (things we will not be doing at least initially) include:
* implementation of the traditional DNS related routines (gethostbyname, etc.)
## Language Bindings
In parallel, the team is actively developing bindings for various languages.
For more information, visit the
[wiki](https://github.com/getdnsapi/getdns/wiki/Language-Bindings).
Motivation for providing the API
================================
The developers are of the opinion that DNSSEC offers a unique global
infrastructure for establishing and enhancing cryptographic trust relations.
With the development of this API we intend to offer application developers a
modern and flexible way that enables end-to-end trust in the DNS architecture
and will inspire application developers towards innovative security solutions
in their applications.
Releases
========
Release numbering follows the [Semantic Versioning](http://semver.org/)
approach. The code is currently under active development.
The following requirements were met as conditions for the present release:
* code compiles cleanly on at least the primary target platforms: OSX, RHEL/CentOS Linux, FreeBSD
* examples must compile and run clean
* clearly document supported/unsupported elements of the API
* code compiles cleanly on at least the primary target platforms: OSX, Linux (RHEL/CentOS, Ubuntu), FreeBSD
* examples must compile and run cleanly
* there must be clear documentation of supported and unsupported elements of the API
# External Dependencies
If you are installing from packages, you have to install the library and also the library-devel (or -dev) for your package management system to get the the necessary compile time files.
External dependencies are linked outside the getdns API build tree (we rely on CMake to find them). We would like to keep the dependency tree short, see [Minimising Dependancies](#minimizing-dependancies) for more details.
Required for all builds:
* [libssl and libcrypto from the OpenSSL Project](https://www.openssl.org/) version 1.0.2 or later. Using OpenSSL 1.1 is recommended due to TSL 1.3 support.
Required for all builds that include recursive functionality:
* [libunbound from NLnet Labs](https://unbound.net/) version 1.5.9 or later. (Note: linking to libunbound is not yet supported on Windows, see [Windows 10](#microsoft-windows-10))
Required for all builds that include IDN functionality:
* [libidn2 from the FSF](https://www.gnu.org/software/libidn/) version 2.0.0 and higher.
Required to build the documentation:
* [Doxygen](http://www.doxygen.nl) is used to generate documentation; while this is not technically necessary for the build it makes things a lot more pleasant.
For example, to build on Ubuntu 18.04 or later, you would need the following packages for a full build:
# apt install build-essential libunbound-dev libidn2-dev libssl-dev cmake
# Building
If you are building from git, you need to do the following before building:
# git submodule update --init
From release 1.6.0 getdns uses CMake (previous versions used autoconf/libtool). To build from this release and later use:
# cmake .
# make
If you are unfamiliar with CMake, see our [CMake Quick Start](https://getdnsapi.net/quick-start/cmake-quick-start/) for how to use CMake options to customise the getdns build.
As well as building the getdns library two other tools are installed by default:
* getdns_query: a command line test script wrapper for getdns. This can be used to quickly check the functionality of the library, see (#using-getdnsquery)
* getdns_server_mon: test DNS server function and capabilities
Additionally `Stubby` a DNS Privacy enabled client can also be built and installed by using the `BUILD_STUBBY` option when running `cmake`, see [Stubby](#stubby).
Tickets/Bug Reports
===================
Tickets and bug reports should be reported via the [GitHub issues list](https://github.com/getdnsapi/getdns/issues).
## Minimizing dependencies
Additionally, we have a mailing list at users@getdns.net.
* getdns can be configured for stub resolution mode only with the `ENABLE_STUB_ONLY` option to `cmake`. This removes the dependency on `libunbound`.
* Currently getdns only offers two helper functions to deal with IDN: `getdns_convert_ulabel_to_alabel` and `getdns_convert_alabel_to_ulabel`. If you do not need these functions, getdns can be configured to compile without them by setting the`USE_LIBIDN2` option to `cmake` to OFF.
* When `ENABLE_STUB_ONLY` is ON, and `USE_LIBIDN2` is OFF, getdns has only one dependency left, which is OpenSSL.
## Extensions and Event loop dependencies
Building/External Dependencies
==============================
The implementation works with a variety of event loops, each built as a separate shared library. See [this Doxygen page](https://getdnsapi.net/doxygen/group__eventloops.html) and [this man page](https://getdnsapi.net/documentation/manpages/#ASYNCHRONOUS USE) for more details.
External dependencies are linked outside the getdns API build tree (we rely on configure to find them). We would like to keep the dependency tree short.
* [libldns from NLnet Labs](https://www.nlnetlabs.nl/projects/ldns/) version 1.6.11 or later (ldns requires openssl headers and libraries)
* [libunbound from NLnet Labs](http://www.nlnetlabs.nl/projects/unbound/) version 1.4.16 or later
* [libexpat](http://expat.sourceforge.net/) for libunbound.
* [libidn from the FSF](http://www.gnu.org/software/libidn/) version 1.
* Doxygen is used to generate documentation, while this is not technically necessary for the build it makes things a lot more pleasant.
You have to install the library and also the library-devel (or -dev) for your
package management system to install the compile time files. If you checked
out our git; the configure script is built with autoreconf --install.
## Extensions / Event loop dependencies
The implementation works with a variety of event loops, each built as a separate shared library. See [the wiki](https://github.com/getdnsapi/getdns/wiki/Asynchronous-Support#wiki-included-event-loop-integrations) for more details.
* [libevent](http://libevent.org). Note: the examples *require* this and should work with either libevent 1.x or 2.x. 2.x is preferred.
* [libuv](https://github.com/joyent/libuv)
* [libevent](http://libevent.org). Note: the examples *require* this. libevent 2.x is required.
* [libuv](https://libuv.org/)
* [libev](http://software.schmorp.de/pkg/libev.html)
##Regression Tests
## Using getdns_query
Example test queries using `getdns_query` (pointed at Google Public DNS) and requesting the `call_reporting` extension which provides information on the transport and query time:
getdns_query -s example.com A @8.8.8.8 +return_call_reporting (UDP)
getdns_query -s example.com A @8.8.8.8 -T +return_call_reporting (TCP)
getdns_query -s example.com A @8.8.8.8 -L +return_call_reporting (TLS without authentication)
getdns_query -s getdnsapi.net A +dnssec_return_status +return_call_reporting (DNSSEC)
## Stubby
* Stubby is an implementation of a DNS Privacy enabled stub resolver that encrypts DNS queries using TLS. It is currently suitable for advanced/technical users - all feedback is welcome!
* Details on how to use Stubby can be found in the [Stubby Reference Guide](https://dnsprivacy.org/wiki/x/JYAT).
* Also see [dnsprivacy.org](https://dnsprivacy.org) for more information on DNS Privacy.
## Experimental support for GnuTLS
A project to allow user selection of either OpenSSL or GnuTLS is currently a work in progress. At present a user may select to use GnuTLS for the majority of the supported functionality, however, OpenSSL is still required for some cryptographic functions.
## Regression Tests
A suite of regression tests are included with the library, if you make changes or just
want to sanity check things on your system take a look at src/test. You will need
to install [libcheck](http://check.sourceforge.net/). Check is also available from
many of the package repositories for the more popular operating systems.
to install [libcheck](https://libcheck.github.io/check/). The check library is also available from many of the package repositories for the more popular operating systems.
Note: The tests currently do not run on Windows because of a dependancy on bash.
## DNSSEC
## DNSSEC dependencies
For the library to be DNSSEC capable, it needs to know the root trust anchor.
The library will try to load the root trust anchor from
@ -118,125 +158,197 @@ The library will try to load the root trust anchor from
or more `DS` or `DNSKEY` resource records in presentation (i.e. zone file)
format. Note that this is different than the format of BIND.keys.
The best way to setup or update the root trust anchor is by using
[`unbound-anchor`](http://www.unbound.net/documentation/unbound-anchor.html).
To setup the library with the root trust anchor at the default location,
execute the following steps as root:
## Zero configuration DNSSEC
# mkdir -p /etc/unbound
# unbound-anchor -a /etc/unbound/getdns-root.key
When the root trust anchor is not installed in the default location and a DNSSEC query is done, getdns will try to use the trust anchors published here: http://data.iana.org/root-anchors/root-anchors.xml .
It will validate these anchors with the ICANN Certificate Authority certificate following the procedure described in [RFC7958].
The `root-anchors.xml` and `root-anchors.p7s` S/MIME signature will be cached in the `$HOME/.getdns` directory on Unixes, and the `%appdata%\getdns` directory on Windows.
#Unsupported Features
When using trust-anchors from the `root-anchors.xml` file, getdns will track the keys in the root DNSKEY rrset and store a copy in `$HOME/.getdns/root.key` on Unixes, and `%appdata%\getdns\root.key` on Windows.
Only when the KSK DNSKEY's change, a new version of `root-anchors.xml` is tried to be retrieved from [data.iana.org](https://data.iana.org/root-anchors/).
A installed trust-anchor from the default location (`/etc/unbound/getdns-root.key`) that fails to validate the root DNSKEY RRset, will also trigger the "Zero configuration DNSSEC" procedure described above.
Support
=======
## Mailing lists
We have a [getdns users list](https://lists.getdnsapi.net/mailman/listinfo/users) for this implementation.
## Tickets and Bug Reports
Tickets and bug reports should be reported via the [GitHub issues list](https://github.com/getdnsapi/getdns/issues).
Features of this release
========================
## Goals
The goals of this implementation of the getdns API are:
* Provide an open source implementation, in C, of the formally described getdns API by getdns API team at <https://getdnsapi.net/spec.html>
* Support FreeBSD, OSX, Linux (CentOS/RHEL, Ubuntu)
* Support Windows 10
* Include examples and tests as part of the build
* Document code using doxygen
* Leverage github as much as possible for project coordination
* Follow the BSD coding style/standards <ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/misc/style>
Non-goals (things we will not be doing at least initially) include:
* implementation of the traditional DNS related routines (gethostbyname, etc.)
## Language Bindings
In parallel, the team is actively developing bindings for various languages.
For more information, visit this
[webpage](https://getdnsapi.net/bindings/).
## Unsupported getDNS Features
The following API calls are documented in getDNS but *not supported* by the implementation at this time:
* DNS Search suffixes
* `getdns_context_set_append_name`
* `getdns_context_set_suffix`
* Setting root servers via `getdns_context_set_dns_root_servers`
* `getdns_context_set_dnssec_trust_anchors`
* Detecting changes to resolv.conf and hosts
* MDNS and NetBIOS namespaces (only DNS and LOCALFILES are supported)
* MDNS, NIS and NetBIOS namespaces (only DNS and LOCALFILES are supported)
Some platform specific features are not implemented in the first public release of getdns, however they are on the radar. These include:
### Minor omissions
* Respecting settings in /etc/nsswitch.conf (linux and some other OSes), for the first release we simply check local files (/etc/hosts) before checking the DNS.
* Search suffixes specified in /etc/resolv.conf
The following minor implementation omissions are noted:
#Known Issues
Recursive mode does not support:
* TLS as a transport
* Non-zero connection idle timeouts or query pipelining
* Anything other than query_type and resolution_type in the return_call_reporting extension
There are a few known issues which we have summarized below - the most recent
and helpful list is being maintained in the git issues list in the repository.
Other known issues are being managed in the git repository issue list.
Stub mode does not support:
* Non zero idle timeouts for synchronous calls
* (#113) Changing the resolution type between stub and recursive after a query has been issued with a context will not work - the previous resolution type will continue to be used. If you want to change the resolution type you will need to create a new context and set the resolution type for that context.
# Known Issues
* When doing a synchronous lookup with a context that has outstanding asynchronous lookups, the callbacks for the asynchronous lookups might get called as a side effect of the synchronous lookup.
* None
# Supported Platforms
The platforms listed here are intended to help ensure that we catch platform specific breakage prior to release.
* Ubuntu 18.04 LTS and newer LTS releases
* Microsoft Windows 10
* FreeBSD 11.3 and newer
* RHEL/CentOS 8
* OSX 10.14 and 10.15
#Supported Platforms
The primary platforms targeted are Linux and FreeBSD, other platform are supported as we get time. The names listed here are intended to help ensure that we catch platform specific breakage, not to limit the work that folks are doing.
* RHEL/CentOS 6.4
* OSX 10.8
* Ubuntu 14.04
We intend to add MS-Windows, Android and other platforms to the releases as we have time to port it.
##Platform Specific Build Reports
### Platform Specific Build Notes
[![Build Status](https://travis-ci.org/getdnsapi/getdns.png?branch=master)](https://travis-ci.org/getdnsapi/getdns)
###FreeBSD
## FreeBSD
If you're using [FreeBSD](http://www.freebsd.org/), you may install getdns via the [ports tree](http://www.freshports.org/dns/getdns/) by running: `cd /usr/ports/dns/getdns && make install clean`
If you're using [FreeBSD](https://www.freebsd.org/), you may install getdns via the [ports tree](https://www.freshports.org/dns/getdns/) by running: `cd /usr/ports/dns/getdns && make install clean`
If you are using FreeBSD 10 getdns can be intalled via 'pkg install getdns'.
###CentOS/RHEL 6.5
## Ubuntu
We rely on the most excellent package manager fpm to build the linux packages which
means that the packaging platform requires ruby 2.1.0. There are other ways to
build the packages, this is simplythe one we chose to use.
getdns should also work on Ubuntu 16.04, however if you require IDN functionality you will have to install a recent version of libidn2 via a ppa e.g. from https://launchpad.net/~ondrej/+archive/ubuntu/php
# cat /etc/redhat-release
CentOS release 6.5 (Final)
# uname -a
Linux host-10-1-1-6 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# cd getdns-0.1.6
# ./configure --prefix=/home/deploy/build
# make; make install
# cd /home/deploy/build
# mv lib lib64
# . /usr/local/rvm/config/alias
# fpm -x "*.la" -a native -s dir -t rpm -n getdns -v 0.1.6 -d "unbound" -d "ldns" -d "libevent" -d "libidn" --prefix /usr --vendor "Verisign Inc., NLnet Labs" --license "BSD New" --url "https://getdnsapi.net" --description "Modern asynchronous API to the DNS" .
You will also have to build Unbound from source code to provide libunbound at version >= 1.5.9.
###OSX
## OSX
# sw_vers
ProductName: Mac OS X
ProductVersion: 10.8.5
BuildVersion: 12F45
A self-compiled version of OpenSSL or the version installed via Homebrew is required and the options OPENSSL_ROOT_DIR, OPENSSL_CRYPTO_LIBRARY and OPENSSL_SSL_LIBRARY can be used to specify the location of the libraries.
Note: If using a self-compiled version, manual configuration of certificates into /usr/local/etc/openssl/certs is required for TLS authentication to work.
Built using PackageMaker, libevent2.
# ./configure --with-libevent --prefix=$HOME/getdnsosx/export
# make
# make install
edit/fix hardcoded paths in lib/*.la to reference /usr/local
update getdns.pmdoc to match release info
build package using PackageMaker
create dmg
#### Homebrew
### Homebrew
If you're using [Homebrew](http://brew.sh/), you may run `brew install getdns`. By default, this will only build the core library without any 3rd party event loop support.
To install the [event loop integration libraries](https://github.com/getdnsapi/getdns/wiki/Asynchronous-Support) that enable support for libevent, libuv, and libev, run: `brew install getdns --with-libevent --with-libuv --with-libev`. All switches are optional.
To install the [event loop integration libraries](https://getdnsapi.net/doxygen/group__eventloops.html) that enable support for libevent, libuv, and libev, run: `brew install getdns --with-libevent --with-libuv --with-libev`. All switches are optional.
Note that in order to compile the examples, the `--with-libevent` switch is required.
Additionally, getdns is linked against the the OpenSSL library installed by Homebrew. Note that the Homebrew OpenSSL installation clones the Keychain certificates to the default OpenSSL location so TLS certificate authentication should work out of the box.
## Microsoft Windows 10
You will need CMake for Windows. Installers can be downloaded from https://cmake.org/download/.
Windows versions of the following libraries are available using [the vcpkg package manager](https://docs.microsoft.com/en-us/cpp/build/vcpkg).
* OpenSSL
* libevent
* libiconv (required for libidn2)
* libidn2
* libyaml
* libuv
Once these are installed, set CMake variables CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to the vcpkg include and library directories e.g. `../vcpkg/installed/x64-windows/include` and `../vcpkg/installed/x64-windows/lib`.
To generate a project suitable for use in Visual Studio, select the appropriate Visual Studio generator in CMake. Once generated, the cmake-gui Open Project button can be used to load the project into Visual Studio.
### Limitations on Windows
Full support for Windows is a work in progress. The following limitations will be addresses in future:
* At present, no native Windows DLL version of libunbound exists; support for linking against libunbound is not currently available. The default build option for ENABLE_STUB_ONLY_ is ON for Windows.
* The getdns unit tests (built with `make test`) require libcheck which is not currently available for Windows and so cannot be built.
* The getdns tpkg test suite is not currently supported on Windows.
* The detection of the location of the `/etc/hosts` file should be optimised - it currently assumes Windows is installed in the default directory on the C: drive
Contributors
============
* Claus Assman
* Theogene Bucuti
* Andrew Cathrow, Verisign Labs
* Neil Cook
* Saúl Ibarra Corretgé
* Craig Despeaux, Verisign, Inc.
* John Dickinson, Sinodun
* Sara Dickinson, Sinodun
* Robert Edmonds
* Angelique Finan, Verisign, Inc.
* Simson Garfinkel
* Daniel Kahn Gillmor
* Neel Goyal, Verisign, Inc.
* Bryan Graham, Verisign, Inc.
* Robert Groenenberg
* Jim Hague, Sinodun
* Paul Hoffman
* Scott Hollenbeck, Verising, Inc.
* Christian Huitema
* Shumon Huque, Verisign Labs
* Jelte Janssen
* Guillem Jover
* Shane Kerr
* Anthony Kirby
* Olaf Kolkman, NLnet Labs
* Sanjay Mahurpawar, Verisign, Inc.
* Allison Mankin, Verisign, Inc. - Verisign Labs.
* Sai Mogali, Verisign, Inc.
* Linus Nordberg
* Benno Overeinder, NLnet Labs
* Joel Purra
* Tom Pusateri
* Prithvi Ranganath, Verisign, Inc.
* Hoda Rohani, NLnet Labs
* Rushi Shah, Verisign, Inc.
* Vinay Soni, Verisign, Inc.
* Melinda Shore, No Mountain Software LLC
* Bob Steagall, Verisign, Inc.
* Andrew Sullivan
* Ondřej Surý
* Willem Toorop, NLnet Labs
* Gowri Visweswaran, Verisign Labs
* Wouter Wijngaards, NLnet Labs
* Glen Wiley, Verisign, Inc.
* Paul Wouters
Acknowledgements
================
The development team explicitly acknowledges Paul Hoffman for his initiative and efforts to develop a consensus based DNS API. We would like to thank the participants of the [mailing list](http://www.vpnc.org/mailman/listinfo/getdns-api) for their contributions.
The development team explicitly acknowledges Paul Hoffman for his initiative and efforts to develop a consensus based DNS API. We would like to thank the participants of the getdns-api mailing list (discontinued) for their contributions.

22
aclocal.m4 vendored
View File

@ -1,22 +0,0 @@
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_include([m4/acx_openssl.m4])
m4_include([m4/ax_check_compile_flag.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
m4_include([m4/pkg.m4])

View File

@ -0,0 +1,540 @@
#ifndef CONFIG_H
#define CONFIG_H
#cmakedefine PACKAGE "@PACKAGE@"
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
#cmakedefine PACKAGE_URL "@PACKAGE_URL@"
#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
#cmakedefine HAVE_ASSERT_H 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_LIMITS_H 1
#cmakedefine HAVE_SYS_LIMITS_H 1
#cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_STDDEF_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_STDIO_H 1
#cmakedefine HAVE_STDLIB_H 1
#cmakedefine HAVE_STRING_H 1
#cmakedefine HAVE_TIME_H 1
#cmakedefine HAVE_UNISTD_H 1
#cmakedefine HAVE_FCNTL_H 1
#cmakedefine HAVE_SIGNAL_H 1
#cmakedefine HAVE_SYS_POLL_H 1
#cmakedefine HAVE_POLL_H 1
#cmakedefine HAVE_RESOURCE_H 1
#cmakedefine HAVE_SYS_TYPES_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_ENDIAN_H 1
#cmakedefine HAVE_NETDB_H 1
#cmakedefine HAVE_ARPA_INET_H 1
#cmakedefine HAVE_NETINET_IN_H 1
#cmakedefine HAVE_NETINET_TCP_H 1
#cmakedefine HAVE_SYS_SELECT_H 1
#cmakedefine HAVE_SYS_SOCKET_H 1
#cmakedefine HAVE_SYS_SYSCTL_H 1
#cmakedefine HAVE_SYS_TIME_H 1
#cmakedefine HAVE_SYS_WAIT_H 1
#cmakedefine HAVE_WINDOWS_H 1
#cmakedefine HAVE_WINSOCK_H 1
#cmakedefine HAVE_WINSOCK2_H 1
#cmakedefine HAVE_WS2TCPIP_H 1
#cmakedefine GETDNS_ON_WINDOWS 1
#cmakedefine USE_WINSOCK 1
#cmakedefine HAVE_SSL 1
#cmakedefine USE_DANESSL 1
#cmakedefine HAVE_OPENSSL_SSL_H 1
#cmakedefine HAVE_OPENSSL_EVP_H 1
#cmakedefine HAVE_OPENSSL_ERR_H 1
#cmakedefine HAVE_OPENSSL_RAND_H 1
#cmakedefine HAVE_OPENSSL_CONF_H 1
#cmakedefine HAVE_OPENSSL_ENGINE_H 1
#cmakedefine HAVE_OPENSSL_BN_H 1
#cmakedefine HAVE_OPENSSL_DSA_H 1
#cmakedefine HAVE_OPENSSL_RSA_H 1
#cmakedefine HAVE_OPENSSL_PARAM_BUILD_H 1
#cmakedefine HAVE_DSA_SIG_SET0 1
#cmakedefine HAVE_DSA_SET0_PQG 1
#cmakedefine HAVE_DSA_SET0_KEY 1
#cmakedefine HAVE_RSA_SET0_KEY 1
#cmakedefine HAVE_EVP_MD5 1
#cmakedefine HAVE_EVP_SHA1 1
#cmakedefine HAVE_EVP_SHA224 1
#cmakedefine HAVE_EVP_SHA256 1
#cmakedefine HAVE_EVP_SHA384 1
#cmakedefine HAVE_EVP_SHA512 1
#cmakedefine HAVE_EVP_DSS1 1
#cmakedefine HAVE_EVP_DIGESTVERIFY 1
#cmakedefine HAVE_EVP_MD_CTX_NEW 1
#cmakedefine HAVE_HMAC_CTX_NEW 1
#cmakedefine HAVE_NETTLE_GET_SECP_256R1 1
#cmakedefine HAVE_NETTLE_GET_SECP_384R1 1
#cmakedefine HAVE_TLS_CLIENT_METHOD 1
#cmakedefine HAVE_OPENSSL_VERSION_NUM 1
#cmakedefine HAVE_OPENSSL_VERSION 1
#cmakedefine HAVE_SSL_CTX_DANE_ENABLE 1
#cmakedefine HAVE_SSL_CTX_SET_CIPHERSUITES 1
#cmakedefine HAVE_SSL_SET_CIPHERSUITES 1
#cmakedefine HAVE_OPENSSL_INIT_CRYPTO 1
#cmakedefine HAVE_OSSL_PARAM_BLD_NEW 1
#cmakedefine HAVE_SSL_DANE_ENABLE 1
#cmakedefine HAVE_DECL_SSL_CTX_SET1_CURVES_LIST 1
#cmakedefine HAVE_DECL_SSL_SET1_CURVES_LIST 1
#cmakedefine HAVE_DECL_SSL_SET_MIN_PROTO_VERSION 1
#cmakedefine HAVE_X509_GET_NOTAFTER 1
#cmakedefine HAVE_X509_GET0_NOTAFTER 1
#cmakedefine HAVE_PTHREAD 1
#cmakedefine HAVE_WINDOWS_THREADS 1
#cmakedefine RUNSTATEDIR "@RUNSTATEDIR@"
#cmakedefine TRUST_ANCHOR_FILE "@PATH_TRUST_ANCHOR_FILE@"
#cmakedefine GETDNS_FN_RESOLVCONF "@PATH_RESOLVCONF@"
#cmakedefine GETDNS_FN_HOSTS "@PATH_HOSTS@"
#cmakedefine DNSSEC_ROADBLOCK_AVOIDANCE 1
#cmakedefine HAVE_MDNS_SUPPORT 1
#cmakedefine STUB_NATIVE_DNSSEC 1
#cmakedefine MAXIMUM_UPSTREAM_OPTION_SPACE @MAXIMUM_UPSTREAM_OPTION_SPACE@
#cmakedefine EDNS_PADDING_OPCODE @EDNS_PADDING_OPCODE@
#cmakedefine MAX_CNAME_REFERRALS @MAX_CNAME_REFERRALS@
#cmakedefine DRAFT_RRTYPES @DRAFT_RRTYPES@
#cmakedefine EDNS_COOKIES 1
#cmakedefine EDNS_COOKIE_OPCODE @EDNS_COOKIE_OPCODE@
#cmakedefine EDNS_COOKIE_ROLLOVER_TIME @EDNS_COOKIE_ROLLOVER_TIME@
#cmakedefine UDP_MAX_BACKOFF @MAX_UDP_BACKOFF@
#cmakedefine HAVE_DECL_GETENTROPY 1
#cmakedefine HAVE_DECL_INET_PTON 1
#cmakedefine HAVE_DECL_INET_NTOP 1
#cmakedefine HAVE_WIN_DECL_INET_PTON 1
#cmakedefine HAVE_WIN_DECL_INET_NTOP 1
#cmakedefine HAVE_DECL_MKSTEMP 1
#cmakedefine HAVE_DECL_SIGEMPTYSET 1
#cmakedefine HAVE_DECL_SIGFILLSET 1
#cmakedefine HAVE_DECL_SIGADDSET 1
#cmakedefine HAVE_DECL_STRPTIME 1
#cmakedefine HAVE_DECL_TCP_FASTOPEN 1
#cmakedefine HAVE_DECL_TCP_FASTOPEN_CONNECT 1
#cmakedefine HAVE_DECL_MSG_FASTOPEN 1
#if defined(HAVE_DECL_INET_PTON) || defined(HAVE_WIN_DECL_INET_PTON)
#undef HAVE_DECL_INET_PTON
#define HAVE_DECL_INET_PTON 1
#endif
#if defined(HAVE_DECL_INET_NTOP) || defined(HAVE_WIN_DECL_INET_NTOP)
#undef HAVE_DECL_INET_NTOP
#define HAVE_DECL_INET_NTOP 1
#endif
#cmakedefine HAVE_FCNTL 1
#cmakedefine HAVE_GETTIMEOFDAY 1
#cmakedefine HAVE_IOCTLSOCKET 1
#cmakedefine HAVE_SIGEMPTYSET 1
#cmakedefine HAVE_SIGFILLSET 1
#cmakedefine HAVE_SIGADDSET 1
#cmakedefine HAVE_STRPTIME 1
#cmakedefine HAVE_SIGSET_T 1
#cmakedefine HAVE__SIGSET_T 1
#cmakedefine HAVE_BSD_STDLIB_H 1
#cmakedefine HAVE_BSD_STRING_H 1
#cmakedefine HAVE_DECL_STRLCPY 1
#cmakedefine HAVE_DECL_ARC4RANDOM 1
#cmakedefine HAVE_DECL_ARC4RANDOM_UNIFORM 1
#cmakedefine HAVE_BSD_DECL_STRLCPY 1
#cmakedefine HAVE_BSD_DECL_ARC4RANDOM 1
#cmakedefine HAVE_BSD_DECL_ARC4RANDOM_UNIFORM 1
#cmakedefine HAVE_STRLCPY 1
#cmakedefine HAVE_ARC4RANDOM 1
#cmakedefine HAVE_ARC4RANDOM_UNIFORM 1
#cmakedefine HAVE_LIBUNBOUND 1
#cmakedefine HAVE_UNBOUND_EVENT_H 1
#cmakedefine HAVE_UNBOUND_EVENT_API 1
#cmakedefine HAVE_UB_CTX_SET_STUB 1
#cmakedefine HAVE_LIBIDN 1
#cmakedefine HAVE_LIBIDN2 1
#cmakedefine HAVE_NETTLE 1
#cmakedefine HAVE_NETTLE_DSA_COMPAT_H 1
#cmakedefine HAVE_NETTLE_EDDSA_H 1
#cmakedefine HAVE_EVENT2_EVENT_H 1
#cmakedefine HAVE_EVENT_BASE_NEW 1
#cmakedefine HAVE_EVENT_BASE_FREE 1
#cmakedefine DEFAULT_EVENTLOOP "@DEFAULT_EVENTLOOP@"
#cmakedefine USE_POLL_DEFAULT_EVENTLOOP 1
#cmakedefine STRPTIME_WORKS 1
#cmakedefine FD_SETSIZE @FD_SETSIZE@
#cmakedefine REQ_DEBUG 1
#cmakedefine SCHED_DEBUG 1
#cmakedefine STUB_DEBUG 1
#cmakedefine DAEMON_DEBUG 1
#cmakedefine SEC_DEBUG 1
#cmakedefine SERVER_DEBUG 1
#cmakedefine ANCHOR_DEBUG 1
#cmakedefine KEEP_CONNECTIONS_OPEN_DEBUG 1
#cmakedefine USE_SHA1 1
#cmakedefine USE_SHA2 1
#cmakedefine USE_GOST 1
#cmakedefine USE_ECDSA 1
#cmakedefine USE_DSA 1
#cmakedefine USE_ED25519 1
#cmakedefine USE_ED448 1
#cmakedefine USE_OSX_TCP_FASTOPEN 1
#cmakedefine HAVE_DECL_TCP_USER_TIMEOUT 1
#cmakedefine HAVE_NEW_UV_TIMER_CB 1
#cmakedefine HAVE_TARGET_ENDIANNESS
#cmakedefine TARGET_IS_BIG_ENDIAN
#cmakedefine HAVE___FUNC__ 1
#ifdef HAVE___FUNC__
#define __FUNC__ __func__
#else
#define __FUNC__ __FUNCTION__
#endif
#ifdef GETDNS_ON_WINDOWS
/* On windows it is allowed to increase the FD_SETSIZE
* (and nescessary to make our custom eventloop work)
* See: https://support.microsoft.com/en-us/kb/111855
*/
# ifndef FD_SETSIZE
# define FD_SETSIZE 1024
# endif
#ifdef __cplusplus
extern "C" {
#endif
/* the version of the windows API enabled */
# ifndef WINVER
# define WINVER 0x0600 // 0x0502
# endif
# ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x0600 // 0x0502
# endif
# ifdef HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
# endif
# ifdef _MSC_VER
# if _MSC_VER >= 1800
# define PRIsz "zu"
# else
# define PRIsz "Iu"
# endif
# include <BaseTsd.h>
typedef SSIZE_T ssize_t;
# else
# define PRIsz "Iu"
# endif
# ifdef HAVE_WINSOCK2_H
# include <winsock2.h>
# endif
/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
# ifdef HAVE_WINSOCK2_H
# define FD_SET_T (u_int)
# else
# define FD_SET_T
# endif
/* Windows wants us to use _strdup instead of strdup */
# ifndef strdup
# define strdup _strdup
# endif
/* Windows doesn't have strcasecmp and strncasecmp. */
# define strcasecmp _stricmp
# define strncasecmp _strnicmp
#else
# define PRIsz "zu"
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ASSERT_H
#include <assert.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
#ifdef HAVE_BSD_STDLIB_H
#include <bsd/stdlib.h>
#endif
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#endif
#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY || !defined(strlcpy)
size_t strlcpy(char *dst, const char *src, size_t siz);
#else
#ifndef __BSD_VISIBLE
#define __BSD_VISIBLE 1
#endif
#endif
#if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
uint32_t arc4random(void);
#endif
#if !defined(HAVE_ARC4RANDOM_UNIFORM) || !HAVE_DECL_ARC4RANDOM_UNIFORM
uint32_t arc4random_uniform(uint32_t upper_bound);
#endif
#ifndef HAVE_ARC4RANDOM
void explicit_bzero(void* buf, size_t len);
int getentropy(void* buf, size_t len);
void arc4random_buf(void* buf, size_t n);
void _ARC4_LOCK(void);
void _ARC4_UNLOCK(void);
#endif
#ifdef COMPAT_SHA512
#ifndef SHA512_DIGEST_LENGTH
#define SHA512_BLOCK_LENGTH 128
#define SHA512_DIGEST_LENGTH 64
#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
typedef struct _SHA512_CTX {
uint64_t state[8];
uint64_t bitcount[2];
uint8_t buffer[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
#endif /* SHA512_DIGEST_LENGTH */
void SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, void*, size_t);
void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
#endif /* COMPAT_SHA512 */
#ifdef USE_WINSOCK
# ifndef _CUSTOM_VSNPRINTF
# define _CUSTOM_VSNPRINTF
static inline int _gldns_custom_vsnprintf(char *str, size_t size, const char *format, va_list ap)
{ int r = vsnprintf(str, size, format, ap); return r == -1 ? _vscprintf(format, ap) : r; }
# define vsnprintf _gldns_custom_vsnprintf
# endif
#endif
#ifdef __cplusplus
}
#endif
/** Use on-board gldns */
#define USE_GLDNS 1
#ifdef HAVE_SSL
# define GLDNS_BUILD_CONFIG_HAVE_SSL 1
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_TCP_H
#include <netinet/tcp.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_SYS_LIMITS_H
#include <sys/limits.h>
#endif
#ifdef PATH_MAX
#define _GETDNS_PATH_MAX PATH_MAX
#else
#define _GETDNS_PATH_MAX 2048
#endif
#ifndef PRIu64
#define PRIu64 "llu"
#endif
#ifdef HAVE_ATTR_FORMAT
# define ATTR_FORMAT(archetype, string_index, first_to_check) \
__attribute__ ((format (archetype, string_index, first_to_check)))
#else /* !HAVE_ATTR_FORMAT */
# define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
#endif /* !HAVE_ATTR_FORMAT */
#if defined(DOXYGEN)
# define ATTR_UNUSED(x) x
#elif defined(__cplusplus)
# define ATTR_UNUSED(x)
#elif defined(__GNUC__)
# define ATTR_UNUSED(x) x __attribute__((unused))
#else /* !HAVE_ATTR_UNUSED */
# define ATTR_UNUSED(x) x
#endif /* !HAVE_ATTR_UNUSED */
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
#define strptime unbound_strptime
struct tm;
char *strptime(const char *s, const char *format, struct tm *tm);
#endif
#if !defined(HAVE_SIGSET_T) && defined(HAVE__SIGSET_T)
typedef _sigset_t sigset_t;
#endif
#if !defined(HAVE_SIGEMPTYSET)
# define sigemptyset(pset) (*(pset) = 0)
#endif
#if !defined(HAVE_SIGFILLSET)
# define sigfillset(pset) (*(pset) = (sigset_t)-1)
#endif
#if !defined(HAVE_SIGADDSET)
# define sigaddset(pset, num) (*(pset) |= (1L<<(num)))
#endif
#ifdef HAVE_LIBUNBOUND
# include <unbound.h>
# ifdef HAVE_UNBOUND_EVENT_H
# include <unbound-event.h>
# else
# ifdef HAVE_UNBOUND_EVENT_API
# ifndef _UB_EVENT_PRIMITIVES
# define _UB_EVENT_PRIMITIVES
struct ub_event_base;
struct ub_ctx* ub_ctx_create_ub_event(struct ub_event_base* base);
typedef void (*ub_event_callback_t)(void*, int, void*, int, int, char*);
int ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype,
int rrclass, void* mydata, ub_event_callback_t callback, int* async_id);
# endif
# endif
# endif
#endif
#ifndef HAVE_DECL_INET_PTON
int inet_pton(int af, const char* src, void* dst);
#endif
#ifndef HAVE_DECL_INET_NTOP
const char *inet_ntop(int af, const void *src, char *dst, size_t size);
#endif
#ifndef HAVE_DECL_MKSTEMP
int mkstemp(char *template);
#endif
#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval* tv, void* tz);
#endif
#ifdef __cplusplus
}
#endif
#endif /* CONFIG_H */

View File

@ -0,0 +1,19 @@
1 VERSIONINFO
FILEVERSION @version_current@,@version_revision@,@version_age@,0
PRODUCTVERSION @version_current@,@version_revision@,0,0
FILEOS 4
FILETYPE 2
FILESUBTYPE 0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "getdns project\0"
VALUE "ProductName", "getdns\0"
VALUE "FileVersion", "@version_current@.@version_revision@\0"
VALUE "ProductVersion", "@version_current@.@version_revision@\0"
VALUE "LegalCopyright", "NLnet Labs, Sinodun, No Mountain Software. New BSD licence.\0"
END
END
END

View File

@ -0,0 +1,114 @@
#[=======================================================================[.rst:
FindCheck
--------
Find the Check (Unit Testing Framework for C) library
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Check::Check``
The Check library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Check_FOUND``
If false, do not try to use Check.
``CHECK_INCLUDE_DIR``
where to find check.h, etc.
``CHECK_LIBRARIES``
the libraries needed to use Check.
``CHECK_VERSION``
the version of the Check library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgCheck IMPORTED_TARGET GLOBAL check)
endif ()
if (PkgCheck_FOUND)
set(CHECK_INCLUDE_DIR ${PkgCheck_INCLUDE_DIRS} CACHE FILEPATH "check include path")
set(CHECK_LIBRARIES ${PkgCheck_LIBRARIES} CACHE STRING "check libraries")
set(CHECK_VERSION ${PkgCheck_VERSION})
add_library(Check::Check ALIAS PkgConfig::PkgCheck)
set(Check_FOUND ON)
else ()
find_path(CHECK_INCLUDE_DIR check.h
HINTS
"${CHECK_DIR}"
"${CHECK_DIR}/include"
)
# Check for PIC and non-PIC libraries. If PIC present, use that
# in preference (as per Debian check.pc).
find_library(CHECK_LIBRARY NAMES check_pic libcheck_pic
HINTS
"${CHECK_DIR}"
"${CHECK_DIR}/lib"
)
if (NOT CHECK_LIBRARY)
find_library(CHECK_LIBRARY NAMES check libcheck
HINTS
"${CHECK_DIR}"
"${CHECK_DIR}/lib"
)
endif ()
set(_CHECK_LIBARIES "")
# Check may need the math, subunit and rt libraries on Unix
if (UNIX)
find_library(CHECK_MATH_LIBRARY m)
find_library(CHECK_RT_LIBRARY rt)
find_library(CHECK_SUBUNIT_LIBRARY subunit)
if (CHECK_MATH_LIBRARY)
list(APPEND _CHECK_LIBARIES "${CHECK_MATH_LIBRARY}")
endif ()
if (CHECK_RT_LIBRARY)
list(APPEND _CHECK_LIBARIES "${CHECK_RT_LIBRARY}")
endif ()
if (CHECK_SUBUNIT_LIBRARY)
list(APPEND _CHECK_LIBARIES "${CHECK_SUBUNIT_LIBRARY}")
endif ()
endif()
set(CHECK_LIBRARIES ${_CHECK_LIBARIES} ${CHECK_LIBRARY} CACHE STRING "check libraries")
if (CHECK_INCLUDE_DIR AND CHECK_LIBRARY)
if (NOT TARGET Check::Check)
add_library(Check::Check UNKNOWN IMPORTED)
set_target_properties(Check::Check PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CHECK_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${CHECK_LIBRARIES}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${CHECK_LIBRARY}"
)
endif ()
if (NOT CHECK_VERSION AND CHECK_INCLUDE_DIR AND EXISTS "${CHECK_INCLUDE_DIR}/check.h")
file(STRINGS "${CHECK_INCLUDE_DIR}/check.h" CHECK_H REGEX "^#define CHECK_M[A-Z]+_VERSION")
string(REGEX REPLACE "^.*\(([0-9]+)\).*\(([0-9]+)\).*\(([0-9]+)\).*$" "\\1.\\2.\\3" CHECK_VERSION "${CHECK_H}")
endif ()
endif()
list(APPEND CHECK_LIBRARIES "${CHECK_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Check
REQUIRED_VARS CHECK_LIBRARIES CHECK_INCLUDE_DIR
VERSION_VAR CHECK_VERSION
)
endif()
mark_as_advanced(CHECK_INCLUDE_DIR CHECK_LIBRARIES CHECK_LIBRARY
CHECK_MATH_LIBRARY CHECK_RT_LIBRARY CHECK_SUBUNIT_LIBRARY)

View File

@ -0,0 +1,101 @@
#[=======================================================================[.rst:
FindGnuTLS
----------
Find the GnuTLS library.
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``GnuTLS::GnuTLS``
The GnuTLS library, if found.
``GnuTLS::Dane``
The GnuTLS DANE library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``GnuTLS_FOUND``
If false, do not try to use GnuTLS.
``GNUTLS_INCLUDE_DIR``
where to find GnuTLS headers.
``GNUTLS_LIBRARIES``
the libraries needed to use GnuTLS.
``GNUTLS_VERSION``
the version of the GnuTLS library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgGnuTLS IMPORTED_TARGET GLOBAL QUIET gnutls)
pkg_check_modules(PkgGnuTLSDane IMPORTED_TARGET GLOBAL QUIET gnutls-dane)
endif ()
if (PkgGnuTLS_FOUND AND PkgGnuTLSDane_FOUND)
set(GNUTLS_INCLUDE_DIR ${PkgGnuTLS_INCLUDE_DIRS} $PkgGnuTLSDane_INCLUDE_DIRS} CACHE FILEPATH "GnuTLS include path")
set(NETTLE_LIBRARIES ${PkgGnuTLS_LIBRARIES} ${PkgGnuTLSDane_LIBRARIES} CACHE STRING "GnuTLS libraries")
set(NETTLE_VERSION ${PkgGnuTLS_VERSION})
add_library(GnuTLS::GnuTLS ALIAS PkgConfig::PkgGnuTLS)
add_library(GnuTLS::Dane ALIAS PkgConfig::PkgGnuTLSDane)
set(GnuTLS_FOUND ON)
else ()
find_path(GNUTLS_INCLUDE_DIR gnutls/gnutls.h
HINTS
"${GNUTLS_DIR}"
"${GNUTLS_DIR}/include"
)
find_library(GNUTLS_LIBRARY NAMES gnutls libgnutls
HINTS
"${GNUTLS_DIR}"
"${GNUTLS_DIR}/lib"
)
find_library(GNUTLS_DANE_LIBRARY NAMES gnutls-dane libgnutls-dane
HINTS
"${GNUTLS_DIR}"
"${GNUTLS_DIR}/lib"
)
set(_GNUTLS_LIBRARIES "")
if (GNUTLS_INCLUDE_DIR AND GNUTLS_LIBRARY AND GNUTLS_DANE_LIBRARY)
if (NOT TARGET GnuTLS::GnuTLS)
add_library(GnuTLS::GnuTLS UNKNOWN IMPORTED)
set_target_properties(GnuTLS::GnuTLS PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${GNUTLS_LIBRARY}"
)
endif ()
if (NOT TARGET GnuTLS::Dane)
add_library(GnuTLS::Dane UNKNOWN IMPORTED)
set_target_properties(GnuTLS::Dane PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GNUTLS_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${GNUTLS_DANE_LIBRARY}"
)
endif ()
if (NOT GNUTLS_VERSION AND GNUTLS_INCLUDE_DIR)
file(STRINGS "${GNUTLS_INCLUDE_DIR}/gnutls/gnutls.h" GNUTLS_VER_H REGEX "^#define GNUTLS_VERSION_(MAJOR|MINOR|PATCH) ")
string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3c" GNUTLS_VERSION "${GNUTLS_VER_H}")
endif ()
endif ()
list(APPEND _GNUTLS_LIBRARIES "${GNUTLS_LIBRARY}" "${GNUTLS_DANE_LIBRARY}")
set(GNUTLS_LIBRARIES ${_GNUTLS_LIBRARIES} CACHE STRING "GnuTLS libraries")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GnuTLS
REQUIRED_VARS GNUTLS_LIBRARIES GNUTLS_INCLUDE_DIR
VERSION_VAR GNUTLS_VERSION
)
endif ()
mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARIES GNUTLS_LIBRARY GNUTLS_DANE_LIBRARY)

View File

@ -0,0 +1,63 @@
#[=======================================================================[.rst:
FindLibev
---------
Find the Libev library.
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Libev::Libev``
The Libev library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Libev_FOUND``
If false, do not try to use Libev.
``LIBEV_INCLUDE_DIR``
where to find libev headers.
``LIBEV_LIBRARIES``
the libraries needed to use Libev.
``LIBEV_VERSION``
the version of the Libev library found
#]=======================================================================]
find_path(LIBEV_INCLUDE_DIR ev.h
HINTS
"${LIBEV_DIR}"
"${LIBEV_DIR}/include"
)
find_library(LIBEV_LIBRARY NAMES ev libev
HINTS
"${LIBEV_DIR}"
"${LIBEV_DIR}/lib"
)
set(LIBEV_LIBRARIES "")
if (LIBEV_INCLUDE_DIR AND LIBEV_LIBRARY)
if (NOT TARGET Libev::Libev)
add_library(Libev::Libev UNKNOWN IMPORTED)
set_target_properties(Libev::Libev PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBEV_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBEV_LIBRARY}"
)
endif ()
endif()
list(APPEND LIBEV_LIBRARIES "${LIBEV_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libev
REQUIRED_VARS LIBEV_LIBRARIES LIBEV_INCLUDE_DIR
)
mark_as_advanced(LIBEV_INCLUDE_DIR LIBEV_LIBRARIES LIBEV_LIBRARY)

View File

@ -0,0 +1,78 @@
#[=======================================================================[.rst:
FindLibevent2
-------------
Find the Libevent2 library. For now this finds the core library only.
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Libevent2::Libevent_core``
The Libevent2 library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Libevent2_FOUND``
If false, do not try to use Libevent2.
``LIBEVENT2_INCLUDE_DIR``
where to find libevent headers.
``LIBEVENT2_LIBRARIES``
the libraries needed to use Libevent2.
``LIBEVENT2_VERSION``
the version of the Libevent2 library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibevent IMPORTED_TARGET GLOBAL QUIET libevent>=2)
endif ()
if (PkgLibevent_FOUND)
set(LIBEVENT2_INCLUDE_DIR ${PkgLibevent_INCLUDE_DIRS} CACHE FILEPATH "libevent2 include path")
set(LIBEVENT2_LIBRARIES ${PkgLibevent_LIBRARIES} CACHE STRING "libevent2 libraries")
set(LIBEVENT2_VERSION ${PkgLibevent_VERSION})
add_library(Libevent2::Libevent_core ALIAS PkgConfig::PkgLibevent)
set(Libevent2_FOUND ON)
else ()
find_path(LIBEVENT2_INCLUDE_DIR event2/event.h
HINTS
"${LIBEVENT2_DIR}"
"${LIBEVENT2_DIR}/include"
)
find_library(LIBEVENT2_LIBRARIES NAMES event_core libevent_core
HINTS
"${LIBEVENT2_DIR}"
"${LIBEVENT2_DIR}/lib"
)
if (LIBEVENT2_INCLUDE_DIR AND LIBEVENT2_LIBRARIES)
if (NOT TARGET Libevent2::Libevent_core)
add_library(Libevent2::Libevent_core UNKNOWN IMPORTED)
set_target_properties(Libevent2::Libevent_core PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBEVENT2_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBEVENT2_LIBRARIES}"
)
endif ()
if (NOT LIBEVENT2_VERSION AND LIBEVENT2_INCLUDE_DIR AND EXISTS "${LIBEVENT2_INCLUDE_DIR}/event2/event.h")
file(STRINGS "${LIBEVENT2_INCLUDE_DIR}/event2/event-config.h" LIBEVENT2_H REGEX "^#define _?EVENT_+VERSION ")
string(REGEX REPLACE "^.*EVENT_+VERSION \"([^\"]+)\".*$" "\\1" LIBEVENT2_VERSION "${LIBEVENT2_H}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libevent2
REQUIRED_VARS LIBEVENT2_LIBRARIES LIBEVENT2_INCLUDE_DIR
VERSION_VAR LIBEVENT2_VERSION
)
endif ()
mark_as_advanced(LIBEVENT2_INCLUDE_DIR LIBEVENT2_LIBRARIES)

View File

@ -0,0 +1,77 @@
#[=======================================================================[.rst:
FindLibidn2
-----------
Find the Libidn2 library
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Libidn2::Libidn2``
The Libidn2 library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Libidn2_FOUND``
If false, do not try to use Libidn2.
``LIBIDN2_INCLUDE_DIR``
where to find libidn2 headers.
``LIBIDN2_LIBRARIES``
the libraries needed to use Libidn2.
``LIBIDN2_VERSION``
the version of the Libidn2 library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibIdn2 IMPORTED_TARGET GLOBAL libidn2)
endif ()
if (PkgLibIdn2_FOUND)
set(LIBIDN2_INCLUDE_DIR ${PkgLibIdn2_INCLUDE_DIRS} CACHE FILEPATH "libidn2 include path")
set(LIBIDN2_LIBRARIES ${PkgLibIdn2_LIBRARIES} CACHE STRING "libidn2 libraries")
set(LIBIDN2_VERSION ${PkgLibIdn2_VERSION})
add_library(Libidn2::Libidn2 ALIAS PkgConfig::PkgLibIdn2)
set(Libidn2_FOUND ON)
else ()
find_path(LIBIDN2_INCLUDE_DIR idn2.h
HINTS
"${LIBIDN2_DIR}"
"${LIBIDN2_DIR}/include"
)
find_library(LIBIDN2_LIBRARIES NAMES idn2 libidn2
HINTS
"${LIBIDN2_DIR}"
"${LIBIDN2_DIR}/lib"
)
if (LIBIDN2_INCLUDE_DIR AND LIBIDN2_LIBRARIES)
if (NOT TARGET Libidn2::Libidn2)
add_library(Libidn2::Libidn2 UNKNOWN IMPORTED)
set_target_properties(Libidn2::Libidn2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBIDN2_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBIDN2_LIBRARIES}"
)
endif ()
if (NOT LIBIDN2_VERSION AND LIBIDN2_INCLUDE_DIR AND EXISTS "${LIBIDN2_INCLUDE_DIR}/idn2.h")
file(STRINGS "${LIBIDN2_INCLUDE_DIR}/idn2.h" LIBIDN2_H REGEX "^[ \t]*#[ \t]*define[ \t]+IDN2_VERSION[ \t]")
string(REGEX REPLACE "^.*IDN2_VERSION[ \t]+\"([0-9.]+)\".*$" "\\1" LIBIDN2_VERSION "${LIBIDN2_H}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libidn2
REQUIRED_VARS LIBIDN2_LIBRARIES LIBIDN2_INCLUDE_DIR
VERSION_VAR LIBIDN2_VERSION
)
endif ()
mark_as_advanced(LIBIDN2_INCLUDE_DIR LIBIDN2_LIBRARIES)

View File

@ -0,0 +1,104 @@
#[=======================================================================[.rst:
FindLibunbound
--------------
Find the Libunbound library
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Libunbound::Libunbound``
The Libunbound library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Libunbound_FOUND``
If false, do not try to use Libunbound.
``LIBUNBOUND_INCLUDE_DIR``
where to find libunbound headers.
``LIBUNBOUND_LIBRARIES``
the libraries needed to use Libunbound.
``LIBUNBOUND_VERSION``
the version of the Libunbound library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibunbound IMPORTED_TARGET GLOBAL QUIET libunbound)
endif ()
if (PkgLibunbound_FOUND)
set(LIBUNBOUND_INCLUDE_DIR ${PkgLibunbound_INCLUDE_DIRS} CACHE FILEPATH "libunbound include path")
set(LIBUNBOUND_LIBRARIES ${PkgLibunbound_LIBRARIES} CACHE STRING "libunbound libraries")
set(LIBUNBOUND_VERSION ${PkgLibunbound_VERSION})
add_library(Libunbound::Libunbound ALIAS PkgConfig::PkgLibunbound)
set(Libunbound_FOUND ON)
else ()
find_path(LIBUNBOUND_INCLUDE_DIR unbound.h
HINTS
"${LIBUNBOUND_DIR}"
"${LIBUNBOUND_DIR}/include"
)
find_library(LIBUNBOUND_LIBRARY NAMES unbound
HINTS
"${LIBUNBOUND_DIR}"
"${LIBUNBOUND_DIR}/lib"
)
set(_LIBUNBOUND_LIBRARIES "")
if (UNIX)
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
list(APPEND _LIBUNBOUND_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
list(APPEND _LIBUNBOUND_LIBRARIES "${OPENSSL_LIBRARIES}")
endif()
if (LIBUNBOUND_INCLUDE_DIR AND LIBUNBOUND_LIBRARY)
if (NOT TARGET Libunbound::Libunbound)
add_library(Libunbound::Libunbound UNKNOWN IMPORTED)
set_target_properties(Libunbound::Libunbound PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBUNBOUND_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBUNBOUND_LIBRARY}"
)
if(UNIX AND TARGET Threads::Threads)
set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
INTERFACE_LINK_LIBRARIES Threads::Threads)
endif ()
if(UNIX AND TARGET OpenSSL::SSL)
set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
INTERFACE_LINK_LIBRARIES OpenSSL::SSL)
endif ()
if(UNIX AND TARGET OpenSSL::Crypto)
set_property(TARGET Libunbound::Libunbound APPEND PROPERTY
INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
endif ()
endif ()
if (NOT LIBUNBOUND_VERSION AND LIBUNBOUND_INCLUDE_DIR AND EXISTS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h")
file(STRINGS "${LIBUNBOUND_INCLUDE_DIR}/unbound.h" LIBUNBOUND_H REGEX "^#define UNBOUND_VERSION_M[A-Z]+")
string(REGEX REPLACE "^.*MAJOR ([0-9]+).*MINOR ([0-9]+).*MICRO ([0-9]+).*$" "\\1.\\2.\\3" LIBUNBOUND_VERSION "${LIBUNBOUND_H}")
endif ()
endif ()
list(APPEND _LIBUNBOUND_LIBRARIES "${LIBUNBOUND_LIBRARY}")
set(LIBUNBOUND_LIBRARIES ${_LIBUNBOUND_LIBRARIES} CACHE STRING "libunbound libraries")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libunbound
REQUIRED_VARS LIBUNBOUND_LIBRARIES LIBUNBOUND_INCLUDE_DIR
VERSION_VAR LIBUNBOUND_VERSION
)
endif ()
mark_as_advanced(LIBUNBOUND_INCLUDE_DIR LIBUNBOUND_LIBRARIES LIBUNBOUND_LIBRARY)

View File

@ -0,0 +1,82 @@
#[=======================================================================[.rst:
FindLibuv
---------
Find the Libuv library.
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Libuv::Libuv``
The Libuv library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Libuv_FOUND``
If false, do not try to use Libuv.
``LIBUV_INCLUDE_DIR``
where to find libuv headers.
``LIBUV_LIBRARIES``
the libraries needed to use Libuv.
``LIBUV_VERSION``
the version of the Libuv library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
pkg_check_modules(PkgLibuv IMPORTED_TARGET GLOBAL libuv)
endif ()
if (PkgLibuv_FOUND)
set(LIBUV_INCLUDE_DIR ${PkgLibuv_INCLUDE_DIRS} CACHE FILEPATH "libuv include path")
set(LIBUV_LIBRARIES ${PkgLibuv_LIBRARIES} CACHE STRING "libuv libraries")
set(LIBUV_VERSION ${PkgLibuv_VERSION})
add_library(Libuv::Libuv ALIAS PkgConfig::PkgLibuv)
set(Libuv_FOUND ON)
else ()
find_path(LIBUV_INCLUDE_DIR uv.h
HINTS
"${LIBUV_DIR}"
"${LIBUV_DIR}/include"
)
find_library(LIBUV_LIBRARIES NAMES uv libuv
HINTS
"${LIBUV_DIR}"
"${LIBUV_DIR}/lib"
)
if (LIBUV_INCLUDE_DIR AND LIBUV_LIBRARIES)
if (NOT TARGET Libuv::Libuv)
add_library(Libuv::Libuv UNKNOWN IMPORTED)
set_target_properties(Libuv::Libuv PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LIBUV_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LIBUV_LIBRARIES}"
)
endif ()
if (NOT LIBUV_VERSION AND LIBUV_INCLUDE_DIR)
if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h")
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv-version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ")
elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h")
file(STRINGS "${LIBUV_INCLUDE_DIR}/uv/version.h" LIBUV_VER_H REGEX "^#define UV_VERSION_(MAJOR|MINOR|PATCH) ")
endif ()
string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*_PATCH ([0-9]+).*$" "\\1.\\2.\\3" LIBUV_VERSION "${LIBUV_VER_H}")
endif ()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Libuv
REQUIRED_VARS LIBUV_LIBRARIES LIBUV_INCLUDE_DIR
VERSION_VAR LIBUV_VERSION
)
endif ()
mark_as_advanced(LIBUV_INCLUDE_DIR LIBUV_LIBRARIES)

View File

@ -0,0 +1,111 @@
#[=======================================================================[.rst:
FindNettle
----------
Find the Nettle library.
Imported targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` targets:
``Nettle::Nettle``
The Nettle library, if found.
``Nettle::Hogweed``
The Hogweed library, if found.
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``Nettle_FOUND``
If false, do not try to use Nettle.
``NETTLE_INCLUDE_DIR``
where to find Nettle headers.
``NETTLE_LIBRARIES``
the libraries needed to use Nettle.
``NETTLE_VERSION``
the version of the Nettle library found
#]=======================================================================]
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PkgNettle IMPORTED_TARGET GLOBAL nettle)
pkg_check_modules(PkgHogweed IMPORTED_TARGET GLOBAL QUIET hogweed)
endif()
if(PkgNettle_FOUND AND PkHogweed_FOUND)
set(NETTLE_INCLUDE_DIR ${PkgNettle_INCLUDE_DIRS} ${PkgHogweed_INCLUDE_DIRS} CACHE FILEPATH "Nettle include path")
set(NETTLE_LIBRARIES ${PkgNettle_LIBRARIES} ${PkgHogweed_LIBRARIES} CACHE STRING "Nettle libraries")
set(NETTLE_VERSION ${PkgNettle_VERSION})
add_library(Nettle::Nettle ALIAS PkgConfig::PkgNettle)
add_library(Nettle::Hogweed ALIAS PkgConfig::PkgHogweed)
set(Nettle_FOUND ON)
else()
find_path(NETTLE_INCLUDE_DIR nettle/version.h
HINTS
"${NETTLE_DIR}"
"${NETTLE_DIR}/include"
)
find_library(NETTLE_LIBRARY NAMES nettle libnettle
HINTS
"${NETTLE_DIR}"
"${NETTLE_DIR}/lib"
)
find_library(HOGWEED_LIBRARY NAMES hogweed libhogweed
HINTS
"${NETTLE_DIR}"
"${NETTLE_DIR}/lib"
)
set(_NETTLE_LIBRARIES ${NETTLE_LIBRARY} ${HOGWEED_LIBRARY})
# May need gmp library on Unix.
if (UNIX)
find_library(NETTLE_GMP_LIBRARY gmp)
endif ()
if (NETTLE_GMP_LIBRARY)
list(APPEND _NETTLE_LIBRARIES "${NETTLE_GMP_LIBRARY}")
endif ()
set(NETTLE_LIBRARIES ${_NETTLE_LIBRARIES} CACHE STRING "nettle libraries")
if (NETTLE_INCLUDE_DIR AND NETTLE_LIBRARY AND HOGWEED_LIBRARY)
if (NOT TARGET Nettle::Nettle)
add_library(Nettle::Nettle UNKNOWN IMPORTED)
set_target_properties(Nettle::Nettle PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${NETTLE_LIBRARIES}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${NETTLE_LIBRARY}"
)
endif ()
if (NOT TARGET Nettle::Hogweed)
add_library(Nettle::Hogweed UNKNOWN IMPORTED)
set_target_properties(Nettle::Hogweed PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${NETTLE_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${HOGWEED_LIBRARY}"
)
endif ()
if (NOT NETTLE_VERSION AND NETTLE_INCLUDE_DIR)
file(STRINGS "${NETTLE_INCLUDE_DIR}/nettle/version.h" NETTLE_VER_H REGEX "^#define NETTLE_VERSION_(MAJOR|MINOR) ")
string(REGEX REPLACE "^.*_MAJOR ([0-9]+).*_MINOR ([0-9]+).*$" "\\1.\\2" NETTLE_VERSION "${NETTLE_VER_H}")
endif ()
endif()
list(APPEND NETTLE_LIBRARIES "${NETTLE_LIBRARY}" "${HOGWEED_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Nettle
REQUIRED_VARS NETTLE_LIBRARIES NETTLE_INCLUDE_DIR
VERSION_VAR NETTLE_VERSION
)
endif()
mark_as_advanced(NETTLE_INCLUDE_DIR NETTLE_LIBRARIES NETTLE_LIBRARY HOGWEED_LIBRARY NETTLE_GMP_LIBRARY)

View File

@ -0,0 +1,27 @@
# Export only named entry points from shared library.
function(target_shared_library_exports lib libname symbols)
if (WIN32)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.def" "LIBRARY ${libname}\n EXPORTS\n")
foreach (symbol IN LISTS symbols)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.def" " ${symbol}\n")
endforeach ()
target_sources(${lib} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.def")
elseif (APPLE)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.syms" "")
foreach (symbol IN LISTS symbols)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.syms" "_${symbol}\n")
endforeach ()
target_sources(${lib} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.syms")
target_link_libraries(${lib} PRIVATE "-exported_symbols_list ${libname}.syms")
elseif (UNIX)
# Assume GNU ld.
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" "{ global:\n")
foreach (symbol IN LISTS symbols)
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" " ${symbol};\n")
endforeach ()
file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${libname}.ver" "local:\n *;\n};\n")
target_link_libraries(${lib} PRIVATE "-Wl,--version-script=${libname}.ver")
else ()
message(WARNING "Unknown platform, ${lib} exports not set.")
endif ()
endfunction ()

View File

@ -0,0 +1,25 @@
# Add version to given shared library linkage.
function(target_shared_library_version lib version_current version_revision version_age)
if (APPLE)
# Follow libtool. Add one to major version, as version 0 doesn't work.
# But tag dynlib name with current-age.
math(EXPR major_version "${version_current}+1")
math(EXPR dynlib_version "${version_current}-${version_age}")
set_target_properties(${lib} PROPERTIES VERSION "${dynlib_version}")
target_link_libraries(${lib} PRIVATE "-compatibility_version ${major_version}")
target_link_libraries(${lib} PRIVATE "-current_version ${major_version}.${version_revision}")
elseif (UNIX OR MINGW OR MSYS OR CYGWIN)
# Assume GNU ld, and again follow libtool. Major version is current-age.
math(EXPR compat_version "${version_current}-${version_age}")
set_target_properties(${lib} PROPERTIES VERSION "${compat_version}.${version_age}.${version_revision}" SOVERSION "${compat_version}")
elseif (WIN32)
set(rc_template "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include/${lib}_version.rc.in")
if (EXISTS ${rc_template})
configure_file(${rc_template} ${lib}.rc @ONLY)
target_sources(${lib} PRIVATE ${lib}.rc)
endif ()
target_link_libraries(${lib} PRIVATE "-VERSION:${version_current}.${version_revision}")
else ()
message(WARNING "Unknown platform, ${lib} will not be versioned.")
endif ()
endfunction ()

View File

@ -0,0 +1,4 @@
int main (int ac, char *av[])
{
char *s = __func__;
}

11
cmake/tests/test_poll.c Normal file
View File

@ -0,0 +1,11 @@
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#else
#include <poll.h>
#endif
int main (int ac, char *av[])
{
int rc;
rc = poll((struct pollfd *)(0), 0, 0);
}

12
cmake/tests/test_uv_cb.c Normal file
View File

@ -0,0 +1,12 @@
#include <uv.h>
void test_cb(uv_timer_t *handle)
{
(void) handle;
}
int main(int ac, char *av[])
{
uv_timer_cb cb = test_cb;
(*cb)(0);
}

1530
config.guess vendored

File diff suppressed because it is too large Load Diff

1782
config.sub vendored

File diff suppressed because it is too large Load Diff

15990
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,791 +0,0 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# known to work with autconf version: autoconf (GNU Autoconf) 2.69
#
# @configure_input@
#
# Copyright (c) 2013, Verisign, Inc., NLnet Labs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the names of the copyright holders nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AC_PREREQ([2.56])
AC_INIT([getdns], [0.1.7], [stub-resolver@verisignlabs.com], [], [http://getdnsapi.net])
AC_SUBST(RELEASE_CANDIDATE, [])
# Set current date from system if not set
AC_ARG_WITH([current-date],
[AS_HELP_STRING([--with-current-date]
[current date of the compilation, set to fixed date for reproducible builds @<:@default=system@:>@])],
[CURRENT_DATE="$with_current_date"],
[CURRENT_DATE="`date -u +%Y-%m-%dT%H:%M:%SZ`"])
GETDNS_COMPILATION_COMMENT="AC_PACKAGE_STRING configured on $CURRENT_DATE for the January 2015 version of the API"
# Library version
# ---------------
# current:revision:age
# (binary-api-number):(which-binary-api-version):(how-many-nrs-backwardscompat)
# if source code changes increment revision
# if any interfaces have been added/removed/changed since last update then
# increment current and set revision to 0
# if any interfaces have been added since the last public release then increment age
# if any interfaces have been removed or changed since the last public release then
# set age to 0
# if api unchanged: no changes
# if api broken: current++ ; revision = 0; age = 0
# if programs compiled against existing library work and link with new
# version of library with new binary api: revision++; age++
#
# getdns-0.1.4 had libversion 0:0:0
# getdns-0.1.5 had libversion 1:0:0
# getdns-0.1.6 had libversion 1:1:0
# getdns-0.1.7 will have libversion 1:2:1
#
GETDNS_LIBVERSION=1:2:1
AC_SUBST(GETDNS_COMPILATION_COMMENT)
AC_SUBST(GETDNS_LIBVERSION)
AC_CONFIG_SRCDIR([src/getdns/getdns.h.in])
# AM_INIT_AUTOMAKE
# LT_INIT
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
AC_PROG_CPP
# Checks for programs.
AC_CANONICAL_HOST
CFLAGS="$CFLAGS"
AC_PROG_CC_C99
AX_CHECK_COMPILE_FLAG([-xc99],[CFLAGS="$CFLAGS -xc99"],[],[])
AX_CHECK_COMPILE_FLAG([-Wall],[CFLAGS="$CFLAGS -Wall"],[],[])
case "$host_os" in
linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE"
;;
solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__" # for strdup() from <string.h>
;;
darwin* ) CFLAGS="$CFLAGS -D_DARWIN_C_SOURCE" # for strlcpy() from <string.h>
;;
esac
# always use ./libtool unless override from commandline (libtool=mylibtool)
if test -z "$libtool"; then
libtool="`pwd`/libtool"
fi
AC_SUBST(libtool)
AC_PROG_LIBTOOL
AC_PROG_INSTALL
initial_LIBS="$LIBS"
initial_LDFLAGS="$LDFLAGS"
dnl Add option to disable the evil rpath. Check whether to use rpath or not.
dnl Adds the --disable-rpath option. Uses trick to edit the ./libtool.
AC_DEFUN([ACX_ARG_RPATH],
[
AC_ARG_ENABLE(rpath,
[ --disable-rpath disable hardcoded rpath (default=enabled)],
enable_rpath="$enableval", enable_rpath=yes)
if test "x$enable_rpath" = xno; then
dnl AC_MSG_RESULT([Fixing libtool for -rpath problems.])
AC_CONFIG_COMMANDS([disable-rpath], [
sed < libtool > libtool-2 \
's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/'
mv libtool-2 libtool
chmod 755 libtool
libtool="./libtool"
])
fi
])
ACX_ARG_RPATH
AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--enable-tcp-fastopen], [Enable TCP Fast Open]))
case "$enable_tcp_fastopen" in
yes)
AC_CHECK_DECL([MSG_FASTOPEN], [], [AC_MSG_ERROR([TCP Fast Open is not available: please rerun without --enable-tcp-fastopen])], [AC_INCLUDES_DEFAULT
#include <sys/socket.h>
])
AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])
;;
no|*)
;;
esac
AC_ARG_ENABLE(broken-native-stub-dnssec, AC_HELP_STRING([--enable-broken-native-stub-dnssec], [Enable very experimental and broken native stub DNSSEC support]))
case "$enable_broken_native_stub_dnssec" in
yes)
AC_DEFINE_UNQUOTED([STUB_NATIVE_DNSSEC], [1], [Define this to enable the very experimental and broken native stub DNSSEC support.])
;;
no|*)
;;
esac
ACX_WITH_SSL_OPTIONAL
AC_ARG_ENABLE(draft-edns-cookies, AC_HELP_STRING([--enable-draft-edns-cookies], [Enable experimental edns cookies]))
case "$enable_draft_edns_cookies" in
yes)
if test "x_$HAVE_SSL" != "x_yes"; then
AC_MSG_ERROR([edns cookies need openssl libcrypto which is not available, please rerun without --enable-draft-edns-cookies])
fi
AC_DEFINE_UNQUOTED([EDNS_COOKIES], [1], [Define this to enable the experimental draft edns cookies.])
;;
no|*)
;;
esac
AC_DEFINE_UNQUOTED([EDNS_COOKIE_OPCODE], [65001], [The edns cookie option code.])
AC_DEFINE_UNQUOTED([EDNS_COOKIE_ROLLOVER_TIME], [(24 * 60 * 60)], [How often the edns client cookie is refreshed.])
# search to set include and library paths right
# find libidn
AC_ARG_WITH(libidn, AS_HELP_STRING([--with-libidn=pathname],
[path to libidn (default: search /usr/local ..)]),
[], [withval="yes"])
if test x_$withval = x_yes; then
for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
if test -f "$dir/include/idna.h"; then
CFLAGS="$CFLAGS -I$dir/include"
LDFLAGS="$LDFLAGS -L$dir/lib"
AC_MSG_NOTICE([Found libidn in $dir])
break
fi
if test -f "$dir/include/idn/idna.h"; then
CFLAGS="$CFLAGS -I$dir/include/idn"
LDFLAGS="$LDFLAGS -L$dir/lib"
AC_MSG_NOTICE([Found libidn in $dir])
break
fi
done
if test -f "/usr/include/idn/idna.h"; then
CFLAGS="$CFLAGS -I/usr/include/idn"
#LDFLAGS="$LDFLAGS -L/usr/lib"
AC_MSG_NOTICE([Found libidn in /usr])
fi
else
if test x_$withval != x_no; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
fi
# find libldns
AC_ARG_WITH(libldns, AS_HELP_STRING([--with-libldns=pathname],
[path to libldns (default: search /usr/local ..)]),
[], [withval="yes"])
if test x_$withval = x_yes; then
for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
if test -f "$dir/include/ldns/ldns.h"; then
CFLAGS="$CFLAGS -I$dir/include"
LDFLAGS="$LDFLAGS -L$dir/lib"
AC_MSG_NOTICE([Found libldns in $dir])
break
fi
done
else
if test x_$withval != x_no; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
fi
# find libunbound
AC_ARG_WITH(libunbound, AS_HELP_STRING([--with-libunbound=pathname],
[path to libunbound (default: search /usr/local ..)]),
[], [withval="yes"])
if test x_$withval = x_yes; then
for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do
if test -f "$dir/include/unbound.h"; then
CFLAGS="$CFLAGS -I$dir/include"
LDFLAGS="$LDFLAGS -L$dir/lib"
AC_MSG_NOTICE([Found libunbound in $dir])
break
fi
done
else
if test x_$withval != x_no; then
CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi
fi
# Checks for libraries.
found_all_libs=1
AC_MSG_NOTICE([Checking for dependency ldns])
AC_CHECK_LIB([ldns], [ldns_dname_new_frm_str], [], [found_all_libs=0])
AC_MSG_NOTICE([Checking for dependency libidn])
AC_CHECK_LIB([idn], [idna_to_ascii_8z], [], [found_all_libs=0])
AC_CHECK_MEMBER([struct ldns_struct_dnssec_zone.hashed_names],
[AC_DEFINE_UNQUOTED([LDNS_DNSSEC_ZONE_HASHED_NAMES], [1], [When defined ldns_dnssec_zone contained the hashed_names member.])], [], [[#include <ldns/ldns.h>]])
if test $found_all_libs == 0
then
AC_MSG_ERROR([One more dependencies is missing])
fi
# break out libunbound from other libraries since we are currently using a
# patch to the sources
found_libunbound=1
AC_MSG_NOTICE([Checking for dependency libunbound])
AC_CHECK_LIB([unbound], [ub_fd], [], [found_libunbound=0])
if test $found_libunbound == 0
then
AC_MSG_ERROR([libunbound is missing.])
fi
AC_PATH_PROG([DOXYGEN], [doxygen])
if test -z "$DOXYGEN";
then AC_MSG_WARN([doxygen not found, continuing without])
fi
# Checks for header files.
AC_CHECK_HEADERS([inttypes.h netinet/in.h stdint.h stdlib.h string.h],,, [AC_INCLUDES_DEFAULT])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPE([u_char])
AC_CHECK_FUNCS([fcntl])
# check ioctlsocket
AC_MSG_CHECKING(for ioctlsocket)
AC_LINK_IFELSE([AC_LANG_PROGRAM([
#ifdef HAVE_WINSOCK2_H
#include <winsock2.h>
#endif
], [
(void)ioctlsocket(0, 0, NULL);
])], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_IOCTLSOCKET, 1, [if the function 'ioctlsocket' is available])
],[AC_MSG_RESULT(no)])
# Check for libraries for other things than libgetdns after this point,
# so the getdns libraries can be reset with:
#
# LIBS="$getdns_LIBS"
# LDFLAGS="$getdns_LDFLAGS"
#
# afterwards.
getdns_LIBS="$LIBS"
getdns_LDFLAGS="$LDFLAGS"
#-------------------- libraries needed for libcheck
LIBS="$initial_LIBS"
CHECK_GETDNS=""
CHECK_LIBS=""
CHECK_CFLAGS=""
PKG_CHECK_MODULES([CHECK],[check >= 0.9.6],[CHECK_GETDNS="check_getdns"],[
AC_SEARCH_LIBS([floor], [m])
AC_SEARCH_LIBS([timer_create], [rt])
AC_SEARCH_LIBS([pthread_create], [pthread])
AC_SEARCH_LIBS([srunner_create],[check check_pic],[
CHECK_GETDNS="check_getdns"
CHECK_LIBS="$LIBS"],[
AC_SUBST(NOLIBCHECK, [nolibcheck])
AC_MSG_WARN([libcheck not found or usable; unit tests will not be compiled and run])])])
LIBS="$getdns_LIBS"
AC_SUBST([CHECK_GETDNS])
AC_SUBST([CHECK_LIBS])
AC_SUBST([CHECK_CFLAGS])
# end libraries needed for libcheck
#-------------------- libevent extension
AC_ARG_WITH([libevent],
[AS_HELP_STRING([--with-libevent], [path to libevent (default: search /usr/local ..)])],
[with_libevent=search],
[withval=no])
# libevent 1.x requires a u_char typedef which is not always available
# on some systems so our check is a little complicated
# we further need to ensure that this is included in the getdns headers
# that get installed later so some users may not be building in an
# environment that has the generated config.h SO we need to generate
# this one extra header in that case
have_libevent=0
EXTENSION_LIBEVENT_EXT_LIBS=""
EXTENSION_LIBEVENT_LIB=""
EXTENSION_LIBEVENT_LDFLAGS=""
CHECK_EVENT_PROG=""
AS_IF([test x_$withval = x_no],
[],
[AS_IF([test x_$withval = x_yes],
[AC_SEARCH_LIBS([event_loop],
[event_core event],
[AC_CHECK_FUNCS([event_base_new event_base_free])]
[AC_CHECK_HEADERS([event2/event.h],
[have_libevent=1]
[AS_IF([test "x_$ac_cv_search_event_loop" = "x_none required"],[],[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"])],
[AC_CHECK_HEADERS([event.h],
[have_libevent=1]
[AS_IF([test "x_$ac_cv_search_event_loop" = "x_none required"],[],[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"])],
[AC_MSG_ERROR([event2/event.h and event.h missing, try without libevent])]
[have_libevent=0],
[AC_INCLUDES_DEFAULT]
[#if HAVE_U_CHAR == 0
typedef unsigned char u_char;
#endif])],
[AC_INCLUDES_DEFAULT])],
[AC_MSG_ERROR([libevent missing, try without libevent])]
)],
[have_libevent=1]
[AC_MSG_NOTICE([assuming libevent in $withval])]
[CFLAGS="$CFLAGS -I$withval/include"]
[EXTENSION_LIBEVENT_LDFLAGS="-L$withval/lib"]
[EXTENSION_LIBEVENT_EXT_LIBS="-levent"])]
)
AS_IF([test x_$have_libevent = x_1],
[EXTENSION_LIBEVENT_LIB="libgetdns_ext_event.la"]
[CHECK_EVENT_PROG=check_getdns_event]
# libunbound version 1.4.22 and older, not linked against libevent, on FreeBSD,
# =============================================================================
# cannot be linked against a program that also links libevent, because of
# symbol clash. Libunbound has a libevent clone (called mini_event) build when
# not linked against libevent that uses the same symbols as libevent.
# First detect if the libevent symbols are visible when linking with libunbound
[LIBS="$getdns_LIBS"]
[LDFLAGS="$getdns_LDFLAGS"]
[AC_MSG_CHECKING([if event_get_version symbol is leaking from libunbound])]
[AC_LANG_PUSH(C)]
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[const char *event_get_version(void);]],
[[const char *v = event_get_version();]])
],[[AC_MSG_RESULT([yes])]
[AC_MSG_CHECKING([if libunbound is linked against libevent])]
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[const char *event_get_version(void);]],
[[const char *v = event_get_version();]
[return v@<:@0@:>@ == 'm' && v@<:@1@:>@ == 'i' &&
v@<:@2@:>@ == 'n' && v@<:@3@:>@ == 'i' ? 1 : 0;]])
],[[AC_MSG_RESULT([yes])]
],[[AC_MSG_RESULT([no])]
[AC_MSG_FAILURE([
***
*** On this system, when using libevent, libunbound must
*** also have been compiled with libevent. Please recompile
*** libunbound with libevent, or configure --without-libevent.
***])]
]
)
],[[AC_MSG_RESULT([no])]
]
)
[AC_LANG_POP(C)])
AC_SUBST(have_libevent)
AC_SUBST(EXTENSION_LIBEVENT_LIB)
AC_SUBST(EXTENSION_LIBEVENT_EXT_LIBS)
AC_SUBST(EXTENSION_LIBEVENT_LDFLAGS)
AS_IF([test "x$have_libcheck" = x1], [AC_SUBST(CHECK_EVENT_PROG)])
LIBS="$getdns_LIBS"
LDFLAGS="$getdns_LDFLAGS"
# end libevent extension
#-------------------- libuv extension
# if user says nothing about libuv, or specifies --with-libuv=no or --without-libuv
# then we do not want libuv extensions built
# if user specifies --with-libuv then search for it
# if user specifies --with-libuv=/path then check the lib at that path
AC_ARG_WITH([libuv],
[AS_HELP_STRING([--with-libuv], [path to libuv (default: search /usr/local ..)])],
[with_libuv=search],
[withval=no])
have_libuv=0
EXTENSION_LIBUV_EXT_LIBS=""
EXTENSION_LIBUV_LIB=""
EXTENSION_LIBUV_LDFLAGS=""
CHECK_UV_PROG=""
AS_IF([test x_$withval = x_no],
[],
[AS_IF([test x_$withval = x_yes],
[AC_SEARCH_LIBS([uv_run],
[uv],
[AC_CHECK_HEADERS([uv.h],
[have_libuv=1]
[EXTENSION_LIBUV_EXT_LIBS="$ac_cv_search_uv_run"],
[AC_MSG_ERROR([uv.h missing, try without libuv])]
[have_libuv=0],
[AC_INCLUDES_DEFAULT])],
[AC_MSG_ERROR([libuv missing, try without libuv])]
)],
[have_libuv=1]
[AC_MSG_NOTICE([assuming libuv in $withval])]
[CFLAGS="$CFLAGS -I$withval/include"]
[EXTENSION_LIBUV_LDFLAGS="-L$withval/lib"]
[EXTENSION_LIBUV_EXT_LIBS="-luv"])]
)
AS_IF([test x_$have_libuv = x_1],
[EXTENSION_LIBUV_LIB="libgetdns_ext_uv.la"]
[CHECK_UV_PROG=check_getdns_uv]
[AC_MSG_CHECKING([for new signature of uv_timer_cb])
AC_LANG_PUSH(C)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[#include <uv.h>]
[void test_cb(uv_timer_t *handle);]],
[[uv_timer_cb cb = test_cb;]
[(*cb)(0);]])
],[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_NEW_UV_TIMER_CB, [1], [Does libuv have the new uv_time_cb signature])
],[AC_MSG_RESULT([no])
])
AC_LANG_POP(C)]
)
AC_SUBST(have_libuv)
AC_SUBST(EXTENSION_LIBUV_LIB)
AC_SUBST(EXTENSION_LIBUV_EXT_LIBS)
AC_SUBST(EXTENSION_LIBUV_LDFLAGS)
AS_IF([test "x$have_libcheck" = x1], [AC_SUBST(CHECK_UV_PROG)])
LIBS="$getdns_LIBS"
LDFLAGS="$getdns_LDFLAGS"
# end libuv extension
#-------------------- libev extension
AC_ARG_WITH([libev],
[AS_HELP_STRING([--with-libev], [path to libev (default: search /usr/local ..)])],
[with_libev=search],
[withval=no])
have_libev=0
EXTENSION_LIBEV_EXT_LIBS=""
EXTENSION_LIBEV_LIB=""
EXTENSION_LIBEV_LDFLAGS=""
CHECK_EV_PROG=""
AS_IF([test x_$withval = x_no],
[],
[AS_IF([test x_$withval = x_yes],
[AC_SEARCH_LIBS([ev_run],
[ev],
[AC_CHECK_HEADERS([ev.h],
[have_libev=1]
[EXTENSION_LIBEV_EXT_LIBS="$ac_cv_search_ev_run"],
[AC_CHECK_HEADERS([libev/ev.h],
[have_libev=1]
[EXTENSION_LIBEV_EXT_LIBS="$ac_cv_search_ev_run"],
[AC_MSG_ERROR([ev.h missing, try without libev])]
[have_libev=0],
[AC_INCLUDES_DEFAULT])
],
[AC_INCLUDES_DEFAULT])
],
[AC_MSG_ERROR([libev missing, try without libev])]
)],
[have_libev=1]
[AC_MSG_NOTICE([assuming libev in $withval])]
[CFLAGS="$CFLAGS -I$withval/include"]
[EXTENSION_LIBEV_LDFLAGS="-L$withval/lib"]
[EXTENSION_LIBEV_EXT_LIBS="-lev"])]
)
AS_IF([test x_$have_libev = x_1],
[EXTENSION_LIBEV_LIB="libgetdns_ext_ev.la"]
[CHECK_EV_PROG=check_getdns_ev])
AC_SUBST(have_libev)
AC_SUBST(EXTENSION_LIBEV_LIB)
AC_SUBST(EXTENSION_LIBEV_EXT_LIBS)
AC_SUBST(EXTENSION_LIBEV_LDFLAGS)
AS_IF([test "x$have_libcheck" = x1], [AC_SUBST(CHECK_EV_PROG)])
LIBS="$getdns_LIBS"
LDFLAGS="$getdns_LDFLAGS"
# end libev extension
# --with-trust-anchor=
AC_DEFINE([SYSCONFDIR], [sysconfdir], [System configuration dir])
AC_ARG_WITH(trust-anchor, AS_HELP_STRING([--with-trust-anchor=KEYFILE], [Default location of the trust anchor file. [default=SYSCONFDIR/unbound/getdns-root.key]]), [
TRUST_ANCHOR_FILE="$withval"
],[
if test "x$TRUST_ANCHOR_FILE" = "x"; then
if test "x$sysconfdir" = 'x${prefix}/etc' ; then
if test "x$prefix" = 'xNONE' ; then
TRUST_ANCHOR_FILE="/etc/unbound/getdns-root.key"
else
TRUST_ANCHOR_FILE="${prefix}/etc/unbound/getdns-root.key"
fi
else
TRUST_ANCHOR_FILE="${sysconfdir}/unbound/getdns-root.key"
fi
fi
])
AC_DEFINE_UNQUOTED([TRUST_ANCHOR_FILE], ["$TRUST_ANCHOR_FILE"], [Default trust anchor file])
AC_SUBST(TRUST_ANCHOR_FILE)
AC_MSG_NOTICE([Default trust anchor: $TRUST_ANCHOR_FILE])
AC_CONFIG_FILES([Makefile src/Makefile src/getdns/getdns.h spec/example/Makefile src/test/Makefile doc/Makefile])
if [ test -n "$DOXYGEN" ]
then AC_CONFIG_FILES([src/Doxyfile])
fi
dnl -----
dnl ----- Start of "Things needed for gldns" section
dnl -----
dnl ---------------------------------------------------------------------------
AC_CHECK_HEADERS([stdarg.h stdint.h netinet/in.h arpa/inet.h netdb.h sys/socket.h time.h sys/time.h bsd/string.h],,, [AC_INCLUDES_DEFAULT])
dnl Check the printf-format attribute (if any)
dnl result in HAVE_ATTR_FORMAT.
dnl
AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "format" attribute)
AC_CACHE_VAL(ac_cv_c_format_attribute,
[ac_cv_c_format_attribute=no
AC_TRY_COMPILE(
[#include <stdio.h>
void f (char *format, ...) __attribute__ ((format (printf, 1, 2)));
void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2)));
], [
f ("%s", "str");
],
[ac_cv_c_format_attribute="yes"],
[ac_cv_c_format_attribute="no"])
])
AC_MSG_RESULT($ac_cv_c_format_attribute)
if test $ac_cv_c_format_attribute = yes; then
AC_DEFINE(HAVE_ATTR_FORMAT, 1, [Whether the C compiler accepts the "format" attribute])
fi
AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "unused" attribute)
AC_CACHE_VAL(ac_cv_c_unused_attribute,
[ac_cv_c_unused_attribute=no
AC_TRY_COMPILE(
[#include <stdio.h>
void f (char *u __attribute__((unused)));
], [
f ("x");
],
[ac_cv_c_unused_attribute="yes"],
[ac_cv_c_unused_attribute="no"])
])
AC_MSG_RESULT($ac_cv_c_unused_attribute)
if test $ac_cv_c_unused_attribute = yes; then
AC_DEFINE(HAVE_ATTR_UNUSED, 1, [Whether the C compiler accepts the "unused" attribute])
fi
AC_CHECK_DECLS([strlcpy,arc4random,arc4random_uniform])
AC_REPLACE_FUNCS(strlcpy)
AC_REPLACE_FUNCS(arc4random)
AC_REPLACE_FUNCS(arc4random_uniform)
if test "$ac_cv_func_arc4random" = "no"; then
AC_LIBOBJ(explicit_bzero)
AC_LIBOBJ(arc4_lock)
AC_CHECK_FUNCS([getentropy],,[
if test "$USE_WINSOCK" = 1; then
AC_LIBOBJ(getentropy_win)
else
case `uname` in
Darwin)
AC_LIBOBJ(getentropy_osx)
;;
SunOS)
AC_LIBOBJ(getentropy_solaris)
AC_CHECK_HEADERS([sys/sha2.h],, [
AC_CHECK_FUNCS([SHA512_Update],,[
AC_LIBOBJ(sha512)
])
], [AC_INCLUDES_DEFAULT])
if test "$ac_cv_header_sys_sha2_h" = "yes"; then
# this lib needed for sha2 on solaris
LIBS="$LIBS -lmd"
fi
AC_SEARCH_LIBS([clock_gettime], [rt])
;;
Linux|*)
AC_LIBOBJ(getentropy_linux)
dnl AC_CHECK_FUNCS([SHA512_Update],,[
dnl AC_DEFINE([COMPAT_SHA512], [1], [Do sha512 definitions in config.h])
dnl AC_LIBOBJ(sha512)
dnl])
AC_CHECK_HEADERS([sys/sysctl.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_FUNCS([getauxval])
AC_SEARCH_LIBS([clock_gettime], [rt])
;;
esac
fi
])
fi
AC_DEFINE(USE_MINI_EVENT, 1, [Needed for sync stub resolver functions])
AC_TYPE_SIGNAL
case `uname` in
FreeBSD)
C99COMPATFLAGS=""
;;
*)
C99COMPATFLAGS="-D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600"
;;
esac
AC_SUBST(C99COMPATFLAGS)
AH_BOTTOM([
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t siz);
#else
#define __BSD_VISIBLE 1
#endif
#if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
uint32_t arc4random(void);
#endif
#if !defined(HAVE_ARC4RANDOM_UNIFORM) || !HAVE_DECL_ARC4RANDOM_UNIFORM
uint32_t arc4random_uniform(uint32_t upper_bound);
#endif
#ifndef HAVE_ARC4RANDOM
void explicit_bzero(void* buf, size_t len);
int getentropy(void* buf, size_t len);
void arc4random_buf(void* buf, size_t n);
void _ARC4_LOCK(void);
void _ARC4_UNLOCK(void);
#endif
#ifdef COMPAT_SHA512
#ifndef SHA512_DIGEST_LENGTH
#define SHA512_BLOCK_LENGTH 128
#define SHA512_DIGEST_LENGTH 64
#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
typedef struct _SHA512_CTX {
uint64_t state[8];
uint64_t bitcount[2];
uint8_t buffer[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
#endif /* SHA512_DIGEST_LENGTH */
void SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, void*, size_t);
void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
#endif /* COMPAT_SHA512 */
#ifdef __cplusplus
}
#endif
/** Use on-board gldns */
#define USE_GLDNS 1
#ifdef HAVE_SSL
# define GLDNS_BUILD_CONFIG_HAVE_SSL 1
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_ATTR_FORMAT
# define ATTR_FORMAT(archetype, string_index, first_to_check) \
__attribute__ ((format (archetype, string_index, first_to_check)))
#else /* !HAVE_ATTR_FORMAT */
# define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
#endif /* !HAVE_ATTR_FORMAT */
#if defined(DOXYGEN)
# define ATTR_UNUSED(x) x
#elif defined(__cplusplus)
# define ATTR_UNUSED(x)
#elif defined(HAVE_ATTR_UNUSED)
# define ATTR_UNUSED(x) x __attribute__((unused))
#else /* !HAVE_ATTR_UNUSED */
# define ATTR_UNUSED(x) x
#endif /* !HAVE_ATTR_UNUSED */
/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
#ifdef HAVE_WINSOCK2_H
#define FD_SET_T (u_int)
#else
#define FD_SET_T
#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#endif
])
dnl ---------------------------------------------------------------------------
dnl -----
dnl ----- End of "Things needed for gldns" section
dnl -----
AC_CONFIG_HEADER([src/config.h])
AC_OUTPUT

View File

@ -1,90 +0,0 @@
#
# @configure_input@
#
#
# Copyright (c) 2013, Verisign, Inc., NLnet Labs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the names of the copyright holders nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package = @PACKAGE_NAME@
version = @PACKAGE_VERSION@
tarname = @PACKAGE_TARNAME@
distdir = $(tarname)-$(version)
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
# datarootdir is here to please some checkers
datarootdir=@datarootdir@
mandir = @mandir@
INSTALL = @INSTALL@
srcdir = @srcdir@
VPATH = @srcdir@
EDITS=-e 's/@''version@/$(version)/g'
DOXYGEN = @DOXYGEN@
DOCDIRS = html latex man
MANPAGES3 = libgetdns.3 getdns_address.3 getdns_cancel_callback.3 getdns_context.3 getdns_context_set.3 getdns_context_set_context_update_callback.3 getdns_convert.3 getdns_dict.3 getdns_dict_get.3 getdns_dict_set.3 getdns_display_ip_address.3 getdns_general.3 getdns_hostname.3 getdns_list.3 getdns_list_get.3 getdns_list_set.3 getdns_pretty_print_dict.3 getdns_root_trust_anchor.3 getdns_service.3 getdns_validate_dnssec.3
default: all
all: doc
doc: $(MANPAGES3)
if test x_$(DOXYGEN) != x_ ; then cd ../src; doxygen; fi
.SUFFIXES: .3.in .3
.3.in.3:
sed $(EDITS) -e "s/@date@/`date +'%B %Y'`/g" $< > $@
# we assume that we want a separate file for each "name" specified for each man page
# and consider these "alternate names" simple copies of the main man page
install: $(MANPAGES3)
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)
$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man3
for x in $(MANPAGES3); do echo $(INSTALL) -m 644 $$x $(DESTDIR)$(mandir)/man3; $(INSTALL) -m 644 $$x $(DESTDIR)$(mandir)/man3; for altpg in $$($(srcdir)/manpgaltnames $$x); do cp $$x $$altpg; echo $(INSTALL) -m 644 $$altpg $(DESTDIR)$(mandir)/man3; $(INSTALL) -m 644 $$altpg $(DESTDIR)$(mandir)/man3; done; done
check: $(MANPAGES3)
for x in $(MANPAGES3); do LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings -E UTF-8 -l -Tutf8 -Z $$x 2>&1 >/dev/null | awk "-vpage=$$x" '{printf("%s: ", page);print}'; if ! lexgrog $$x >/dev/null 2>&1 ; then echo $$x: manpage-has-bad-whatis-entry; fi; done
uninstall:
for x in $(MANPAGES3); do echo rm -f $(DESTDIR)$(mandir)/man3/$$x; rm -f $(DESTDIR)$(mandir)/man3/$$x; for altpg in $$($(srcdir)/manpgaltnames $$x); do echo rm -f $(DESTDIR)$(mandir)/man3/$$altpg; rm -f $(DESTDIR)$(mandir)/man3/$$altpg; done; done
clean:
for x in $(MANPAGES3); do rm -f $$($(srcdir)/manpgaltnames $$x); done
rm -rf $(DOCDIRS) $(MANPAGES3)
distclean : clean
rm -f Makefile config.status config.log
rm -Rf autom4te.cache
Makefile: Makefile.in ../config.status
cd .. && ./config.status $@
configure.status: configure
cd .. && ./config.status --recheck
.PHONY: clean $(DOC)

View File

@ -33,7 +33,7 @@
-- get ip address(es) for a name
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -32,7 +32,7 @@
-- cancel an outstanding asyn getdns request
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -39,7 +39,7 @@
.ad n
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>
@ -134,6 +134,16 @@ will be called with a callback_type of GETDNS_CALLBACK_CANCEL.
getdns_context_destroy() returns after all of the needed cleanup is done and
callbacks are made.
.LP
If you are using getdns in a multi-threaded manner, you are then of course using
the underlying OpenSSL library multi-threaded and the version of that library
in use might have a requirements on this issue. You may need to provide one or
two functions to allow it to function properly. For example before you call
getdns_context_create() you may need to use
the openssl functions CRYPTO_set_id_callback and CRYPTO_set_locking_callback to set up
asynchronous operation (the application calls these functions once for initialisation).
Openssl 1.0.0 or later uses the CRYPTO_THREADID_set_callback function.
.HP 3
.I context
Used to return the pointer to an opaque structure. The caller passes the address of a pointer (decl: getdns_context *context; passed as &context) which will be populated as a result of returning from the function. The result is a newly allocated and initialized context (if there are no errors). In the getdns_destroy_context function this is the context whose associated memory will be released.

View File

@ -45,7 +45,7 @@
.ad n
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -32,7 +32,7 @@
-- get informed on getdns context updates
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -34,7 +34,7 @@
-- convert dname between presentation- and wire-format
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -38,7 +38,7 @@
.ad n
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -38,7 +38,7 @@
-- get value by name from a getdns dict
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -36,7 +36,7 @@
-- set a value by name in a getdns dict
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -32,7 +32,7 @@
-- convert an getdns ip address to string
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -33,7 +33,7 @@
-- do a getdns DNS lookup
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>
@ -76,7 +76,7 @@ getdns_dict **response)
The getdns_general(3) and getdns_general_sync functions provide public entry
points into the getdns API library to retrieve any valid responses to a query
from the DNS (note that other namespaces in the context are not used). Most
typical use cases for applications are probably satisifed via calls to
typical use cases for applications are probably satisfied via calls to
getdns_address(3) which would replace getaddrinfo(3).
.HP 3

View File

@ -33,7 +33,7 @@
-- get hostname by address
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -38,7 +38,7 @@
.ad n
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -38,7 +38,7 @@
-- get a value by index from a getdns list
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -36,7 +36,7 @@
-- set a value by index from a getdns list
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>
@ -46,7 +46,7 @@ getdns_return_t
.B getdns_list_set_bindata
(getdns_list *this_list,
.RS 3
char *name,
size_t index,
.br
getdns_bindata *child_bindata)
.RE
@ -56,7 +56,7 @@ getdns_return_t
.B getdns_list_set_dict
(getdns_list *this_list,
.RS 3
char *name,
size_t index,
.br
getdns_dict *child_dict)
.RE
@ -66,7 +66,7 @@ getdns_return_t
.B getdns_list_set_int
(getdns_list *this_list,
.RS 3
char *name,
size_t index,
.br
uint32_t child_uint32_t)
.RE
@ -76,7 +76,7 @@ getdns_return_t
.B getdns_list_set_list
(getdns_list *this_list,
.RS 3
char *name,
size_t index,
.br
getdns_list *child_list)
.RE

View File

@ -32,12 +32,12 @@
-- return a string representation of a getdns dict
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>
getdns_list *
char *
.br
.B getdns_pretty_print_dict
(const getdns_dict *this_dict)

View File

@ -32,7 +32,7 @@
-- return the getdns list of default root trust anchors
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -33,7 +33,7 @@
-- getdns lookup of a service
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -32,7 +32,7 @@
-- DNSSEC validate a given getdns record
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
#include <getdns.h>

View File

@ -32,7 +32,7 @@ libgetdns
-- an implementation of a modern asynchronous DNS API by and for application developers
.SH LIBRARY
DNS Resolver library (libgetdns, -lgetdns)
DNS Resolver library (libgetdns, \-lgetdns)
.SH SYNOPSIS
.B libgetdns
@ -223,37 +223,37 @@ that the API can free the memory from its internal pool.
Applications may populate an extension dictionary when making a call to the public entry points. To use an extension add it to the extension dictionary prior to making the call to the public entry point and set the value depending on the behavior you expect. These extensions include:
.HP 3
dnssec_return_status (int)
"dnssec_return_status" (int)
Set to GETDNS_EXTENSION_TRUE to include the DNSSEC status for each DNS record in the replies_tree
.HP 3
dnssec_return_only_secure (int)
"dnssec_return_only_secure" (int)
Set to GETDNS_EXTENSION_TRUE to cause only records that the API can validate as secure withe DNSSEC to be returned in the
Set to GETDNS_EXTENSION_TRUE to cause only records that the API can validate as secure with DNSSEC to be returned in the
.I replies_tree
and
.I replies_full lists
.HP 3
dnssec_return_validation_chain (int)
"dnssec_return_validation_chain" (int)
Set to GETDNS_EXTENSION_TRUE to cause the set of additional DNSSEC-related records needed for validation to be returned in the response object as the list named
.I additional_dnssec
at the top level of the response object
.HP 3
return_both_v4_and_v6 (int)
"return_both_v4_and_v6" (int)
Set to GETDNS_EXTENSION_TRUE to cause the results of both A and AAAA records for the queried name to be included in the response object.
.HP 3
add_opt_parameters (dict)
"add_opt_parameters" (dict)
TBD (complicated)
.HP 3
add_warning_for_bad_dns
"add_warning_for_bad_dns"
Set to GETDNS_EXTENSION_TRUE to cause each reply in the
.I replies_tree
@ -270,15 +270,15 @@ GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE: query type for other than CNAME re
.RE
.HP 3
specify_class (int)
"specify_class" (int)
Set to the DNS class number (other than Internet (IN) class desired in query.
.HP 3
return_call_debugging (int)
"return_call_reporting" (int)
Set to GETDNS_EXTENSION_TRUE to add the name
.I call_debugging
.I call_reporting
(list) to the top level of the response object that includes a dict for each call made to the API. TBD: more detail
.LP

11
getdns.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=@libdir_for_pc_file@
includedir=@includedir_for_pc_file@
Name: getdns
Version: @GETDNS_VERSION@
Description: A modern asynchronous DNS library
Libs: -L${libdir} -lgetdns
Cflags: -I${includedir}

11
getdns_ext_event.pc.in Normal file
View File

@ -0,0 +1,11 @@
prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: getdns_ext_event
Version: @GETDNS_VERSION@
Description: A modern asynchronous DNS library
Libs: -L${libdir} -lgetdns_ext_event
Cflags: -I${includedir}

View File

@ -1,527 +0,0 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-11-20.07; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

9661
ltmain.sh

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
# Taken from acx_nlnetlabs.m4 - common macros for configure checks
# Copyright 2009, Wouter Wijngaards, NLnet Labs.
# BSD licensed.
#
dnl Add a -R to the RUNTIME_PATH. Only if rpath is enabled and it is
dnl an absolute path.
dnl $1: the pathname to add.
AC_DEFUN([ACX_RUNTIME_PATH_ADD], [
if test "x$enable_rpath" = xyes; then
if echo "$1" | grep "^/" >/dev/null; then
RUNTIME_PATH="$RUNTIME_PATH -R$1"
fi
fi
])
dnl Common code for both ACX_WITH_SSL and ACX_WITH_SSL_OPTIONAL
dnl Takes one argument; the withval checked in those 2 functions
dnl sets up the environment for the given openssl path
AC_DEFUN([ACX_SSL_CHECKS], [
withval=$1
if test x_$withval != x_no; then
AC_MSG_CHECKING(for SSL)
if test x_$withval = x_ -o x_$withval = x_yes; then
withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr"
fi
for dir in $withval; do
ssldir="$dir"
if test -f "$dir/include/openssl/ssl.h"; then
found_ssl="yes"
AC_DEFINE_UNQUOTED([HAVE_SSL], [], [Define if you have the SSL libraries installed.])
dnl assume /usr/include is already in the include-path.
if test "$ssldir" != "/usr"; then
CPPFLAGS="$CPPFLAGS -I$ssldir/include"
LIBSSL_CPPFLAGS="$LIBSSL_CPPFLAGS -I$ssldir/include"
fi
break;
fi
done
if test x_$found_ssl != x_yes; then
AC_MSG_ERROR(Cannot find the SSL libraries in $withval)
else
AC_MSG_RESULT(found in $ssldir)
HAVE_SSL=yes
dnl assume /usr is already in the lib and dynlib paths.
if test "$ssldir" != "/usr" -a "$ssldir" != ""; then
LDFLAGS="$LDFLAGS -L$ssldir/lib"
LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib"
ACX_RUNTIME_PATH_ADD([$ssldir/lib])
fi
AC_MSG_CHECKING([for HMAC_CTX_init in -lcrypto])
LIBS="$LIBS -lcrypto"
LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto"
AC_TRY_LINK(, [
int HMAC_CTX_init(void);
(void)HMAC_CTX_init();
], [
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_HMAC_CTX_INIT], 1,
[If you have HMAC_CTX_init])
], [
AC_MSG_RESULT(no)
# check if -lwsock32 or -lgdi32 are needed.
BAKLIBS="$LIBS"
BAKSSLLIBS="$LIBSSL_LIBS"
LIBS="$LIBS -lgdi32"
LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32"
AC_MSG_CHECKING([if -lcrypto needs -lgdi32])
AC_TRY_LINK([], [
int HMAC_CTX_init(void);
(void)HMAC_CTX_init();
],[
AC_DEFINE([HAVE_HMAC_CTX_INIT], 1,
[If you have HMAC_CTX_init])
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
LIBS="$BAKLIBS"
LIBSSL_LIBS="$BAKSSLLIBS"
LIBS="$LIBS -ldl"
LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
AC_MSG_CHECKING([if -lcrypto needs -ldl])
AC_TRY_LINK([], [
int HMAC_CTX_init(void);
(void)HMAC_CTX_init();
],[
AC_DEFINE([HAVE_HMAC_CTX_INIT], 1,
[If you have HMAC_CTX_init])
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required])
])
])
])
fi
AC_SUBST(HAVE_SSL)
AC_SUBST(RUNTIME_PATH)
# openssl engine functionality needs dlopen().
BAKLIBS="$LIBS"
AC_SEARCH_LIBS([dlopen], [dl])
if test "$LIBS" != "$BAKLIBS"; then
LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
fi
fi
AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT])
AC_CHECK_HEADERS([openssl/rand.h],,, [AC_INCLUDES_DEFAULT])
])dnl End of ACX_SSL_CHECKS
dnl Check for SSL, where SSL is mandatory
dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS.
dnl Checks main header files of SSL.
dnl
AC_DEFUN([ACX_WITH_SSL],
[
AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
[enable SSL (will check /usr/local/ssl
/usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[
],[
withval="yes"
])
if test x_$withval = x_no; then
AC_MSG_ERROR([Need SSL library to do digital signature cryptography])
fi
ACX_SSL_CHECKS($withval)
])dnl End of ACX_WITH_SSL
dnl Check for SSL, where ssl is optional (--without-ssl is allowed)
dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS.
dnl Checks main header files of SSL.
dnl
AC_DEFUN([ACX_WITH_SSL_OPTIONAL],
[
AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
[enable SSL (will check /usr/local/ssl
/usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[
],[
withval="yes"
])
ACX_SSL_CHECKS($withval)
])dnl End of ACX_WITH_SSL_OPTIONAL
dnl Setup to use -lssl
dnl To use -lcrypto, use the ACX_WITH_SSL setup (before this one).
AC_DEFUN([ACX_LIB_SSL],
[
# check if libssl needs libdl
BAKLIBS="$LIBS"
LIBS="-lssl $LIBS"
AC_MSG_CHECKING([if libssl needs libdl])
AC_TRY_LINK_FUNC([SSL_CTX_new], [
AC_MSG_RESULT([no])
LIBS="$BAKLIBS"
] , [
AC_MSG_RESULT([yes])
LIBS="$BAKLIBS"
AC_SEARCH_LIBS([dlopen], [dl])
]) ])dnl End of ACX_LIB_SSL

View File

@ -1,74 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 3
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS

7997
m4/libtool.m4 vendored

File diff suppressed because it is too large Load Diff

384
m4/ltoptions.m4 vendored
View File

@ -1,384 +0,0 @@
# Helper functions for option handling. -*- Autoconf -*-
#
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 7 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
# ------------------------------------------
m4_define([_LT_MANGLE_OPTION],
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
# ---------------------------------------
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
# saved as a flag.
m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl
])
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
# ------------------------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
m4_define([_LT_IF_OPTION],
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
# -------------------------------------------------------
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
# are set.
m4_define([_LT_UNLESS_OPTIONS],
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
[m4_define([$0_found])])])[]dnl
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
])[]dnl
])
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
# ----------------------------------------
# OPTION-LIST is a space-separated list of Libtool options associated
# with MACRO-NAME. If any OPTION has a matching handler declared with
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
# the unknown option and exit.
m4_defun([_LT_SET_OPTIONS],
[# Set options
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
[_LT_SET_OPTION([$1], _LT_Option)])
m4_if([$1],[LT_INIT],[
dnl
dnl Simply set some default values (i.e off) if boolean options were not
dnl specified:
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
])
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
])
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
])
])# _LT_SET_OPTIONS
## --------------------------------- ##
## Macros to handle LT_INIT options. ##
## --------------------------------- ##
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
# -----------------------------------------
m4_define([_LT_MANGLE_DEFUN],
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
# -----------------------------------------------
m4_define([LT_OPTION_DEFINE],
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
])# LT_OPTION_DEFINE
# dlopen
# ------
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
])
AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
# win32-dll
# ---------
# Declare package support for building win32 dll's.
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
[enable_win32_dll=yes
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
;;
esac
test -z "$AS" && AS=as
_LT_DECL([], [AS], [1], [Assembler program])dnl
test -z "$DLLTOOL" && DLLTOOL=dlltool
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
test -z "$OBJDUMP" && OBJDUMP=objdump
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
])# win32-dll
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
# implement the --enable-shared flag, and supports the `shared' and
# `disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_shared=yes ;;
no) enable_shared=no ;;
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
_LT_DECL([build_libtool_libs], [enable_shared], [0],
[Whether or not to build shared libraries])
])# _LT_ENABLE_SHARED
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
# Old names:
AC_DEFUN([AC_ENABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
])
AC_DEFUN([AC_DISABLE_SHARED],
[_LT_SET_OPTION([LT_INIT], [disable-shared])
])
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
# implement the --enable-static flag, and support the `static' and
# `disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_static=yes ;;
no) enable_static=no ;;
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
_LT_DECL([build_old_libs], [enable_static], [0],
[Whether or not to build static libraries])
])# _LT_ENABLE_STATIC
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
# Old names:
AC_DEFUN([AC_ENABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
])
AC_DEFUN([AC_DISABLE_STATIC],
[_LT_SET_OPTION([LT_INIT], [disable-static])
])
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install'
# and `disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
[p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
_LT_DECL([fast_install], [enable_fast_install], [0],
[Whether or not to optimize for fast installation])dnl
])# _LT_ENABLE_FAST_INSTALL
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
# Old names:
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
# LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
[lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
# Old name:
AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
## ----------------- ##
## LTDL_INIT Options ##
## ----------------- ##
m4_define([_LTDL_MODE], [])
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
[m4_define([_LTDL_MODE], [nonrecursive])])
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
[m4_define([_LTDL_MODE], [recursive])])
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
[m4_define([_LTDL_MODE], [subproject])])
m4_define([_LTDL_TYPE], [])
LT_OPTION_DEFINE([LTDL_INIT], [installable],
[m4_define([_LTDL_TYPE], [installable])])
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
[m4_define([_LTDL_TYPE], [convenience])])

123
m4/ltsugar.m4 vendored
View File

@ -1,123 +0,0 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 6 ltsugar.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
# lt_join(SEP, ARG1, [ARG2...])
# -----------------------------
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
# associated separator.
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
# versions in m4sugar had bugs.
m4_define([lt_join],
[m4_if([$#], [1], [],
[$#], [2], [[$2]],
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
m4_define([_lt_join],
[m4_if([$#$2], [2], [],
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
# lt_car(LIST)
# lt_cdr(LIST)
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
# Autoconf-2.59 which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
[$#], 1, [],
[m4_dquote(m4_shift($@))])])
m4_define([lt_unquote], $1)
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
# than defined and empty).
#
# This macro is needed until we can rely on Autoconf 2.62, since earlier
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
m4_define([lt_append],
[m4_define([$1],
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
# ----------------------------------------------------------
# Produce a SEP delimited list of all paired combinations of elements of
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
# has the form PREFIXmINFIXSUFFIXn.
# Needed until we can rely on m4_combine added in Autoconf 2.62.
m4_define([lt_combine],
[m4_if(m4_eval([$# > 3]), [1],
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
[[m4_foreach([_Lt_prefix], [$2],
[m4_foreach([_Lt_suffix],
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
# -----------------------------------------------------------------------
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
m4_define([lt_if_append_uniq],
[m4_ifdef([$1],
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
[lt_append([$1], [$2], [$3])$4],
[$5])],
[lt_append([$1], [$2], [$3])$4])])
# lt_dict_add(DICT, KEY, VALUE)
# -----------------------------
m4_define([lt_dict_add],
[m4_define([$1($2)], [$3])])
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
# --------------------------------------------
m4_define([lt_dict_add_subkey],
[m4_define([$1($2:$3)], [$4])])
# lt_dict_fetch(DICT, KEY, [SUBKEY])
# ----------------------------------
m4_define([lt_dict_fetch],
[m4_ifval([$3],
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
# -----------------------------------------------------------------
m4_define([lt_if_dict_fetch],
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
[$5],
[$6])])
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
# --------------------------------------------------------------
m4_define([lt_dict_filter],
[m4_if([$5], [], [],
[lt_join(m4_quote(m4_default([$4], [[, ]])),
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
])

23
m4/ltversion.m4 vendored
View File

@ -1,23 +0,0 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
# Copyright (C) 2004 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# @configure_input@
# serial 3337 ltversion.m4
# This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2])
m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2'
macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])

98
m4/lt~obsolete.m4 vendored
View File

@ -1,98 +0,0 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
# serial 5 lt~obsolete.m4
# These exist entirely to fool aclocal when bootstrapping libtool.
#
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
# using a macro with the same name in our local m4/libtool.m4 it'll
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
# and doesn't know about Autoconf macros at all.)
#
# So we provide this file, which has a silly filename so it's always
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
# we give up compatibility with versions before 1.7, at which point
# we need to keep only those names which we still refer to.
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])

214
m4/pkg.m4
View File

@ -1,214 +0,0 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES
# PKG_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable pkgconfigdir as the location where a module
# should install pkg-config .pc files. By default the directory is
# $libdir/pkgconfig, but the default can be changed by passing
# DIRECTORY. The user can override through the --with-pkgconfigdir
# parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_INSTALLDIR
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
# -------------------------
# Substitutes the variable noarch_pkgconfigdir as the location where a
# module should install arch-independent pkg-config .pc files. By
# default the directory is $datadir/pkgconfig, but the default can be
# changed by passing DIRECTORY. The user can override through the
# --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
]) dnl PKG_NOARCH_INSTALLDIR
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------
# Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])# PKG_CHECK_VAR

330
missing
View File

@ -1,330 +0,0 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
scriptversion=2012-01-06.18; # UTC
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
run=:
sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, 'missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file 'aclocal.m4'
autoconf touch file 'configure'
autoheader touch file 'config.h.in'
autom4te touch the output file, or create a stub one
automake touch all 'Makefile.in' files
bison create 'y.tab.[ch]', if possible, from existing .[ch]
flex create 'lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create 'lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create 'y.tab.[ch]', if possible, from existing .[ch]
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: Unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# normalize program name to check for.
program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program). This is about non-GNU programs, so use $1 not
# $program.
case $1 in
lex*|yacc*)
# Not GNU programs, they don't have --version.
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running '$TOOL --version' or '$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case $program in
aclocal*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'acinclude.m4' or '${configure_ac}'. You might want
to install the Automake and Perl packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified '${configure_ac}'. You might want to install the
Autoconf and GNU m4 packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'acconfig.h' or '${configure_ac}'. You might want
to install the Autoconf and GNU m4 packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
You might want to install the Automake and Perl packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te*)
echo 1>&2 "\
WARNING: '$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get '$1' as part of Autoconf from any GNU
archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison*|yacc*)
echo 1>&2 "\
WARNING: '$1' $msg. You should only need it if
you modified a '.y' file. You may need the Bison package
in order for those modifications to take effect. You can get
Bison from any GNU archive site."
rm -f y.tab.c y.tab.h
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if test ! -f y.tab.h; then
echo >y.tab.h
fi
if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex*|flex*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a '.l' file. You may need the Flex package
in order for those modifications to take effect. You can get
Flex from any GNU archive site."
rm -f lex.yy.c
if test $# -ne 1; then
eval LASTARG=\${$#}
case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
Help2man package in order for those modifications to take
effect. You can get Help2man from any GNU archive site."
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit $?
fi
;;
makeinfo*)
echo 1>&2 "\
WARNING: '$1' is $msg. You should only need it if
you modified a '.texi' or '.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy 'make' (AIX,
DU, IRIX). You might want to install the Texinfo package or
the GNU make package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n "$sed_output"`
test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '
/^@setfilename/{
s/.* \([^ ]*\) *$/\1/
p
q
}' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
*)
echo 1>&2 "\
WARNING: '$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the 'README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing '$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@ -13,10 +13,10 @@ Recursive Resolver Cache
Caching is arguably an important feature for most recursive resolvers.
In this case we are not intending a replacement for the fully
functional recursive resolvers already available (BIND, Unbound, etc.)
so we shoudl limit a cache implementation to behaviors important to
so we should limit a cache implementation to behaviors important to
proper operation of a recursive resolver.
DNSSEC validation can potentially triggers more queries than a simple
DNSSEC validation can potentially trigger more queries than a simple
request for a A RR so I think it makes sense to cache root and TLD
data. Once we have gone that far it isn't much of a reach to cache
at each layer in the hierarchy (depth will not increase the coding
@ -53,9 +53,9 @@ Local configuration via API or local file (e.g. /etc/getdns.conf, ~/.getdnsrc)
- max TTL/TTL override (separate for pos/neg cache entries)
- inclusions (use cache for specified domains) (maybe over-eng)
- exceptions (avoid ache for specified domains) (maybe over-eng)
- persistant vs. transitory cache
- persistent vs. transitory cache
- cache data store via Berkely db to allow for persistance
- cache data store via Berkely db to allow for persistence
- negative cache TTL derived from SOA

View File

@ -0,0 +1,10 @@
pkg update
pkg upgrade
pkg install -y gawk unbound valgrind bash check cmake git libyaml libevent libuv
git clone git@github.com:getdnsapi/getdns.git
cd getdns/
git checkout remotes/origin/release/1.6.0-beta.1
mkdir test
cd test/
../src/test/tpkg/run-all.sh

Binary file not shown.

Binary file not shown.

21
project-doc/makedist.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
[ ! -f git-archive-all.sh ] && wget "https://raw.githubusercontent.com/meitar/git-archive-all.sh/master/git-archive-all.sh"
[ ! -x git-archive-all.sh ] && chmod +x git-archive-all.sh
[ ! -f git-archive-all.sh ] && exit 1
GIT_ARCHIVE="`pwd`/git-archive-all.sh"
git submodule update --init
GIT_ROOT=`git rev-parse --show-toplevel`
version=`awk '/^set\(PACKAGE_VERSION/{V=$2}
/^set\(RELEASE_CANDIDATE/{RC=$2}
END{print V""RC}' "$GIT_ROOT/CMakeLists.txt" | sed 's/[")]//g'`
output_file="getdns-${version}.tar.gz"
( cd "$GIT_ROOT" \
&& "$GIT_ARCHIVE" --prefix "getdns-$version/" --format tar.gz \
--worktree-attributes -- - ) > "$output_file"
openssl md5 "$output_file" > "${output_file}.md5"
openssl sha1 "$output_file" > "${output_file}.sha1"
openssl sha256 "$output_file" > "${output_file}.sha256"
gpg --armor --detach-sig "$output_file"
[ -f "$output_file" -a -f "${output_file}.md5" -a -f "${output_file}.sha1" -a -f "${output_file}.sha256" -a -f "${output_file}.asc" ] \
&& rm git-archive-all.sh

20
project-doc/packages.txt Normal file
View File

@ -0,0 +1,20 @@
Some notes about packages and maintainers.
For Homebrew, created and maintained by ilovezfs
https://github.com/Homebrew/homebrew-core/Formula/getdns.rb
https://github.com/Homebrew/homebrew-core/Formula/stubby.rb
For Arch, created and maintained by Bruno Pagani (ArchangeGabriel)
For OpenWRT, created and maintained by David Mora (iamperson347)
https://github.com/openwrt/packages/tree/master/libs/getdns
https://github.com/openwrt/packages/tree/master/net/stubby
For AstLinux Project, created and maintained by Lonnie Abelbeck (abelbeck)
https://github.com/astlinux-project/astlinux/tree/master/package/getdns
For Genode, created and maintained by Emery Hemingway (ehmry)
https://github.com/genodelabs/genode/blob/master/repos/ports/ports/getdns.port
For Gentoo, created and maintained by CaseOf (Quentin R.?)
https://packages.gentoo.org/packages/net-dns/getdns

View File

@ -1,168 +1,93 @@
High level release procedure that we follow to make a formal release for the
getdns API project. This is a recipe - if you have a better way to do it then
update this document and share it with us.
High level release procedure for formal release for the getdns API project.
- code freeze
confirm with core team that all commits are in, from this point forward
only bug fixes should be committed to the release branch, once the release
is cut nothing should be committed to the release branch (make a new release)
1) Git branching for a release
-- Confirm with core team (preferably via email) that all commits to be included
in the release are in the develop branch. Development for the next release can
continue on develop.
-- Create a release branch. We use the pattern "release/v1.0.0-b3" for naming
release branches. This branch is used for testing
and bug fixing while preparing the release (which can take several days
if there are un-foreseen issues). Note that from this point forward _only_
bug fixes for this release should be committed to the release branch.
-- Once the release is published there should be no further commits on that
release branch.
- create a release branch
in git repository named for the release, e.g. "v0.1.2"
we do this because folks may want to continue to work in the master branch
and be free to commit changes without injuring the release process. Since
building and testing binaries for a release takes a few days we don't want to
force changes to queue up.
2) Prepare the release
-- Clone the upstream to a _new_ local directory. (Do NOT re-use and
existing working copy as this can lead to issues).
One might argue that a release can be cut more quickly, however there are
inevitably little tweaks that need to be made that get uncovered as a result
of the binary builds - these tweaks need to be included in the souces for
this release so building the source tarball can't be done until all of the
binaries have been built and tested.
# git clone -b v1.0.0-b3 https://github.com/getdnsapi/getdns.git getdns-1.0.0-b3
- clone repo release branch to a clean local repo
this should be a brand spanking new directory - don't try to shortcut it and
use a working directory with lots of cruft - crap will find its way into the
release and embarass you:
-- Update several files to reflect release number/date
./README.md
./ChangeLog
./configure.ac
- Check and change the values for:
- AC_INIT
- RELEASE_CANDIDATE
- GETDNS_NUMERIC_VERSION
- API_VERSION and API_NUMERUC_VERSION
- read the section "Library version" and update GETDNS_LIBVERSION carefully!
# git clone -b v0.1.2 https://github.com/getdnsapi/getdns.git getdns-0.1.2
# autoreconf -fi
- update files to reflect release number/date
./README.md
./ChangeLog
./configure.ac (AC_INIT)
./src/Makefile.in (-version-info, follow libtool guidelines)
Commit these changes to the release branch
# make clean
# autoreconf
# git commit -a -m "release number and date updates"
# git push
commit these changes to the release branch
3) Test
The unit and tpkg tests should be run on all the supported platforms. They must all
be able to fulfil all requirements. So they must have libidn, libev, libuv, libevent,
latest libunbound, latest openssl (at least 1.0.2) latest clang compiler
(for static analysis), latest valgrind. The tests can be run using:
# git commit -a -m "release number and date updates"
# git push
# ${GETDNS_SRCDIR}/src/test/tpkg/run-all.sh
- prepare to build binaries for each target platform
you need to remove libs and headers that might be lingering from previous builds
to avoid accidentally including the wrong headers or linking the wrong libs
and evaluating the results.
- create clean local repo
- build source distribution tar
4) Build and sign source distribution tarball
# rm -fr *
# git reset --hard
# git submodule update --init
# autoreconf -fi
# libtoolize -ci
# ./configure
# make dist
# openssl sha1 getdns-0.1.2.tar.gz > getdns-0.1.2.tar.gz.sha1
# openssl md5 getdns-0.1.2.tar.gz > getdns-0.1.2.tar.gz.md5
# gpg --armor --detach-sig --default-key gwiley@verisign.com getdns-0.1.2.tar.gz
# make pub
- test the resulting tar by building it and running the regression tests
The resulting tarball must be built, installed and tested on all the supported
platforms. Be sure to use a user that was NOT used for the build, this will uncover
any issues related to absolute paths in the build
- build CentOS binary
# tar -xzvf getdns-0.1.2.tar.gz
# cd getdns-0.1.2
# ./configure --with-libevent --prefix=$HOME/build
# make
# make install
# cd ~/build
- fix the libdir path in the *.la files to point to /usr/local/lib
- fix the dependency_libs entry in the *.la files to point to /usr/local/lib
# fpm -x "*.la" -a native -s dir --rpm-sign -t rpm -n getdns -v 0.1.2 -d "unbound" -d "ldns" -d "libevent" -d "libidn" --prefix /usr/local --vendor "Verisign Inc., NLnet Labs" --license "BSD New" --url "http://www.getdnsapi.net" --description "Modern asynchronous API to the DNS" .
- make sure your signing key is in the keyring on the build machine
- contents of ~/.rpmmacros
%_signature gpg
%_gpg_path /root/.gnupg
%_gpg_name A6B73532
%_gpgbin /usr/bin/gpg
5) Fix any problems
-- If a build breaks or an install fails then commit fixes to the release branch.
Then re-run steps 3 and 4 for all supported platforms using the new code.
- name the rpm and checksum files something like this:
getdns-0.1.3-1.CentOS_6_5.x86_64.rpm
getdns-0.1.3-1.CentOS_6_5.x86_64.rpm.sha1
getdns-0.1.3-1.CentOS_6_5.x86_64.rpm.md5
- check the signature
- install
- test
6) Merge branch changes back into master/develop
-- If this is a production release - then the release branch must be merged into master
Sign the merge tag if possible.
-- Now the release is ready, all the relevant commits on the release branch
should also be merged back into develop.
- build OSX binary disk image
7) Create the tarball
# make clean
# make pub
This generates getdns-1.0.0-b3.tar.gz + checksums + signatures.
- build code (no additional libraries, note that regression tests will not build)
if you are building a simple binary tar then something like this works
# ./configure --prefix=/Users/gwiley/getdnsox/export
# make
# make install
# tar -C /Users/gwiley/getdnsosx/export -cvf getdns-0.1.2.tar *
8) Upload source tarball and checksums and signatures to the getdnsapi.net site
- build code (with libevent)
# ./configure --with-libevent2
# scp getdns-1.0.0-b3.tar.gz* getdnsapi.net:/usr/local/www/apache24/data/dist
- run regression tests and verify that alls well
9) Create and push signed tags to github
if you have do do anything even mildly interesting to get the build or install to
work then we either have to add it to the README.md or, preferably, fix it
and update the branch
# git -s v1.0.0-b3
# git push --tags
Be careful about tool sets loaded on your build hosts. You may have 'solved'
problems while you are working that mask issues with the build for more typical
users - this is why we want to build on hosts that are representative of
our users.
10) Update getdnsapi.net web site
- Create an entry the the 'Checksum' page using the content of ChangeLog
- Create a new 'News' entry
- install on each target platform
- make sure and use a user that was NOT used for the build, this will uncover
any silliness related to absolute paths in the build
- if a build breaks or an install fails then commit fixes to the relase branch
- rebuild EVERY binary using the changed release branch
- merge branch changes back into master
- once all binaries are built and tested clean, create source tar ball
and the actual package for each platform
you may need to run this as root to permit the chown
# make clean
# make dist
generates getdns-0.1.2.tar.gz
- sign each binary/source tar using one or more developers keys
- make sure that the keys you use to sign the release are also up to date
on the getdnsapi.net site
- generate checksums for each binary/source tar
- upload source and binaries to the getdnsapi.net site
- create a release in the github repository
- from the main repo choose 'releases'
- choose 'Draft a new release'
- use tag v0.x.y to match the branch being released
- for a release name use v0.x.y
- for description cut/paste the ChangeLog entry
- check the 'pre-release' checkbox (unless this is a production release)
- update getdnsapi.net web site
- push binaries to getdnsapi.net
/usr/local/www/apache24/data/dist
- news entry for the release
/usr/local/www/apache24/data/news.html
- download links and checksums
/usr/local/www/apache24/data/frontpage.html
- rebuild website
# ./build.sh
- announce message to
getdns mailing list
stub-resolvers mailing list
Verisign internal via the matrix
- update the
11) Announce the release to the lists (make sure to sign the emails)
users@getdnsapi.net, spec@getdnsapi.net and maintainers@nlnetlabs.nl
List of Build Targets
---------------------
The naming conventions for each of these build products are specific to the
platform they target. The result is that the naming seems a little inconsistent,
however I felt that it is best to follow naming standards for the platform rather
than try to impose a project specific standard across platforms.
- source tar: getdns-0.1.2.tar.gz
- OSX binary package: getdns-0.1.2-OSX_10_8.dmg
- RHEL/CentOS: getdns-0.1.0-1.CentOS_6_5.x86_64.rpm
- Debian/Ubuntu:

10074
ranlib

File diff suppressed because it is too large Load Diff

View File

@ -1,162 +0,0 @@
#
# @configure_input@
#
# Copyright (c) 2013, Verisign, Inc., NLNet Labs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the names of the copyright holders nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package = @PACKAGE_NAME@
version = @PACKAGE_VERSION@
tarname = @PACKAGE_TARNAME@
distdir = $(tarname)-$(version)
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
LIBTOOL = ../../libtool
srcdir = @srcdir@
EXTENSION_LIBEVENT_EXT_LIBS=@EXTENSION_LIBEVENT_EXT_LIBS@
EXTENSION_LIBEVENT_LDFLAGS=@EXTENSION_LIBEVENT_LDFLAGS@
EXTENSION_LIBEVENT_LIB=../../src/libgetdns_ext_event.la
CC=@CC@
CFLAGS=-I$(srcdir) -I$(srcdir)/../../src -I../../src @CFLAGS@
LDFLAGS=@LDFLAGS@ -L../../src
LDLIBS=../../src/libgetdns.la @LIBS@
OBJS=example-all-functions.lo example-simple-answers.lo example-tree.lo example-synchronous.lo example-reverse.lo
PROGRAMS=example-all-functions example-synchronous example-simple-answers example-tree example-reverse
.SUFFIXES: .c .o .a .lo .h
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
.c.lo:
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@
default: all
example: all
all: $(PROGRAMS)
$(OBJS):
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$(@:.lo=.c) -o $@
example-all-functions: example-all-functions.lo
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ example-all-functions.lo
example-synchronous: example-synchronous.lo
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ example-synchronous.lo
$(EXTENSION_LIBEVENT_LIB):
@echo "***"
@echo "*** Three examples from the specification need libevent."
@echo "*** libevent was not found or usable at configure time."
@echo "*** To compile and run all examples from the spec, make sure"
@echo "*** libevent is available and usable during configuration."
@echo "***"
@false
example-simple-answers: example-simple-answers.lo $(EXTENSION_LIBEVENT_LIB)
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-simple-answers.lo
example-tree: example-tree.lo $(EXTENSION_LIBEVENT_LIB)
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-tree.lo
example-reverse: example-reverse.lo $(EXTENSION_LIBEVENT_LIB)
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-reverse.lo
clean:
rm -f *.o *.lo $(PROGRAMS)
rm -rf .libs
distclean : clean
rm -f Makefile config.status config.log
rm -Rf autom4te.cache
$(distdir): FORCE
mkdir -p $(distdir)/src
cp configure.ac $(distdir)
cp configure $(distdir)
cp Makefile.in $(distdir)
cp src/Makefile.in $(distdir)/src
distcheck: $(distdir).tar.gz
gzip -cd $(distdir).tar.gz | tar xvf -
cd $(distdir) && ./configure
cd $(distdir) && $(MAKE) all
cd $(distdir) && $(MAKE) check
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
@remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`"; \
if test "$${remaining}" -ne 0; then
echo "@@@ $${remaining} file(s) remaining in stage directory!"; \
exit 1; \
fi
cd $(distdir) && $(MAKE) clean
rm -rf $(distdir)
@echo "*** Package $(distdir).tar.gz is ready for distribution"
Makefile: $(srcdir)/Makefile.in ../../config.status
cd ../.. && ./config.status spec/example/Makefile
configure.status: configure
cd ../.. && ./config.status --recheck
.PHONY: clean
depend:
(cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new )
(cd $(srcdir) ; gcc -MM -I. -I../../src *.c | \
sed -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
-e 's? \$$(srcdir)/config\.h? ../../src/config.h?g' \
-e 's? \.\./\.\./src/getdns/getdns_extra\.h? $$(srcdir)/../../src/getdns/getdns_extra.h?g' \
-e 's? \.\./\.\./src/getdns/getdns_ext_libevent\.h? $$(srcdir)/../../src/getdns/getdns_ext_libevent.h?g' \
-e 's? \.\./\.\./src/getdns/getdns_ext_libev\.h? $$(srcdir)/../../src/getdns/getdns_ext_libev.h?g' \
-e 's? \.\./\.\./src/getdns/getdns_ext_libuv\.h? $$(srcdir)/../../src/getdns/getdns_ext_libuv.h?g' \
-e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
(cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
|| mv Makefile.in.new Makefile.in )
# Dependencies for the examples
example-all-functions.lo example-all-functions.o: $(srcdir)/example-all-functions.c $(srcdir)/getdns_libevent.h \
../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
$(srcdir)/../../src/getdns/getdns_extra.h
example-reverse.lo example-reverse.o: $(srcdir)/example-reverse.c $(srcdir)/getdns_libevent.h \
../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
$(srcdir)/../../src/getdns/getdns_extra.h
example-simple-answers.lo example-simple-answers.o: $(srcdir)/example-simple-answers.c $(srcdir)/getdns_libevent.h \
../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
$(srcdir)/../../src/getdns/getdns_extra.h
example-synchronous.lo example-synchronous.o: $(srcdir)/example-synchronous.c $(srcdir)/getdns_core_only.h \
../../src/getdns/getdns.h
example-tree.lo example-tree.o: $(srcdir)/example-tree.c $(srcdir)/getdns_libevent.h \
../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \
$(srcdir)/../../src/getdns/getdns_extra.h

View File

@ -1,135 +1,112 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <getdns_libevent.h>
#define UNUSED_PARAM(x) ((void)(x))
/* Set up the callback function, which will also do the processing of the results */
void this_callbackfn(getdns_context *this_context,
getdns_callback_type_t this_callback_type,
getdns_dict *this_response,
void *this_userarg,
getdns_transaction_t this_transaction_id)
void callback(getdns_context *context,
getdns_callback_type_t callback_type,
getdns_dict *response,
void *userarg,
getdns_transaction_t transaction_id)
{
getdns_return_t this_ret; /* Holder for all function returns */
UNUSED_PARAM(this_userarg); /* Not looking at the userarg for this example */
UNUSED_PARAM(this_context); /* Not looking at the context for this example */
UNUSED_PARAM(this_ret); /* Set, but not read */
if (this_callback_type == GETDNS_CALLBACK_COMPLETE) /* This is a callback with data */
{
/* Be sure the search returned something */
uint32_t this_error;
this_ret = getdns_dict_get_int(this_response, "status", &this_error); // Ignore any error
if (this_error != GETDNS_RESPSTATUS_GOOD) // If the search didn't return "good"
{
fprintf(stderr, "The search had no results, and a return value of %d. Exiting.\n", this_error);
getdns_dict_destroy(this_response);
return;
}
getdns_list *replies_tree;
this_ret = getdns_dict_get_list(this_response, "replies_tree", &replies_tree); // Ignore any error
size_t num_replies;
this_ret = getdns_list_get_length(replies_tree, &num_replies); // Ignore any error
/* Go through each reply */
for ( size_t reply_count = 0; reply_count < num_replies; ++reply_count)
{
getdns_dict * this_reply;
this_ret = getdns_list_get_dict(replies_tree, reply_count, &this_reply); // Ignore any error
/* Just print the address */
getdns_list* reply_answers;
this_ret = getdns_dict_get_list(this_reply, "answer", &reply_answers); // Ignore any error
size_t num_answers;
this_ret = getdns_list_get_length(reply_answers, &num_answers); // Ignore any error
/* Go through each answer */
for ( size_t answer_count = 0; answer_count < num_answers; ++answer_count)
{
getdns_dict * this_rr;
this_ret = getdns_list_get_dict(reply_answers, answer_count, &this_rr);
/* Get the RDATA type */
uint32_t this_type;
this_ret = getdns_dict_get_int(this_rr, "type", &this_type); // Ignore any error
if (this_type == GETDNS_RRTYPE_PTR)
{
getdns_dict *this_rdata;
this_ret = getdns_dict_get_dict(this_rr, "rdata", &this_rdata); // Ignore any error
getdns_return_t r; /* Holder for all function returns */
getdns_list *answer;
size_t n_answers, i;
getdns_bindata * this_dname;
this_ret = getdns_dict_get_bindata(this_rdata, "rdata_raw", &this_dname);
char *this_dname_str;
this_ret = getdns_convert_dns_name_to_fqdn(this_dname, &this_dname_str); // Ignore any error
printf("The dname is %s\n", this_dname_str);
free(this_dname_str);
}
}
(void) context; (void) userarg; /* unused parameters */
switch(callback_type) {
case GETDNS_CALLBACK_CANCEL:
printf("Transaction with ID %"PRIu64" was cancelled.\n", transaction_id);
return;
case GETDNS_CALLBACK_TIMEOUT:
printf("Transaction with ID %"PRIu64" timed out.\n", transaction_id);
return;
case GETDNS_CALLBACK_ERROR:
printf("An error occurred for transaction ID %"PRIu64".\n", transaction_id);
return;
default: break;
}
assert( callback_type == GETDNS_CALLBACK_COMPLETE );
if ((r = getdns_dict_get_list(response, "/replies_tree/0/answer", &answer)))
fprintf(stderr, "Could not get \"answer\" section from first reply in the response");
else if ((r = getdns_list_get_length(answer, &n_answers)))
fprintf(stderr, "Could not get replies_tree\'s length");
else for (i = 0; i < n_answers && r == GETDNS_RETURN_GOOD; i++) {
getdns_dict *rr;
getdns_bindata *dname;
char *dname_str;
if ((r = getdns_list_get_dict(answer, i, &rr)))
fprintf(stderr, "Could not get rr %zu from answer section", i);
else if (getdns_dict_get_bindata(rr, "/rdata/ptrdname", &dname))
continue; /* Not a PTR */
else if ((r = getdns_convert_dns_name_to_fqdn(dname, &dname_str)))
fprintf(stderr, "Could not convert PTR dname to string");
else {
printf("The dname is %s\n", dname_str);
free(dname_str);
}
}
else if (this_callback_type == GETDNS_CALLBACK_CANCEL)
fprintf(stderr, "The callback with ID %"PRIu64" was cancelled. Exiting.", this_transaction_id);
else
fprintf(stderr, "The callback got a callback_type of %d. Exiting.", this_callback_type);
getdns_dict_destroy(this_response);
if (r) {
assert( r != GETDNS_RETURN_GOOD );
fprintf(stderr, ": %d\n", r);
}
getdns_dict_destroy(response);
}
int main()
{
/* Create the DNS context for this call */
getdns_context *this_context = NULL;
getdns_return_t context_create_return = getdns_context_create(&this_context, 1);
if (context_create_return != GETDNS_RETURN_GOOD)
{
fprintf(stderr, "Trying to create the context failed: %d", context_create_return);
return(GETDNS_RETURN_GENERIC_ERROR);
}
/* Create an event base and put it in the context using the unknown function name */
struct event_base *this_event_base;
this_event_base = event_base_new();
if (this_event_base == NULL)
{
fprintf(stderr, "Trying to create the event base failed.");
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
(void)getdns_extension_set_libevent_base(this_context, this_event_base);
/* Set up the getdns call */
getdns_dict * this_addr_to_look_up = getdns_dict_create();
// TODO: check the return value above
getdns_bindata this_type = { 4, (void *)"IPv4" };
getdns_return_t this_ret = getdns_dict_set_bindata(this_addr_to_look_up, "address_type", &this_type);
UNUSED_PARAM(this_ret);
getdns_bindata this_ipv4_addr = { 4, (void *)"\x08\x08\x08\x08" };
this_ret = getdns_dict_set_bindata(this_addr_to_look_up, "address_data", &this_ipv4_addr);
char* this_userarg = "somestring"; // Could add things here to help identify this call
getdns_transaction_t this_transaction_id = 0;
getdns_return_t r; /* Holder for all function returns */
getdns_context *context = NULL;
struct event_base *event_base = NULL;
getdns_bindata address_type = { 4, (void *)"IPv4" };
getdns_bindata address_data = { 4, (void *)"\x08\x08\x08\x08" };
getdns_dict *address = NULL;
getdns_dict *extensions = NULL;
/* Could add things here to help identify this call */
char *userarg = NULL;
getdns_transaction_t transaction_id;
/* Make the call */
getdns_return_t dns_request_return = getdns_hostname(this_context, this_addr_to_look_up,
NULL, this_userarg, &this_transaction_id, this_callbackfn);
if (dns_request_return == GETDNS_RETURN_BAD_DOMAIN_NAME)
{
char *ip_address_str = getdns_display_ip_address(&this_ipv4_addr);
if ((r = getdns_context_create(&context, 1)))
fprintf(stderr, "Trying to create the context failed");
else if (!(event_base = event_base_new()))
fprintf(stderr, "Trying to create the event base failed.\n");
else if ((r = getdns_extension_set_libevent_base(context, event_base)))
fprintf(stderr, "Setting the event base failed");
else if (!(address = getdns_dict_create()))
fprintf(stderr, "Could not create address dict.\n");
else if ((r = getdns_dict_set_bindata(address, "address_type", &address_type)))
fprintf(stderr, "Could not set address_type in address dict.\n");
else if ((r = getdns_dict_set_bindata(address, "address_data", &address_data)))
fprintf(stderr, "Could not set address_data in address dict.\n");
else if ((r = getdns_hostname( context, address, extensions
, userarg, &transaction_id, callback)))
fprintf(stderr, "Error scheduling asynchronous request");
else if (event_base_dispatch(event_base) < 0)
fprintf(stderr, "Error dispatching events\n");
fprintf(stderr, "A bad IP address was used: %s. Exiting.\n", ip_address_str);
free(ip_address_str);
getdns_dict_destroy(this_addr_to_look_up);
event_base_free(this_event_base);
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
else
{
/* Call the event loop */
int dispatch_return = event_base_dispatch(this_event_base);
UNUSED_PARAM(dispatch_return);
// TODO: check the return value above
}
/* Clean up */
getdns_dict_destroy(this_addr_to_look_up);
event_base_free(this_event_base);
getdns_context_destroy(this_context);
if (event_base)
event_base_free(event_base);
if (context)
getdns_context_destroy(context);
/* Assuming we get here, leave gracefully */
exit(EXIT_SUCCESS);
}

View File

@ -1,108 +1,109 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <getdns_libevent.h>
#define UNUSED_PARAM(x) ((void)(x))
/* Set up the callback function, which will also do the processing of the results */
void this_callbackfn(getdns_context *this_context,
getdns_callback_type_t this_callback_type,
getdns_dict *this_response,
void *this_userarg,
getdns_transaction_t this_transaction_id)
void callback(getdns_context *context,
getdns_callback_type_t callback_type,
getdns_dict *response,
void *userarg,
getdns_transaction_t transaction_id)
{
UNUSED_PARAM(this_userarg); /* Not looking at the userarg for this example */
UNUSED_PARAM(this_context); /* Not looking at the context for this example */
getdns_return_t this_ret; /* Holder for all function returns */
if (this_callback_type == GETDNS_CALLBACK_COMPLETE) /* This is a callback with data */
{
/* Be sure the search returned something */
uint32_t this_error;
this_ret = getdns_dict_get_int(this_response, "status", &this_error); // Ignore any error
if (this_error != GETDNS_RESPSTATUS_GOOD) // If the search didn't return "good"
{
fprintf(stderr, "The search had no results, and a return value of %d. Exiting.\n", this_error);
getdns_dict_destroy(this_response);
return;
}
getdns_list * just_the_addresses_ptr;
this_ret = getdns_dict_get_list(this_response, "just_address_answers", &just_the_addresses_ptr);
if (this_ret != GETDNS_RETURN_GOOD) // This check is really not needed, but prevents a compiler error under "pedantic"
{
fprintf(stderr, "Trying to get the answers failed: %d\n", this_ret);
getdns_dict_destroy(this_response);
return;
}
size_t num_addresses;
this_ret = getdns_list_get_length(just_the_addresses_ptr, &num_addresses); // Ignore any error
/* Go through each record */
for ( size_t rec_count = 0; rec_count < num_addresses; ++rec_count )
{
getdns_dict * this_address;
this_ret = getdns_list_get_dict(just_the_addresses_ptr, rec_count, &this_address); // Ignore any error
/* Just print the address */
getdns_bindata * this_address_data;
this_ret = getdns_dict_get_bindata(this_address, "address_data", &this_address_data); // Ignore any error
char *this_address_str = getdns_display_ip_address(this_address_data);
printf("The address is %s\n", this_address_str);
free(this_address_str);
}
getdns_return_t r; /* Holder for all function returns */
uint32_t status;
getdns_bindata *address_data;
char *first = NULL, *second = NULL;
(void) context; /* unused parameter */
printf( "Callback for query \"%s\" with request ID %"PRIu64".\n"
, (char *)userarg, transaction_id );
switch(callback_type) {
case GETDNS_CALLBACK_CANCEL:
printf("Transaction with ID %"PRIu64" was cancelled.\n", transaction_id);
return;
case GETDNS_CALLBACK_TIMEOUT:
printf("Transaction with ID %"PRIu64" timed out.\n", transaction_id);
return;
case GETDNS_CALLBACK_ERROR:
printf("An error occurred for transaction ID %"PRIu64".\n", transaction_id);
return;
default: break;
}
else if (this_callback_type == GETDNS_CALLBACK_CANCEL)
fprintf(stderr, "The callback with ID %"PRIu64" was cancelled. Exiting.\n", this_transaction_id);
else
fprintf(stderr, "The callback got a callback_type of %d. Exiting.\n", this_callback_type);
getdns_dict_destroy(this_response);
assert( callback_type == GETDNS_CALLBACK_COMPLETE );
if ((r = getdns_dict_get_int(response, "status", &status)))
fprintf(stderr, "Could not get \"status\" from response");
else if (status != GETDNS_RESPSTATUS_GOOD)
fprintf(stderr, "The search had no results, and a return value of %"PRIu32".\n", status);
else if ((r = getdns_dict_get_bindata(response, "/just_address_answers/0/address_data", &address_data)))
fprintf(stderr, "Could not get first address");
else if (!(first = getdns_display_ip_address(address_data)))
fprintf(stderr, "Could not convert first address to string\n");
else if ((r = getdns_dict_get_bindata(response, "/just_address_answers/1/address_data", &address_data)))
fprintf(stderr, "Could not get second address");
else if (!(second = getdns_display_ip_address(address_data)))
fprintf(stderr, "Could not convert second address to string\n");
if (first) {
printf("The address is %s\n", first);
free(first);
}
if (second) {
printf("The address is %s\n", second);
free(second);
}
if (r) {
assert( r != GETDNS_RETURN_GOOD );
fprintf(stderr, ": %d\n", r);
}
getdns_dict_destroy(response);
}
int main()
{
/* Create the DNS context for this call */
getdns_context *this_context = NULL;
getdns_return_t context_create_return = getdns_context_create(&this_context, 1);
if (context_create_return != GETDNS_RETURN_GOOD)
{
fprintf(stderr, "Trying to create the context failed: %d", context_create_return);
return(GETDNS_RETURN_GENERIC_ERROR);
}
/* Create an event base and put it in the context using the unknown function name */
struct event_base *this_event_base;
this_event_base = event_base_new();
if (this_event_base == NULL)
{
fprintf(stderr, "Trying to create the event base failed.\n");
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
(void)getdns_extension_set_libevent_base(this_context, this_event_base);
/* Set up the getdns call */
const char * this_name = "www.example.com";
char* this_userarg = "somestring"; // Could add things here to help identify this call
getdns_transaction_t this_transaction_id = 0;
getdns_return_t r; /* Holder for all function returns */
getdns_context *context = NULL;
struct event_base *event_base = NULL;
getdns_dict *extensions = NULL;
char *query_name = "www.example.com";
/* Could add things here to help identify this call */
char *userarg = query_name;
getdns_transaction_t transaction_id;
/* Make the call */
getdns_return_t dns_request_return = getdns_address(this_context, this_name,
NULL, this_userarg, &this_transaction_id, this_callbackfn);
if (dns_request_return == GETDNS_RETURN_BAD_DOMAIN_NAME)
{
fprintf(stderr, "A bad domain name was used: %s. Exiting.\n", this_name);
event_base_free(this_event_base);
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
else
{
/* Call the event loop */
int dispatch_return = event_base_dispatch(this_event_base);
UNUSED_PARAM(dispatch_return);
// TODO: check the return value above
if ((r = getdns_context_create(&context, 1)))
fprintf(stderr, "Trying to create the context failed");
else if (!(event_base = event_base_new()))
fprintf(stderr, "Trying to create the event base failed.\n");
else if ((r = getdns_extension_set_libevent_base(context, event_base)))
fprintf(stderr, "Setting the event base failed");
else if ((r = getdns_address( context, query_name, extensions
, userarg, &transaction_id, callback)))
fprintf(stderr, "Error scheduling asynchronous request");
else {
printf("Request with transaction ID %"PRIu64" scheduled.\n", transaction_id);
if (event_base_dispatch(event_base) < 0)
fprintf(stderr, "Error dispatching events\n");
}
/* Clean up */
event_base_free(this_event_base);
getdns_context_destroy(this_context);
if (event_base)
event_base_free(event_base);
if (context)
getdns_context_destroy(context);
/* Assuming we get here, leave gracefully */
exit(EXIT_SUCCESS);
}

View File

@ -1,81 +1,66 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <assert.h>
#include <getdns_core_only.h>
int main()
{
getdns_return_t this_ret; /* Holder for all function returns */
/* Create the DNS context for this call */
getdns_context *this_context = NULL;
getdns_return_t context_create_return = getdns_context_create(&this_context, 1);
if (context_create_return != GETDNS_RETURN_GOOD)
{
fprintf(stderr, "Trying to create the context failed: %d\n", context_create_return);
return(GETDNS_RETURN_GENERIC_ERROR);
}
/* Set up the getdns_sync_request call */
const char * this_name = "www.example.com";
uint8_t this_request_type = GETDNS_RRTYPE_A;
/* Get the A and AAAA records */
getdns_dict * this_extensions = getdns_dict_create();
this_ret = getdns_dict_set_int(this_extensions, "return_both_v4_and_v6", GETDNS_EXTENSION_TRUE);
if (this_ret != GETDNS_RETURN_GOOD)
{
fprintf(stderr, "Trying to set an extension do both IPv4 and IPv6 failed: %d\n", this_ret);
getdns_dict_destroy(this_extensions);
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
getdns_dict * this_response = NULL;
getdns_return_t r; /* Holder for all function returns */
getdns_context *context = NULL;
getdns_dict *response = NULL;
getdns_dict *extensions = NULL;
getdns_bindata *address_data;
char *first = NULL, *second = NULL;
/* Make the call */
getdns_return_t dns_request_return = getdns_general_sync(this_context, this_name, this_request_type,
this_extensions, &this_response);
if (dns_request_return == GETDNS_RETURN_BAD_DOMAIN_NAME)
{
fprintf(stderr, "A bad domain name was used: %s. Exiting.\n", this_name);
getdns_dict_destroy(this_response);
getdns_dict_destroy(this_extensions);
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
/* Create the DNS context for this call */
if ((r = getdns_context_create(&context, 1)))
fprintf(stderr, "Trying to create the context failed");
else if (!(extensions = getdns_dict_create()))
fprintf(stderr, "Could not create extensions dict.\n");
else if ((r = getdns_dict_set_int(extensions, "return_both_v4_and_v6", GETDNS_EXTENSION_TRUE)))
fprintf(stderr, "Trying to set an extension do both IPv4 and IPv6 failed");
else if ((r = getdns_general_sync(context, "example.com", GETDNS_RRTYPE_A, extensions, &response)))
fprintf(stderr, "Error scheduling synchronous request");
else if ((r = getdns_dict_get_bindata(response, "/just_address_answers/0/address_data", &address_data)))
fprintf(stderr, "Could not get first address");
else if (!(first = getdns_display_ip_address(address_data)))
fprintf(stderr, "Could not convert first address to string\n");
else if ((r = getdns_dict_get_bindata(response, "/just_address_answers/1/address_data", &address_data)))
fprintf(stderr, "Could not get second address");
else if (!(second = getdns_display_ip_address(address_data)))
fprintf(stderr, "Could not convert second address to string\n");
if (first) {
printf("The address is %s\n", first);
free(first);
}
else
{
/* Be sure the search returned something */
uint32_t this_error;
this_ret = getdns_dict_get_int(this_response, "status", &this_error); // Ignore any error
if (this_error != GETDNS_RESPSTATUS_GOOD) // If the search didn't return "good"
{
fprintf(stderr, "The search had no results, and a return value of %d. Exiting.\n", this_error);
getdns_dict_destroy(this_response);
getdns_dict_destroy(this_extensions);
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
getdns_list * just_the_addresses_ptr;
this_ret = getdns_dict_get_list(this_response, "just_address_answers", &just_the_addresses_ptr); // Ignore any error
size_t num_addresses;
this_ret = getdns_list_get_length(just_the_addresses_ptr, &num_addresses); // Ignore any error
/* Go through each record */
for ( size_t rec_count = 0; rec_count < num_addresses; ++rec_count )
{
getdns_dict * this_address;
this_ret = getdns_list_get_dict(just_the_addresses_ptr, rec_count, &this_address); // Ignore any error
/* Just print the address */
getdns_bindata * this_address_data;
this_ret = getdns_dict_get_bindata(this_address, "address_data", &this_address_data); // Ignore any error
char *this_address_str = getdns_display_ip_address(this_address_data);
printf("The address is %s\n", this_address_str);
free(this_address_str);
}
if (second) {
printf("The address is %s\n", second);
free(second);
}
/* Clean up */
getdns_dict_destroy(this_response);
getdns_dict_destroy(this_extensions);
getdns_context_destroy(this_context);
if (response)
getdns_dict_destroy(response);
if (extensions)
getdns_dict_destroy(extensions);
if (context)
getdns_context_destroy(context);
if (r) {
assert( r != GETDNS_RETURN_GOOD );
fprintf(stderr, ": %d\n", r);
exit(EXIT_FAILURE);
}
/* Assuming we get here, leave gracefully */
exit(EXIT_SUCCESS);
}

View File

@ -1,151 +1,121 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <inttypes.h>
#include <stdio.h>
#include <getdns_libevent.h>
#define UNUSED_PARAM(x) ((void)(x))
/* Set up the callback function, which will also do the processing of the results */
void this_callbackfn(getdns_context *this_context,
getdns_callback_type_t this_callback_type,
getdns_dict *this_response,
void *this_userarg,
getdns_transaction_t this_transaction_id)
void callback(getdns_context *context,
getdns_callback_type_t callback_type,
getdns_dict *response,
void *userarg,
getdns_transaction_t transaction_id)
{
UNUSED_PARAM(this_userarg); /* Not looking at the userarg for this example */
UNUSED_PARAM(this_context); /* Not looking at the context for this example */
getdns_return_t this_ret; /* Holder for all function returns */
if (this_callback_type == GETDNS_CALLBACK_COMPLETE) /* This is a callback with data */
{
/* Be sure the search returned something */
uint32_t this_error;
this_ret = getdns_dict_get_int(this_response, "status", &this_error); // Ignore any error
if (this_error != GETDNS_RESPSTATUS_GOOD) // If the search didn't return "good"
{
fprintf(stderr, "The search had no results, and a return value of %d. Exiting.\n", this_error);
getdns_dict_destroy(this_response);
return;
}
/* Find all the answers returned */
getdns_list * these_answers;
this_ret = getdns_dict_get_list(this_response, "replies_tree", &these_answers);
if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME)
{
fprintf(stderr, "Weird: the response had no error, but also no replies_tree. Exiting.\n");
getdns_dict_destroy(this_response);
return;
}
size_t num_answers;
this_ret = getdns_list_get_length(these_answers, &num_answers);
/* Go through each answer */
for ( size_t rec_count = 0; rec_count < num_answers; ++rec_count )
{
getdns_dict * this_record;
this_ret = getdns_list_get_dict(these_answers, rec_count, &this_record); // Ignore any error
/* Get the answer section */
getdns_list * this_answer;
this_ret = getdns_dict_get_list(this_record, "answer", &this_answer); // Ignore any error
/* Get each RR in the answer section */
size_t num_rrs;
this_ret = getdns_list_get_length(this_answer, &num_rrs);
for ( size_t rr_count = 0; rr_count < num_rrs; ++rr_count )
{
getdns_dict *this_rr = NULL;
this_ret = getdns_list_get_dict(this_answer, rr_count, &this_rr); // Ignore any error
/* Get the RDATA */
getdns_dict * this_rdata = NULL;
this_ret = getdns_dict_get_dict(this_rr, "rdata", &this_rdata); // Ignore any error
/* Get the RDATA type */
uint32_t this_type;
this_ret = getdns_dict_get_int(this_rr, "type", &this_type); // Ignore any error
/* If it is type A or AAAA, print the value */
if (this_type == GETDNS_RRTYPE_A)
{
getdns_bindata * this_a_record = NULL;
this_ret = getdns_dict_get_bindata(this_rdata, "ipv4_address", &this_a_record);
if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME)
{
fprintf(stderr, "Weird: the A record at %d in record at %d had no address. Exiting.\n",
(int) rr_count, (int) rec_count);
getdns_dict_destroy(this_response);
return;
}
char *this_address_str = getdns_display_ip_address(this_a_record);
printf("The IPv4 address is %s\n", this_address_str);
free(this_address_str);
}
else if (this_type == GETDNS_RRTYPE_AAAA)
{
getdns_bindata * this_aaaa_record = NULL;
this_ret = getdns_dict_get_bindata(this_rdata, "ipv6_address", &this_aaaa_record);
if (this_ret == GETDNS_RETURN_NO_SUCH_DICT_NAME)
{
fprintf(stderr, "Weird: the AAAA record at %d in record at %d had no address. Exiting.\n",
(int) rr_count, (int) rec_count);
getdns_dict_destroy(this_response);
return;
}
char *this_address_str = getdns_display_ip_address(this_aaaa_record);
printf("The IPv6 address is %s\n", this_address_str);
free(this_address_str);
getdns_return_t r; /* Holder for all function returns */
getdns_list *replies_tree;
size_t n_replies, i;
(void) context; (void) userarg; /* unused parameters */
switch(callback_type) {
case GETDNS_CALLBACK_CANCEL:
printf("Transaction with ID %"PRIu64" was cancelled.\n", transaction_id);
return;
case GETDNS_CALLBACK_TIMEOUT:
printf("Transaction with ID %"PRIu64" timed out.\n", transaction_id);
return;
case GETDNS_CALLBACK_ERROR:
printf("An error occurred for transaction ID %"PRIu64".\n", transaction_id);
return;
default: break;
}
assert( callback_type == GETDNS_CALLBACK_COMPLETE );
if ((r = getdns_dict_get_list(response, "replies_tree", &replies_tree)))
fprintf(stderr, "Could not get \"replies_tree\" from response");
else if ((r = getdns_list_get_length(replies_tree, &n_replies)))
fprintf(stderr, "Could not get replies_tree\'s length");
else for (i = 0; i < n_replies && r == GETDNS_RETURN_GOOD; i++) {
getdns_dict *reply;
getdns_list *answer;
size_t n_answers, j;
if ((r = getdns_list_get_dict(replies_tree, i, &reply)))
fprintf(stderr, "Could not get address %zu from just_address_answers", i);
else if ((r = getdns_dict_get_list(reply, "answer", &answer)))
fprintf(stderr, "Could not get \"address_data\" from address");
else if ((r = getdns_list_get_length(answer, &n_answers)))
fprintf(stderr, "Could not get answer section\'s length");
else for (j = 0; j < n_answers && r == GETDNS_RETURN_GOOD; j++) {
getdns_dict *rr;
getdns_bindata *address = NULL;
if ((r = getdns_list_get_dict(answer, j, &rr)))
fprintf(stderr, "Could net get rr %zu from answer section", j);
else if (getdns_dict_get_bindata(rr, "/rdata/ipv4_address", &address) == GETDNS_RETURN_GOOD)
printf("The IPv4 address is ");
else if (getdns_dict_get_bindata(rr, "/rdata/ipv6_address", &address) == GETDNS_RETURN_GOOD)
printf("The IPv6 address is ");
if (address) {
char *address_str;
if (!(address_str = getdns_display_ip_address(address))) {
fprintf(stderr, "Could not convert second address to string");
r = GETDNS_RETURN_MEMORY_ERROR;
break;
}
printf("%s\n", address_str);
free(address_str);
}
}
}
else if (this_callback_type == GETDNS_CALLBACK_CANCEL)
fprintf(stderr, "The callback with ID %"PRIu64" was cancelled. Exiting.\n", this_transaction_id);
else
fprintf(stderr, "The callback got a callback_type of %d. Exiting.\n", this_callback_type);
getdns_dict_destroy(this_response);
if (r) {
assert( r != GETDNS_RETURN_GOOD );
fprintf(stderr, ": %d\n", r);
}
getdns_dict_destroy(response);
}
int main()
{
/* Create the DNS context for this call */
getdns_context *this_context = NULL;
getdns_return_t context_create_return = getdns_context_create(&this_context, 1);
if (context_create_return != GETDNS_RETURN_GOOD)
{
fprintf(stderr, "Trying to create the context failed: %d\n", context_create_return);
return(GETDNS_RETURN_GENERIC_ERROR);
}
/* Create an event base and put it in the context using the unknown function name */
struct event_base *this_event_base;
this_event_base = event_base_new();
if (this_event_base == NULL)
{
fprintf(stderr, "Trying to create the event base failed.\n");
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
(void)getdns_extension_set_libevent_base(this_context, this_event_base);
/* Set up the getdns call */
const char * this_name = "www.example.com";
char* this_userarg = "somestring"; // Could add things here to help identify this call
getdns_transaction_t this_transaction_id = 0;
getdns_return_t r; /* Holder for all function returns */
getdns_context *context = NULL;
struct event_base *event_base = NULL;
getdns_dict *extensions = NULL;
char *query_name = "www.example.com";
/* Could add things here to help identify this call */
char *userarg = NULL;
getdns_transaction_t transaction_id;
if ((r = getdns_context_create(&context, 1)))
fprintf(stderr, "Trying to create the context failed");
else if (!(event_base = event_base_new()))
fprintf(stderr, "Trying to create the event base failed.\n");
else if ((r = getdns_extension_set_libevent_base(context, event_base)))
fprintf(stderr, "Setting the event base failed");
else if ((r = getdns_address( context, query_name, extensions
, userarg, &transaction_id, callback)))
fprintf(stderr, "Error scheduling asynchronous request");
else if (event_base_dispatch(event_base) < 0)
fprintf(stderr, "Error dispatching events\n");
/* Make the call */
getdns_return_t dns_request_return = getdns_address(this_context, this_name,
NULL, this_userarg, &this_transaction_id, this_callbackfn);
if (dns_request_return == GETDNS_RETURN_BAD_DOMAIN_NAME)
{
fprintf(stderr, "A bad domain name was used: %s. Exiting.\n", this_name);
event_base_free(this_event_base);
getdns_context_destroy(this_context);
return(GETDNS_RETURN_GENERIC_ERROR);
}
else
{
/* Call the event loop */
int dispatch_return = event_base_dispatch(this_event_base);
UNUSED_PARAM(dispatch_return);
// TODO: check the return value above
}
/* Clean up */
event_base_free(this_event_base);
getdns_context_destroy(this_context);
if (event_base)
event_base_free(event_base);
if (context)
getdns_context_destroy(context);
/* Assuming we get here, leave gracefully */
exit(EXIT_SUCCESS);
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,321 +0,0 @@
#
# @configure_input@
#
# Copyright (c) 2013, Verisign, Inc., NLnet Labs
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the names of the copyright holders nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package = @PACKAGE_NAME@
version = @PACKAGE_VERSION@
tarname = @PACKAGE_TARNAME@
distdir = $(tarname)-$(version)
libversion = @GETDNS_LIBVERSION@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
have_libevent = @have_libevent@
have_libuv = @have_libuv@
have_libev = @have_libev@
# datarootdir is here to please some checkers
datarootdir=@datarootdir@
INSTALL = @INSTALL@
srcdir = @srcdir@
LIBTOOL = ../libtool
CC=@CC@
CFLAGS=-I$(srcdir) -I. @CFLAGS@
LDFLAGS=@LDFLAGS@ @LIBS@
EXTENSION_LIBEVENT_LIB=@EXTENSION_LIBEVENT_LIB@
EXTENSION_LIBEVENT_EXT_LIBS=@EXTENSION_LIBEVENT_EXT_LIBS@
EXTENSION_LIBEVENT_LDFLAGS=@EXTENSION_LIBEVENT_LDFLAGS@
EXTENSION_LIBEV_LIB=@EXTENSION_LIBEV_LIB@
EXTENSION_LIBEV_EXT_LIBS=@EXTENSION_LIBEV_EXT_LIBS@
EXTENSION_LIBEV_LDFLAGS=@EXTENSION_LIBEV_LDFLAGS@
EXTENSION_LIBUV_LIB=@EXTENSION_LIBUV_LIB@
EXTENSION_LIBUV_EXT_LIBS=@EXTENSION_LIBUV_EXT_LIBS@
EXTENSION_LIBUV_LDFLAGS=@EXTENSION_LIBUV_LDFLAGS@
C99COMPATFLAGS=@C99COMPATFLAGS@
GETDNS_OBJ=const-info.lo convert.lo dict.lo dnssec.lo general.lo \
list.lo request-internal.lo rr-dict.lo rr-iter.lo stub.lo sync.lo \
util-internal.lo
GLDNS_OBJ=keyraw.lo gbuffer.lo wire2str.lo parse.lo parseutil.lo rrdef.lo \
str2wire.lo
LIBOBJDIR=
LIBOBJS=@LIBOBJS@
COMPAT_OBJ=$(LIBOBJS:.o=.lo)
UTIL_OBJ=mini_event.lo rbtree.lo
EXTENSION_OBJ=libmini_event.lo libevent.lo libev.lo
NON_C99_OBJS=context.lo libuv.lo
.SUFFIXES: .c .o .a .lo .h
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
.c.lo:
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@
default: all
all: libgetdns.la $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBUV_LIB) $(EXTENSION_LIBEV_LIB)
$(GETDNS_OBJ):
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$(@:.lo=.c) -o $@
$(GLDNS_OBJ):
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/gldns/$(@:.lo=.c) -o $@
$(COMPAT_OBJ):
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/compat/$(@:.lo=.c) -o $@
$(UTIL_OBJ):
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/util/$(@:.lo=.c) -o $@
$(EXTENSION_OBJ):
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/extension/$(@:.lo=.c) -o $@
context.lo:
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(C99COMPATFLAGS) -c $(srcdir)/context.c -o context.lo
libuv.lo:
$(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) $(C99COMPATFLAGS) -c $(srcdir)/extension/libuv.c -o libuv.lo
install: libgetdns.la
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/getdns
$(INSTALL) -m 644 getdns/getdns.h $(DESTDIR)$(includedir)/getdns/getdns.h
$(INSTALL) -m 644 $(srcdir)/getdns/getdns_extra.h $(DESTDIR)$(includedir)/getdns/getdns_extra.h
$(INSTALL) -m 755 -d $(DESTDIR)$(libdir)
$(LIBTOOL) --mode=install cp libgetdns.la $(DESTDIR)$(libdir)
if test $(have_libevent) = 1 ; then $(INSTALL) -m 644 $(srcdir)/getdns/getdns_ext_libevent.h $(DESTDIR)$(includedir)/getdns/ ; $(LIBTOOL) --mode=install cp $(EXTENSION_LIBEVENT_LIB) $(DESTDIR)$(libdir) ; fi
if test $(have_libuv) = 1 ; then $(INSTALL) -m 644 $(srcdir)/getdns/getdns_ext_libuv.h $(DESTDIR)$(includedir)/getdns/ ; $(LIBTOOL) --mode=install cp $(EXTENSION_LIBUV_LIB) $(DESTDIR)$(libdir) ; fi
if test $(have_libev) = 1 ; then $(INSTALL) -m 644 $(srcdir)/getdns/getdns_ext_libev.h $(DESTDIR)$(includedir)/getdns/ ; $(LIBTOOL) --mode=install cp $(EXTENSION_LIBEV_LIB) $(DESTDIR)$(libdir) ; fi
$(LIBTOOL) --mode=finish $(DESTDIR)$(libdir)
uninstall:
rm -rf $(DESTDIR)$(includedir)/getdns
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/libgetdns.la
if test $(have_libevent) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBEVENT_LIB) ; fi
if test $(have_libuv) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBUV_LIB) ; fi
if test $(have_libev) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBEV_LIB) ; fi
libgetdns_ext_event.la: libgetdns.la libevent.lo
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libevent.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libevent.symbols
libgetdns_ext_uv.la: libgetdns.la libuv.lo
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libuv.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBUV_LDFLAGS) $(EXTENSION_LIBUV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libuv.symbols
libgetdns_ext_ev.la: libgetdns.la libev.lo
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libev.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEV_LDFLAGS) $(EXTENSION_LIBEV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libev.symbols
libgetdns.la: $(GETDNS_OBJ) context.lo libmini_event.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ)
$(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(GETDNS_OBJ) context.lo libmini_event.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(LDFLAGS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/libgetdns.symbols
test: FORCE
cd test && $(MAKE) $@
getdns_query: FORCE
cd test && $(MAKE) $@
clean:
cd test && $(MAKE) $@
rm -f *.o *.lo extension/*.lo extension/*.o $(PROGRAMS) libgetdns.la libgetdns_ext_*.la
rm -rf .libs extension/.libs
distclean : clean
cd test && $(MAKE) $@
rmdir test 2>/dev/null || true
rm -f Makefile config.status config.log Doxyfile config.h getdns/Makefile getdns/getdns.h
rmdir getdns 2>/dev/null || true
rmdir extension 2>/dev/null || true
rm -Rf autom4te.cache
$(distdir): FORCE
mkdir -p $(distdir)/src
cp configure.ac $(distdir)
cp configure $(distdir)
cp Makefile.in $(distdir)
cp src/Makefile.in $(distdir)/src
distcheck: $(distdir).tar.gz
gzip -cd $(distdir).tar.gz | tar xvf -
cd $(distdir) && ./configure
cd $(distdir) && $(MAKE) all
cd $(distdir) && $(MAKE) check
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
@remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`"; \
if test "$${remaining}" -ne 0; then
echo "@@@ $${remaining} file(s) remaining in stage directory!"; \
exit 1; \
fi
cd $(distdir) && $(MAKE) clean
rm -rf $(distdir)
@echo "*** Package $(distdir).tar.gz is ready for distribution"
Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && ./config.status src/Makefile
configure.status: configure
cd .. && ./config.status --recheck
depend:
(cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new )
(cd $(srcdir) ; gcc -MM -I. *.c gldns/*.c compat/*.c util/*.c extension/*.c| \
sed -e 's?gldns/?$$(srcdir)/gldns/?g' \
-e 's?compat/?$$(srcdir)/compat/?g' \
-e 's?util/?$$(srcdir)/util/?g' \
-e 's?extension/?$$(srcdir)/extension/?g' \
-e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \
-e 's? \$$(srcdir)/config\.h? config.h?g' \
-e 's? getdns/getdns_extra\.h? $$(srcdir)/getdns/getdns_extra.h?g' \
-e 's? getdns/getdns_ext_libevent\.h? $$(srcdir)/getdns/getdns_ext_libevent.h?g' \
-e 's? getdns/getdns_ext_libev\.h? $$(srcdir)/getdns/getdns_ext_libev.h?g' \
-e 's? getdns/getdns_ext_libuv\.h? $$(srcdir)/getdns/getdns_ext_libuv.h?g' \
-e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new )
(cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \
|| mv Makefile.in.new Makefile.in )
.PHONY: clean test
FORCE:
# Dependencies for gldns, utils, the extensions and compat functions
const-info.lo const-info.o: $(srcdir)/const-info.c getdns/getdns.h $(srcdir)/const-info.h
context.lo context.o: $(srcdir)/context.c config.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/context.h \
getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h \
$(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \
$(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
$(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h $(srcdir)/dnssec.h $(srcdir)/stub.h $(srcdir)/list.h
convert.lo convert.o: $(srcdir)/convert.c getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
getdns/getdns.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h $(srcdir)/types-internal.h \
$(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \
$(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h \
$(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h
dict.lo dict.o: $(srcdir)/dict.c $(srcdir)/types-internal.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h \
$(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
$(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h \
$(srcdir)/dict.h $(srcdir)/const-info.h $(srcdir)/gldns/wire2str.h
dnssec.lo dnssec.o: $(srcdir)/dnssec.c getdns/getdns.h config.h $(srcdir)/context.h \
$(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
$(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
$(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h \
$(srcdir)/gldns/gbuffer.h $(srcdir)/dnssec.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h \
$(srcdir)/general.h
general.lo general.o: $(srcdir)/general.c config.h $(srcdir)/context.h getdns/getdns.h \
$(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \
$(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
$(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h \
$(srcdir)/gldns/gbuffer.h $(srcdir)/dnssec.h $(srcdir)/stub.h
list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \
getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h \
$(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
$(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h \
$(srcdir)/list.h
request-internal.lo request-internal.o: $(srcdir)/request-internal.c config.h $(srcdir)/types-internal.h \
getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \
$(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h \
$(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
$(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h \
$(srcdir)/gldns/rrdef.h
rr-dict.lo rr-dict.o: $(srcdir)/rr-dict.c $(srcdir)/rr-dict.h getdns/getdns.h $(srcdir)/gldns/gbuffer.h \
$(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h config.h \
$(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h config.h \
$(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h \
$(srcdir)/gldns/pkthdr.h $(srcdir)/dict.h
rr-iter.lo rr-iter.o: $(srcdir)/rr-iter.c $(srcdir)/rr-iter.h getdns/getdns.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h \
$(srcdir)/gldns/gbuffer.h config.h
stub.lo stub.o: $(srcdir)/stub.c config.h $(srcdir)/stub.h getdns/getdns.h $(srcdir)/types-internal.h \
$(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/gldns/gbuffer.h \
$(srcdir)/gldns/pkthdr.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h \
$(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/util-internal.h \
$(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/general.h
sync.lo sync.o: $(srcdir)/sync.c getdns/getdns.h config.h $(srcdir)/context.h $(srcdir)/getdns/getdns_extra.h \
getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h \
config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/general.h \
$(srcdir)/util-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h \
$(srcdir)/dnssec.h $(srcdir)/stub.h $(srcdir)/gldns/wire2str.h
util-internal.lo util-internal.o: $(srcdir)/util-internal.c getdns/getdns.h $(srcdir)/dict.h $(srcdir)/util/rbtree.h \
$(srcdir)/types-internal.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/list.h \
$(srcdir)/util-internal.h $(srcdir)/context.h config.h $(srcdir)/extension/libmini_event.h config.h \
$(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \
$(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h
gbuffer.lo gbuffer.o: $(srcdir)/gldns/gbuffer.c config.h $(srcdir)/gldns/gbuffer.h
keyraw.lo keyraw.o: $(srcdir)/gldns/keyraw.c config.h $(srcdir)/gldns/keyraw.h $(srcdir)/gldns/rrdef.h
parse.lo parse.o: $(srcdir)/gldns/parse.c config.h $(srcdir)/gldns/parse.h $(srcdir)/gldns/parseutil.h \
$(srcdir)/gldns/gbuffer.h
parseutil.lo parseutil.o: $(srcdir)/gldns/parseutil.c config.h $(srcdir)/gldns/parseutil.h
rrdef.lo rrdef.o: $(srcdir)/gldns/rrdef.c config.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/parseutil.h
str2wire.lo str2wire.o: $(srcdir)/gldns/str2wire.c config.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h \
$(srcdir)/gldns/wire2str.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/parse.h $(srcdir)/gldns/parseutil.h
wire2str.lo wire2str.o: $(srcdir)/gldns/wire2str.c config.h $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h \
$(srcdir)/gldns/rrdef.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/parseutil.h $(srcdir)/gldns/gbuffer.h \
$(srcdir)/gldns/keyraw.h
arc4_lock.lo arc4_lock.o: $(srcdir)/compat/arc4_lock.c config.h
arc4random.lo arc4random.o: $(srcdir)/compat/arc4random.c config.h $(srcdir)/compat/chacha_private.h
arc4random_uniform.lo arc4random_uniform.o: $(srcdir)/compat/arc4random_uniform.c config.h
explicit_bzero.lo explicit_bzero.o: $(srcdir)/compat/explicit_bzero.c config.h
getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h
getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c config.h
getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h
getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c
sha512.lo sha512.o: $(srcdir)/compat/sha512.c config.h
strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h
mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
$(srcdir)/util/fptr_wlist.h
rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \
$(srcdir)/util/rbtree.h
libev.lo libev.o: $(srcdir)/extension/libev.c $(srcdir)/getdns/getdns_ext_libev.h getdns/getdns.h \
$(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \
$(srcdir)/getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h
libevent.lo libevent.o: $(srcdir)/extension/libevent.c $(srcdir)/getdns/getdns_ext_libevent.h \
getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \
$(srcdir)/getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h
libmini_event.lo libmini_event.o: $(srcdir)/extension/libmini_event.c $(srcdir)/extension/libmini_event.h \
config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h \
getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \
$(srcdir)/context.h config.h $(srcdir)/types-internal.h $(srcdir)/extension/libmini_event.h \
$(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h \
$(srcdir)/gldns/gbuffer.h
libuv.lo libuv.o: $(srcdir)/extension/libuv.c config.h $(srcdir)/getdns/getdns_ext_libuv.h \
getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/util-internal.h $(srcdir)/context.h \
getdns/getdns.h $(srcdir)/getdns/getdns_extra.h config.h $(srcdir)/types-internal.h \
$(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \
$(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/gbuffer.h

1639
src/anchor.c Normal file

File diff suppressed because it is too large Load Diff

83
src/anchor.h Normal file
View File

@ -0,0 +1,83 @@
/**
*
* /brief functions for DNSSEC trust anchor management
*
*/
/*
* Copyright (c) 2017, NLnet Labs
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the names of the copyright holders nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ANCHOR_H_
#define ANCHOR_H_
#include "getdns/getdns.h"
#include "getdns/getdns_extra.h"
#include <time.h>
#include "rr-iter.h"
#include "types-internal.h"
/**
** Internal functions, implemented in anchor-internal.c.
**/
void _getdns_context_equip_with_anchor(getdns_context *context, uint64_t *now_ms);
uint8_t *_getdns_tas_validate(struct mem_funcs *mf,
const getdns_bindata *xml_bd, const getdns_bindata *p7s_bd,
const getdns_bindata *crt_bd, const char *p7signer,
uint64_t *now_ms, uint8_t *tas, size_t *tas_len);
/**
** anchor.c functions used by anchor-internal.c.
**/
time_t _getdns_xml_convertdate(const char* str);
uint16_t _getdns_parse_xml_trust_anchors_buf(gldns_buffer *gbuf, uint64_t *now_ms, char *xml_data, size_t xml_len);
/**
** Public interface.
**/
void _getdns_context_equip_with_anchor(getdns_context *context, uint64_t *now_ms);
void _getdns_start_fetching_ta(
getdns_context *context, getdns_eventloop *loop, uint64_t *now_ms);
#define MAX_KSKS 16
#define RRSIG_RDATA_LEN 16
typedef struct _getdns_ksks {
size_t n;
uint16_t ids[MAX_KSKS];
size_t n_rrsigs;
uint8_t rrsigs[MAX_KSKS][RRSIG_RDATA_LEN];
} _getdns_ksks;
void _getdns_context_update_root_ksk(
getdns_context *context, _getdns_rrset *dnskey_set);
#endif
/* anchor.h */

View File

@ -34,6 +34,79 @@
#include "config.h"
#define LOCKRET(func) func
#ifdef HAVE_PTHREAD
#include "pthread.h"
static pthread_mutex_t arc_lock = PTHREAD_MUTEX_INITIALIZER;
void _ARC4_LOCK(void)
{
pthread_mutex_lock(&arc_lock);
}
void _ARC4_UNLOCK(void)
{
pthread_mutex_unlock(&arc_lock);
}
#elif defined(GETDNS_ON_WINDOWS)
/*
* There is no explicit arc4random_init call, and thus
* the critical section must be allocated on the first call to
* ARC4_LOCK(). The interlocked test is used to verify that
* the critical section will be allocated only once.
*
* The work around is for the main program to call arc4random()
* at the beginning of execution, before spinning new threads.
*
* There is also no explicit arc4random_close call, and thus
* the critical section is never deleted. It will remain allocated
* as long as the program runs.
*/
static CRITICAL_SECTION arc_critical_section;
static volatile long arc_critical_section_initialized = 0;
void _ARC4_LOCK(void)
{
long r = InterlockedCompareExchange(&arc_critical_section_initialized, 1, 0);
if (r != 2)
{
if (r == 0)
{
InitializeCriticalSection(&arc_critical_section);
arc_critical_section_initialized = 2;
}
else if (r == 1)
{
/*
* If the critical section is initialized, the first test
* will return the value 2.
*
* If several threads try to initialize the arc4random
* state "at the same time", the first one will find
* the "initialized" variable at 0, the other ones at 1.
*
* Since this is a fairly rare event, we resolve it with a
* simple active wait loop.
*/
while (arc_critical_section_initialized != 2)
{
Sleep(1);
}
}
}
EnterCriticalSection(&arc_critical_section);
}
void _ARC4_UNLOCK(void)
{
LeaveCriticalSection(&arc_critical_section);
}
#else
/* XXX - add non pthread specific lock routines here */
void _ARC4_LOCK(void)
{
}
@ -41,4 +114,4 @@ void _ARC4_LOCK(void)
void _ARC4_UNLOCK(void)
{
}
#endif

View File

@ -26,16 +26,21 @@
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#ifndef GETDNS_ON_WINDOWS
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/time.h>
#ifndef UB_ON_WINDOWS
#include <sys/mman.h>
#endif
#if defined(GETDNS_ON_WINDOWS) && !defined(MAP_INHERIT_ZERO)
#define explicit_bzero(rnd, rnd_size) memset(rnd, 0, rnd_size)
#endif
#define KEYSTREAM_ONLY
#include "chacha_private.h"
@ -46,6 +51,9 @@
#else /* !__GNUC__ */
#define inline
#endif /* !__GNUC__ */
#ifndef MAP_ANON
#define MAP_ANON MAP_ANONYMOUS
#endif
#define KEYSZ 32
#define IVSZ 8
@ -66,6 +74,72 @@ static struct {
static inline void _rs_rekey(u_char *dat, size_t datlen);
/*
* Basic sanity checking; wish we could do better.
*/
static int
fallback_gotdata(char *buf, size_t len)
{
char any_set = 0;
size_t i;
for (i = 0; i < len; ++i)
any_set |= buf[i];
if (any_set == 0)
return -1;
return 0;
}
/* fallback for getentropy in case libc returns failure */
static int
fallback_getentropy_urandom(void *buf, size_t len)
{
size_t i;
int fd, flags;
int save_errno = errno;
start:
flags = O_RDONLY;
#ifdef O_NOFOLLOW
flags |= O_NOFOLLOW;
#endif
#ifdef O_CLOEXEC
flags |= O_CLOEXEC;
#endif
fd = open("/dev/urandom", flags, 0);
if (fd == -1) {
if (errno == EINTR)
goto start;
goto nodevrandom;
}
#ifndef O_CLOEXEC
# ifdef HAVE_FCNTL
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
# endif
#endif
for (i = 0; i < len; ) {
size_t wanted = len - i;
ssize_t ret = read(fd, (char*)buf + i, wanted);
if (ret == -1) {
if (errno == EAGAIN || errno == EINTR)
continue;
close(fd);
goto nodevrandom;
}
i += ret;
}
close(fd);
if (fallback_gotdata(buf, len) == 0) {
errno = save_errno;
return 0; /* satisfied */
}
nodevrandom:
errno = EIO;
return -1;
}
static inline void
_rs_init(u_char *buf, size_t n)
{
@ -73,7 +147,7 @@ _rs_init(u_char *buf, size_t n)
return;
if (rs == NULL) {
#ifndef UB_ON_WINDOWS
#ifndef GETDNS_ON_WINDOWS
if ((rs = mmap(NULL, sizeof(*rs), PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
abort();
@ -88,7 +162,7 @@ _rs_init(u_char *buf, size_t n)
#endif
}
if (rsx == NULL) {
#ifndef UB_ON_WINDOWS
#ifndef GETDNS_ON_WINDOWS
if ((rsx = mmap(NULL, sizeof(*rsx), PROT_READ|PROT_WRITE,
MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
abort();
@ -97,6 +171,9 @@ _rs_init(u_char *buf, size_t n)
if(!rsx)
abort();
#endif
/* Pleast older clang scan-build */
if (!buf)
buf = rsx->rs_buf;
}
chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8, 0);
@ -109,11 +186,14 @@ _rs_stir(void)
u_char rnd[KEYSZ + IVSZ];
if (getentropy(rnd, sizeof rnd) == -1) {
if(errno != ENOSYS ||
fallback_getentropy_urandom(rnd, sizeof rnd) == -1) {
#ifdef SIGKILL
raise(SIGKILL);
raise(SIGKILL);
#else
exit(9); /* windows */
exit(9); /* windows */
#endif
}
}
if (!rs)
@ -132,7 +212,7 @@ _rs_stir(void)
static inline void
_rs_stir_if_needed(size_t len)
{
#ifndef MAP_INHERIT_ZERO
#if !defined(GETDNS_ON_WINDOWS) && !defined(MAP_INHERIT_ZERO)
static pid_t _rs_pid = 0;
pid_t pid = getpid();

View File

@ -6,17 +6,12 @@
#include "config.h"
#include <string.h>
__attribute__((weak)) void
__explicit_bzero_hook(void *ATTR_UNUSED(buf), size_t ATTR_UNUSED(len))
{
}
void
explicit_bzero(void *buf, size_t len)
{
#ifdef UB_ON_WINDOWS
#ifdef GETDNS_ON_WINDOWS
SecureZeroMemory(buf, len);
#endif
#else
memset(buf, 0, len);
__explicit_bzero_hook(buf, len);
#endif
}

View File

@ -46,7 +46,12 @@
#include <errno.h>
#include <unistd.h>
#include <time.h>
#if defined(HAVE_SSL)
#include <openssl/sha.h>
#elif defined(HAVE_NETTLE)
#include <nettle/sha.h>
#endif
#include <linux/types.h>
#include <linux/random.h>
@ -55,6 +60,9 @@
#include <sys/auxv.h>
#endif
#include <sys/vfs.h>
#ifndef MAP_ANON
#define MAP_ANON MAP_ANONYMOUS
#endif
#define REPEAT 5
#define min(a, b) (((a) < (b)) ? (a) : (b))
@ -67,9 +75,21 @@
HD(b); \
} while (0)
#if defined(HAVE_SSL)
#define CRYPTO_SHA512_CTX SHA512_CTX
#define CRYPTO_SHA512_INIT(x) SHA512_Init(x)
#define CRYPTO_SHA512_FINAL(r, c) SHA512_Final(r, c)
#define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l)))
#define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x)))
#define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*)))
#elif defined(HAVE_NETTLE)
#define CRYPTO_SHA512_CTX struct sha512_ctx
#define CRYPTO_SHA512_INIT(x) sha512_init(x)
#define CRYPTO_SHA512_FINAL(r, c) sha512_digest(c, SHA512_DIGEST_SIZE, r)
#define HR(x, l) (sha512_update(&ctx, (l), (uint8_t *)(x)))
#define HD(x) (sha512_update(&ctx, sizeof (x), (uint8_t *)&(x)))
#define HF(x) (sha512_update(&ctx, sizeof (void*), (uint8_t *)&(x)))
#endif
int getentropy(void *buf, size_t len);
@ -77,7 +97,7 @@ int getentropy(void *buf, size_t len);
extern int main(int, char *argv[]);
#endif
static int gotdata(char *buf, size_t len);
#ifdef SYS_getrandom
#if defined(SYS_getrandom) && defined(__NR_getrandom)
static int getentropy_getrandom(void *buf, size_t len);
#endif
static int getentropy_urandom(void *buf, size_t len);
@ -96,7 +116,7 @@ getentropy(void *buf, size_t len)
return -1;
}
#ifdef SYS_getrandom
#if defined(SYS_getrandom) && defined(__NR_getrandom)
/*
* Try descriptor-less getrandom()
*/
@ -122,7 +142,7 @@ getentropy(void *buf, size_t len)
* Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID.
* sysctl is a failsafe API, so it guarantees a result. This
* should work inside a chroot, or when file descriptors are
* exhuasted.
* exhausted.
*
* However this can fail if the Linux kernel removes support
* for sysctl. Starting in 2007, there have been efforts to
@ -192,7 +212,7 @@ gotdata(char *buf, size_t len)
return 0;
}
#ifdef SYS_getrandom
#if defined(SYS_getrandom) && defined(__NR_getrandom)
static int
getentropy_getrandom(void *buf, size_t len)
{
@ -337,7 +357,7 @@ getentropy_fallback(void *buf, size_t len)
struct rusage ru;
sigset_t sigset;
struct stat st;
SHA512_CTX ctx;
CRYPTO_SHA512_CTX ctx;
static pid_t lastpid;
pid_t pid;
size_t i, ii, m;
@ -354,7 +374,7 @@ getentropy_fallback(void *buf, size_t len)
}
for (i = 0; i < len; ) {
int j;
SHA512_Init(&ctx);
CRYPTO_SHA512_INIT(&ctx);
for (j = 0; j < repeat; j++) {
HX((e = gettimeofday(&tv, NULL)) == -1, tv);
if (e != -1) {
@ -526,7 +546,7 @@ getentropy_fallback(void *buf, size_t len)
# endif
#endif /* HAVE_GETAUXVAL */
SHA512_Final(results, &ctx);
CRYPTO_SHA512_FINAL(results, &ctx);
memcpy((char*)buf + i, results, min(sizeof(results), len - i));
i += min(sizeof(results), len - i);
}

View File

@ -30,7 +30,9 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <stdlib.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdio.h>
#include <termios.h>
#include <fcntl.h>
@ -39,10 +41,14 @@
#include <errno.h>
#include <unistd.h>
#include <time.h>
#ifdef HAVE_SYS_SHA2_H
#include <sys/sha2.h>
#define SHA512_Init SHA512Init
#define SHA512_Update SHA512Update
#define SHA512_Final SHA512Final
#else
#include "openssl/sha.h"
#endif
#include <sys/vfs.h>
#include <sys/statfs.h>

74
src/compat/gettimeofday.c Normal file
View File

@ -0,0 +1,74 @@
/*
* Copyright (c) 2016 Christian Huitema <huitema@huitema.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Numerous places in the code make reference to the Unix/Linux
* "gettimeofday()" function, which is not available in the standard
* windows libraries. This code provides a compatible implementation.
*/
#include "config.h"
#ifndef HAVE_GETTIMEOFDAY
int gettimeofday(struct timeval* tv, void* tz)
{
FILETIME ft;
uint64_t now = 0;
/*
* The GetSystemTimeAsFileTime API returns the number
* of 100-nanosecond intervals since January 1, 1601 (UTC),
* in FILETIME format.
*/
GetSystemTimeAsFileTime(&ft);
/*
* Convert to plain 64 bit format, without making
* assumptions about the FILETIME structure alignment.
*/
now |= ft.dwHighDateTime;
now <<= 32;
now |= ft.dwLowDateTime;
/*
* Convert units from 100ns to 1us
*/
now /= 10;
/*
* Account for microseconds elapsed between 1601 and 1970.
*/
now -= 11644473600000000ULL;
if (tv != NULL)
{
uint64_t sec = now / 1000000;
uint64_t usec = now % 1000000;
tv->tv_sec = (long)sec;
tv->tv_usec = (long)usec;
}
if (tz != NULL)
{
/*
* TODO: implement a timezone retrieval function.
* Not urgent, since the GetDNS code always set this parameter to NULL.
*/
return -1;
}
return 0;
}
#endif /* HAVE_GETTIMEOFDAY */

214
src/compat/inet_ntop.c Normal file
View File

@ -0,0 +1,214 @@
/* From openssh 4.3p2 compat/inet_ntop.c */
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* OPENBSD ORIGINAL: lib/libc/net/inet_ntop.c */
#include <config.h>
#include <sys/param.h>
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#include <string.h>
#include <errno.h>
#include <stdio.h>
#ifndef IN6ADDRSZ
#define IN6ADDRSZ 16 /* IPv6 T_AAAA */
#endif
#ifndef INT16SZ
#define INT16SZ 2 /* for systems without 16-bit ints */
#endif
/*
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
/* char *
* inet_ntop(af, src, dst, size)
* convert a network format address to presentation format.
* return:
* pointer to presentation format address (`dst'), or NULL (see errno).
* author:
* Paul Vixie, 1996.
*/
const char *
inet_ntop(int af, const void *src, char *dst, size_t size)
{
switch (af) {
case AF_INET:
return (inet_ntop4(src, dst, size));
case AF_INET6:
return (inet_ntop6(src, dst, size));
default:
#ifdef EAFNOSUPPORT
errno = EAFNOSUPPORT;
#else
errno = ENOSYS;
#endif
return (NULL);
}
/* NOTREACHED */
}
/* const char *
* inet_ntop4(src, dst, size)
* format an IPv4 address, more or less like inet_ntoa()
* return:
* `dst' (as a const)
* notes:
* (1) uses no statics
* (2) takes a u_char* not an in_addr as input
* author:
* Paul Vixie, 1996.
*/
static const char *
inet_ntop4(const u_char *src, char *dst, size_t size)
{
static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
int l;
l = snprintf(tmp, size, fmt, src[0], src[1], src[2], src[3]);
if (l <= 0 || l >= (int)size) {
errno = ENOSPC;
return (NULL);
}
strlcpy(dst, tmp, size);
return (dst);
}
/* const char *
* inet_ntop6(src, dst, size)
* convert IPv6 binary address into presentation (printable) format
* author:
* Paul Vixie, 1996.
*/
static const char *
inet_ntop6(const u_char *src, char *dst, size_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
* to contain a value of the specified size. On some systems, like
* Crays, there is no such thing as an integer variable with 16 bits.
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
char *tp, *ep;
struct { int base, len; } best, cur;
u_int words[IN6ADDRSZ / INT16SZ];
int i;
int advance;
/*
* Preprocess:
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
memset(words, '\0', sizeof words);
for (i = 0; i < IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1;
best.len = 0;
cur.base = -1;
cur.len = 0;
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
if (words[i] == 0) {
if (cur.base == -1)
cur.base = i, cur.len = 1;
else
cur.len++;
} else {
if (cur.base != -1) {
if (best.base == -1 || cur.len > best.len)
best = cur;
cur.base = -1;
}
}
}
if (cur.base != -1) {
if (best.base == -1 || cur.len > best.len)
best = cur;
}
if (best.base != -1 && best.len < 2)
best.base = -1;
/*
* Format the result.
*/
tp = tmp;
ep = tmp + sizeof(tmp);
for (i = 0; i < (IN6ADDRSZ / INT16SZ) && tp < ep; i++) {
/* Are we inside the best run of 0x00's? */
if (best.base != -1 && i >= best.base &&
i < (best.base + best.len)) {
if (i == best.base) {
if (tp + 1 >= ep)
return (NULL);
*tp++ = ':';
}
continue;
}
/* Are we following an initial run of 0x00s or any real hex? */
if (i != 0) {
if (tp + 1 >= ep)
return (NULL);
*tp++ = ':';
}
/* Is this address an encapsulated IPv4? */
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
if (!inet_ntop4(src+12, tp, (size_t)(ep - tp)))
return (NULL);
tp += strlen(tp);
break;
}
advance = snprintf(tp, ep - tp, "%x", words[i]);
if (advance <= 0 || advance >= ep - tp)
return (NULL);
tp += advance;
}
/* Was it a trailing run of 0x00's? */
if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) {
if (tp + 1 >= ep)
return (NULL);
*tp++ = ':';
}
if (tp + 1 >= ep)
return (NULL);
*tp++ = '\0';
/*
* Check for overflow, copy, and we're done.
*/
if ((size_t)(tp - tmp) > size) {
errno = ENOSPC;
return (NULL);
}
strlcpy(dst, tmp, size);
return (dst);
}

229
src/compat/inet_pton.c Normal file
View File

@ -0,0 +1,229 @@
/* $KAME: inet_pton.c,v 1.5 2001/08/20 02:32:40 itojun Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include <config.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
/*
* WARNING: Don't even consider trying to compile this on a system where
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
static int inet_pton4 (const char *src, uint8_t *dst);
static int inet_pton6 (const char *src, uint8_t *dst);
/*
*
* The definitions we might miss.
*
*/
#ifndef NS_INT16SZ
#define NS_INT16SZ 2
#endif
#ifndef NS_IN6ADDRSZ
#define NS_IN6ADDRSZ 16
#endif
#ifndef NS_INADDRSZ
#define NS_INADDRSZ 4
#endif
/* int
* inet_pton(af, src, dst)
* convert from presentation format (which usually means ASCII printable)
* to network format (which is usually some kind of binary format).
* return:
* 1 if the address was valid for the specified address family
* 0 if the address wasn't valid (`dst' is untouched in this case)
* -1 if some other error occurred (`dst' is untouched in this case, too)
* author:
* Paul Vixie, 1996.
*/
int
inet_pton(af, src, dst)
int af;
const char *src;
void *dst;
{
switch (af) {
case AF_INET:
return (inet_pton4(src, dst));
case AF_INET6:
return (inet_pton6(src, dst));
default:
#ifdef EAFNOSUPPORT
errno = EAFNOSUPPORT;
#else
errno = ENOSYS;
#endif
return (-1);
}
/* NOTREACHED */
}
/* int
* inet_pton4(src, dst)
* like inet_aton() but without all the hexadecimal and shorthand.
* return:
* 1 if `src' is a valid dotted quad, else 0.
* notice:
* does not touch `dst' unless it's returning 1.
* author:
* Paul Vixie, 1996.
*/
static int
inet_pton4(src, dst)
const char *src;
uint8_t *dst;
{
static const char digits[] = "0123456789";
int saw_digit, octets, ch;
uint8_t tmp[NS_INADDRSZ], *tp;
saw_digit = 0;
octets = 0;
*(tp = tmp) = 0;
while ((ch = *src++) != '\0') {
const char *pch;
if ((pch = strchr(digits, ch)) != NULL) {
uint32_t new = *tp * 10 + (pch - digits);
if (new > 255)
return (0);
*tp = new;
if (! saw_digit) {
if (++octets > 4)
return (0);
saw_digit = 1;
}
} else if (ch == '.' && saw_digit) {
if (octets == 4)
return (0);
*++tp = 0;
saw_digit = 0;
} else
return (0);
}
if (octets < 4)
return (0);
memcpy(dst, tmp, NS_INADDRSZ);
return (1);
}
/* int
* inet_pton6(src, dst)
* convert presentation level address to network order binary form.
* return:
* 1 if `src' is a valid [RFC1884 2.2] address, else 0.
* notice:
* (1) does not touch `dst' unless it's returning 1.
* (2) :: in a full address is silently ignored.
* credit:
* inspired by Mark Andrews.
* author:
* Paul Vixie, 1996.
*/
static int
inet_pton6(src, dst)
const char *src;
uint8_t *dst;
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
uint8_t tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
uint32_t val;
memset((tp = tmp), '\0', NS_IN6ADDRSZ);
endp = tp + NS_IN6ADDRSZ;
colonp = NULL;
/* Leading :: requires some special handling. */
if (*src == ':')
if (*++src != ':')
return (0);
curtok = src;
saw_xdigit = 0;
val = 0;
while ((ch = *src++) != '\0') {
const char *pch;
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
pch = strchr((xdigits = xdigits_u), ch);
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
if (val > 0xffff)
return (0);
saw_xdigit = 1;
continue;
}
if (ch == ':') {
curtok = src;
if (!saw_xdigit) {
if (colonp)
return (0);
colonp = tp;
continue;
}
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (uint8_t) (val >> 8) & 0xff;
*tp++ = (uint8_t) val & 0xff;
saw_xdigit = 0;
val = 0;
continue;
}
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
if (saw_xdigit) {
if (tp + NS_INT16SZ > endp)
return (0);
*tp++ = (uint8_t) (val >> 8) & 0xff;
*tp++ = (uint8_t) val & 0xff;
}
if (colonp != NULL) {
/*
* Since some memmove()'s erroneously fail to handle
* overlapping regions, we'll do the shift by hand.
*/
const int n = tp - colonp;
int i;
for (i = 1; i <= n; i++) {
endp[- i] = colonp[n - i];
colonp[n - i] = 0;
}
tp = endp;
}
if (tp != endp)
return (0);
memcpy(dst, tmp, NS_IN6ADDRSZ);
return (1);
}

43
src/compat/mkstemp.c Normal file
View File

@ -0,0 +1,43 @@
/**
* \file mkstemp.c
* @brief Implementation of mkstemp for Windows.
*/
/*
* Copyright (c) 2019 Sinodun
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the names of the copyright holders nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
int mkstemp(char *template)
{
if (_mktemp_s(template, strlen(template) + 1) != 0)
return -1;
return open(template, _O_CREAT | _O_EXCL | _O_RDWR, _S_IWRITE | _S_IREAD);
}

View File

@ -70,7 +70,7 @@ unsigned char *SHA512(void *data, unsigned int data_len, unsigned char *digest);
* Please make sure that your system defines BYTE_ORDER. If your
* architecture is little-endian, make sure it also defines
* LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are
* equivilent.
* equivalent.
*
* If your system does not define the above, then you can do so by
* hand like this:

View File

@ -18,7 +18,6 @@
/* OPENBSD ORIGINAL: lib/libc/string/strlcpy.c */
#include <config.h>
#ifndef HAVE_STRLCPY
#include <sys/types.h>
#include <string.h>
@ -53,5 +52,3 @@ strlcpy(char *dst, const char *src, size_t siz)
return(s - src - 1); /* count does not include NUL */
}
#endif /* !HAVE_STRLCPY */

345
src/compat/strptime.c Normal file
View File

@ -0,0 +1,345 @@
/** strptime workaround (for oa macos leopard)
* This strptime follows the man strptime (2001-11-12)
* conforming to SUSv2, POSIX.1-2001
*
* This very simple version of strptime has no:
* - E alternatives
* - O alternatives
* - Glibc additions
* - Does not process week numbers
* - Does not properly processes year day
*
* LICENSE
* Copyright (c) 2008, NLnet Labs, Matthijs Mekking
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NLnetLabs nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
**/
#include "config.h"
#ifndef HAVE_CONFIG_H
#include <time.h>
#endif
#ifndef STRPTIME_WORKS
#define TM_YEAR_BASE 1900
#include <ctype.h>
#include <string.h>
static const char *abb_weekdays[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL
};
static const char *full_weekdays[] = {
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday", NULL
};
static const char *abb_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL
};
static const char *full_months[] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December", NULL
};
static const char *ampm[] = {
"am", "pm", NULL
};
static int
match_string(const char **buf, const char **strs)
{
int i = 0;
for (i = 0; strs[i] != NULL; i++) {
int len = strlen(strs[i]);
if (strncasecmp (*buf, strs[i], len) == 0) {
*buf += len;
return i;
}
}
return -1;
}
static int
str2int(const char **buf, int max)
{
int ret=0, count=0;
while (*buf[0] != '\0' && isdigit((unsigned char)*buf[0]) && count<max) {
ret = ret*10 + (*buf[0] - '0');
(*buf)++;
count++;
}
if (!count)
return -1;
return ret;
}
/** Converts the character string s to values which are stored in tm
* using the format specified by format
**/
char *
unbound_strptime(const char *s, const char *format, struct tm *tm)
{
int c, ret;
int split_year = 0;
while ((c = *format) != '\0') {
/* whitespace, literal or format */
if (isspace((unsigned char)c)) { /* whitespace */
/** whitespace matches zero or more whitespace characters in the
* input string.
**/
while (isspace((unsigned char)*s))
s++;
}
else if (c == '%') { /* format */
format++;
c = *format;
switch (c) {
case '%': /* %% is converted to % */
if (*s != c) {
return NULL;
}
s++;
break;
case 'a': /* weekday name, abbreviated or full */
case 'A':
ret = match_string(&s, full_weekdays);
if (ret < 0)
ret = match_string(&s, abb_weekdays);
if (ret < 0) {
return NULL;
}
tm->tm_wday = ret;
break;
case 'b': /* month name, abbreviated or full */
case 'B':
case 'h':
ret = match_string(&s, full_months);
if (ret < 0)
ret = match_string(&s, abb_months);
if (ret < 0) {
return NULL;
}
tm->tm_mon = ret;
break;
case 'c': /* date and time representation */
if (!(s = unbound_strptime(s, "%x %X", tm))) {
return NULL;
}
break;
case 'C': /* century number */
ret = str2int(&s, 2);
if (ret < 0 || ret > 99) { /* must be in [00,99] */
return NULL;
}
if (split_year) {
tm->tm_year = ret*100 + (tm->tm_year%100);
}
else {
tm->tm_year = ret*100 - TM_YEAR_BASE;
split_year = 1;
}
break;
case 'd': /* day of month */
case 'e':
ret = str2int(&s, 2);
if (ret < 1 || ret > 31) { /* must be in [01,31] */
return NULL;
}
tm->tm_mday = ret;
break;
case 'D': /* equivalent to %m/%d/%y */
if (!(s = unbound_strptime(s, "%m/%d/%y", tm))) {
return NULL;
}
break;
case 'H': /* hour */
ret = str2int(&s, 2);
if (ret < 0 || ret > 23) { /* must be in [00,23] */
return NULL;
}
tm->tm_hour = ret;
break;
case 'I': /* 12hr clock hour */
ret = str2int(&s, 2);
if (ret < 1 || ret > 12) { /* must be in [01,12] */
return NULL;
}
if (ret == 12) /* actually [0,11] */
ret = 0;
tm->tm_hour = ret;
break;
case 'j': /* day of year */
ret = str2int(&s, 2);
if (ret < 1 || ret > 366) { /* must be in [001,366] */
return NULL;
}
tm->tm_yday = ret;
break;
case 'm': /* month */
ret = str2int(&s, 2);
if (ret < 1 || ret > 12) { /* must be in [01,12] */
return NULL;
}
/* months go from 0-11 */
tm->tm_mon = (ret-1);
break;
case 'M': /* minute */
ret = str2int(&s, 2);
if (ret < 0 || ret > 59) { /* must be in [00,59] */
return NULL;
}
tm->tm_min = ret;
break;
case 'n': /* arbitrary whitespace */
case 't':
while (isspace((unsigned char)*s))
s++;
break;
case 'p': /* am pm */
ret = match_string(&s, ampm);
if (ret < 0) {
return NULL;
}
if (tm->tm_hour < 0 || tm->tm_hour > 11) { /* %I */
return NULL;
}
if (ret == 1) /* pm */
tm->tm_hour += 12;
break;
case 'r': /* equivalent of %I:%M:%S %p */
if (!(s = unbound_strptime(s, "%I:%M:%S %p", tm))) {
return NULL;
}
break;
case 'R': /* equivalent of %H:%M */
if (!(s = unbound_strptime(s, "%H:%M", tm))) {
return NULL;
}
break;
case 'S': /* seconds */
ret = str2int(&s, 2);
/* 60 may occur for leap seconds */
/* earlier 61 was also allowed */
if (ret < 0 || ret > 60) { /* must be in [00,60] */
return NULL;
}
tm->tm_sec = ret;
break;
case 'T': /* equivalent of %H:%M:%S */
if (!(s = unbound_strptime(s, "%H:%M:%S", tm))) {
return NULL;
}
break;
case 'U': /* week number, with the first Sun of Jan being w1 */
ret = str2int(&s, 2);
if (ret < 0 || ret > 53) { /* must be in [00,53] */
return NULL;
}
/** it is hard (and not necessary for nsd) to determine time
* data from week number.
**/
break;
case 'w': /* day of week */
ret = str2int(&s, 1);
if (ret < 0 || ret > 6) { /* must be in [0,6] */
return NULL;
}
tm->tm_wday = ret;
break;
case 'W': /* week number, with the first Mon of Jan being w1 */
ret = str2int(&s, 2);
if (ret < 0 || ret > 53) { /* must be in [00,53] */
return NULL;
}
/** it is hard (and not necessary for nsd) to determine time
* data from week number.
**/
break;
case 'x': /* date format */
if (!(s = unbound_strptime(s, "%m/%d/%y", tm))) {
return NULL;
}
break;
case 'X': /* time format */
if (!(s = unbound_strptime(s, "%H:%M:%S", tm))) {
return NULL;
}
break;
case 'y': /* last two digits of a year */
ret = str2int(&s, 2);
if (ret < 0 || ret > 99) { /* must be in [00,99] */
return NULL;
}
if (split_year) {
tm->tm_year = ((tm->tm_year/100) * 100) + ret;
}
else {
split_year = 1;
/** currently:
* if in [0,68] we are in 21th century,
* if in [69,99] we are in 20th century.
**/
if (ret < 69) /* 2000 */
ret += 100;
tm->tm_year = ret;
}
break;
case 'Y': /* year */
ret = str2int(&s, 4);
if (ret < 0 || ret > 9999) {
return NULL;
}
tm->tm_year = ret - TM_YEAR_BASE;
break;
case '\0':
default: /* unsupported, cannot match format */
return NULL;
break;
}
}
else { /* literal */
/* if input cannot match format, return NULL */
if (*s != c)
return NULL;
s++;
}
format++;
}
/* return pointer to remainder of s */
return (char*) s;
}
#endif /* STRPTIME_WORKS */

View File

@ -1,361 +0,0 @@
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Define this to enable the experimental draft edns cookies. */
#undef EDNS_COOKIES
/* The edns cookie option code. */
#undef EDNS_COOKIE_OPCODE
/* How often the edns client cookie is refreshed. */
#undef EDNS_COOKIE_ROLLOVER_TIME
/* Define to 1 if you have the `arc4random' function. */
#undef HAVE_ARC4RANDOM
/* Define to 1 if you have the `arc4random_uniform' function. */
#undef HAVE_ARC4RANDOM_UNIFORM
/* Define to 1 if you have the <arpa/inet.h> header file. */
#undef HAVE_ARPA_INET_H
/* Whether the C compiler accepts the "format" attribute */
#undef HAVE_ATTR_FORMAT
/* Whether the C compiler accepts the "unused" attribute */
#undef HAVE_ATTR_UNUSED
/* Define to 1 if you have the <bsd/string.h> header file. */
#undef HAVE_BSD_STRING_H
/* Define to 1 if you have the declaration of `arc4random', and to 0 if you
don't. */
#undef HAVE_DECL_ARC4RANDOM
/* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
if you don't. */
#undef HAVE_DECL_ARC4RANDOM_UNIFORM
/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
don't. */
#undef HAVE_DECL_STRLCPY
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <event2/event.h> header file. */
#undef HAVE_EVENT2_EVENT_H
/* Define to 1 if you have the `event_base_free' function. */
#undef HAVE_EVENT_BASE_FREE
/* Define to 1 if you have the `event_base_new' function. */
#undef HAVE_EVENT_BASE_NEW
/* Define to 1 if you have the <event.h> header file. */
#undef HAVE_EVENT_H
/* Define to 1 if you have the <ev.h> header file. */
#undef HAVE_EV_H
/* Define to 1 if you have the `fcntl' function. */
#undef HAVE_FCNTL
/* Define to 1 if you have the `getauxval' function. */
#undef HAVE_GETAUXVAL
/* Define to 1 if you have the `getentropy' function. */
#undef HAVE_GETENTROPY
/* If you have HMAC_CTX_init */
#undef HAVE_HMAC_CTX_INIT
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* if the function 'ioctlsocket' is available */
#undef HAVE_IOCTLSOCKET
/* Define to 1 if you have the <libev/ev.h> header file. */
#undef HAVE_LIBEV_EV_H
/* Define to 1 if you have the `idn' library (-lidn). */
#undef HAVE_LIBIDN
/* Define to 1 if you have the `ldns' library (-lldns). */
#undef HAVE_LIBLDNS
/* Define to 1 if you have the `unbound' library (-lunbound). */
#undef HAVE_LIBUNBOUND
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
/* Define to 1 if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H
/* Does libuv have the new uv_time_cb signature */
#undef HAVE_NEW_UV_TIMER_CB
/* Define to 1 if you have the <openssl/err.h> header file. */
#undef HAVE_OPENSSL_ERR_H
/* Define to 1 if you have the <openssl/rand.h> header file. */
#undef HAVE_OPENSSL_RAND_H
/* Define to 1 if you have the <openssl/ssl.h> header file. */
#undef HAVE_OPENSSL_SSL_H
/* Define to 1 if you have the `SHA512_Update' function. */
#undef HAVE_SHA512_UPDATE
/* Define if you have the SSL libraries installed. */
#undef HAVE_SSL
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strlcpy' function. */
#undef HAVE_STRLCPY
/* Define to 1 if you have the <sys/sha2.h> header file. */
#undef HAVE_SYS_SHA2_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/sysctl.h> header file. */
#undef HAVE_SYS_SYSCTL_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the <uv.h> header file. */
#undef HAVE_UV_H
/* When defined ldns_dnssec_zone contained the hashed_names member. */
#undef LDNS_DNSSEC_ZONE_HASHED_NAMES
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define this to enable the very experimental and broken native stub DNSSEC
support. */
#undef STUB_NATIVE_DNSSEC
/* System configuration dir */
#undef SYSCONFDIR
/* Default trust anchor file */
#undef TRUST_ANCHOR_FILE
/* Needed for sync stub resolver functions */
#undef USE_MINI_EVENT
/* Define this to enable TCP fast open. */
#undef USE_TCP_FASTOPEN
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT64_T
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT8_T
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef uint16_t
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef uint32_t
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef uint64_t
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
#undef uint8_t
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#if STDC_HEADERS
#include <stdlib.h>
#include <stddef.h>
#endif
#if !defined(HAVE_STRLCPY) || !HAVE_DECL_STRLCPY
size_t strlcpy(char *dst, const char *src, size_t siz);
#else
#define __BSD_VISIBLE 1
#endif
#if !defined(HAVE_ARC4RANDOM) || !HAVE_DECL_ARC4RANDOM
uint32_t arc4random(void);
#endif
#if !defined(HAVE_ARC4RANDOM_UNIFORM) || !HAVE_DECL_ARC4RANDOM_UNIFORM
uint32_t arc4random_uniform(uint32_t upper_bound);
#endif
#ifndef HAVE_ARC4RANDOM
void explicit_bzero(void* buf, size_t len);
int getentropy(void* buf, size_t len);
void arc4random_buf(void* buf, size_t n);
void _ARC4_LOCK(void);
void _ARC4_UNLOCK(void);
#endif
#ifdef COMPAT_SHA512
#ifndef SHA512_DIGEST_LENGTH
#define SHA512_BLOCK_LENGTH 128
#define SHA512_DIGEST_LENGTH 64
#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
typedef struct _SHA512_CTX {
uint64_t state[8];
uint64_t bitcount[2];
uint8_t buffer[SHA512_BLOCK_LENGTH];
} SHA512_CTX;
#endif /* SHA512_DIGEST_LENGTH */
void SHA512_Init(SHA512_CTX*);
void SHA512_Update(SHA512_CTX*, void*, size_t);
void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
#endif /* COMPAT_SHA512 */
#ifdef __cplusplus
}
#endif
/** Use on-board gldns */
#define USE_GLDNS 1
#ifdef HAVE_SSL
# define GLDNS_BUILD_CONFIG_HAVE_SSL 1
#endif
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <assert.h>
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_ATTR_FORMAT
# define ATTR_FORMAT(archetype, string_index, first_to_check) \
__attribute__ ((format (archetype, string_index, first_to_check)))
#else /* !HAVE_ATTR_FORMAT */
# define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
#endif /* !HAVE_ATTR_FORMAT */
#if defined(DOXYGEN)
# define ATTR_UNUSED(x) x
#elif defined(__cplusplus)
# define ATTR_UNUSED(x)
#elif defined(HAVE_ATTR_UNUSED)
# define ATTR_UNUSED(x) x __attribute__((unused))
#else /* !HAVE_ATTR_UNUSED */
# define ATTR_UNUSED(x) x
#endif /* !HAVE_ATTR_UNUSED */
/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
#ifdef HAVE_WINSOCK2_H
#define FD_SET_T (u_int)
#else
#define FD_SET_T
#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef HAVE_BSD_STRING_H
#include <bsd/string.h>
#endif

View File

@ -3,79 +3,132 @@
*/
#include <stdlib.h>
#include "getdns/getdns.h"
#include "getdns/getdns_extra.h"
#include "const-info.h"
#include <string.h>
static struct const_info consts_info[] = {
{ -1, NULL, "/* <unknown getdns value> */" },
{ 0, "GETDNS_RETURN_GOOD", GETDNS_RETURN_GOOD_TEXT },
{ 1, "GETDNS_RETURN_GENERIC_ERROR", GETDNS_RETURN_GENERIC_ERROR_TEXT },
{ 300, "GETDNS_RETURN_BAD_DOMAIN_NAME", GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT },
{ 301, "GETDNS_RETURN_BAD_CONTEXT", GETDNS_RETURN_BAD_CONTEXT_TEXT },
{ 302, "GETDNS_RETURN_CONTEXT_UPDATE_FAIL", GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT },
{ 303, "GETDNS_RETURN_UNKNOWN_TRANSACTION", GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT },
{ 304, "GETDNS_RETURN_NO_SUCH_LIST_ITEM", GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT },
{ 305, "GETDNS_RETURN_NO_SUCH_DICT_NAME", GETDNS_RETURN_NO_SUCH_DICT_NAME_TEXT },
{ 306, "GETDNS_RETURN_WRONG_TYPE_REQUESTED", GETDNS_RETURN_WRONG_TYPE_REQUESTED_TEXT },
{ 307, "GETDNS_RETURN_NO_SUCH_EXTENSION", GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT },
{ 308, "GETDNS_RETURN_EXTENSION_MISFORMAT", GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT },
{ 309, "GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED", GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT },
{ 310, "GETDNS_RETURN_MEMORY_ERROR", GETDNS_RETURN_MEMORY_ERROR_TEXT },
{ 311, "GETDNS_RETURN_INVALID_PARAMETER", GETDNS_RETURN_INVALID_PARAMETER_TEXT },
{ 400, "GETDNS_DNSSEC_SECURE", GETDNS_DNSSEC_SECURE_TEXT },
{ 401, "GETDNS_DNSSEC_BOGUS", GETDNS_DNSSEC_BOGUS_TEXT },
{ 402, "GETDNS_DNSSEC_INDETERMINATE", GETDNS_DNSSEC_INDETERMINATE_TEXT },
{ 403, "GETDNS_DNSSEC_INSECURE", GETDNS_DNSSEC_INSECURE_TEXT },
{ 404, "GETDNS_DNSSEC_NOT_PERFORMED", GETDNS_DNSSEC_NOT_PERFORMED_TEXT },
{ 500, "GETDNS_NAMESPACE_DNS", GETDNS_NAMESPACE_DNS_TEXT },
{ 501, "GETDNS_NAMESPACE_LOCALNAMES", GETDNS_NAMESPACE_LOCALNAMES_TEXT },
{ 502, "GETDNS_NAMESPACE_NETBIOS", GETDNS_NAMESPACE_NETBIOS_TEXT },
{ 503, "GETDNS_NAMESPACE_MDNS", GETDNS_NAMESPACE_MDNS_TEXT },
{ 504, "GETDNS_NAMESPACE_NIS", GETDNS_NAMESPACE_NIS_TEXT },
{ 520, "GETDNS_RESOLUTION_STUB", GETDNS_RESOLUTION_STUB_TEXT },
{ 521, "GETDNS_RESOLUTION_RECURSING", GETDNS_RESOLUTION_RECURSING_TEXT },
{ 530, "GETDNS_REDIRECTS_FOLLOW", GETDNS_REDIRECTS_FOLLOW_TEXT },
{ 531, "GETDNS_REDIRECTS_DO_NOT_FOLLOW", GETDNS_REDIRECTS_DO_NOT_FOLLOW_TEXT },
{ 540, "GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP", GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP_TEXT },
{ 541, "GETDNS_TRANSPORT_UDP_ONLY", GETDNS_TRANSPORT_UDP_ONLY_TEXT },
{ 542, "GETDNS_TRANSPORT_TCP_ONLY", GETDNS_TRANSPORT_TCP_ONLY_TEXT },
{ 543, "GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN", GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN_TEXT },
{ 550, "GETDNS_APPEND_NAME_ALWAYS", GETDNS_APPEND_NAME_ALWAYS_TEXT },
{ 551, "GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE", GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE_TEXT },
{ 552, "GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE", GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE_TEXT },
{ 553, "GETDNS_APPEND_NAME_NEVER", GETDNS_APPEND_NAME_NEVER_TEXT },
{ 600, "GETDNS_CONTEXT_CODE_NAMESPACES", GETDNS_CONTEXT_CODE_NAMESPACES_TEXT },
{ 601, "GETDNS_CONTEXT_CODE_RESOLUTION_TYPE", GETDNS_CONTEXT_CODE_RESOLUTION_TYPE_TEXT },
{ 602, "GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS", GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS_TEXT },
{ 603, "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS_TEXT },
{ 604, "GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS", GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS_TEXT },
{ 605, "GETDNS_CONTEXT_CODE_DNS_TRANSPORT", GETDNS_CONTEXT_CODE_DNS_TRANSPORT_TEXT },
{ 606, "GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES", GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES_TEXT },
{ 607, "GETDNS_CONTEXT_CODE_APPEND_NAME", GETDNS_CONTEXT_CODE_APPEND_NAME_TEXT },
{ 608, "GETDNS_CONTEXT_CODE_SUFFIX", GETDNS_CONTEXT_CODE_SUFFIX_TEXT },
{ 609, "GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS", GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS_TEXT },
{ 610, "GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE", GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE_TEXT },
{ 611, "GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE", GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE_TEXT },
{ 612, "GETDNS_CONTEXT_CODE_EDNS_VERSION", GETDNS_CONTEXT_CODE_EDNS_VERSION_TEXT },
{ 613, "GETDNS_CONTEXT_CODE_EDNS_DO_BIT", GETDNS_CONTEXT_CODE_EDNS_DO_BIT_TEXT },
{ 614, "GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW", GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW_TEXT },
{ 615, "GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS", GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS_TEXT },
{ 616, "GETDNS_CONTEXT_CODE_TIMEOUT", GETDNS_CONTEXT_CODE_TIMEOUT_TEXT },
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },
{ 703, "GETDNS_CALLBACK_ERROR", GETDNS_CALLBACK_ERROR_TEXT },
{ 800, "GETDNS_NAMETYPE_DNS", GETDNS_NAMETYPE_DNS_TEXT },
{ 801, "GETDNS_NAMETYPE_WINS", GETDNS_NAMETYPE_WINS_TEXT },
{ 900, "GETDNS_RESPSTATUS_GOOD", GETDNS_RESPSTATUS_GOOD_TEXT },
{ 901, "GETDNS_RESPSTATUS_NO_NAME", GETDNS_RESPSTATUS_NO_NAME_TEXT },
{ 902, "GETDNS_RESPSTATUS_ALL_TIMEOUT", GETDNS_RESPSTATUS_ALL_TIMEOUT_TEXT },
{ 903, "GETDNS_RESPSTATUS_NO_SECURE_ANSWERS", GETDNS_RESPSTATUS_NO_SECURE_ANSWERS_TEXT },
{ 904, "GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS", GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS_TEXT },
{ 1000, "GETDNS_EXTENSION_TRUE", GETDNS_EXTENSION_TRUE_TEXT },
{ 1001, "GETDNS_EXTENSION_FALSE", GETDNS_EXTENSION_FALSE_TEXT },
{ 1100, "GETDNS_BAD_DNS_CNAME_IN_TARGET", GETDNS_BAD_DNS_CNAME_IN_TARGET_TEXT },
{ 1101, "GETDNS_BAD_DNS_ALL_NUMERIC_LABEL", GETDNS_BAD_DNS_ALL_NUMERIC_LABEL_TEXT },
{ 1102, "GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE", GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE_TEXT },
{ -1, NULL, "/* <unknown getdns value> */" },
{ 0, "GETDNS_RETURN_GOOD", GETDNS_RETURN_GOOD_TEXT },
{ 1, "GETDNS_RETURN_GENERIC_ERROR", GETDNS_RETURN_GENERIC_ERROR_TEXT },
{ 2, "GETDNS_LOG_CRIT", GETDNS_LOG_CRIT_TEXT },
{ 3, "GETDNS_LOG_ERR", GETDNS_LOG_ERR_TEXT },
{ 4, "GETDNS_LOG_WARNING", GETDNS_LOG_WARNING_TEXT },
{ 5, "GETDNS_LOG_NOTICE", GETDNS_LOG_NOTICE_TEXT },
{ 6, "GETDNS_LOG_INFO", GETDNS_LOG_INFO_TEXT },
{ 7, "GETDNS_LOG_DEBUG", GETDNS_LOG_DEBUG_TEXT },
{ 300, "GETDNS_RETURN_BAD_DOMAIN_NAME", GETDNS_RETURN_BAD_DOMAIN_NAME_TEXT },
{ 301, "GETDNS_RETURN_BAD_CONTEXT", GETDNS_RETURN_BAD_CONTEXT_TEXT },
{ 302, "GETDNS_RETURN_CONTEXT_UPDATE_FAIL", GETDNS_RETURN_CONTEXT_UPDATE_FAIL_TEXT },
{ 303, "GETDNS_RETURN_UNKNOWN_TRANSACTION", GETDNS_RETURN_UNKNOWN_TRANSACTION_TEXT },
{ 304, "GETDNS_RETURN_NO_SUCH_LIST_ITEM", GETDNS_RETURN_NO_SUCH_LIST_ITEM_TEXT },
{ 305, "GETDNS_RETURN_NO_SUCH_DICT_NAME", GETDNS_RETURN_NO_SUCH_DICT_NAME_TEXT },
{ 306, "GETDNS_RETURN_WRONG_TYPE_REQUESTED", GETDNS_RETURN_WRONG_TYPE_REQUESTED_TEXT },
{ 307, "GETDNS_RETURN_NO_SUCH_EXTENSION", GETDNS_RETURN_NO_SUCH_EXTENSION_TEXT },
{ 308, "GETDNS_RETURN_EXTENSION_MISFORMAT", GETDNS_RETURN_EXTENSION_MISFORMAT_TEXT },
{ 309, "GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED", GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED_TEXT },
{ 310, "GETDNS_RETURN_MEMORY_ERROR", GETDNS_RETURN_MEMORY_ERROR_TEXT },
{ 311, "GETDNS_RETURN_INVALID_PARAMETER", GETDNS_RETURN_INVALID_PARAMETER_TEXT },
{ 312, "GETDNS_RETURN_NOT_IMPLEMENTED", GETDNS_RETURN_NOT_IMPLEMENTED_TEXT },
{ 397, "GETDNS_RETURN_IO_ERROR", GETDNS_RETURN_IO_ERROR_TEXT },
{ 398, "GETDNS_RETURN_NO_UPSTREAM_AVAILABLE", GETDNS_RETURN_NO_UPSTREAM_AVAILABLE_TEXT },
{ 399, "GETDNS_RETURN_NEED_MORE_SPACE", GETDNS_RETURN_NEED_MORE_SPACE_TEXT },
{ 400, "GETDNS_DNSSEC_SECURE", GETDNS_DNSSEC_SECURE_TEXT },
{ 401, "GETDNS_DNSSEC_BOGUS", GETDNS_DNSSEC_BOGUS_TEXT },
{ 402, "GETDNS_DNSSEC_INDETERMINATE", GETDNS_DNSSEC_INDETERMINATE_TEXT },
{ 403, "GETDNS_DNSSEC_INSECURE", GETDNS_DNSSEC_INSECURE_TEXT },
{ 404, "GETDNS_DNSSEC_NOT_PERFORMED", GETDNS_DNSSEC_NOT_PERFORMED_TEXT },
{ 500, "GETDNS_NAMESPACE_DNS", GETDNS_NAMESPACE_DNS_TEXT },
{ 501, "GETDNS_NAMESPACE_LOCALNAMES", GETDNS_NAMESPACE_LOCALNAMES_TEXT },
{ 502, "GETDNS_NAMESPACE_NETBIOS", GETDNS_NAMESPACE_NETBIOS_TEXT },
{ 503, "GETDNS_NAMESPACE_MDNS", GETDNS_NAMESPACE_MDNS_TEXT },
{ 504, "GETDNS_NAMESPACE_NIS", GETDNS_NAMESPACE_NIS_TEXT },
{ 520, "GETDNS_RESOLUTION_STUB", GETDNS_RESOLUTION_STUB_TEXT },
{ 521, "GETDNS_RESOLUTION_RECURSING", GETDNS_RESOLUTION_RECURSING_TEXT },
{ 530, "GETDNS_REDIRECTS_FOLLOW", GETDNS_REDIRECTS_FOLLOW_TEXT },
{ 531, "GETDNS_REDIRECTS_DO_NOT_FOLLOW", GETDNS_REDIRECTS_DO_NOT_FOLLOW_TEXT },
{ 540, "GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP", GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP_TEXT },
{ 541, "GETDNS_TRANSPORT_UDP_ONLY", GETDNS_TRANSPORT_UDP_ONLY_TEXT },
{ 542, "GETDNS_TRANSPORT_TCP_ONLY", GETDNS_TRANSPORT_TCP_ONLY_TEXT },
{ 543, "GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN", GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN_TEXT },
{ 544, "GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN", GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN_TEXT },
{ 545, "GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN", GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN_TEXT },
{ 550, "GETDNS_APPEND_NAME_ALWAYS", GETDNS_APPEND_NAME_ALWAYS_TEXT },
{ 551, "GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE", GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE_TEXT },
{ 552, "GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE", GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE_TEXT },
{ 553, "GETDNS_APPEND_NAME_NEVER", GETDNS_APPEND_NAME_NEVER_TEXT },
{ 554, "GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST", GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST_TEXT },
{ 600, "GETDNS_CONTEXT_CODE_NAMESPACES", GETDNS_CONTEXT_CODE_NAMESPACES_TEXT },
{ 601, "GETDNS_CONTEXT_CODE_RESOLUTION_TYPE", GETDNS_CONTEXT_CODE_RESOLUTION_TYPE_TEXT },
{ 602, "GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS", GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS_TEXT },
{ 603, "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS_TEXT },
{ 604, "GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS", GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS_TEXT },
{ 605, "GETDNS_CONTEXT_CODE_DNS_TRANSPORT", GETDNS_CONTEXT_CODE_DNS_TRANSPORT_TEXT },
{ 606, "GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES", GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES_TEXT },
{ 607, "GETDNS_CONTEXT_CODE_APPEND_NAME", GETDNS_CONTEXT_CODE_APPEND_NAME_TEXT },
{ 608, "GETDNS_CONTEXT_CODE_SUFFIX", GETDNS_CONTEXT_CODE_SUFFIX_TEXT },
{ 609, "GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS", GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS_TEXT },
{ 610, "GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE", GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE_TEXT },
{ 611, "GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE", GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE_TEXT },
{ 612, "GETDNS_CONTEXT_CODE_EDNS_VERSION", GETDNS_CONTEXT_CODE_EDNS_VERSION_TEXT },
{ 613, "GETDNS_CONTEXT_CODE_EDNS_DO_BIT", GETDNS_CONTEXT_CODE_EDNS_DO_BIT_TEXT },
{ 614, "GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW", GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW_TEXT },
{ 615, "GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS", GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS_TEXT },
{ 616, "GETDNS_CONTEXT_CODE_TIMEOUT", GETDNS_CONTEXT_CODE_TIMEOUT_TEXT },
{ 617, "GETDNS_CONTEXT_CODE_IDLE_TIMEOUT", GETDNS_CONTEXT_CODE_IDLE_TIMEOUT_TEXT },
{ 618, "GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION", GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION_TEXT },
{ 619, "GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE", GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE_TEXT },
{ 620, "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE_TEXT },
{ 621, "GETDNS_CONTEXT_CODE_PUBKEY_PINSET", GETDNS_CONTEXT_CODE_PUBKEY_PINSET_TEXT },
{ 622, "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS_TEXT },
{ 623, "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME_TEXT },
{ 624, "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES_TEXT },
{ 625, "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_URL", GETDNS_CONTEXT_CODE_TRUST_ANCHORS_URL_TEXT },
{ 626, "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_VERIFY_CA", GETDNS_CONTEXT_CODE_TRUST_ANCHORS_VERIFY_CA_TEXT },
{ 627, "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_VERIFY_EMAIL", GETDNS_CONTEXT_CODE_TRUST_ANCHORS_VERIFY_EMAIL_TEXT },
{ 628, "GETDNS_CONTEXT_CODE_APPDATA_DIR", GETDNS_CONTEXT_CODE_APPDATA_DIR_TEXT },
{ 629, "GETDNS_CONTEXT_CODE_RESOLVCONF", GETDNS_CONTEXT_CODE_RESOLVCONF_TEXT },
{ 630, "GETDNS_CONTEXT_CODE_HOSTS", GETDNS_CONTEXT_CODE_HOSTS_TEXT },
{ 631, "GETDNS_CONTEXT_CODE_TLS_CA_PATH", GETDNS_CONTEXT_CODE_TLS_CA_PATH_TEXT },
{ 632, "GETDNS_CONTEXT_CODE_TLS_CA_FILE", GETDNS_CONTEXT_CODE_TLS_CA_FILE_TEXT },
{ 633, "GETDNS_CONTEXT_CODE_TLS_CIPHER_LIST", GETDNS_CONTEXT_CODE_TLS_CIPHER_LIST_TEXT },
{ 634, "GETDNS_CONTEXT_CODE_TLS_CURVES_LIST", GETDNS_CONTEXT_CODE_TLS_CURVES_LIST_TEXT },
{ 635, "GETDNS_CONTEXT_CODE_TLS_CIPHERSUITES", GETDNS_CONTEXT_CODE_TLS_CIPHERSUITES_TEXT },
{ 636, "GETDNS_CONTEXT_CODE_TLS_MIN_VERSION", GETDNS_CONTEXT_CODE_TLS_MIN_VERSION_TEXT },
{ 637, "GETDNS_CONTEXT_CODE_TLS_MAX_VERSION", GETDNS_CONTEXT_CODE_TLS_MAX_VERSION_TEXT },
{ 638, "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_BACKOFF_TIME", GETDNS_CONTEXT_CODE_TRUST_ANCHORS_BACKOFF_TIME_TEXT },
{ 699, "GETDNS_CONTEXT_CODE_MAX_BACKOFF_VALUE", GETDNS_CONTEXT_CODE_MAX_BACKOFF_VALUE_TEXT },
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },
{ 703, "GETDNS_CALLBACK_ERROR", GETDNS_CALLBACK_ERROR_TEXT },
{ 800, "GETDNS_NAMETYPE_DNS", GETDNS_NAMETYPE_DNS_TEXT },
{ 801, "GETDNS_NAMETYPE_WINS", GETDNS_NAMETYPE_WINS_TEXT },
{ 900, "GETDNS_RESPSTATUS_GOOD", GETDNS_RESPSTATUS_GOOD_TEXT },
{ 901, "GETDNS_RESPSTATUS_NO_NAME", GETDNS_RESPSTATUS_NO_NAME_TEXT },
{ 902, "GETDNS_RESPSTATUS_ALL_TIMEOUT", GETDNS_RESPSTATUS_ALL_TIMEOUT_TEXT },
{ 903, "GETDNS_RESPSTATUS_NO_SECURE_ANSWERS", GETDNS_RESPSTATUS_NO_SECURE_ANSWERS_TEXT },
{ 904, "GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS", GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS_TEXT },
{ 1000, "GETDNS_EXTENSION_TRUE", GETDNS_EXTENSION_TRUE_TEXT },
{ 1001, "GETDNS_EXTENSION_FALSE", GETDNS_EXTENSION_FALSE_TEXT },
{ 1100, "GETDNS_BAD_DNS_CNAME_IN_TARGET", GETDNS_BAD_DNS_CNAME_IN_TARGET_TEXT },
{ 1101, "GETDNS_BAD_DNS_ALL_NUMERIC_LABEL", GETDNS_BAD_DNS_ALL_NUMERIC_LABEL_TEXT },
{ 1102, "GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE", GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE_TEXT },
{ 1200, "GETDNS_TRANSPORT_UDP", GETDNS_TRANSPORT_UDP_TEXT },
{ 1201, "GETDNS_TRANSPORT_TCP", GETDNS_TRANSPORT_TCP_TEXT },
{ 1202, "GETDNS_TRANSPORT_TLS", GETDNS_TRANSPORT_TLS_TEXT },
{ 1300, "GETDNS_AUTHENTICATION_NONE", GETDNS_AUTHENTICATION_NONE_TEXT },
{ 1301, "GETDNS_AUTHENTICATION_REQUIRED", GETDNS_AUTHENTICATION_REQUIRED_TEXT },
{ 1400, "GETDNS_SSL3", GETDNS_SSL3_TEXT },
{ 1401, "GETDNS_TLS1", GETDNS_TLS1_TEXT },
{ 1402, "GETDNS_TLS1_1", GETDNS_TLS1_1_TEXT },
{ 1403, "GETDNS_TLS1_2", GETDNS_TLS1_2_TEXT },
{ 1404, "GETDNS_TLS1_3", GETDNS_TLS1_3_TEXT },
{ 8192, "GETDNS_LOG_SYS_STUB", GETDNS_LOG_SYS_STUB_TEXT },
{ 12288, "GETDNS_LOG_UPSTREAM_STATS", GETDNS_LOG_UPSTREAM_STATS_TEXT },
{ 16384, "GETDNS_LOG_SYS_RECURSING", GETDNS_LOG_SYS_RECURSING_TEXT },
{ 24576, "GETDNS_LOG_SYS_RESOLVING", GETDNS_LOG_SYS_RESOLVING_TEXT },
{ 32768, "GETDNS_LOG_SYS_ANCHOR", GETDNS_LOG_SYS_ANCHOR_TEXT },
};
static int const_info_cmp(const void *a, const void *b)
@ -83,7 +136,7 @@ static int const_info_cmp(const void *a, const void *b)
return ((struct const_info *) a)->code - ((struct const_info *) b)->code;
}
struct const_info *
priv_getdns_get_const_info(int value)
_getdns_get_const_info(int value)
{
struct const_info key = { value, "", "" };
struct const_info *i = bsearch(&key, consts_info,
@ -106,3 +159,267 @@ getdns_get_errorstr_by_id(uint16_t err)
else
return NULL;
}
static struct const_name_info consts_name_info[] = {
{ "GETDNS_APPEND_NAME_ALWAYS", 550 },
{ "GETDNS_APPEND_NAME_NEVER", 553 },
{ "GETDNS_APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE", 552 },
{ "GETDNS_APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE", 551 },
{ "GETDNS_APPEND_NAME_TO_SINGLE_LABEL_FIRST", 554 },
{ "GETDNS_AUTHENTICATION_NONE", 1300 },
{ "GETDNS_AUTHENTICATION_REQUIRED", 1301 },
{ "GETDNS_BAD_DNS_ALL_NUMERIC_LABEL", 1101 },
{ "GETDNS_BAD_DNS_CNAME_IN_TARGET", 1100 },
{ "GETDNS_BAD_DNS_CNAME_RETURNED_FOR_OTHER_TYPE", 1102 },
{ "GETDNS_CALLBACK_CANCEL", 701 },
{ "GETDNS_CALLBACK_COMPLETE", 700 },
{ "GETDNS_CALLBACK_ERROR", 703 },
{ "GETDNS_CALLBACK_TIMEOUT", 702 },
{ "GETDNS_CONTEXT_CODE_APPDATA_DIR", 628 },
{ "GETDNS_CONTEXT_CODE_APPEND_NAME", 607 },
{ "GETDNS_CONTEXT_CODE_DNSSEC_ALLOWED_SKEW", 614 },
{ "GETDNS_CONTEXT_CODE_DNSSEC_TRUST_ANCHORS", 609 },
{ "GETDNS_CONTEXT_CODE_DNS_ROOT_SERVERS", 604 },
{ "GETDNS_CONTEXT_CODE_DNS_TRANSPORT", 605 },
{ "GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE", 619 },
{ "GETDNS_CONTEXT_CODE_EDNS_DO_BIT", 613 },
{ "GETDNS_CONTEXT_CODE_EDNS_EXTENDED_RCODE", 611 },
{ "GETDNS_CONTEXT_CODE_EDNS_MAXIMUM_UDP_PAYLOAD_SIZE", 610 },
{ "GETDNS_CONTEXT_CODE_EDNS_VERSION", 612 },
{ "GETDNS_CONTEXT_CODE_FOLLOW_REDIRECTS", 602 },
{ "GETDNS_CONTEXT_CODE_HOSTS", 630 },
{ "GETDNS_CONTEXT_CODE_IDLE_TIMEOUT", 617 },
{ "GETDNS_CONTEXT_CODE_LIMIT_OUTSTANDING_QUERIES", 606 },
{ "GETDNS_CONTEXT_CODE_MAX_BACKOFF_VALUE", 699 },
{ "GETDNS_CONTEXT_CODE_MEMORY_FUNCTIONS", 615 },
{ "GETDNS_CONTEXT_CODE_NAMESPACES", 600 },
{ "GETDNS_CONTEXT_CODE_PUBKEY_PINSET", 621 },
{ "GETDNS_CONTEXT_CODE_RESOLUTION_TYPE", 601 },
{ "GETDNS_CONTEXT_CODE_RESOLVCONF", 629 },
{ "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", 622 },
{ "GETDNS_CONTEXT_CODE_SUFFIX", 608 },
{ "GETDNS_CONTEXT_CODE_TIMEOUT", 616 },
{ "GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION", 618 },
{ "GETDNS_CONTEXT_CODE_TLS_BACKOFF_TIME", 623 },
{ "GETDNS_CONTEXT_CODE_TLS_CA_FILE", 632 },
{ "GETDNS_CONTEXT_CODE_TLS_CA_PATH", 631 },
{ "GETDNS_CONTEXT_CODE_TLS_CIPHERSUITES", 635 },
{ "GETDNS_CONTEXT_CODE_TLS_CIPHER_LIST", 633 },
{ "GETDNS_CONTEXT_CODE_TLS_CONNECTION_RETRIES", 624 },
{ "GETDNS_CONTEXT_CODE_TLS_CURVES_LIST", 634 },
{ "GETDNS_CONTEXT_CODE_TLS_MAX_VERSION", 637 },
{ "GETDNS_CONTEXT_CODE_TLS_MIN_VERSION", 636 },
{ "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", 620 },
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_BACKOFF_TIME", 638 },
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_URL", 625 },
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_VERIFY_CA", 626 },
{ "GETDNS_CONTEXT_CODE_TRUST_ANCHORS_VERIFY_EMAIL", 627 },
{ "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", 603 },
{ "GETDNS_DNSSEC_BOGUS", 401 },
{ "GETDNS_DNSSEC_INDETERMINATE", 402 },
{ "GETDNS_DNSSEC_INSECURE", 403 },
{ "GETDNS_DNSSEC_NOT_PERFORMED", 404 },
{ "GETDNS_DNSSEC_SECURE", 400 },
{ "GETDNS_EXTENSION_FALSE", 1001 },
{ "GETDNS_EXTENSION_TRUE", 1000 },
{ "GETDNS_LOG_ALERT", 1 },
{ "GETDNS_LOG_CRIT", 2 },
{ "GETDNS_LOG_DEBUG", 7 },
{ "GETDNS_LOG_EMERG", 0 },
{ "GETDNS_LOG_ERR", 3 },
{ "GETDNS_LOG_INFO", 6 },
{ "GETDNS_LOG_NOTICE", 5 },
{ "GETDNS_LOG_SYS_ANCHOR", 32768 },
{ "GETDNS_LOG_SYS_RECURSING", 16384 },
{ "GETDNS_LOG_SYS_RESOLVING", 24576 },
{ "GETDNS_LOG_SYS_STUB", 8192 },
{ "GETDNS_LOG_UPSTREAM_STATS", 12288 },
{ "GETDNS_LOG_WARNING", 4 },
{ "GETDNS_NAMESPACE_DNS", 500 },
{ "GETDNS_NAMESPACE_LOCALNAMES", 501 },
{ "GETDNS_NAMESPACE_MDNS", 503 },
{ "GETDNS_NAMESPACE_NETBIOS", 502 },
{ "GETDNS_NAMESPACE_NIS", 504 },
{ "GETDNS_NAMETYPE_DNS", 800 },
{ "GETDNS_NAMETYPE_WINS", 801 },
{ "GETDNS_OPCODE_IQUERY", 1 },
{ "GETDNS_OPCODE_NOTIFY", 4 },
{ "GETDNS_OPCODE_QUERY", 0 },
{ "GETDNS_OPCODE_STATUS", 2 },
{ "GETDNS_OPCODE_UPDATE", 5 },
{ "GETDNS_RCODE_BADALG", 21 },
{ "GETDNS_RCODE_BADCOOKIE", 23 },
{ "GETDNS_RCODE_BADKEY", 17 },
{ "GETDNS_RCODE_BADMODE", 19 },
{ "GETDNS_RCODE_BADNAME", 20 },
{ "GETDNS_RCODE_BADSIG", 16 },
{ "GETDNS_RCODE_BADTIME", 18 },
{ "GETDNS_RCODE_BADTRUNC", 22 },
{ "GETDNS_RCODE_BADVERS", 16 },
{ "GETDNS_RCODE_FORMERR", 1 },
{ "GETDNS_RCODE_NOERROR", 0 },
{ "GETDNS_RCODE_NOTAUTH", 9 },
{ "GETDNS_RCODE_NOTIMP", 4 },
{ "GETDNS_RCODE_NOTZONE", 10 },
{ "GETDNS_RCODE_NXDOMAIN", 3 },
{ "GETDNS_RCODE_NXRRSET", 8 },
{ "GETDNS_RCODE_REFUSED", 5 },
{ "GETDNS_RCODE_SERVFAIL", 2 },
{ "GETDNS_RCODE_YXDOMAIN", 6 },
{ "GETDNS_RCODE_YXRRSET", 7 },
{ "GETDNS_REDIRECTS_DO_NOT_FOLLOW", 531 },
{ "GETDNS_REDIRECTS_FOLLOW", 530 },
{ "GETDNS_RESOLUTION_RECURSING", 521 },
{ "GETDNS_RESOLUTION_STUB", 520 },
{ "GETDNS_RESPSTATUS_ALL_BOGUS_ANSWERS", 904 },
{ "GETDNS_RESPSTATUS_ALL_TIMEOUT", 902 },
{ "GETDNS_RESPSTATUS_GOOD", 900 },
{ "GETDNS_RESPSTATUS_NO_NAME", 901 },
{ "GETDNS_RESPSTATUS_NO_SECURE_ANSWERS", 903 },
{ "GETDNS_RETURN_BAD_CONTEXT", 301 },
{ "GETDNS_RETURN_BAD_DOMAIN_NAME", 300 },
{ "GETDNS_RETURN_CONTEXT_UPDATE_FAIL", 302 },
{ "GETDNS_RETURN_DNSSEC_WITH_STUB_DISALLOWED", 309 },
{ "GETDNS_RETURN_EXTENSION_MISFORMAT", 308 },
{ "GETDNS_RETURN_GENERIC_ERROR", 1 },
{ "GETDNS_RETURN_GOOD", 0 },
{ "GETDNS_RETURN_INVALID_PARAMETER", 311 },
{ "GETDNS_RETURN_IO_ERROR", 397 },
{ "GETDNS_RETURN_MEMORY_ERROR", 310 },
{ "GETDNS_RETURN_NEED_MORE_SPACE", 399 },
{ "GETDNS_RETURN_NOT_IMPLEMENTED", 312 },
{ "GETDNS_RETURN_NO_SUCH_DICT_NAME", 305 },
{ "GETDNS_RETURN_NO_SUCH_EXTENSION", 307 },
{ "GETDNS_RETURN_NO_SUCH_LIST_ITEM", 304 },
{ "GETDNS_RETURN_NO_UPSTREAM_AVAILABLE", 398 },
{ "GETDNS_RETURN_UNKNOWN_TRANSACTION", 303 },
{ "GETDNS_RETURN_WRONG_TYPE_REQUESTED", 306 },
{ "GETDNS_RRCLASS_ANY", 255 },
{ "GETDNS_RRCLASS_CH", 3 },
{ "GETDNS_RRCLASS_HS", 4 },
{ "GETDNS_RRCLASS_IN", 1 },
{ "GETDNS_RRCLASS_NONE", 254 },
{ "GETDNS_RRTYPE_A", 1 },
{ "GETDNS_RRTYPE_A6", 38 },
{ "GETDNS_RRTYPE_AAAA", 28 },
{ "GETDNS_RRTYPE_AFSDB", 18 },
{ "GETDNS_RRTYPE_AMTRELAY", 260 },
{ "GETDNS_RRTYPE_ANY", 255 },
{ "GETDNS_RRTYPE_APL", 42 },
{ "GETDNS_RRTYPE_ATMA", 34 },
{ "GETDNS_RRTYPE_AVC", 258 },
{ "GETDNS_RRTYPE_AXFR", 252 },
{ "GETDNS_RRTYPE_CAA", 257 },
{ "GETDNS_RRTYPE_CDNSKEY", 60 },
{ "GETDNS_RRTYPE_CDS", 59 },
{ "GETDNS_RRTYPE_CERT", 37 },
{ "GETDNS_RRTYPE_CNAME", 5 },
{ "GETDNS_RRTYPE_CSYNC", 62 },
{ "GETDNS_RRTYPE_DHCID", 49 },
{ "GETDNS_RRTYPE_DLV", 32769 },
{ "GETDNS_RRTYPE_DNAME", 39 },
{ "GETDNS_RRTYPE_DNSKEY", 48 },
{ "GETDNS_RRTYPE_DOA", 259 },
{ "GETDNS_RRTYPE_DS", 43 },
{ "GETDNS_RRTYPE_EID", 31 },
{ "GETDNS_RRTYPE_EUI48", 108 },
{ "GETDNS_RRTYPE_EUI64", 109 },
{ "GETDNS_RRTYPE_GID", 102 },
{ "GETDNS_RRTYPE_GPOS", 27 },
{ "GETDNS_RRTYPE_HINFO", 13 },
{ "GETDNS_RRTYPE_HIP", 55 },
{ "GETDNS_RRTYPE_HTTPS", 65 },
{ "GETDNS_RRTYPE_IPSECKEY", 45 },
{ "GETDNS_RRTYPE_ISDN", 20 },
{ "GETDNS_RRTYPE_IXFR", 251 },
{ "GETDNS_RRTYPE_KEY", 25 },
{ "GETDNS_RRTYPE_KX", 36 },
{ "GETDNS_RRTYPE_L32", 105 },
{ "GETDNS_RRTYPE_L64", 106 },
{ "GETDNS_RRTYPE_LOC", 29 },
{ "GETDNS_RRTYPE_LP", 107 },
{ "GETDNS_RRTYPE_MAILA", 254 },
{ "GETDNS_RRTYPE_MAILB", 253 },
{ "GETDNS_RRTYPE_MB", 7 },
{ "GETDNS_RRTYPE_MD", 3 },
{ "GETDNS_RRTYPE_MF", 4 },
{ "GETDNS_RRTYPE_MG", 8 },
{ "GETDNS_RRTYPE_MINFO", 14 },
{ "GETDNS_RRTYPE_MR", 9 },
{ "GETDNS_RRTYPE_MX", 15 },
{ "GETDNS_RRTYPE_NAPTR", 35 },
{ "GETDNS_RRTYPE_NID", 104 },
{ "GETDNS_RRTYPE_NIMLOC", 32 },
{ "GETDNS_RRTYPE_NINFO", 56 },
{ "GETDNS_RRTYPE_NS", 2 },
{ "GETDNS_RRTYPE_NSAP", 22 },
{ "GETDNS_RRTYPE_NSAP_PTR", 23 },
{ "GETDNS_RRTYPE_NSEC", 47 },
{ "GETDNS_RRTYPE_NSEC3", 50 },
{ "GETDNS_RRTYPE_NSEC3PARAM", 51 },
{ "GETDNS_RRTYPE_NULL", 10 },
{ "GETDNS_RRTYPE_NXT", 30 },
{ "GETDNS_RRTYPE_OPENPGPKEY", 61 },
{ "GETDNS_RRTYPE_OPT", 41 },
{ "GETDNS_RRTYPE_PTR", 12 },
{ "GETDNS_RRTYPE_PX", 26 },
{ "GETDNS_RRTYPE_RKEY", 57 },
{ "GETDNS_RRTYPE_RP", 17 },
{ "GETDNS_RRTYPE_RRSIG", 46 },
{ "GETDNS_RRTYPE_RT", 21 },
{ "GETDNS_RRTYPE_SIG", 24 },
{ "GETDNS_RRTYPE_SINK", 40 },
{ "GETDNS_RRTYPE_SMIMEA", 53 },
{ "GETDNS_RRTYPE_SOA", 6 },
{ "GETDNS_RRTYPE_SPF", 99 },
{ "GETDNS_RRTYPE_SRV", 33 },
{ "GETDNS_RRTYPE_SSHFP", 44 },
{ "GETDNS_RRTYPE_SVCB", 64 },
{ "GETDNS_RRTYPE_TA", 32768 },
{ "GETDNS_RRTYPE_TALINK", 58 },
{ "GETDNS_RRTYPE_TKEY", 249 },
{ "GETDNS_RRTYPE_TLSA", 52 },
{ "GETDNS_RRTYPE_TSIG", 250 },
{ "GETDNS_RRTYPE_TXT", 16 },
{ "GETDNS_RRTYPE_UID", 101 },
{ "GETDNS_RRTYPE_UINFO", 100 },
{ "GETDNS_RRTYPE_UNSPEC", 103 },
{ "GETDNS_RRTYPE_URI", 256 },
{ "GETDNS_RRTYPE_WKS", 11 },
{ "GETDNS_RRTYPE_X25", 19 },
{ "GETDNS_RRTYPE_ZONEMD", 63 },
{ "GETDNS_SSL3", 1400 },
{ "GETDNS_TLS1", 1401 },
{ "GETDNS_TLS1_1", 1402 },
{ "GETDNS_TLS1_2", 1403 },
{ "GETDNS_TLS1_3", 1404 },
{ "GETDNS_TRANSPORT_TCP", 1201 },
{ "GETDNS_TRANSPORT_TCP_ONLY", 542 },
{ "GETDNS_TRANSPORT_TCP_ONLY_KEEP_CONNECTIONS_OPEN", 543 },
{ "GETDNS_TRANSPORT_TLS", 1202 },
{ "GETDNS_TRANSPORT_TLS_FIRST_AND_FALL_BACK_TO_TCP_KEEP_CONNECTIONS_OPEN", 545 },
{ "GETDNS_TRANSPORT_TLS_ONLY_KEEP_CONNECTIONS_OPEN", 544 },
{ "GETDNS_TRANSPORT_UDP", 1200 },
{ "GETDNS_TRANSPORT_UDP_FIRST_AND_FALL_BACK_TO_TCP", 540 },
{ "GETDNS_TRANSPORT_UDP_ONLY", 541 },
};
static int const_name_info_cmp(const void *a, const void *b)
{
return strcmp( ((struct const_name_info *) a)->name
, ((struct const_name_info *) b)->name );
}
int
_getdns_get_const_name_info(const char *name, uint32_t *code)
{
struct const_name_info key = { name, 0 };
struct const_name_info *i = bsearch(&key, consts_name_info,
sizeof(consts_name_info) / sizeof(struct const_name_info),
sizeof(struct const_name_info), const_name_info_cmp);
if (!i)
return 0;
if (code)
*code = i->code;
return 1;
}

View File

@ -1,9 +1,9 @@
/**
*
* /brief priv_getdns_consts table with values, names and descriptions of the
* /brief _getdns_consts table with values, names and descriptions of the
* constants in getdns
*
* The priv_getdns_get_validation_chain function is called after an answer
* The _getdns_get_validation_chain function is called after an answer
* has been fetched when the dnssec_return_validation_chain extension is set.
* It fetches DNSKEYs, DSes and their signatures for all RRSIGs found in the
* answer.
@ -39,13 +39,28 @@
#ifndef CONST_INFO_H_
#define CONST_INFO_H_
#include "getdns/getdns.h"
#include "getdns/getdns_extra.h"
#ifndef GETDNS_CONTEXT_CODE_MAX_BACKOFF_VALUE
#define GETDNS_CONTEXT_CODE_MAX_BACKOFF_VALUE 699
#define GETDNS_CONTEXT_CODE_MAX_BACKOFF_VALUE_TEXT "Change related to getdns_context_set_max_backoff_value"
#endif
struct const_info {
int code;
const char *name;
const char *text;
};
struct const_info *priv_getdns_get_const_info(int value);
struct const_info *_getdns_get_const_info(int value);
struct const_name_info {
const char *name;
uint32_t code;
};
int _getdns_get_const_name_info(const char *name, uint32_t *code);
#endif

Some files were not shown because too many files have changed in this diff Show More