79 Commits

Author SHA1 Message Date
Michael Rash
bacd054b13 strip trailing whitespace from config values, closes #288 2018-10-24 23:40:13 -04:00
Michael Rash
69291b91fa [test suite] add invalid ALLOW_IP test 2018-08-11 08:23:41 -07:00
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
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
Michael Rash
e271442aa9 [server] first cut at converting iptables commands to use execvpe() 2014-10-03 21:58:51 -04:00
Franck Joncourt
260cd5481b Use of init and cleanup functions for the test suite. 2014-09-07 20:33:39 +02:00
Franck Joncourt
bd0035af1e Fixed tab vs spaces 2014-09-07 15:40:03 +02:00
Franck Joncourt
32c5afae83 Merge remote-tracking branch 'upstream/master' into c_unit_testing 2014-09-07 15:24:59 +02:00
Franck Joncourt
688f08c2a0 Both the fwknop client and server have their own test suites tied to fwknop_utests
and fwknopd_utests binaries.

When profil coverage is enbaled, lcov filee are parsed by test-fwknop.pl and added
to the main profil coverage report in the output directory.

Running make from the main directory build the c-unit test suites if enabled.
2014-09-07 15:15:22 +02:00
Damien Stuart
73186e511a Added WIN32 definitions for popen (_popen) and pclose (_pclose) to accommodate the call to wget on Windows-based systems. 2014-08-30 16:18:46 -04:00
Franck Joncourt
306dd0f685 First layout to add c unit testing support to fwknop. 2014-08-24 21:05:44 +02:00
Michael Rash
6d1d66fe03 add --fault-injection-tag support to the client/server/libfko
This is a significant commit to add the ability to leverage libfko fault
injections from both the fwknop client and server command lines via a
new option '--fault-injection-tag <tag name>'.  This option is used by
the test suite with the tests/fault_injection.pl tests.
2014-06-05 23:05:49 -04:00
Michael Rash
ddaf0134d6 use fiu.h instead of fiu-local.h 2014-05-26 15:54:12 -04:00
Michael Rash
15aff82980 client/server added libfiu header files in --enable-libfiu-support mode 2014-05-26 08:39:44 -04:00
Michael Rash
4ba55d6814 fix automake subdir-objects warning on Mac OS X, fixes part of #115 2014-03-17 22:05:45 -04:00