125 Commits

Author SHA1 Message Date
Michael Rash
39ca73a245 [test suite] added OpenSSL HMAC verification (closes #39) 2013-03-05 23:29:46 -05:00
Michael Rash
1dc47f80d8 Fix byte order warning
This commit fixes a byte order warning for both sha1.c and md5.c like so:

sha1.c:127:6: warning: #warning Undetermined or unsupported Byte Order... We will try LITTLE_ENDIAN [-Wcpp]

Also removed a couple of header includes that appear not be needed.
2013-03-03 14:29:08 -05:00
Michael Rash
b86e48dd66 remove a couple of unnecessary header includes 2013-03-02 23:16:26 -05:00
Damien Stuart
f9e1ae4859 Merge my working branch 'hmac_support' into hmac_header_fixes 2013-03-02 17:22:50 -05:00
Damien Stuart
6ecf81b16e First round if refactoring to clean up header dependencies. 2013-03-02 17:03:20 -05:00
Michael Rash
73b1931bd8 minor clean up for get_keys() base64 decoded key length 2013-02-28 22:25:04 -05:00
Michael Rash
ffcb77552b Remove lib/fko.h dependency on rijndael.h 2013-02-28 21:47:43 -05:00
Michael Rash
5b00d1756f set fko_ctx_t opaque pointers to NULL 2013-02-20 21:20:09 -05:00
Michael Rash
a413c6cf94 Continue atoi() replacement with strtol() wrapper, closes issue #21
This commit completes the conversion to the strtol() wrapper function in order
to remove all atoi() calls.  In addition, variable max values are enforced
using more broadly defined RCHK_* values.
2013-02-19 23:11:01 -05:00
Michael Rash
1afc8db96a Added strtol_wrapper() libfko utility function for atoi() replacement (#21)
This commit replaces most atoi() calls (which don't report errors) with a strtol()
wrapper function for stronger string -> integer conversion validation.
2013-02-18 19:32:53 -05:00
Michael Rash
7735e8ce7a minor comment typ fix 2013-02-17 12:02: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
47f20ea30c merged in the fixes_for_2.0.4 branch 2013-01-19 18:36:52 -05:00
Michael Rash
307cb84323 port strlen bugfix 2013-01-18 22:11:32 -05:00
Michael Rash
47ea800889 merged in fwknop-2.0.4 changes 2013-01-18 17:25:16 -05:00
Damien Stuart
5f598bbf7f Added Les Aker's changes: Look for glibtoolize if libtoolize is not available (for Macs). Added USE_GPG_AGENT option for .fwknoprc 2012-12-09 12:30:43 -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
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
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
f544a4aeb5 Added the --icmp-xxxx arg descriptions to the fwknop usage message. 2012-11-19 09:48:34 -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
2a3cd1abfe Merge branch 'master' of github.com:mrash/fwknop 2012-11-08 22:25:33 -05:00
Michael Rash
03b222ddda [client] (Franck Joncourt) Fixed Ctrl-C problem where SPA packets were sent anyway
[client] (Franck Joncourt) Contributed a patch to allow the fwknop
client to be stopped during the password entry prompt with Ctrl-C before
any SPA packet is sent on the wire.
2012-11-08 22:22:04 -05:00
Damien Stuart
5ddf5afec6 Ignore trailing whitespace on .fwknoprc directives 2012-11-08 19:41:46 -05:00
Michael Rash
627035fb22 Patch from Franck Joncourt for setting permissions via open()
[client+server] Applied patch from Franck Joncourt to remove unnecessary
chmod() call when creating client rc file and server replay cache file.
The permissions are now set appropriately via open(), and at the same
time this patch fixes a potential race condition since the previous code
used fopen() followed by chmod().
2012-10-23 21:47:56 -04:00
Michael Rash
e4751d1c20 added icmp type/code blurb 2012-10-11 23:40:04 -04:00
Michael Rash
ecce80b92b [client] for spoofed SPA packets over ICMP, switche back to sending over echo reply 2012-10-04 21:05:22 -04:00
Michael Rash
229a36625b Better IP spoofing support (udpraw and icmp)
- [client] Added '-P udpraw' to allow the client to send SPA packets over
  UDP with a spoofed source IP address.  This is in addition to the
  original 'tcpraw' and 'icmp' protocols that also support a spoofed
  source IP.
- [server] Bug fix to accept SPA packets over ICMP if the fwknop client
  is executed with '-P icmp' and the user has the required privileges.
2012-10-03 22:56:10 -04:00
Michael Rash
55fa4841f2 another merge from master 2012-09-03 22:32:44 -04:00
Michael Rash
e3a78a175c verify_file_perms_ownership() to just return if the file doesn't exist 2012-09-01 21:55:52 -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
dafcfbc488 bug fix to make sure to verify file permissions/ownership on files that actually exist 2012-08-31 23:00:45 -04:00
Michael Rash
5daaca01ea merged master 2.0.3 changes 2012-08-31 21:43:55 -04:00
Michael Rash
d739331818 implemented a couple of minor stronger bounds checks 2012-08-30 23:38:54 -04:00
Michael Rash
a60f05ad44 file permissions and client buffer overflow fix
- [client+server] Fernando Arnaboldi from IOActive found that strict
filesystem permissions for various fwknop files are not verified.  Added
warnings whenever permissions are not strict enough, and ensured that
files created by the fwknop client and server are only set to user
read/write.
- [client] Fernando Arnaboldi from IOActive found a local buffer overflow
in --last processing with a maliciously constructed ~/.fwknop.run file.
This has been fixed with proper validation of .fwknop.run arguments.
2012-08-29 22:21:43 -04:00
Michael Rash
8d6bc05295 merged from master 2012-08-17 21:19:52 -04:00
Michael Rash
38feb8d7b9 Better --resolve-url handling
Chop any trailing '/' char, be more careful about handling incoming large HTTP
responses, print the HTTP request and response in --verbose --verbose mode.
2012-08-17 21:02:24 -04:00
Michael Rash
3af8e4c517 [client] Added cipherdyne.com backup check in -R mode.
Added backup check against a cipherdyne.com 'myip' cgi instance in -R mode if
the normal check against cipherdyne.org fails.
2012-08-15 22:49:29 -04:00
Michael Rash
c374a7df27 Merge branch 'master' into hmac_support 2012-08-05 13:26:43 -04:00
Michael Rash
f6ac4484c9 minor memset value update 0 -> 0x0 to conform to other memset() calls 2012-08-05 13:05:30 -04:00
Michael Rash
29512bd8ec [client] -R http recv() read until close (Jonathan Schulz)
Applied patch from Jonathan Schulz to ensure that the fwknop client reads all
data from a remote webserver when resolving the client IP address in -R mode.
Jonathan indicated that some webservers would transfer HTTP headers and data
separately, and a single recv() would therefore fail to get the necessary IP
information.
2012-08-03 21:49:03 -04:00
Michael Rash
7c1db89106 minor white space fix tabs->spaces 2012-08-03 21:30:24 -04:00
Michael Rash
cba6478258 Memory leak bug fix for rc file parsing of invalid data
This commit fixes the following (found with the test suite in valgrind mode):

568 bytes in 1 blocks are still reachable in loss record 1 of 1
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x50B1C9A: __fopen_internal (iofopen.c:76)
   by 0x10D0CD: process_rc (config_init.c:516)
   by 0x10D645: config_init (config_init.c:752)
   by 0x10AB13: main (fwknop.c:70)
2012-08-02 22:29:54 -04:00
Michael Rash
c37047ac93 Memory leak bug fix in --key-gen mode
This commit fixes the following memory caught with the test suite in valgrind
mode:

HEAP SUMMARY:
    in use at exit: 285 bytes in 4 blocks
  total heap usage: 11 allocs, 7 frees, 3,179 bytes allocated

5 bytes in 1 blocks are indirectly lost in loss record 1 of 4
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x50CB801: strdup (strdup.c:43)
   by 0x4E3A7B2: fko_set_username (fko_user.c:96)
   by 0x4E39628: fko_new (fko_funcs.c:86)
   by 0x10AB54: main (fwknop.c:83)

7 bytes in 1 blocks are indirectly lost in loss record 2 of 4
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E395D7: fko_new (fko_funcs.c:62)
   by 0x10AB54: main (fwknop.c:83)

17 bytes in 1 blocks are indirectly lost in loss record 3 of 4
   at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E3A06A: fko_set_rand_value (fko_rand_value.c:114)
   by 0x4E39605: fko_new (fko_funcs.c:75)
   by 0x10AB54: main (fwknop.c:83)

285 (256 direct, 29 indirect) bytes in 1 blocks are definitely lost in loss record 4 of 4
   at 0x4C29DB4: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4E395BA: fko_new (fko_funcs.c:46)
   by 0x10AB54: main (fwknop.c:83)

LEAK SUMMARY:
   definitely lost: 256 bytes in 1 blocks
   indirectly lost: 29 bytes in 3 blocks
     possibly lost: 0 bytes in 0 blocks
   still reachable: 0 bytes in 0 blocks
        suppressed: 0 bytes in 0 blocks
2012-08-02 22:00:05 -04:00
Michael Rash
84b9c775c0 Merge branch 'master' into hmac_support 2012-08-01 23:41:00 -04:00
Michael Rash
84e036f95b Change HTTP connection type to 'close' in -R mode
Applied patch from Jonathan Schulz to change the HTTP connection type to
'close' for the client in -R mode.
2012-08-01 23:27:34 -04:00
Michael Rash
fd30a3491d minor variable rename LENGTH -> LEN, STRING_LENGTH -> STR_LEN 2012-07-29 21:57:05 -04:00
Michael Rash
ab52476bfc [test suite] [client] added --key-gen and --key-gen-file tests 2012-07-27 13:05:29 -04:00
Michael Rash
175374337d merged crypto_update after fwknop-2.0.1 merge to crypto_update from master 2012-07-24 17:10:00 -04:00