Commit Graph

177 Commits

Author SHA1 Message Date
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
Michael Rash
fa56f951b4 [test suite] bug fix for 'set_legacy_iv' mode in perl_fko_module_complete_cycle() 2013-01-29 21:57:38 -05:00
Michael Rash
efe6e9f23b more legacy IV mode tests with the perl FKO module 2013-01-27 22:22:52 -05:00
Michael Rash
4cb139c674 added fuzzing test counters with summary output 2013-01-27 20:37:48 -05:00
Michael Rash
2ecb278d8e added legacy IV tests for perl FKO client -> C server 2013-01-27 14:18:25 -05:00
Michael Rash
0109d64e54 added encryption_mode() support to perl FKO module 2013-01-27 14:03:26 -05:00
Michael Rash
e7eb02f82d Maintain backwards compatibility with old "zero padding" code
[libfko] Added the ability to maintain backwards compatibility with the
now deprecated "zero padding" strategy in AES mode that was a hold over
from the old perl fwknop implementation.  This enables the backwards
compatiblity tests to continue to pass in the test suite.
2013-01-27 13:18:29 -05:00
Michael Rash
8a5b700c30 openssl tests to use '-pass file:' method for setting passphrase 2013-01-27 10:54:20 -05:00
Michael Rash
1618dc2a7c minor typo spelling fix 2013-01-26 20:45:56 -05:00
Michael Rash
1d35c33d52 [test suite] added --enable-openssl-checks
Added --enable-openssl-checks to send all SPA packets encrypted via libfko
through the OpenSSL library to ensure that the libfko usage of AES is always
compatible with OpenSSL.  This ensures that the fwknop usage of AES is properly
implemented as verified by the OpenSSL library, which is a frequently audited
high profile crypto engine.  If a vulnerability is discovered in OpenSSL and a
change is made, then the --enable-openssl-checks mode will allow the test suite
to discover this in a automated fashion for fwknop.
2013-01-25 21:44:24 -05:00
Michael Rash
fbbcae3a0d [libfko] Don't trundate > 16 byte Rijndael keys
Significant bug fix to honor the full encryption key length for
user-supplied Rijndael keys > 16 bytes long.  Previous to this bug fix,
only the first 16 bytes of a key were actually used in the encryption/
decryption process even if the supplied key was longer.  The result was
a weakening of expected security for users that had keys > 16 bytes,
although this is probably not too common.  Note that "passphrase" is
perhaps technically a better word for "user-supplied key" in this
context since Rijndael in CBC mode derives a real encryption/decryption
key from the passphrase through a series of applications of md5 against
the passphrase and a random salt.  This issue was reported by Michael T.
Dean.  Closes issue #18 on github.
2013-01-22 22:20:54 -05:00
Michael Rash
6c72e7a908 added test for b0a4c045e6 (ensure iptables rules not duplicated) 2013-01-20 18:51:34 -05:00
Michael Rash
160a9e5565 perl FKO module HMAC compatibility 2013-01-20 14:27:27 -05:00
Michael Rash
fc4825b331 added backwards compatibility test for 2.0.4 client->server 2013-01-19 18:17:29 -05:00
Michael Rash
47ea800889 merged in fwknop-2.0.4 changes 2013-01-18 17:25:16 -05:00
Michael Rash
59fe04787b [test suite] minor 're-run make' bug fix for perl FKO module installation 2012-12-09 15:25:14 -05:00
Michael Rash
a673406ebd [test suite] updated fuzzing tests to allow usernames with '.' chars 2012-12-08 20:58:17 -05:00
Michael Rash
05d4299de1 made compilation warning check case-insensitive 2012-12-07 14:53:27 -05:00
Michael Rash
fe8ac98004 bug fix for firewall rule deletion check in backwards compatibility tests on FreeBSD and OpenBSD 2012-11-21 21:29:26 -05:00
Michael Rash
5a2150e070 [test suite] minor update to not look for lib/.libs/ in --enable-recompile mode 2012-11-15 22:36:29 -05:00
Michael Rash
9921e72d70 [test suite] backwards compatibility tests
Added a few backwards compatibility tests for versions of fwknop going back to
2.0, and also added a compatibility test for an SPA packet produced by Android
4.2.1.
2012-11-15 21:16:11 -05:00
Michael Rash
38d4b5cc88 minor marking text update around fuzzing packet count 2012-11-13 21:18:29 -05:00
Michael Rash
c0349a20a3 added fuzzing packet count to FKO server fuzzing test 2012-11-09 20:42:43 -05:00
Michael Rash
66ad134708 [server] Added '--pcap-file <file>' option
Added a new '--pcap-file <file>' option to allow pcap files to
be processed directly by fwknopd instead of sniffing an interface.  This
feature is mostly intended for debugging purposes.
2012-11-08 21:33:23 -05:00
Michael Rash
2ae1449122 allow '_' chars in usernames provided to libfko 2012-11-08 21:02:44 -05:00
Michael Rash
575e696164 [test suite] added pinentry check for gpg tests that have keys that require associated passphrases 2012-11-05 20:38:34 -05:00
Michael Rash
5c1979e16a Added test suite config file: disable_aging_nat_fwknopd.conf 2012-11-04 22:13:52 -05:00
Michael Rash
231be81f5b bug fix to include multi-gpg ID no password test 2012-11-03 23:11:24 -04:00
Michael Rash
dbf6dc8846 --enable-recompile try raw make if sudo make fails 2012-11-03 18:09:12 -04:00
Michael Rash
5218e52f9a added run-test-suite.sh LD_LIBRARY_PATH wrapper 2012-11-03 16:50:26 -04:00
Michael Rash
8c3a67377e [test suite] bug fix to ensure binary existence check in build security tests 2012-10-30 21:23:30 -04:00
Michael Rash
aa74fa3eed minor fuzzing README update 2012-10-28 23:31:09 -04:00
Michael Rash
cefac6275b added non digit rand val fuzzing encoding tests 2012-10-27 22:45:28 -04:00
Michael Rash
dced7c6a77 added fuzzing encoding strip eq return packets 2012-10-27 22:34:52 -04:00
Michael Rash
4b25e1e242 added encoding_append_b64_modified_byte equals sign fuzzing encoding tests 2012-10-27 22:28:33 -04:00
Michael Rash
807dd315e5 added encoding_append_b64_modified_byte fuzzing encoding tests 2012-10-27 22:07:40 -04:00
Michael Rash
03255a5547 added non-base64 char to access msg for fuzzing encoding tests 2012-10-26 23:13:41 -04:00
Michael Rash
f3c9f49a67 added fuzzing encoding packets (extra colon 3) 2012-10-26 23:07:35 -04:00
Michael Rash
e89338c431 added fuzzing encoding packets (extra colon 2) 2012-10-26 23:06:09 -04:00
Michael Rash
69ed7ee635 added fuzzing encoding packets (extra colon 1) 2012-10-26 21:47:08 -04:00
Michael Rash
830996b3ac added non-base64 encoding fuzzing packets 2012-10-26 15:52:09 -04:00
Michael Rash
60083cc272 added rm colon5 fuzzing packets 2012-10-25 22:12:47 -04:00
Michael Rash
3ae583813c added fuzzing encoding test that removes colon #5 2012-10-25 22:04:09 -04:00
Michael Rash
91596f4450 added fuzzing encoding test that removes colon #4 2012-10-25 22:01:12 -04:00
Michael Rash
ef635d57e3 added test/fuzzing/patches/encoding_rm_colon1.patch file 2012-10-25 21:57:40 -04:00
Michael Rash
165e618bad Added fuzzing encoding tests that remove the 2nd and 3rd colons 2012-10-25 21:55:01 -04:00
Michael Rash
f6b0d23c1c Added fuzzing spa packet generation for invalid encodings
This commit adds the ability to generate SPA packets that are valid except for
the last encoding step before encryption.  This is independent of supplying
invalid data for SPA packet fields.  To invoke the test suite in this mode,
do something like:

 # ./test-fwknop.pl --enable-perl-module-pkt-gen  --fuzzing-test-tag "encoded_colon1_missing"  --fuzzing-class encoding

This assumes that lib/fko_encode.c has been patched to subvert the encoding
step itself before encryption.  In this case, the first colon after the random
value is removed.
2012-10-25 21:37:52 -04:00