Commit Graph
90 Commits
Author SHA1 Message Date
khorben c1d3656f0b Code cleanup 2018-08-20 11:02:17 +02:00
khorben 70df56f73c Only support IPv4 on Windows 2018-08-20 11:02:17 +02:00
khorben 159c62c8ef Re-indent 2018-08-20 11:02:16 +02:00
khorben 561ba964f3 Resolve hostnames to IPv6 addresses in IPv6 mode 2018-08-20 11:02:16 +02:00
khorben fd6def040f Remove useless code 2018-08-20 11:02:16 +02:00
khorben 81e2255912 Update a comment 2018-08-20 11:02:16 +02:00
khorben 15dfc94e9c Fix the build on Linux (iptables) 2018-08-20 11:02:16 +02:00
khorben 08e805da53 Optimize moot variable initialization away 2018-08-20 11:02:16 +02:00
khorben 37a8000aa2 Protect some more headers for inclusion 2018-08-20 11:02:15 +02:00
khorben a525734afc Also include <netinet/ip6.h> where relevant 2018-08-20 11:02:15 +02:00
khorben aea56f54c4 Implement is_valid_ip_addr() with getaddrinfo() 2018-08-20 11:02:14 +02:00
khorben b3494dcfc1 Migrate is_valid_ipv4_addr() to a more generic function
It is now called is_valid_ip_addr() and expects an additional parameter
for the address family.
2018-08-20 10:59:27 +02:00
Michael Rash 69291b91fa [test suite] add invalid ALLOW_IP test 2018-08-11 08:23:41 -07:00
khorben 5228fe88d0 Avoid compilation warnings from ctype(3) helpers
Characters should be casted as unsigned before use in functions from
<ctype.h>. Otherwise the compiler treats 8-bit characters (eg UTF-8) as
negative values (since it expects signed integers) and they no longer
match the comparison tables. Worse, the character 0xff gets interpreted
as -1 (like EOF). In turn, it helps to explicitly cast the result as a
signed integer, since this is what is expected. Characters in the range
0x80-0xff do keep their original values.

See the manual page for ctype(3) for more details (eg from NetBSD)
2018-06-12 14:01:22 -04:00
khorben 4d88f08f56 Let fwknop build on NetBSD 2018-04-25 03:47:56 +02:00
Michael Rash 08c6a9d4e2 [test suite] trigger a couple of -p errors for code coverage 2016-05-24 19:00:58 -07:00
Michael Rash 975093c546 minor sha3_256 string conversion bug fix 2016-05-13 09:04:13 -07:00
Jonathan Bennett fc1a436ff5 Adds the is_valid_hostname() c-unit-tests 2016-05-07 21:59:48 -05:00
Jonathan Bennett 65e0c4abd6 Add is_valid_hostname() 2016-05-07 21:59:48 -05:00
Jonathan Bennett 5f80a1ae33 Adds is_valid_ipv4_addr() c-unit tests 2016-05-07 21:59:48 -05:00
Jonathan Bennett dc9ad5de4a Adds a length modifier to is_valid_ipv4_addr 2016-05-07 21:59:48 -05:00
Jonathan Bennett 58bce15b1e Exclude the CUnit tests themselves from lcov 2016-05-02 13:17:03 -05:00
Jonathan Bennett d939deb811 Spelling corrections, found using the codespell tool. 2016-04-10 12:03:59 -05:00
Damien Stuart 4fc9d05660 Tweaks for MINGW builds 2016-01-17 13:09:15 -05:00
Damien Stuart e4fffdf44c Changes to fix the native Windows build. 2016-01-17 10:45:51 -05:00
Jonathan Bennett 83961750b3 Add ifdef for mingw compilation 2016-01-10 22:48:07 -06:00
Jonathan Bennett a3e0d1cc1b clean up whitespace problems 2016-01-02 20:18:12 -06:00
Jonathan Bennett 9bb70fa17a Add Doxygen headers for common files 2016-01-01 03:02:17 +00:00
Jonathan Bennett dda7fa39c1 Disable client side nat_dns 2015-12-31 19:24:45 +00:00
Jonathan Bennett 748803aef7 Add length checks for nat_access messages 2015-12-31 04:40:41 +00:00
Jonathan Bennett bc55f0f21f Add count_characters and a CUnit test series for it. 2015-12-31 04:14:58 +00:00
Jonathan Bennett 56be13b3f6 Add dns resolution for nat access 2015-12-31 04:13:46 +00:00
Jonathan Bennett d9f9cb8ad5 Add SHA3 and HMAC-SHA3 support 2015-12-30 20:32:52 +00:00
Michael Rash a85b081f79 copyright update 2015-12-23 14:34:51 -05:00
Michael Rash 2fad399db3 promote hex_dump() to fko_util 2015-12-16 19:28:10 -08:00
Michael Rash 998fb96f0b promote argv handling functions to fko_util (avoids duplication across client and server) 2015-12-16 18:59:10 -08:00
Michael Rash f230c32371 promote chop_* functions into fko_util 2015-12-16 18:00:57 -08:00
Damien Stuart a4309ad768 Added clean up for .gcno and .gcda files (left went c-unit-tests are enabled. 2015-09-05 15:20:22 -04:00
Damien Stuart 2e60687dcf Merge branch 'master' into dstuart_refactor_autoconf 2015-08-29 12:46:24 -04:00
Michael Rash 416023723f minor #define addition 2015-07-11 21:28:56 -04:00
Michael Rash ceb1713976 add --key-gen option to fwknopd (suggested by Jonathan Bennett) 2015-05-20 08:55:17 -07:00
Damien Stuart e4fae829bc Refactor of Makefile.am files to fix issues caused by referencing source files in other directories - which broke make dist and make distclean targets. 2015-02-17 14:37:20 -05:00
Damien Stuart b152d15970 Refactored how the cunit tests are processed so "make dist" does not fail and builds with c-unit-tests enabled work on systems with firewalld (added fw_util_firewalld.c for server tests). 2015-02-14 12:29:30 -05:00
Michael Rash e8cfeaf772 Merge pull request #142 from fjoncourt/c_unit_testing
C unit testing - excellent, thank you Franck. I'll work on the relative path issue you mentioned as well.
2015-01-17 09:11:29 -05:00
Michael Rash 6b7a3bbdae [server] Add FORWARD_ALL access.conf wildcard
This is a significant commit that allows iptables firewalls to be used
as an "SPA gateway" for all ports/protocols upon providing a valid SPA
packet. Additional commits will be made to extend this capability, but
this commit adds two new access.conf keywords: FORWARD_ALL and
DISABLE_DNAT. These are used in conjunction to add ACCEPT rules for all
ports/protocols in the FORWARD chain, and also disable DNAT rules at the
same time. Then, by buildling the SNAT chain to provide translation for
an internal network (where an SPA cliet is located), but DROP all
forwarded traffic by default at the same time, SPA can be used to gain
access to the internet. So, this would allow, say, an RFC 1918 internal
network to have IP's assigned via DHCP but they wouldn't be able to
access the internet before sending a SPA packet to the gateway. This
scenario was suggested by spartan1833 to the fwknop list and tracked via
github issue 131.

Additional commits will be made to fully support this feature.
2015-01-17 08:38:32 -05:00
Franck Joncourt 1c81aef39d Fixed file permissions 2014-12-31 09:51:08 +01:00
Franck Joncourt 5c3a709014 Merge branch 'c_unit_testing' of https://github.com/fjoncourt/fwknop into c_unit_testing
Conflicts:
	client/config_init.c
	common/cunit_common.h
	lib/cunit_common.c
	server/access.c
2014-12-28 23:24:15 +01:00
Franck Joncourt b7ecb3334a Merge upstream changes to our changes 2014-12-28 15:00:24 +01:00
Michael Rash b5fe62bfc7 [test suite] command exec too many args tests 2014-10-26 16:58:13 -04:00
Michael Rash 837f7780fe [libfko] validate MAX_PORT integer value for SPA messages 2014-10-25 08:42:14 -04:00