316 Commits

Author SHA1 Message Date
Michael Rash
ce18de4f84 make libfko pointers constant where possible 2013-02-12 22:39:39 -05:00
Michael Rash
c31c924a45 minor spacing fix 2013-01-30 21:13:44 -05:00
Michael Rash
13018a5c42 Merge pull request #19 from fjoncourt/hmac_support
Fixed gcc warning for the md5 driver.
2013-01-30 18:04:50 -08:00
Michael Rash
f1793a61d6 Merge remote-tracking branch 'fjoncourt/hmac_support' into hmac_support
Applied fix from Franck Joncourt for the 'warning: dereferencing type-punned
pointer will break strict-aliasing rules [-Wstrict-aliasing]' error in the
MD5 digest code.
2013-01-29 21:52:15 -05:00
Franck Joncourt
fcf9f43c5b Fixed gcc warnings for the sha2 driver. 2013-01-28 21:47:57 +01: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
98c16005da memset() AES buffers to zero 2013-01-27 10:53:07 -05:00
Franck Joncourt
1a8520d659 Fixed gcc warning for the md5 driver.
md5.c: In function 'MD5Final':
md5.c:166:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
md5.c:167:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Debian Gnu/Linux on i386 build against 2.0.4 :

https://buildd.debian.org/status/fetch.php?pkg=fwknop&arch=i386&ver=2.0.4-1&stamp=1358610541
2013-01-26 22:23:18 +01: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
160a9e5565 perl FKO module HMAC compatibility 2013-01-20 14:27:27 -05:00
Michael Rash
47f20ea30c merged in the fixes_for_2.0.4 branch 2013-01-19 18:36:52 -05:00
Michael Rash
47ea800889 merged in fwknop-2.0.4 changes 2013-01-18 17:25:16 -05:00
Damien Stuart
10c19063df Fixed parallel build issue
Added explicit dependency directives to Makefile.am to address errors
when running a parallel build.
2012-12-23 10:28:30 -05:00
Damien Stuart
10f2d295be Have libfko link strlxxx objects directly instead of libfko_util. 2012-12-08 15:40:40 -05:00
Damien Stuart
39410044c5 Set new libfko version. Client: allow dot (.) in validate_username, and display version and exit without creating an fko context. 2012-12-07 11:38:31 -05:00
Michael Rash
88c66f647f Revert "added got_allow_ip() wrapper around have_allow_ip() to fix an exported symbol issue noticed by Franck"
This reverts commit e57cfa2e235261b960986ecae0c7e86307159529.  This is done
because libfko now restricts the symbols it exports to only those functions
that should be visible when making use of the library - internal libfko
functions should not be exported.
2012-12-03 22:45:39 -05:00
Damien Stuart
7df9edc1db Merge branch 'master' of github.com:mrash/fwknop 2012-12-02 09:59:48 -05:00
Damien Stuart
bcea440b87 Limited exported symbols in libfko to only the public (fko_) functions. Moved strlcat/cpy to a separate libfko_util lib. 2012-12-02 09:56:57 -05:00
Michael Rash
e57cfa2e23 added got_allow_ip() wrapper around have_allow_ip() to fix an exported symbol issue noticed by Franck 2012-12-01 22:45:55 -05:00
Damien Stuart
e3c4c045c6 Changes to address header references, platform support, error messages, and the perl module test suite.
Rearranged headers to reduce duplication and remove local header
references from fko.h.
Removed references to headers that did not need to be explicitly set.
Moved the MAX_PROTO_STR_LEN and MAX_PORT_STR_LEN definitions to the
fko_limits.h file.
Fixed bug where invalid nat_access or command messages were returning
FKO_ERROR_INVALID_SPA_ACCESS_MSG error code instead of the one
appropriate to the message type.
Fixed bad nat_access_msg test in Perl module test suite (caught by new
validation code).
2012-12-01 11:06:41 -05:00
Damien Stuart
1ec9f4ae94 Re-tweaks for accommodating the windows build and systems that do not have strnlen 2012-11-30 23:40:24 -05:00
Michael Rash
eaba5813f3 Bug fix for perl FKO compilation
This commit removes lib/ includes of common/ header files that was breaking
the perl FKO module compilation.
2012-11-28 22:39:07 -05:00
Damien Stuart
617305504a Revert "Tweaks to EXTRA_DIST. Added one missing and removed one invalid entry under the test directory."
This reverts commit 556ca2c146a598cddada4dd8cdf3f9b12f32f202.
2012-11-19 12:19:12 -05:00
Damien Stuart
556ca2c146 Tweaks to EXTRA_DIST. Added one missing and removed one invalid entry under the test directory. 2012-11-19 09:30:15 -05:00
Damien Stuart
f499e30900 Tweaks to fix issues with building the lib and client under Windows. Added .fwknop.last support on Windows. Bumped the lib version to 0.0.4. Fixed bug in username detection code. Removed -Werror from AM_INIT_AUTOMAKE which prevented setting of CPPFLAG for the lib build in some circumstances. 2012-11-19 08:43:14 -05:00
Michael Rash
517f447028 bumped version to 2.0.4 2012-11-14 23:45:43 -05:00
Michael Rash
02790628d4 additional SPA validation check to ensure no non-ascii printable chars in decoded message 2012-11-13 21:16:27 -05:00
Michael Rash
70afd9c2d4 minor spacing fix 2012-11-13 21:12:41 -05:00
Michael Rash
7afe5b28b7 minor update to use explicit FKO_SUCCESS value in if() result check 2012-11-08 21:03:45 -05:00
Michael Rash
2ae1449122 allow '_' chars in usernames provided to libfko 2012-11-08 21:02:44 -05:00
Tomoyuki Kano
cf783e075e add missing include files to lib/Makefile.am 2012-11-03 19:03:48 +09:00
Michael Rash
ac38f8d993 [libfko] bug fix to check b64_decode() return value
Bug fix to check b64_decode() return value to ensure that
non-base64 encoded data is never used.  Even though other validation
routines checked decoded results, it is important to discard invalid
data as early as possible.  Note too that such invalid data would only
be provided to b64_decode() after proper decryption, so the client must
provide authentic SPA data.
2012-10-26 15:36:08 -04:00
Michael Rash
52d023ec60 added validate_username() call to SPA packet encoding routine 2012-10-22 20:31:31 -04:00
Michael Rash
3eaa7dcb5f added libfko validate_username() for decrypted SPA data 2012-10-18 23:01:54 -04:00
Michael Rash
e0d86f9a33 [libfko] validation of NAT access strings
Added validation of NAT access strings in the various NAT modes in libfko.
This applies to both the client and server, and test suite support was added
as well.
2012-10-15 20:52:23 -04:00
Michael Rash
402c7033d5 force usernames to be alpha numeric chars and dashes 2012-10-12 23:51:28 -04:00
Michael Rash
e4751d1c20 added icmp type/code blurb 2012-10-11 23:40:04 -04:00
Michael Rash
f8374c8aef [server] (Vlad Glagolev) Submitted a patch to fix command exec mode
(Vlad Glagolev) Submitted a patch to fix command exec mode
under SPA message type validity test.  Support for command exec mode was
also added to the test suite.
2012-09-11 21:54:26 -04:00
Michael Rash
55fa4841f2 another merge from master 2012-09-03 22:32:44 -04:00
Michael Rash
40ac28df21 bump version to 2.0.3 2012-09-03 22:23:48 -04:00
Michael Rash
8d26cc90ee include file compilation fix for OpenBSD relative to inet_aton() IP verification 2012-09-03 22:18:59 -04:00
Michael Rash
b05d229bb1 sprintf() -> snprintf() calls 2012-09-03 09:09:35 -04:00
Michael Rash
263fa01f2a added inet_aton() call for IP strong IP validation (credit: Fernando Arnaboldi) 2012-09-03 00:21:32 -04:00
Michael Rash
1548cbafc8 get MAX_PORT_STR_LEN constant from fko_message.h 2012-08-31 23:05:05 -04:00
Michael Rash
b567514a6c Added fko_context.h file to lib/Makefile.am 2012-08-31 22:59:44 -04:00
Michael Rash
5daaca01ea merged master 2.0.3 changes 2012-08-31 21:43:55 -04:00
Michael Rash
f4c16bc47f [server] Stronger IP validation based on a bug found by Fernando Arnaboldi from IOActive
This commit fixes a condition in which the server did not properly validate
allow IP addresses from malicious authenticated clients.  This has been fixed
with stronger allow IP validation.
2012-08-25 23:08:55 -04:00
Michael Rash
d46ba1c027 (Fernando Arnaboldi, IOActive) Found and fixed several DoS/code execution vulns for authenticated clients
- [server] Fernando Arnaboldi from IOActive found several DoS/code
execution vulnerabilities for malicious fwknop clients that manage to
get past the authentication stage (so a such a client must be in
possession of a valid access.conf encryption key).  These vulnerbilities
manifested themselves in the handling of malformed access requests, and
both the fwknopd server code along with libfko now perform stronger input
validation of access request data.  These vulnerabilities affect
pre-2.0.3 fwknop releases.
- [test suite] Added a new fuzzing capability to ensure proper server-side
input validation.  Fuzzing data is constructed with modified fwknop
client code that is designed to emulate malicious behavior.
2012-08-24 22:12:19 -04:00
Michael Rash
e80a6de5f7 Memory leak bug fix discovered through the "altered HMAC test"
This commit fixes a memory leak caught with valgrind in the "altered HMAC
test":

 [+] fwknop functions (unique view):
-        9 : ???
-        4 : main
-        4 : pcap_capture
-        2 : incoming_spa
-        2 : fko_new_with_data
-        2 : fko_verify_hmac
+        7 : ???
+        2 : pcap_capture
+        2 : main
         1 : pcap_compile
-        1 : strdup
-        1 : fko_calculate_hmac
-        1 : add_salted_str

 [+] fwknop functions (with call line numbers):
-        9 : ??? (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.1.1)
-        4 : main (fwknopd.c:299)
-        2 : fko_new_with_data (fko_funcs.c:220)
-        2 : pcap_capture (pcap_capture.c:226)
-        2 : incoming_spa (incoming_spa.c:378)
-        1 : add_salted_str (cipher_funcs.c:298)
-        1 : strdup (strdup.c:43)
-        1 : fko_verify_hmac (fko_hmac.c:78)
-        1 : fko_verify_hmac (fko_hmac.c:92)
-        1 : pcap_capture (pcap_capture.c:105)
+        7 : ??? (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.1.1)
+        2 : main (fwknopd.c:299)
         1 : pcap_compile (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.1.1)
         1 : pcap_capture (pcap_capture.c:97)
-        1 : fko_calculate_hmac (fko_hmac.c:169)
+        1 : pcap_capture (pcap_capture.c:105)
2012-08-19 10:43:30 -04:00