221 Commits

Author SHA1 Message Date
Franck Joncourt
6d9f840ab7 The -R command line switch is now handled in fwknoprc as RESOLVE_IP_HTTP variable. 2013-05-29 14:06:57 +02:00
Franck Joncourt
cf6cb01f67 Fixed ask_overwrite(). Generated keys are now stored in fwknoprc.
* ask_overwrite() : when the user inputs more than one char when prompted,
   a second call to the function does not take the second char anymore.
   We parse all of the chars until we reach an LF char and discard all of them
   except the first one.
   The overwrite is requested only when the user sets 'y', if there is anything
   else we asssume 'N'.

 * When -k is used on the command line along with the --save-rc-stanza, the
   generated keys are also written in the stanza in fwknoprc.
2013-05-29 12:19:56 +02:00
Franck Joncourt
82caa9a6a9 The variables are now stored in a hash (variable name and position) rather than
an array containing only their name. It is now possible to sort them without
 worrying about their position in the enumeration.

Improve variable naming for a better understanding (var_ndx becomes var_pos).
2013-05-28 17:14:36 +02:00
Franck Joncourt
dedc4bc8aa Interim commit to handle bitmask with more than 32 positions. 2013-05-27 18:18:47 +02:00
Franck Joncourt
cc07d10d73 Set command line argument bitmask as a 64-bits value to be able to handle more arguments.
Interim commit to add the VERBOSE variable to be stored in the fwknoprc file when
 -v is used with --save-rc-stanza. The VERBOSE variable is also read by fwknop
 and the verbosity level is set accordingly.
2013-05-25 21:56:01 +02:00
Michael Rash
cfbbac2654 man page updates - access.conf section now includes variable guidance 2013-05-21 22:10:13 -04:00
Michael Rash
52462e7dba Use {0} initializer for all stack allocated char arrays
Lots of places in the code were already using {0} to initialize stack char
arrays, but memset() was being used as well.  This commit removes all
unnecessary memset() calls against char arrays that are already initialized
via {0} (which sets all members to zero for such arrays).
2013-05-21 22:00:15 -04:00
Franck Joncourt
98e631451f Fixed stanza name in log message. We display the stanza we were looking for, not the current one. 2013-05-20 21:58:18 +02:00
Franck Joncourt
5e3d9b6e0b Do not assume two rc sections are separated by an empty line. (mrash/fwknop#81) 2013-05-19 22:00:51 +02:00
Michael Rash
e31459bb1e updated client and server man page material 2013-05-19 14:12:58 -04:00
Michael Rash
0a279ccbfc [client] minor --verbose display update to say source port is 'OS assigned' when not otherwise set 2013-05-18 22:49:38 -04:00
Michael Rash
96bbf7e61a [client] bug fix to separate out --named-config vs. --no-save-args command line args 2013-05-18 22:36:13 -04:00
Michael Rash
23a354fced [client+server] ensure HMAC key and encryption passphrase are not the same 2013-05-18 12:10:18 -04:00
Michael Rash
731ca0e038 [client] added warning in --verbose mode if -s is used instead of -a or -R 2013-05-18 10:51:49 -04:00
Michael Rash
45244114f8 [client] --key-gen bug fix to print keys to stdout 2013-05-17 21:03:16 -04:00
Franck Joncourt
bb90a8bf75 Fixed gcc warnings on openbsd. - mrash/fwknop#60 2013-05-14 22:08:44 +02:00
Franck Joncourt
9dbb62ae1e Merge remote-tracking branch 'upstream/master' 2013-05-13 16:30:27 +02:00
Michael Rash
c555a35489 [client] set ctx=NULL after fko_destroy() calls 2013-05-12 20:54:04 -04:00
Franck Joncourt
160c21d6b6 Rewrite enc_mode_inttostr() and enc_mode_strtoint().
Make sure both functions works the same way and refer to the same
encryption mode string.

Updated the fwknop usage message to display the encryption mode.
2013-05-12 16:52:52 +02:00
Michael Rash
add518016c [client] removed unnecessary array NULL check found by Coverity 2013-05-09 22:10:38 -04:00
Michael Rash
8c09d38941 various sizeof() usage and type bug fixes found by Coverity 2013-05-09 21:17:27 -04:00
Michael Rash
9f9bbcbcdd fixed several resource leak conditions found by Coverity 2013-05-09 17:15:58 -04:00
Michael Rash
8d980ae686 remove dead code caught by Coverity 2013-05-07 23:02:49 -04:00
Michael Rash
e1c6f04ef9 [client] fix missing 'break' in switch statement (discovered by Coverity) 2013-05-07 21:43:38 -04:00
Franck Joncourt
a9a143a85d Merge remote-tracking branch 'upstream/master' 2013-05-06 11:52:35 +02:00
Franck Joncourt
b3cbf1ecfa Replaced printf() by log_msg(). 2013-05-06 10:02:02 +02:00
Michael Rash
eb143db9a7 [client] added --get-hmac-key to mirror --get-key, closes #68 2013-05-05 21:54:07 -04:00
Michael Rash
83493a424c Merge branch 'master' of github.com:mrash/fwknop 2013-05-05 21:01:26 -04:00
Michael Rash
314cc3eb23 Merge remote-tracking branch 'origin/win32_fixes'
This fixes issue #69 thanks to Damien.
2013-05-05 20:59:04 -04:00
Damien S. Stuart
0363a2099a Regenerated the client and server manpage .in files from the asciidoc sources 2013-05-05 20:44:47 -04:00
Damien Stuart
c0c0941d55 Tweaked WIN32 conditional for using inet_ntoa instead of inet_ntop to apply only to versions below Vista (WINVER <= 0x0600) 2013-05-05 19:02:48 -04:00
Damien Stuart
b84415c33c Use inet_aton on Windows (Older windows versions do not have enet_ntop). 2013-05-05 16:37:18 -04:00
Franck Joncourt
327257ef5f Fixed command line arguments (key-base64-rijndael and key-base64-hmac).
The cmd_opts structure containing the command line args does not follow the
documentation. This update fix it.
2013-05-05 22:03:21 +02:00
Franck Joncourt
17a105fd8a Added GPG_SIGNER and GPG_RECIPIENT to the list of important variables. 2013-05-05 21:43:31 +02:00
Franck Joncourt
b8145f6d7f Added --force-stanza command line arg to avoid prompting the user. 2013-05-05 21:13:26 +02: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
Michael Rash
3c3283992c (Franck Joncourt) patch to address sprintf() warnings for issue #60 2013-05-04 14:16:06 -04:00
Franck Joncourt
9d8d1de60d Ask the user whether he wants to overwrite a variable in the updated rc file or not. 2013-05-04 17:02:02 +02:00
Franck Joncourt
f217506234 Fixed names of function for better understanding. 2013-05-04 15:33:03 +02:00
Franck Joncourt
84768dda6f Continued implementing a way to not overwrite KEY.. variables with --save-rc-stanza
mrash/fwknop#67
2013-05-03 13:49:32 +02:00
Franck Joncourt
c71ce885be First attempt to not ovewrite some configuration variables with --save-rc-stanza.
At this time it only does not overwrite the KEY and HMAC variable without asking the user
what he wants to do.
2013-05-02 23:58:28 +02:00
Franck Joncourt
fca497f0d8 New tests for rc file processing (SPA_SOURCE_PORT, FW_TIMEOUT).
Added spa source port variable to dump_transmit_options() and renamed port
to destination port.
2013-05-01 15:29:17 +02:00
Franck Joncourt
209c0f16da Protocol string is set has const char in fko_protocol_t. 2013-05-01 14:33:35 +02: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
10a4e1f675 Updated the TParam typedef to conform to the fko_cli_options_t typedef. 2013-04-30 15:37:08 +02:00
Franck Joncourt
2110790a30 Added new rc file processing tests for the SPA_SERVER_PORT. 2013-04-30 13:54:58 +02:00
Michael Rash
90175250e5 [client] add USE_HMAC handling to parse_rc_param() 2013-04-29 22:14:39 -04:00
Michael Rash
df5066447d Started on --save-rc-stanza tests, client bug fix for HMAC verification in --test mode 2013-04-29 21:43:21 -04:00
Franck Joncourt
36202d8c66 Merge remote-tracking branch 'upstream/master' 2013-04-29 22:21:18 +02:00
Franck Joncourt
7a719389ca Integrated the log module in the whol client source code.
perror() is also replaced by log_msg()
2013-04-29 22:18:29 +02:00