188 Commits

Author SHA1 Message Date
2a71226968 Let snprintf() use buffers completely 2018-07-24 18:24:22 +02:00
5228fe88d0 Avoid compilation warnings from ctype(3) helpers
Characters should be casted as unsigned before use in functions from
<ctype.h>. Otherwise the compiler treats 8-bit characters (eg UTF-8) as
negative values (since it expects signed integers) and they no longer
match the comparison tables. Worse, the character 0xff gets interpreted
as -1 (like EOF). In turn, it helps to explicitly cast the result as a
signed integer, since this is what is expected. Characters in the range
0x80-0xff do keep their original values.

See the manual page for ctype(3) for more details (eg from NetBSD)
2018-06-12 14:01:22 -04:00
Jakub Wilk
2d7f5132aa Fix indefinite articles 2016-09-06 12:20:39 +02:00
Michael Rash
74ddbf63b2 minor documentation updates 2016-05-27 23:15:39 -07:00
Jonathan Bennett
74d3515218 Removes a dead code path in client
A trio of checks were done two places, and the code path always went through both checks.
Since the program announced a fail and closed, the second set of checks could never be triggered.
2016-05-26 09:32:26 -05:00
Jonathan Bennett
dc9ad5de4a Adds a length modifier to is_valid_ipv4_addr 2016-05-07 21:59:48 -05:00
Jonathan Bennett
58bce15b1e Exclude the CUnit tests themselves from lcov 2016-05-02 13:17:03 -05:00
Michael Rash
5e7871c9c6 Merge pull request #208 from oneru/master 2016-04-10 13:30:46 -04:00
Jonathan Bennett
d939deb811 Spelling corrections, found using the codespell tool. 2016-04-10 12:03:59 -05:00
Michael Rash
eb94f19d8f [client] add --no-home-dir and --no-rc-file, closes #203 2016-04-09 21:17:10 -04:00
Jonathan Bennett
a3e0d1cc1b clean up whitespace problems 2016-01-02 20:18:12 -06:00
Jonathan Bennett
9475b625a0 Add Doxygen headers to client files 2016-01-01 02:13:21 +00:00
Jonathan Bennett
d9f9cb8ad5 Add SHA3 and HMAC-SHA3 support 2015-12-30 20:32:52 +00:00
Michael Rash
a85b081f79 copyright update 2015-12-23 14:34:51 -05:00
Michael Rash
f230c32371 promote chop_* functions into fko_util 2015-12-16 18:00:57 -08:00
Michael Rash
a000bcd4a0 [client] minor formatting update 2015-12-04 18:49:24 -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
ceb1713976 add --key-gen option to fwknopd (suggested by Jonathan Bennett) 2015-05-20 08:55:17 -07:00
Michael Rash
136d017afb [client] ensure no dns, http, or other network comms in AFL fuzzing mode 2015-05-14 17:51:25 -07:00
Damien Stuart
b152d15970 Refactored how the cunit tests are processed so "make dist" does not fail and builds with c-unit-tests enabled work on systems with firewalld (added fw_util_firewalld.c for server tests). 2015-02-14 12:29:30 -05:00
Franck Joncourt
1c81aef39d Fixed file permissions 2014-12-31 09:51:08 +01:00
Franck Joncourt
b7ecb3334a Merge upstream changes to our changes 2014-12-28 15:00:24 +01:00
Michael Rash
ece855b66a [client] bug fix to ensure -a overrides IP resolution 2014-11-18 23:10:19 -05:00
Michael Rash
22289a3f58 [client] disable IP resolution in AFL_FUZZING mode 2014-11-18 20:16:12 -05:00
Michael Rash
50952b4a6e Merge branch 'master' of https://github.com/mrash/fwknop into execvpe 2014-10-04 19:36:04 -04:00
Michael Rash
836370d034 [client] minor tab->spaces fix 2014-10-04 10:32:52 -04:00
Michael Rash
b1358d564d minor client --help update 2014-10-03 11:35:38 -04:00
Florian Schüller
dc30f162c7 Add "NO_SAVE_ARGS" to initial config file 2014-10-01 14:28:36 +02:00
Florian Schüller
981d1f7077 Support for "--no-save-args" in .fwknoprc 2014-10-01 14:28:29 +02:00
Michael Rash
50434c5c4c Use the fwknop User-Agent for wget SSL external IP resolutions
Bug fix to ensure that a User-Agent string can be specified when the
fwknop client uses wget via SSL to resolve the external IP address. This
closes issue #134 on github reported by Barry Allard. The fwknop now
uses the wget '-U' option to specify the User-Agent string with a
default of "Fwknop/<version>". In addition, a new command line argument
"--use-wget-user-agent" to allow the default wget User-Agent string to
apply instead.
2014-09-27 23:23:12 -04:00
Franck Joncourt
260cd5481b Use of init and cleanup functions for the test suite. 2014-09-07 20:33:39 +02:00
Franck Joncourt
32c5afae83 Merge remote-tracking branch 'upstream/master' into c_unit_testing 2014-09-07 15:24:59 +02:00
Franck Joncourt
688f08c2a0 Both the fwknop client and server have their own test suites tied to fwknop_utests
and fwknopd_utests binaries.

When profil coverage is enbaled, lcov filee are parsed by test-fwknop.pl and added
to the main profil coverage report in the output directory.

Running make from the main directory build the c-unit test suites if enabled.
2014-09-07 15:15:22 +02:00
Michael Rash
eb0e8eb6a1 fwknopd man page updates for access.conf vars 2014-08-26 23:21:14 -04:00
Franck Joncourt
306dd0f685 First layout to add c unit testing support to fwknop. 2014-08-24 21:05:44 +02:00
Michael Rash
b06447384e [client] have autoconf resolve the absolute path to wget for SSL IP resolution 2014-07-27 22:03:58 -04:00
Michael Rash
59718f1a36 [client] Updated IP resolution mode -R to use SSL
External IP resolution via '-R' (or '--resolve-ip-http') is now done via SSL by
default. The IP resolution URL is now 'https://www.cipherdyne.org/cgi-gin/myip',
and a warning is generated in '-R' mode whenever a non-HTTPS URL is specified
(it is safer just to use the default). The fwknop client leverages 'wget' for
this operation since that is cleaner than having fwknop link against an SSL
library.
2014-07-25 17:42:06 -04:00
Michael Rash
764d9ca26d fix gcc -Wstrlcpy-strlcat-size warnings 2014-07-19 16:30:53 -04:00
Michael Rash
6d1d66fe03 add --fault-injection-tag support to the client/server/libfko
This is a significant commit to add the ability to leverage libfko fault
injections from both the fwknop client and server command lines via a
new option '--fault-injection-tag <tag name>'.  This option is used by
the test suite with the tests/fault_injection.pl tests.
2014-06-05 23:05:49 -04:00
Michael Rash
b243bb4bb7 [client] fix minor memory leak before exit() in parsing invalid time offsets 2014-04-11 22:45:27 -04:00
Michael Rash
f539afc750 [client] make is_rc_param() error condition fatal 2014-04-10 20:48:05 -04:00
Michael Rash
c6cb892a05 [test suite] more client/config_init.c test coverage 2014-04-06 22:14:10 -04:00
Michael Rash
a65324bad1 [client] return error exit status if --stanza-list cannot open the rc file 2014-04-04 23:02:09 -04:00
Michael Rash
956199a3cb [client] minor typo fix for -P requirement under spoofed src mode 2014-04-03 22:52:11 -04:00
Michael Rash
73bc473563 [client+server] verify GnuPG signatures by default
- [server] When GnuPG is used, the default now is to require that
incoming SPA packets are signed by a key listed in GPG_REMOTE_ID for each
access.conf stanza. In other words, the usage of GPG_REQUIRE_SIG
is no longer necessary in order to authenticate SPA packets via the
GnuPG signature. Verification of GnuPG signatures can be disabled with a
new access.conf variable GPG_DISABLE_SIG, but this is NOT a
recommended configuration.
- [client+server] Add --gpg-exe command line argument and GPG_EXE
config variable to ~/.fwknoprc and the access.conf file so that the path
to GnuPG can be changed from the default /usr/bin/gpg path.
2014-03-25 19:53:13 -04:00
Michael Rash
5baf8a3fa9 replace malloc() with calloc() calls 2014-03-15 22:02:57 -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
ad512ff6e7 [test suite] added Rijndael+HMAC SPOOF_SRC fwknoprc file test 2014-03-13 21:43:51 -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
c382febf3d [client] use libfko is_valid_ipv4_addr() for IP address validation 2013-11-26 23:48:56 -05:00