Linus Nordberg [Mon, 7 Mar 2011 14:25:33 +0000 (15:25 +0100)]
Requests are now high level, i.e. not for user doing the dispatching.
Linus Nordberg [Mon, 7 Mar 2011 14:23:40 +0000 (15:23 +0100)]
Move verification of response packets up to a level where it makes sense.
Replace the user_dispatch_flag on connections with
conn_user_dispatch_p().
Remove the 'original' member from packet and instead have an upper
layer verify.
Rename packet valid_flag --> received_flag to reflect that we don't
verify.
Move _close_conn() --> conn_close().
Move packet flags into a single unsigned int, for portability.
(_read_packet): Don't verify packet.
(rs_conn_receive_packet): Don't touch PKT_OUT if there isn't a packet.
(rs_conn_receive_packet): Verify packet using packet_verify_response().
Linus Nordberg [Mon, 7 Mar 2011 08:53:40 +0000 (09:53 +0100)]
Formatting changes.
Linus Nordberg [Mon, 7 Mar 2011 08:38:01 +0000 (09:38 +0100)]
Remove lib/radsec.h.
1. Two radsec.h is icky.
2. Its contents fit nicely in send.c.
Linus Nordberg [Sun, 6 Mar 2011 16:08:41 +0000 (17:08 +0100)]
Move event_set_timeout --> tcp_set_connect_timeout.
Linus Nordberg [Sun, 6 Mar 2011 16:04:54 +0000 (17:04 +0100)]
request: Save callers user_data and do invoke callers callbacks.
Linus Nordberg [Sun, 6 Mar 2011 15:44:43 +0000 (16:44 +0100)]
Replace asserts with EINVAL checks.
Linus Nordberg [Sun, 6 Mar 2011 14:53:58 +0000 (15:53 +0100)]
Restructure code, moving most code out of packet.c
Also, move copyright notice out of COPYING and into every file.
Linus Nordberg [Sun, 6 Mar 2011 13:46:57 +0000 (14:46 +0100)]
UDP w/o bufferevents, part 1.
Sending, no retransmitting and no receiving.
Linus Nordberg [Sun, 6 Mar 2011 13:44:27 +0000 (14:44 +0100)]
Cosmetic changes.
Linus Nordberg [Sun, 6 Mar 2011 13:30:14 +0000 (14:30 +0100)]
Don't free config object until we destroy the context.
Linus Nordberg [Fri, 4 Mar 2011 12:27:57 +0000 (13:27 +0100)]
Revert
578e3551 -- double free in second invocation of dict_free().
Linus Nordberg [Fri, 4 Mar 2011 12:00:42 +0000 (13:00 +0100)]
Do _copy_ the strings from the config object.
Linus Nordberg [Fri, 4 Mar 2011 11:51:42 +0000 (12:51 +0100)]
Do free the config object.
Linus Nordberg [Thu, 3 Mar 2011 15:05:48 +0000 (16:05 +0100)]
_init_evb: Don't crash on socket errors.
Linus Nordberg [Thu, 3 Mar 2011 13:02:40 +0000 (14:02 +0100)]
Correct an error code.
Linus Nordberg [Thu, 3 Mar 2011 10:50:35 +0000 (11:50 +0100)]
Correct an error string.
Linus Nordberg [Wed, 2 Mar 2011 09:23:12 +0000 (10:23 +0100)]
Be consistent with naming of formal arguments.
Linus Nordberg [Tue, 1 Mar 2011 12:56:49 +0000 (13:56 +0100)]
Error handling cleanup 3.
Split timeout errors in connecting and I/O.
Linus Nordberg [Tue, 1 Mar 2011 12:53:34 +0000 (13:53 +0100)]
Error handling cleanup 2.
RSE_NOSYS doesn't need a string.
Linus Nordberg [Tue, 1 Mar 2011 12:51:35 +0000 (13:51 +0100)]
Error handling cleanup
Remove RSE_SOME_ERROR.
rs_tls_init: Push SSL error stack on libradsec error stack.
Linus Nordberg [Tue, 1 Mar 2011 10:02:45 +0000 (11:02 +0100)]
rs_context_destroy: Free freeradius dictionary.
Linus Nordberg [Tue, 1 Mar 2011 00:00:47 +0000 (01:00 +0100)]
Don't have the connection freeing peers -- it's the contexts responsibility.
Also, let _rs_peer_destroy() free secret.
Linus Nordberg [Mon, 28 Feb 2011 23:41:34 +0000 (00:41 +0100)]
rs_request_send: Check arguments and that we have a packet to send.
Linus Nordberg [Mon, 28 Feb 2011 23:40:56 +0000 (00:40 +0100)]
Add RSE_INVAL.
Linus Nordberg [Mon, 28 Feb 2011 21:39:29 +0000 (22:39 +0100)]
Add asserts to request object.
Linus Nordberg [Mon, 28 Feb 2011 16:49:49 +0000 (17:49 +0100)]
Update status in HACKING.
Linus Nordberg [Mon, 28 Feb 2011 16:49:29 +0000 (17:49 +0100)]
Make tests run again.
NOTE: 2 exceptions ATM.
Linus Nordberg [Mon, 28 Feb 2011 13:50:04 +0000 (14:50 +0100)]
Remove last trace of server and client in API.
Linus Nordberg [Mon, 28 Feb 2011 12:15:13 +0000 (13:15 +0100)]
Rename relevant functions to reflect authn as opposed to authz.
Also add a "bare" create request function.
Linus Nordberg [Mon, 28 Feb 2011 10:46:14 +0000 (11:46 +0100)]
API changes: rs_client* --> rs_peer.
Move peer (former server) things to new file peer.c.
Update examples.
Linus Nordberg [Mon, 28 Feb 2011 09:55:41 +0000 (10:55 +0100)]
Cosmetic header file changes.
Linus Nordberg [Fri, 25 Feb 2011 13:20:19 +0000 (14:20 +0100)]
Time out on connect and break event loop on errors.
Linus Nordberg [Fri, 25 Feb 2011 12:05:46 +0000 (13:05 +0100)]
API change. Have the request object create its own request message.
Linus Nordberg [Fri, 25 Feb 2011 11:48:26 +0000 (12:48 +0100)]
Get rid of loopbreak as a mean for signalling successful packet handling.
In blocking mode, breaking the event loop with loopbreak will probably
be needed for exceptions like timeout so we shouldn't use it for
breaking the loop and signalling success.
In the user callbaks used in blocking mode (_rcb and _wcb), disable
read and write events on the event buffer. This will stop the loop.
Also, set a flag in the packet struct to signal success.
In the "low level callbacks" (_read_cb and _write_cb), enable read or
write, accordingly.
Linus Nordberg [Thu, 24 Feb 2011 21:25:22 +0000 (22:25 +0100)]
Config file changes and small API changes.
'timeout' and 'tries' move from 'server' stanza to top. 'tries' is
now 'retries'.
Moving around in internal data structs, making struct peer strictly config.
Bug fixes in configuration code.
Adding some more cleanup code, freeing allocated memory (still not done!).
Linus Nordberg [Thu, 24 Feb 2011 20:57:46 +0000 (21:57 +0100)]
Split example config in two files.
Linus Nordberg [Thu, 24 Feb 2011 20:56:47 +0000 (21:56 +0100)]
Split example config in two files.
Linus Nordberg [Sun, 20 Feb 2011 16:17:54 +0000 (17:17 +0100)]
Report SSL errors with error string rather than an integer.
Linus Nordberg [Sun, 20 Feb 2011 15:44:58 +0000 (16:44 +0100)]
Push an ENOMEM error on the connection rather than the context.
Linus Nordberg [Sun, 20 Feb 2011 15:42:51 +0000 (16:42 +0100)]
Handle another ENOMEM case.
Linus Nordberg [Sat, 19 Feb 2011 17:55:51 +0000 (18:55 +0100)]
Improve protocol robustness and invoke user callbacks.
All aborts are removed, as well as all asserts which aren't
programming errors.
When an invalid packet is received, the connection is closed, as per
draft-ietf-radext-tcp-transport-08 (2.6.4).
Use new rs_debug() macro rather than fprintf() for debug printouts.
Coding style overhaul.
Linus Nordberg [Sat, 19 Feb 2011 17:22:39 +0000 (18:22 +0100)]
Use AM_CFLAGS when setting CFLAGS.
Linus Nordberg [Tue, 15 Feb 2011 14:02:46 +0000 (15:02 +0100)]
Merge branch 'libradsec' of /tmp/radsecproxy into libradsec
Linus Nordberg [Tue, 15 Feb 2011 14:02:41 +0000 (15:02 +0100)]
Add comments.
Linus Nordberg [Tue, 15 Feb 2011 14:01:15 +0000 (15:01 +0100)]
Include debug.h regardless if DEBUG -- rs_debug needs to be declared.
Linus Nordberg [Tue, 15 Feb 2011 13:49:47 +0000 (14:49 +0100)]
Make autogen.sh actually work -- were missing ltmain.sh.
Add Automake/Libtool files to biuld-aux and set AC_CONFIG_AUX_DIR.
Use LT_INIT rather than deprecated AC_PROG_LIBTOOL.
Linus Nordberg [Fri, 4 Feb 2011 12:59:58 +0000 (13:59 +0100)]
Do build examples with -Wall -g.
Linus Nordberg [Fri, 4 Feb 2011 12:59:40 +0000 (13:59 +0100)]
Add comments on some error codes.
Linus Nordberg [Fri, 4 Feb 2011 12:59:19 +0000 (13:59 +0100)]
Initialize pointer in example program before trusting it.
Linus Nordberg [Fri, 4 Feb 2011 12:54:15 +0000 (13:54 +0100)]
Handle more read, write and packet verification errors.
Still some aborts left.
Linus Nordberg [Fri, 4 Feb 2011 12:44:19 +0000 (13:44 +0100)]
Add and use rs_debug() instead of fprintf to stderr.
Linus Nordberg [Fri, 4 Feb 2011 12:29:12 +0000 (13:29 +0100)]
Don't consume sent packets.
A sent packet is a fine thing to have when you're verifying the
Response Authenticator. We could solve this by having an upper layer
saving only the Request Authenticator somewhere instead the whole
packet and we might just do that at some point which is not now.
Linus Nordberg [Wed, 2 Feb 2011 14:19:40 +0000 (15:19 +0100)]
Pick usage of struct request in example code at run time.
Linus Nordberg [Wed, 2 Feb 2011 09:55:27 +0000 (10:55 +0100)]
Reorder function prototypes.
Linus Nordberg [Wed, 2 Feb 2011 09:54:54 +0000 (10:54 +0100)]
Disable some debug printout in tests.
Linus Nordberg [Wed, 2 Feb 2011 09:54:11 +0000 (10:54 +0100)]
Replace some code for debug printouts.
Linus Nordberg [Tue, 1 Feb 2011 14:50:25 +0000 (15:50 +0100)]
Update release info to avoid confusion.
linus [Fri, 21 Jan 2011 15:35:54 +0000 (16:35 +0100)]
Remove unused Makefile.
linus [Fri, 21 Jan 2011 15:35:07 +0000 (16:35 +0100)]
New versions of config.guess and config.sub.
linus [Fri, 21 Jan 2011 15:33:43 +0000 (16:33 +0100)]
Generate tests/Makefile.
linus [Fri, 21 Jan 2011 15:33:26 +0000 (16:33 +0100)]
Compile with -Wall and -g.
linus [Fri, 21 Jan 2011 15:32:28 +0000 (16:32 +0100)]
Some more UDP tests.
linus [Fri, 21 Jan 2011 15:31:13 +0000 (16:31 +0100)]
Follow API changes.
linus [Fri, 21 Jan 2011 15:30:17 +0000 (16:30 +0100)]
API breakage -- rename rs_packet_create_acc_request().
linus [Fri, 21 Jan 2011 12:09:00 +0000 (13:09 +0100)]
Fix bug where one or two stanzas in a config file would be but not more.
Also restructure error handling in rs_context_create().
linus [Thu, 20 Jan 2011 16:29:42 +0000 (17:29 +0100)]
Cosmetic changes to conf.c.
linus [Thu, 20 Jan 2011 16:28:12 +0000 (17:28 +0100)]
Improve error message.
Differentiate between an invalid connection type string in config file
when parsing and unknown connection type (number) when connecting.
linus [Thu, 20 Jan 2011 09:02:52 +0000 (10:02 +0100)]
Rename external functions in UDP test files.
linus [Wed, 19 Jan 2011 15:47:37 +0000 (16:47 +0100)]
Add basic testing code.
linus [Mon, 17 Jan 2011 15:27:57 +0000 (16:27 +0100)]
Cosmetic changes.
linus [Mon, 17 Jan 2011 15:25:29 +0000 (16:25 +0100)]
Update copyright years.
Linus Nordberg [Thu, 11 Nov 2010 14:12:15 +0000 (15:12 +0100)]
Use standard RadSec port in example config.
Linus Nordberg [Thu, 11 Nov 2010 13:57:05 +0000 (14:57 +0100)]
Add extern "C" guards to all header files.
Linus Nordberg [Thu, 11 Nov 2010 11:33:58 +0000 (12:33 +0100)]
Do print generic error strings.
Linus Nordberg [Thu, 11 Nov 2010 10:06:23 +0000 (11:06 +0100)]
Remove spurious comment.
Linus Nordberg [Thu, 11 Nov 2010 10:03:52 +0000 (11:03 +0100)]
Disable debugging.
Linus Nordberg [Thu, 11 Nov 2010 10:02:14 +0000 (11:02 +0100)]
Build even when not configured with `--enable-tls'.
Linus Nordberg [Thu, 11 Nov 2010 09:30:35 +0000 (10:30 +0100)]
Bringing up TLS connections working.
NOTE: Clean up of resources not yet sane. Expect resource leakages.
NOTE: Most failure cases are not handled properly. With the wind at
your back and the sun shining, it might work.
Linus Nordberg [Mon, 8 Nov 2010 10:18:38 +0000 (11:18 +0100)]
Don't ignore connection type configuration.
Linus Nordberg [Thu, 28 Oct 2010 11:00:31 +0000 (13:00 +0200)]
Use the request object in example programs.
Linus Nordberg [Thu, 28 Oct 2010 10:49:34 +0000 (12:49 +0200)]
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end."
Linus Nordberg [Tue, 19 Oct 2010 17:17:42 +0000 (19:17 +0200)]
Move connection related functions to conn.c.
Linus Nordberg [Sat, 16 Oct 2010 10:11:06 +0000 (12:11 +0200)]
Revert "Require Autoconf 2.68 since 2.65 doesn't work on OSX."
That was wrong -- 2.65 is _not_ known to not work on OSX. (2.61 is
known to not work on OSX but we don't care.)
This reverts commit
d726d4a61e0516b18df5903088e58d015c7cd1b8.
Linus Nordberg [Sat, 16 Oct 2010 09:29:14 +0000 (11:29 +0200)]
Require Autoconf 2.68 since 2.65 doesn't work on OSX.
With 2.65 on OSX, libradsec isn't linked correctly with
libfreeradius-radius and libevent-core. The effect is that a program
linking with -lradsec need to add the other two libraries on the link
line as well.
Whether 2.66 or 2.67 works on OSX is unknown.
Linus Nordberg [Fri, 15 Oct 2010 12:48:27 +0000 (14:48 +0200)]
Add stub.
Linus Nordberg [Mon, 11 Oct 2010 17:06:06 +0000 (19:06 +0200)]
Merge branch 'merge-luke' into libradsec
8a676ab Robustness fixes (and some callback invocation) by Luke Howard.
ff55882 Request object implementation and bug fixes by Luke Howard.
06936d1 Have rad_decode() verify responses.
Luke Howard [Sat, 9 Oct 2010 09:54:37 +0000 (11:54 +0200)]
Have rad_decode() verify responses.
Linus Nordberg [Mon, 11 Oct 2010 08:41:58 +0000 (10:41 +0200)]
Request object implementation and bug fixes by Luke Howard.
Linus Nordberg [Sun, 10 Oct 2010 14:00:11 +0000 (16:00 +0200)]
Compile again after bad fixes.
Linus Nordberg [Sun, 10 Oct 2010 13:56:01 +0000 (15:56 +0200)]
Cosmetics.
Linus Nordberg [Sun, 10 Oct 2010 13:53:37 +0000 (15:53 +0200)]
Robustness fixes (and some callback invocation) by Luke Howard.
* lib/packet.c (_packet_create): Set packet identity properly.
(_do_send): Return an int.
(_do_send): Don't ignore rad_encode() errors.
(_do_send): Do invoke rad_sign().
(_event_cb): Invoke callbacks.
(_event_cb): Honour _do_send() return code.
(_read_cb): Check packet (by invoking rad_packet_ok()).
(_read_cb): Don't ignore rad_decode() errors.
(_read_cb): Invoke callbacks.
Linus Nordberg [Sun, 10 Oct 2010 09:47:43 +0000 (11:47 +0200)]
Rename rs_req_* --> rs_request_.
Contributed by Luke Howard.
Linus Nordberg [Sun, 10 Oct 2010 08:10:28 +0000 (10:10 +0200)]
Add stuff to .gitignore.
Linus Nordberg [Sun, 10 Oct 2010 08:10:11 +0000 (10:10 +0200)]
Don't require username & pw in rs_packet_create_acc_request().
Linus Nordberg [Sat, 9 Oct 2010 12:52:13 +0000 (14:52 +0200)]
Fail at configure time rather than build time when missing a library.
Linus Nordberg [Tue, 5 Oct 2010 20:12:05 +0000 (22:12 +0200)]
#include assert.h.
Linus Nordberg [Tue, 5 Oct 2010 20:09:15 +0000 (22:09 +0200)]
Add rs_conn_fd().
Linus Nordberg [Tue, 5 Oct 2010 20:07:21 +0000 (22:07 +0200)]
More info to README and HACKING.
Linus Nordberg [Tue, 5 Oct 2010 20:06:01 +0000 (22:06 +0200)]
Rename struct rs_handle --> rs_context.