923 Commits

Author SHA1 Message Date
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
3ef3ab29c8 [test suite] 'key_file' hash key update for HMAC SHA384 test 2013-03-12 23:20:12 -04:00
Michael Rash
0b9f25362e [test suite] minor bug fix for HMAC SHA384 default key test rc file path 2013-03-12 23:10:09 -04:00
Michael Rash
9e32cdd6d9 [test suite] added files to Makefile.am and added a test to verify this 2013-03-12 22:50:37 -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
4ef2a1ec57 fix fko_new_with_data() call to include the hmac type 2013-03-11 22:41:08 -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
dc0ce29477 bug fix to anticipate OpenSSL HMAC output that spans multiple lines (as in SHA512) 2013-03-10 16:37:34 -04:00
Michael Rash
7821e83dfc Merge branch 'hmac_support' of github.com:mrash/fwknop into hmac_support
Conflicts:
	client/fwknop.c
	lib/fko_hmac.c
2013-03-10 14:32:07 -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
Damien Stuart
6fa3be393c Renamed fko_set_hmac_type to fko_set_spa_hmac_type. Incorporated libfko changes and additions to the fko python module code. 2013-03-10 13:21:24 -04:00
Michael Rash
f9fa3c2b6d [test suite] derive HMAC digest type from client display context output 2013-03-09 23:25:59 -05:00
Michael Rash
3ff39dfab4 [test suite] minor variable conversion to 'our' vars 2013-03-09 16:41:32 -05:00
Michael Rash
8b5cf3446f [test suite] minor bug fix for command line definition for invalid HMAC test 2013-03-08 22:05:11 -05:00
Michael Rash
d13eba7d13 [test suite] minor category/subcategory update for fuzzing tests 2013-03-08 21:48:19 -05:00
Michael Rash
7fe5c55fcf [test suite] added various hmac verification conf files 2013-03-08 21:10:45 -05:00
Michael Rash
d4362b7b38 [test suite] import test definitions from tests/*.pl files 2013-03-08 21:09:51 -05:00
Michael Rash
44d05a6916 interim commit for supporting multiple HMAC digest types (# 45) 2013-03-07 23:14:48 -05:00
Michael Rash
39ca73a245 [test suite] added OpenSSL HMAC verification (closes #39) 2013-03-05 23:29:46 -05:00
Michael Rash
a09392b08d [test suite] better reporting of test title matching for valgrind coverage test 2013-03-03 17:56:02 -05:00
Michael Rash
5c182c1722 [test suite] added HMAC dual usage test 2013-03-03 16:21:46 -05:00
Michael Rash
d94513ee00 [test suite] started adding HMAC equivalent tests for all existing tests 2013-03-02 22:38:26 -05:00
Michael Rash
58ba7717e6 [test suite] minor category renaming 2013-03-02 14:13:47 -05:00
Michael Rash
1de684ab16 [test suite] minor spacing fix for hmac_access.conf file 2013-03-02 11:15:19 -05:00
Michael Rash
e4b6f56619 [test suite] minor valgrind coverage dir import status message 2013-03-02 11:10:48 -05:00
Michael Rash
a00de31f5a [test suite] use find_command() for valgrind path 2013-03-02 10:47:03 -05:00
Michael Rash
1e01d59c91 [test suite] added elapsed time display 2013-03-02 10:18:05 -05:00
Michael Rash
db7f3e2b3c Added fko_set_spa_encryption_mode() multi-call test to fko-wrapper 2013-02-25 16:50:12 -05:00
Michael Rash
bdb32cf634 added decryption tests to fko-wrapper 2013-02-21 22:47:40 -05:00
Michael Rash
74fe3c6330 added fko-wrapper memory validation test 2013-02-21 08:35:17 -05:00
Michael Rash
3ce7a77df3 added global function call number var for fko-wrapper 2013-02-21 08:34:36 -05:00
Michael Rash
52f40fea3c added 'clean' stanza for fko-wrapper Makefile 2013-02-21 08:33:36 -05:00
Michael Rash
0ae954cb17 completed fko_wrapper Rijndael encryption usage 2013-02-20 23:06:40 -05:00
Michael Rash
c70ad5f12f added fko-wrapper Makefile 2013-02-20 21:05:47 -05:00
Michael Rash
e4a5b79750 Added fko-wrapper that the test suite will be able to use for valgrind operations
The fko_wrapper.c code is designed to call libfko functions multiple times in
order to allow valgrind to test re-execution conditions.  This ensures that
libfko code frees memory from previous calls before leaking memory.
2013-02-20 21:00:46 -05:00
Michael Rash
33e1c19bb2 Make sure valgrind is stopped after each test in --enable-valgrind mode, closes #38
This commit uses pgrep + killall (if available) to ensure that valgrind is not
running after each test.
2013-02-20 20:45:40 -05:00
Michael Rash
6a475bbe54 Continued atoi() replacement with strtol() wrapper (issue #21)
This commit replaces a few additional atoi() calls with the strtol() wrapper
function, and also fixes a bug where access SOURCE IP/mask combinations would
not be accepted when the string length was a long as something like
'123.123.123.123/255.255.255.255'.
2013-02-18 22:22:44 -05:00
Michael Rash
934e676053 minor cleanup to put --enable-all flags in one place 2013-02-18 19:22:48 -05:00
Michael Rash
aab3ba3b0c added --save-args-file and corresponding tests to the fwknop client 2013-02-14 22:50:14 -05:00
Michael Rash
280dbbfe10 added test for client --save-packet <file> argument 2013-02-12 23:26:08 -05:00
Michael Rash
4daedde364 updated untested function list for Linux systems 2013-02-12 22:18:16 -05:00
Michael Rash
67c09c8a1f Added test-coverage/README file 2013-02-12 22:08:42 -05:00
Michael Rash
f14fb4cb76 use same test execution strategy for --enable-profile-coverage-check as --enable-valgrind 2013-02-12 22:06:35 -05:00
Michael Rash
98ed91a36f updated ownership determination to use the test suite owner instead of the configure script 2013-02-11 23:17:52 -05:00
Michael Rash
b820bbbe4b Minor memory leak bug fix in --rotate-digest-cache mode
This commit fixes a minor memory leak for the digest cache file path in
--rotate-digest-cache mode in the replay_cache_init() function.  The leak was
caught by valgrind, and a new test was added to the test suite for it.  Here
is the valgrind warning:

==29021== 21 bytes in 1 blocks are definitely lost in loss record 2 of 2
==29021==    at 0x4C2B3F8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29021==    by 0x1103AA: replay_cache_init (replay_cache.c:96)
==29021==    by 0x10BB8C: main (fwknopd.c:254)
2013-02-10 14:57:44 -05:00
Michael Rash
7face3eec9 ensure matching test file comparison for valgrind test 2013-02-02 22:37:17 -05:00
Michael Rash
7bfaee9aef Make valgrind test fail for new flagged functions
In --enable-valgrind mode, this commit adds the ability to compare current test
result output with any previous test suite execution.  Whenever valgrind flags
a new function or if an existing flagged function has a greater number of
calls, then the final valgrind test will fail.  This allows a greater level of
valgrind validation to take place for new code in an automated fashion.  For
example, if a change to a piece of code introduces a memory handling problem of
the sort that valgrind can detect, then the final test will fail like so:

 # ./test-fwknop.pl --include "complete cycle.*HMAC" --enable-valgrind --test-limit 1

 [+] Starting the fwknop test suite...

     args: --include complete cycle.*HMAC --enable-valgrind --test-limit 1

     Saved results from previous run to: output.last/

 [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)...pass (1)
 [valgrind output] [flagged functions] ..............................fail (2)

 [+] 1/1/2 tests passed/failed/executed

The newly flagged functions will be written to the corresponding test file:

 # cat output/2.test

 [+] TEST: [valgrind output] [flagged functions]~
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: main
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_spa_data_final
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: strdup
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_new
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_encrypt_spa_data
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_encode_spa_data
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_calculate_hmac
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_set_username
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_set_rand_value
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: fko_set_spa_message
 [-] 1.test (client) '[+] TEST: [Rijndael SPA] [client+server] complete cycle + HMAC (tcp/22 ssh)' --> NEW valgrind flagged function: set_digest
 [-] 1.test New and/or greater number of valgrind flagged function calls
2013-02-02 22:06:45 -05:00
Michael Rash
4824b74d93 bug fix for iptables duplicate rules test to account for rules that may have a different time stamp 2013-01-31 22:19:21 -05:00
Michael Rash
6d233a9427 make sure test message strings are unique across all tests 2013-01-31 21:20:04 -05:00