1411 Commits

Author SHA1 Message Date
Michael Rash
92cdb47ff7 [server] added FORCE_MASQUERADE to fwknopd(8) man page, closes #101
This commit completes the addition of generalized NAT (both DNAT and
SNAT) capabilities to access.conf stanzas.
2013-12-14 15:44:39 -05:00
Michael Rash
3a2c33cd3c Added Les Aker to credits file 2013-12-12 15:57:10 -06:00
Michael Rash
3b2cd063fe [server] pcap_dispatch() packet count default to 100
Updated pcap_dispatch() default packet count from zero to 100.
This change was made to ensure backwards compatibility with older
versions of libpcap per the pcap_dispatch() man page, and also because
some of a report from Les Aker of an unexpected crash on Arch Linux with
libpcap-1.5.1 that is fixed by this change (closes #110).
2013-12-10 22:24:39 -06:00
Michael Rash
aeed8323f7 [test suite] multi-packet pcap test for pcap_dispatch() validation
This commit adds a new pcap file to the test suite with an SPA packet after
99 other garbage packets.  This can be used for pcap_dispatch() testing,
though this is not meant to be super instensive - it is just to ensure that
if a PCAP_DISPATCH_COUNT of, say, 10 is selected that the SPA is still seen
by fwknopd.  This commit is in support of #110.
2013-12-10 21:56:20 -06:00
Michael Rash
5f50ac22db [server] use SIGKILL if necessary for -K
This change sends SIGKILL to fwknopd under -K if SIGTERM does not do the job
first.  This can be necessary in some cases if libpcap does not properly handle
a packet count of zero in pcap_dispatch() (see github issue #110).  On a side
note, the default packet dispatch count of zero will likely be changed because
of that issue too.
2013-12-10 14:35:38 -06:00
Michael Rash
3ef9e5645b [test suite] added masquerade exception for non-Linux systems 2013-12-05 23:37:10 -05:00
Michael Rash
0319b72334 [test suite] added missing config files 2013-12-05 23:01:12 -05:00
Michael Rash
46b5f2ecaf [server] added the ability to use FORCE_MASQUERADE to access.conf stanzas 2013-12-05 23:00:19 -05:00
Michael Rash
79f0cb8986 [libfko] added defensive NULL check for is_valid_ipv4_addr() 2013-12-04 23:11:11 -05:00
Michael Rash
e0114e60c2 [server] Added FORCE_SNAT to access.conf stanzas.
Added FORCE_SNAT to the access.conf file so that per-access stanza SNAT
criteria can be specified for SPA access.
2013-12-04 21:52:07 -05:00
Michael Rash
d7aa820e33 [server] Bug fix for SPA NAT modes on iptables firewalls for chain re-creation
For SPA NAT modes this commit ensures that custom fwknop chains are re-created
if they get deleted out from under the running fwknopd instance.
2013-12-03 21:42:23 -05:00
Michael Rash
bd73ceb5bd [test suite] added FreeBSD-9.2 and OpenBSD-5.4 compatibility tests 2013-11-27 21:58:13 -05:00
Michael Rash
c382febf3d [client] use libfko is_valid_ipv4_addr() for IP address validation 2013-11-26 23:48:56 -05:00
Michael Rash
aeb415d0e0 move fuzzing_spa_packets file to perl/FKO/t/ for fuzzing tests
This change moves the fuzzing_spa_packets file from the test/fuzzing/
directory into the perl FKO extension t/ directory and is now referenced
directly by the t/04_fuzzing.t test file.  The test suite itself also uses
this file for fuzzing tests as well, but having the FKO built-in tests
enables Test::Valgrind memory checks so it is useful to have this included
in the FKO sources.  (When the FKO module is submitted to CPAN, it should
not depend on non-local files, but it's ok for the test suite to reference
the ../perl/FKO/t/ directory.)
2013-11-26 21:44:53 -05:00
Michael Rash
a15be4005e minor ChangeLog rewording for GPG fix 2013-11-26 09:07:56 -05:00
Michael Rash
be904769c4 [libfko] Bug fix to not decrypt with GnuGP without FKO_ENC_MODE_ASYMMETRIC
[libfko] Bug fix to not attempt SPA packet decryption with GnuPG without
an fko object with encryption_mode set to FKO_ENC_MODE_ASYMMETRIC.  This
bug was caught with valgrind validation against the perl FKO extension
together with the set of SPA fuzzing packets in
test/fuzzing/fuzzing_spa_packets.  Note that this bug cannot be
triggered via fwknopd because additional checks are made within fwknopd
itself to force FKO_ENC_MODE_ASYMMETRIC whenever an access.conf stanza
contains GPG key information.  This fix strengthens libfko itself to
independently require that the usage of fko objects without GPG key
information does not result in attempted GPG decryption operations.  Hence
this fix applies mostly to third party usage of libfko - i.e. stock
installations of fwknopd are not affected.  As always, it is recommended to
use HMAC authenticated encryption whenever possible even for GPG modes since
this also provides a work around even for libfko prior to this fix.
2013-11-26 08:35:16 -05:00
Michael Rash
6dd5ab8e35 [test suite] added --cmd-verbose to control fwknop command verbosity levels
This commit provides an easy way to control how verbose fwknop command
execution will be.  For example, fwknopd only calls hex_dump() against
SPA packets when --verbose > 2, so invoking the tests suite as follows
will result in hex_dump() being included in fwknopd output (see the
output/1_fwknopd.test file:

./test-fwknop.pl --include "Rijndael.*complete.*22" --test-limit 1 --cmd-verbose "--verbose --verbose --verbose"

[+] candidate SPA packet payload:

  0x0000:  39 62 72 51 58 75 7a 4b  57 54 53 67 57 56 35 66 9brQXuzKWTSgWV5f
  0x0010:  73 63 78 42 35 78 69 51  65 6c 55 4f 53 78 69 45 scxB5xiQelUOSxiE
  0x0020:  51 30 59 6a 41 50 70 31  4f 70 43 62 32 51 4a 4c Q0YjAPp1OpCb2QJL
  0x0030:  48 34 42 65 68 64 6d 47  35 49 31 50 36 2f 5a 69 H4BehdmG5I1P6/Zi
  0x0040:  6a 34 4b 41 62 34 53 68  6a 59 66 4f 71 2b 46 6c j4KAb4ShjYfOq+Fl
  0x0050:  4a 35 52 75 70 33 39 6f  6e 65 42 79 72 51 46 57 J5Rup39oneByrQFW
  0x0060:  61 38 6c 37 63 48 6e 38  5a 54 36 59 6e 55 56 47 a8l7cHn8ZT6YnUVG
  0x0070:  50 36 6e 53 6f 69 30 61  70 72 32 52 39 62 6b 56 P6nSoi0apr2R9bkV
  0x0080:  37 50 61 67 41 61 6b 49  44 63 58 59 44 6b 2f 64 7PagAakIDcXYDk/d
  0x0090:  67 51 45 61 37 39 32 6f  30 4d 38 6e 30 30 6e 35 gQEa792o0M8n00n5
  0x00a0:  55                                               U
2013-11-22 23:00:20 -05:00
Michael Rash
cba2873e22 AppArmor profile update to allow GnuPG link operations, closes #109
This fix was submitted by Raybuntu through github.
2013-11-22 22:36:17 -05:00
Michael Rash
72eb3421b6 Merge branch 'master' of ssh://192.168.10.1/home/mbr/git/fwknop 2013-11-21 21:02:08 -05:00
Michael Rash
f396b816a1 [test suite] fix LD_LIBRARY_PATH for perl FKO 'make test' run 2013-11-21 21:01:17 -05:00
Michael Rash
65195d74ae added AppArmor policy to Makefile.am 2013-11-21 20:47:50 -05:00
Michael Rash
eeda4e0f10 [test suite] better --lib-dir support for non-default LD_LIBRARY_PATH values
This commit allow the test suite to easily use a non-default LD_LIBRARY_PATH
in order to test mixed combinations of newly compiled fwknop client/server
binaries and previously installed versions of libfko.  This allows backwards
compatibility (and forwards compatibility) to be verified by the test suite.

For example, after compiling the fwknop client and server for the 2.5.2
release, one could use libfko from 2.5.1 to verify compatibility:

./test-fwknop.pl --enable-all --lib-path /home/mbr/install/fwknop-2.0.4/lib

See the --fwknop-path and --fwknopd-path args as well in order to support
arbitrary client/server/libfko combinations.
2013-11-20 23:14:57 -05:00
Michael Rash
28a915c8c8 [test suite] added short and long IP tests (1.1.1.1 and 123.123.123.123) 2013-11-20 23:10:36 -05:00
Michael Rash
78f696b2f7 [libfko] implemented shared utility function for ipv4 address checking
This commit implements a single shared utility function for checking the
validaty of an IPv4 address, and both libfko and the fwknopd server use it
now.  The client will be updated as well.
2013-11-20 17:13:55 -05:00
Michael Rash
5f5367cf62 [server] minor error code text typo fixes 2013-11-19 23:14:46 -05:00
Michael Rash
8cb5653d5e [test suite] minor update for SNAT tests to not restrict --fw-list search to 127.0.0.2 2013-11-18 22:22:02 -05:00
Michael Rash
71d19031e6 [test suite] remove init file before starting test run 2013-11-17 22:27:07 -05:00
Michael Rash
38fe23c398 added tests/code_structure.pl file to Makefile.am 2013-11-17 21:26:51 -05:00
Michael Rash
796bd761a9 [python extension] bug fix for missing error code constants (caught with code structure test) 2013-11-17 20:44:41 -05:00
Michael Rash
93c0faafeb [test suite] extended code structure errstr test to validate python extention error code constants 2013-11-17 20:43:28 -05:00
Michael Rash
6469f81860 [perl FKO module] bug fix for missing error code constants (caught with code structure test) 2013-11-17 19:52:09 -05:00
Michael Rash
eebfa8924d [test suite] extended code structure errstr test to validate perl FKO constants 2013-11-17 19:50:42 -05:00
Michael Rash
c019a43808 [libfko] bug fix caught by new code structure error str test to add string for FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG 2013-11-16 23:23:32 -05:00
Michael Rash
a9cc97cd2a [test suite] added tests/code_structure.pl with a test for expected lib/fko.h error code fko_errstr() handling 2013-11-16 23:22:25 -05:00
Michael Rash
cd15502bf1 [test suite] minor addition to fko-wrapper to call fko_errstr() across valid and invalid values 2013-11-16 20:36:39 -05:00
Michael Rash
196fef65b6 [libfko] move is_base64 check to libfko
This commit replaces the separately implemented client/server
is_base64() check with a single libfko function, and libfko itself now
uses it as well before prepending Rijndael or GnuPG base64 encoded
prefixes.
2013-11-16 19:20:08 -05:00
Michael Rash
173b7518e1 Merge branch 'mac_os_x_mavericks_build' of ssh://10.211.55.3/home/parallels/git/fwknop into mac_os_x_mavericks_build 2013-11-15 14:55:28 -05:00
Michael Rash
63568d061b minor hex_dump() formatting bug fix to properly align ascii remainder output 2013-11-15 14:53:04 -05:00
Michael Rash
6d78c49ef9 [libfko] minor update to print 'None' for the HMAC type when an HMAC is not used instead of just diplaying '()' 2013-11-14 23:13:33 -05:00
Michael Rash
cb2fc3abbe [test suite] handle LD_LIBRARY_PATH from the main test-fwknop.pl script 2013-11-14 22:47:13 -05:00
Michael Rash
a6f030412f [test suite] added Rijndael/HMAC compatibility tests for Mac OS X 10.9 2013-11-14 10:37:36 -05:00
Michael Rash
6870e65800 [test suite] minor cleanup to remove uncessary 'fatal' test hash keys 2013-11-14 10:24:58 -05:00
Michael Rash
5f51d7b3eb [test suite] added support for 'otool' instead of 'ldd' on Mac OS X systems 2013-11-14 09:59:28 -05:00
Michael Rash
af3d4fa926 minor extras/apparmor configure_args.sh path typo fix 2013-11-14 09:55:43 -05:00
Michael Rash
10ac35b344 added extras/apparmor configure_args.sh helper script for building fwknop with args that AppArmor expects 2013-11-14 09:54:38 -05:00
Michael Rash
1299a8ee87 [test suite] added DYLD_LIBRARY_PATH for Mac OS X 10.9 2013-11-12 23:05:16 -05:00
Michael Rash
e75117616e [server] ignore pcap direction for sniffing link type DLT_NULL interfaces (fixes OS X 10.9 test suite runs) 2013-11-12 23:04:35 -05:00
Michael Rash
23ef1d4e59 [libfko] Candidate build fix for Mac OS X 10.9 (closes #108)
Nikolay Kolev reported a build issue on Mac OS X 10.9 (Mavericks) where fwknop
copies of strlcpy() and strlcat() functions were conflicting with those that ship
with OS X 10.9.

The solution was to add a configure.ac check for strlcat() and strlcpy() and
wrap "#if !HAVE_..." checks around those functions.

A portion of the build errors looked like this:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in lib
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I ../common   -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all -fstack-protector -fPIE -D_FORTIFY_SOURCE=2 -MT base64.lo -MD -MP -MF .deps/base64.Tpo -c -o base64.lo base64.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I ../common -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all -fstack-protector -D_FORTIFY_SOURCE=2 -MT base64.lo -MD -MP -MF .deps/base64.Tpo -c base64.c  -fno-common -DPIC -o .libs/base64.o
In file included from base64.c:34:
In file included from ./fko_common.h:149:
./fko_util.h:56:9: error: expected parameter declarator
size_t  strlcat(char *dst, const char *src, size_t siz);
        ^
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
 #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
2013-11-12 21:36:14 -05:00
Michael Rash
5cfbcce7d3 [perl FKO module] added a series of encryption + HMAC key tests with single bytes converted to NULL 2013-10-30 23:39:48 -04:00
Michael Rash
6785462573 added perl FKO t/04_fuzzing.t tests file 2013-10-30 23:30:31 -04:00