33 Commits

Author SHA1 Message Date
2def3bb0e8 Avoid TOCTOU by using fstat() after open()
This also needs fileno() after fopen(). This time it addresses the code
for the client.

This is the third part of three for Coverity issue 1355235.
2018-08-27 20:19:31 +02:00
Jonathan Bennett
9475b625a0 Add Doxygen headers to client files 2016-01-01 02:13:21 +00:00
Michael Rash
a85b081f79 copyright update 2015-12-23 14:34:51 -05:00
Michael Rash
2fad399db3 promote hex_dump() to fko_util 2015-12-16 19:28:10 -08:00
Michael Rash
998fb96f0b promote argv handling functions to fko_util (avoids duplication across client and server) 2015-12-16 18:59:10 -08:00
Michael Rash
b03c007c44 [client] add --server-resolve-ipv4 to only accept IPv4 addresses from DNS for the SPA server 2015-09-27 10:17:36 -04:00
Michael Rash
e271442aa9 [server] first cut at converting iptables commands to use execvpe() 2014-10-03 21:58:51 -04:00
Michael Rash
7aa34a92f1 [client] add strtoargv() to easily get an argv array for passing to execvpe() 2014-10-03 14:44:01 -04:00
Michael Rash
2247dfeab8 use execvpe() with NULL env for wget calls 2014-10-03 11:39:33 -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
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
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
Franck Joncourt
c2e1a00154 s/GNU Public/GNU General Public/g 2013-06-30 22:21:22 +02:00
Michael Rash
66399fed1a Merge remote-tracking branch 'fjoncourt/master'
Closes #74 - allows a passphrase to be read from STDIN or from a file descriptor
via --fd.
2013-06-02 22:54:23 -04:00
Franck Joncourt
9fce10abd8 Adding support for reading encryption/key password from a file descriptor.
* Added tests to the test suite.
 * Updated the usage message.
 * Fixed the password functions.

reference : mrash/fwknop#74
2013-06-02 21:36:17 +02:00
Michael Rash
382099e85a Updated copyright dates, removed NEWS file in favor of the ChangeLog 2013-06-02 14:07:01 -04:00
Damien Stuart
15d9c6197b Fixes to get hmac_support and 2.5 changes working for the Windows lib and client builds. 2013-05-05 13:20:20 -04:00
Franck Joncourt
d93648cf99 Moved/Created proto_intostr() and proto_strtoint() to utils.c.
This allows to update dump_transmit_options() to use the log module to dump data.
2013-04-30 22:22:03 +02:00
Franck Joncourt
b04de687ce Fixed hostname resolution while spoof ip is used.
mrash/fwknop#64
2013-04-27 23:31:40 +02:00
Damien Stuart
6ecf81b16e First round if refactoring to clean up header dependencies. 2013-03-02 17:03:20 -05:00
Michael Rash
47ea800889 merged in fwknop-2.0.4 changes 2013-01-18 17:25:16 -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
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
5daaca01ea merged master 2.0.3 changes 2012-08-31 21:43:55 -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
3095f0ee43 Added key generation support with --key-gen
Added --key-gen to allow KEY_BASE64 and HMAC_KEY_BASE64 keys to be created from
reading random data from /dev/random.  These keys can be placed within server
access.conf files and corresponding client .fwknoprc files for SPA
communications.  The HMAC key is not used yet with this commit, but that is
coming.
2012-06-27 23:06:17 -04:00
Michael Rash
6388e8ac7f added 'const' to function prototype vars where possible
Added the 'const' qualifier to function prototype variables where possible.
In addition, reduced some functions to file-scope with 'static' where possible.

Also made a few minor changes to remove extra whitespace, and fixed a bug
in create_fwknoprc() to ensure the new fwknoprc filehandle is closed.
2011-10-25 21:00:40 -04:00
Michael Rash
ca5f82c067 Removed legacy $Id$ tags from svn
$Id$ tags don't really mean anything to git so they have been removed from all
source files.
2011-06-18 20:53:40 -04:00
Damien Stuart
0f6ca00ac4 Updated the GPL blurb at the top of the source files. Added some missing copyright statements (Thanks to Franck Joncourt).
git-svn-id: file:///home/mbr/svn/fwknop/trunk@300 510a4753-2344-4c79-9c09-4d669213fbeb
2010-11-13 03:04:36 +00:00
Damien Stuart
b0886a1d49 Updates and clean-up to address the many compiler warnings when compiled with -Wall. Also some autoconf updates
git-svn-id: file:///home/mbr/svn/fwknop/trunk@265 510a4753-2344-4c79-9c09-4d669213fbeb
2010-07-16 14:28:32 +00:00
Michael Rash
510702dc18 added Id tag expansion
git-svn-id: file:///home/mbr/svn/fwknop/trunk@180 510a4753-2344-4c79-9c09-4d669213fbeb
2010-01-03 04:49:51 +00:00
Damien Stuart
08aa1ef2e8 Updates to accommodate the Windows build.
git-svn-id: file:///home/mbr/svn/fwknop/trunk@131 510a4753-2344-4c79-9c09-4d669213fbeb
2009-08-09 17:14:08 +00:00
Damien Stuart
53b7fae8bb Major rearrangement. Renamed directories: "fko" to "lib", "src" to "client". Added "common" and "server" directories. Setup autoconf to allow disabling the server and/or client builds.
git-svn-id: file:///home/mbr/svn/fwknop/trunk@127 510a4753-2344-4c79-9c09-4d669213fbeb
2009-08-09 15:43:16 +00:00