319 Commits

Author SHA1 Message Date
Michael Rash
f5bb43927d Merge branch 'master' of https://github.com/mrash/fwknop 2014-03-14 22:57:53 -04:00
Michael Rash
0897bd54e1 [libfko] call SPA field parsers via function pointers in fko_decode_spa_data() 2014-03-14 22:57:36 -04:00
Michael Rash
2eff0c01aa [libfko] start on refactoring fko_decode_spa_data() to put SPA field parsing into dedicated functions 2014-03-14 21:11:25 -04:00
Michael Rash
9e990c9be0 fix header non-ascii chars, and introduce test suite support for detecting this in source files 2014-03-14 09:14:35 -04:00
Michael Rash
b5eb857533 [libfko] allow MS compatible usernames
Allow usernames that are compatible with Microsoft guidelines as defined
here:

http://technet.microsoft.com/en-us/library/bb726984.aspx

This allows for greater compatibility between fwknop clients on Windows
(for example that may be deployed with Cygwin) and fwknopd on other
systems.  This change was suggested by Gerry Reno, and tracked by Github
issue #114.
2014-03-09 23:12:53 -04:00
Michael Rash
bfdbb8f260 Updated authorship and copyright information
This commit updates all authorship and copyright information to include a
standard header that references the AUTHORS and CREDITS file. This standard
header was written by the Debian legal team at the request of Franck Joncourt.
2014-03-04 17:53:10 -05:00
Michael Rash
7bb5811651 [libfko] minor bug fix to not return GPG error codes from _rijndael_decrypt() 2014-02-02 20:32:02 -05:00
Damien Stuart
1e1729905e Bumped libfko and protocol versions to 2.0.1. Added dependencies for this version to the fwknop.spec file. 2014-01-11 10:58:01 -05:00
Michael Rash
3820b64394 [libfko] ensure a NULL HMAC key is properly handled 2014-01-01 19:45:38 -05:00
Michael Rash
227d0ab947 [libfko] ensure NULL is handled properly for all fko_get_* functions 2013-12-31 23:27:05 -05:00
Michael Rash
7aa6d37fff [libfko] added NULL check for fko_set_spa_data() data arg 2013-12-30 21:56:08 -05:00
Michael Rash
5022beaf12 [libfko] < 0 checks not needed for size_t vars which are unsigned 2013-12-30 21:09:27 -05:00
Michael Rash
297d7d00fe [libfko] enc key NULL checks with fko-wrapper test support 2013-12-29 22:44:16 -05:00
Michael Rash
0c6911941b [libfko] reject negative length values
Integer lengths that are negative are never valid.  This commit also
extends the fuzzing capabilities of the test/fko-wrapper code to
validate libfko calls with negative length arguments, and one crash
scenario with a negative length for the encryption key was found (and
fixed) this way.
2013-12-29 21:05:04 -05:00
Michael Rash
79f0cb8986 [libfko] added defensive NULL check for is_valid_ipv4_addr() 2013-12-04 23:11:11 -05:00
Michael Rash
be904769c4 [libfko] Bug fix to not decrypt with GnuGP without FKO_ENC_MODE_ASYMMETRIC
[libfko] Bug fix to not attempt SPA packet decryption with GnuPG without
an fko object with encryption_mode set to FKO_ENC_MODE_ASYMMETRIC.  This
bug was caught with valgrind validation against the perl FKO extension
together with the set of SPA fuzzing packets in
test/fuzzing/fuzzing_spa_packets.  Note that this bug cannot be
triggered via fwknopd because additional checks are made within fwknopd
itself to force FKO_ENC_MODE_ASYMMETRIC whenever an access.conf stanza
contains GPG key information.  This fix strengthens libfko itself to
independently require that the usage of fko objects without GPG key
information does not result in attempted GPG decryption operations.  Hence
this fix applies mostly to third party usage of libfko - i.e. stock
installations of fwknopd are not affected.  As always, it is recommended to
use HMAC authenticated encryption whenever possible even for GPG modes since
this also provides a work around even for libfko prior to this fix.
2013-11-26 08:35:16 -05:00
Michael Rash
78f696b2f7 [libfko] implemented shared utility function for ipv4 address checking
This commit implements a single shared utility function for checking the
validaty of an IPv4 address, and both libfko and the fwknopd server use it
now.  The client will be updated as well.
2013-11-20 17:13:55 -05:00
Michael Rash
c019a43808 [libfko] bug fix caught by new code structure error str test to add string for FKO_ERROR_INVALID_DATA_DECODE_EXTRA_TOOBIG 2013-11-16 23:23:32 -05:00
Michael Rash
196fef65b6 [libfko] move is_base64 check to libfko
This commit replaces the separately implemented client/server
is_base64() check with a single libfko function, and libfko itself now
uses it as well before prepending Rijndael or GnuPG base64 encoded
prefixes.
2013-11-16 19:20:08 -05:00
Michael Rash
6d78c49ef9 [libfko] minor update to print 'None' for the HMAC type when an HMAC is not used instead of just diplaying '()' 2013-11-14 23:13:33 -05:00
Michael Rash
23ef1d4e59 [libfko] Candidate build fix for Mac OS X 10.9 (closes #108)
Nikolay Kolev reported a build issue on Mac OS X 10.9 (Mavericks) where fwknop
copies of strlcpy() and strlcat() functions were conflicting with those that ship
with OS X 10.9.

The solution was to add a configure.ac check for strlcat() and strlcpy() and
wrap "#if !HAVE_..." checks around those functions.

A portion of the build errors looked like this:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in lib
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I ../common   -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all -fstack-protector -fPIE -D_FORTIFY_SOURCE=2 -MT base64.lo -MD -MP -MF .deps/base64.Tpo -c -o base64.lo base64.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I ../common -g -O2 -Wall -Wformat -Wformat-security -fstack-protector-all -fstack-protector -D_FORTIFY_SOURCE=2 -MT base64.lo -MD -MP -MF .deps/base64.Tpo -c base64.c  -fno-common -DPIC -o .libs/base64.o
In file included from base64.c:34:
In file included from ./fko_common.h:149:
./fko_util.h:56:9: error: expected parameter declarator
size_t  strlcat(char *dst, const char *src, size_t siz);
        ^
/usr/include/secure/_string.h:111:44: note: expanded from macro 'strlcat'
  __builtin___strlcat_chk (dest, src, len, __darwin_obsz (dest))
                                           ^
/usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz'
 #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0)
                                                             ^
2013-11-12 21:36:14 -05:00
Michael Rash
0d80f72c00 Revert "[test suite] minor Test::Valgrind name typo fix"
This reverts commit 642024041534d79c897a21b2e19ef3e1ed7b2a61.
2013-10-22 20:36:30 -04:00
Michael Rash
6420240415 [test suite] minor Test::Valgrind name typo fix 2013-10-22 16:18:46 -04:00
Franck Joncourt
5693b0536a Fixed *Value stored is never read* warning found by clang. 2013-08-27 20:45:17 +02:00
Michael Rash
e8fe29bbe1 Merge branch 'master' of github.com:mrash/fwknop 2013-08-11 22:09:22 -04:00
Michael Rash
c0c8048ee1 Added fko context dumper change to ChangeLog, updated test suite to account for single line printing of final SPA data 2013-08-11 22:07:02 -04:00
Damien Stuart
12916f21ef Moved new invalid data error definitions above the GPGME_ERR_START marker. 2013-08-11 22:02:50 -04:00
Franck Joncourt
f8ae3b8da3 Merge remote-tracking branch 'upstream/master' into fko_dump 2013-08-10 14:32:34 +02:00
Franck Joncourt
b590932fb6 * Removed goto statements. We do not do any further processings
when we reach the error label.
2013-08-10 14:30:40 +02:00
Hank Leininger
bc907e0b24
Add unique errors for every FKO_ERROR_INVALID_DATA. Needed this to
track down mystery errors (#98).
2013-08-05 22:21:10 -04:00
Franck Joncourt
7296d3f3bf * Interim commit to add a dump function to dump the FKO context shared
by both the server and client. mrash/fwknop#95
2013-08-05 23:28:07 +02:00
Michael Rash
11fa1f2f0d [libfko] set version-info to 2:0:0 per Damien and Franck's recommendations 2013-07-19 20:33:38 -04:00
Michael Rash
f7a821d082 minor ChangeLog text tweaks and one typo fix 2013-07-17 23:34:37 -04:00
Damien S. Stuart
4b0f0802ee Tweaks to unbreak the windows build: Renamed FD_SET macro to FD_SET_ALT to avoid conflict with the well-known FD_SET macro. Made the client read password from file descriptor a non-supported function on Windows. 2013-07-17 22:46:24 -04:00
Michael Rash
f391b1391d [libfko] apply zero_buf() to stack allocated Rijndael context for encrypt/decrypt 2013-07-12 23:21:38 -04:00
Michael Rash
e75c10c6e5 [libfko] use zero_free_rv - dead code bug fix found by CLANG static analyzer 2013-07-10 23:10:23 -04:00
Michael Rash
6c24b1c858 [libfko] always call free() from zero_free() on all non-NULL buf pointers 2013-07-10 23:09:41 -04:00
Michael Rash
a42bfd38c2 [libfko] bug fix to set digest length upon SPA packet decode
This bug was caught with the fko_wrapper.c multi-call tester running under
valgrind.
2013-07-10 23:07:43 -04:00
Michael Rash
3756b831f5 simplified zero_free() calls in support of #93 2013-07-09 22:17:05 -04:00
Michael Rash
189a183e18 allow zero length to return FKO_SUCCESS from zero_buf() call 2013-07-09 21:40:23 -04:00
Michael Rash
69760d49c5 [libfko] return proper GPG error code upon gpg_decrypt() failure 2013-07-09 21:18:45 -04:00
Michael Rash
5915ee72a9 [libfko] add ctx initialized check to fko_gpg_errstr() 2013-07-09 21:18:06 -04:00
Michael Rash
24c4c5e208 continued zeroing out of sensitive data buffers in support of issue #93 2013-07-08 23:00:18 -04:00
Michael Rash
1e77f6ed53 continued changes to zero out sensitive information before exit (#93) 2013-07-07 22:32:30 -04:00
Franck Joncourt
9d7feb52f6 Merge remote-tracking branch 'upstream/master' 2013-06-30 22:22:34 +02:00
Franck Joncourt
c2e1a00154 s/GNU Public/GNU General Public/g 2013-06-30 22:21:22 +02:00
Michael Rash
37b624ac8b bump version to 2.5, minor fwknopd -S exit status update
This commit bumps the fwknop version to 2.5 and sets the libfko version to 2.0 to
signal incompatibility with older libfko versions.  Backwards compatibility is
maintained in SPA packet construction, but function prototypes in libfko-2.0 are
no longer compatible with older versions.

This commit also returns non-zero exit status under 'fwknopd --status' if there
is no existing fwknopd process.  This is better than always exiting with a zero
status regardless of whether fwknopd is already running or not, and adds a level
of scriptability to --status usage.  This change was suggested by George Herlin.
2013-06-27 21:21:10 -04:00
Michael Rash
54c26ede6e [libfko] defensive coding update to quiet minor CLANG static analyzer false positives 2013-06-19 23:38:37 -04:00
Michael Rash
ea0ecc8cbe [libfko] BYTEORDER macro update to 4321 or 1234 if all other methods fail 2013-06-12 23:09:55 -04:00
Michael Rash
ffeb285f7b [libfko] handle endian detection on PPC (and other) systems
Blair Zajac contributed a patch to handle endian detection on PPC systems
and issue a compile time error if it cannot be determined.  This commit affects
the BYTEORDER macro.
2013-06-10 22:28:00 -04:00