Commit Graph

98 Commits

Author SHA1 Message Date
Michael Rash
0a82c68451 [test suite] add hmac_fuzzing_access.conf file 2014-05-23 18:50:47 -04:00
Michael Rash
fb21e3a575 [server] bug fix to handle SPA packets via http 2014-04-29 23:25:31 -04:00
Michael Rash
6dde30bc91 [test suite] significant test coverage update
This commit adds a lot of test coverage support as guided by gcov +
lcov.

Also added the --no-ipt-check-support option to fwknopd (this is only
useful in practice on older Linux distros where 'iptables -C' is not
available, but it helps with test coverage).
2014-04-29 20:54:01 -04:00
Michael Rash
9901d8a76a [libfko/test suite] add the FUZZING_INTERFACES macro
Add a new fko_set_encoded_data() function gated by #define
FUZZING_INTERFACES to allow encryption and authentication to be bypassed
for fuzzing purposes (and only fuzzing purposes).  The fko-wrapper code
has been extended to process data in the
test/fko-wrapper/fuzz_spa_payloads file, which is created by the new
python fuzzer.  Typical workflow is:

$ cd test/fko-wrapper
$ ../spa_fuzzer.py > fuzz_spa_payloads
$ make fuzzing

(as root):

./test-fwknop.pl  --enable-profile-coverage --enable-fuzzing-interfaces --enable-all --include wrapper

[+] Starting the fwknop test suite...

    args: --enable-profile-coverage --enable-fuzzing-interfaces --enable-all --include wrapper

    Saved results from previous run to: output.last/

    Valgrind mode enabled, will import previous coverage from:
        output.last/valgrind-coverage/

[+] Total test buckets to execute: 2

[Rijndael] [fko-wrapper] multiple libfko calls (with valgrind)......pass (1)
[Rijndael] [fko-wrapper] multiple libfko calls......................pass (2)
[profile coverage] gcov profile coverage............................pass (3)
[valgrind output] [flagged functions] ..............................pass (4)

    Run time: 5.85 minutes

[+] 0/0/0 OpenSSL tests passed/failed/executed
[+] 0/0/0 OpenSSL HMAC tests passed/failed/executed
[+] 4/0/4 test buckets passed/failed/executed
2014-04-26 23:04:44 -04:00
Michael Rash
67dd1d5bdd [server] bug fix to allow IP-formatted masks for SOURCE lines in access.conf 2014-04-12 15:21:00 -04:00
Michael Rash
2da2704d4c [test suite] fwknoprc GPG tests, more time offset tests 2014-04-03 19:30:58 -04:00
Michael Rash
3ca546092b [test suite] additional rc file code coverage tests 2014-03-29 22:23:45 -04:00
Michael Rash
22b1b2d9d2 [test suite] additional client/config_init.c code coverage test for fwknoprc file parsing 2014-03-29 21:44:24 -04:00
Michael Rash
73bc473563 [client+server] verify GnuPG signatures by default
- [server] When GnuPG is used, the default now is to require that
incoming SPA packets are signed by a key listed in GPG_REMOTE_ID for each
access.conf stanza. In other words, the usage of GPG_REQUIRE_SIG
is no longer necessary in order to authenticate SPA packets via the
GnuPG signature. Verification of GnuPG signatures can be disabled with a
new access.conf variable GPG_DISABLE_SIG, but this is NOT a
recommended configuration.
- [client+server] Add --gpg-exe command line argument and GPG_EXE
config variable to ~/.fwknoprc and the access.conf file so that the path
to GnuPG can be changed from the default /usr/bin/gpg path.
2014-03-25 19:53:13 -04:00
Michael Rash
ad512ff6e7 [test suite] added Rijndael+HMAC SPOOF_SRC fwknoprc file test 2014-03-13 21:43:51 -04:00
Michael Rash
4181b43f55 [test suite] Added Rijndael+HMAC NAT rand port via client rc file test 2014-03-13 20:10:26 -04:00
Michael Rash
83595bdabb [test suite] Added Rijndael+HMAC command execution test 2014-03-13 19:40:47 -04:00
Michael Rash
873b06b422 [test suite] added portrange bpf filter test 2014-02-07 07:49:50 -05:00
Michael Rash
509dcf93dd [android] added HMAC test along with non-legacy Rijndael test 2013-12-23 23:15:11 -05: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
0319b72334 [test suite] added missing config files 2013-12-05 23:01:12 -05:00
Michael Rash
c04efc20dd [test suite] added Rijndael HMAC digest mismatch tests 2013-08-10 15:45:51 -04:00
Michael Rash
dfc2a06547 [test suite] added Rijndael HMAC + RAND_PORT test 2013-08-10 14:27:10 -04:00
Michael Rash
4775327d98 [test suite] added two GnuPG HMAC SHA512 tests 2013-08-10 13:54:03 -04:00
Michael Rash
05e7d52a5f [client] merged --stanza-list changes from Franck, closes #94 2013-08-08 20:54:07 -04:00
Michael Rash
870a08c9f5 [test suite] added invalid IPT input chain specification tests 2013-08-04 21:22:35 -04:00
Michael Rash
0200169dfd [test suite] started on SNAT tests 2013-08-03 13:36:32 -04:00
Franck Joncourt
836921a9ea * Added new test to validate --stanza-list 2013-07-30 22:54:10 +02:00
Michael Rash
dac75c0242 [server] restore backwards compatibility for Rijndael keys > 16 bytes in legacy mode by truncating (upgrading recommended of course) 2013-07-14 15:37:24 -04:00
Michael Rash
13626a2a74 [test suite] added tests for KEY synonym GPG_SIGNING_PW 2013-06-19 23:41:37 -04:00
Michael Rash
0c19e5170a [test suite] added backwards compatibility tests with a dual usage key in access.conf 2013-06-10 21:16:33 -04:00
Michael Rash
88e1e0e099 [test suite] added tests for setting gpg recipient, signer, and homedir via the client rc file 2013-06-09 15:27:19 -04:00
Michael Rash
7a1bdea514 [server] fix 'Use of untrusted string value' bug found by Coverity
This commit changes iptables policy parsing to re-use rule_exists() for fwknop
jump rule detection instead of using sscanf() against iptables policy list
output.  Also, fwknop jump rules are now deleted from iptables policies in a
loop to ensure all are removed even if there are duplicates (even though this
should not happen under normal circumstances anyway).
2013-06-09 14:28:17 -04:00
Michael Rash
164888e075 [test suite] added backwards compatibility test for truncated keys longer > 16 chars 2013-06-02 21:19:19 -04:00
Michael Rash
47d235f4fe [test suite] minor formatting update to access.conf files to mimic fwknoprc vars (no colon or trailing semicolon) 2013-05-21 22:12:03 -04:00
Michael Rash
fad0ef8690 [test suite] added 'equal keys' files 2013-05-19 16:15:19 -04:00
Michael Rash
3246c3c6b0 [test suite] added hmac_get_key_access.conf file 2013-05-12 22:30:28 -04:00
Michael Rash
d61d5b964e [test suite] added Cygwin client compatibility tests 2013-05-03 23:17:24 -04:00
Michael Rash
56ef34738e [test suite] add new test files to Makefile.am 2013-05-02 15:08:04 -04:00
Michael Rash
0f24877762 [test suite] minor comment addition so this isn't a zero-byte file 2013-05-01 08:21:11 -04:00
Michael Rash
486f0ea52f [test suite] restore gpg directories after test suite runs 2013-04-27 22:41:17 -04:00
Franck Joncourt
b04de687ce Fixed hostname resolution while spoof ip is used.
mrash/fwknop#64
2013-04-27 23:31:40 +02:00
Michael Rash
5e82adbf3f [test suite] added GPG password required HMAC tests, added --disable-valgrind argument 2013-04-23 21:56:41 -04:00
Michael Rash
4ea683678b [test suite] added gpg_no_pw_hmac_access.conf file 2013-04-22 20:59:32 -04:00
Michael Rash
6c1b755bea [test suite] removed unnecessary comment lines from test config files 2013-04-20 15:31:26 -04:00
Michael Rash
387b6e40d3 [test suite] updated non-based64 keys in non-base64 key files 2013-04-20 11:09:48 -04:00
Michael Rash
f010d88016 removed trailing semicolon from KEY value 2013-04-19 19:42:06 -04:00
Michael Rash
05ced0a514 add HMAC_KEY variable support to access.conf (alternative to HMAC_KEY_BASE64) 2013-04-08 22:14:06 -04:00
Michael Rash
748715acf8 [test suite] added python->C HMAC test 2013-04-08 20:45:14 -04:00
Michael Rash
4bdb71315a [client] --nat-rand-port bug fix
Bug fix for --nat-rand-port mode to ensure that the port to be
NAT'd is properly defined so that the fwknopd server will NAT
connnections to this port instead of applying the NAT operation to the
port that is to be accessed via -A.  This change also prints the
randomly assigned port to stdout regardless of whether --verbose mode is
used (since it not then the user will have no idea which port is
actually going to be NAT'd on the fwknopd side).
2013-03-16 14:38:20 -04:00
Michael Rash
55d188ed1f [test suite] added HMAC key tests 2013-03-12 22:18:43 -04:00
Michael Rash
402a545cb2 convert standard hmac access.conf file for HMAC SHA512 to use key size of 128 bytes 2013-03-11 23:12:56 -04:00
Michael Rash
bd2af22691 [test suite] set HMAC_DIGEST_TYPE to md5 for HMAC MD5 test 2013-03-10 21:58:52 -04:00
Michael Rash
22dde8eb35 SPA with HMAC SHA256 and SHA384 now works
This is a fairly significant commit that lays the groundwork for getting
selectable HMAC modes working for both the client and server.  One libfko API
change was required so that the hmac_type is passed into fko_new_with_data().
This allows the server to set the hmac_type via access.conf stanzas.  The
effort in this commit will be extended to allow HMAC MD5, SHA1, and SHA512
also function properly.
2013-03-10 14:26:05 -04:00
Michael Rash
7fe5c55fcf [test suite] added various hmac verification conf files 2013-03-08 21:10:45 -05:00