trust_router.git
7 years agoSweep for expired routes. Sweeps every two seconds for now, not yet configurable.
Jennifer Richards [Thu, 14 Jul 2016 19:54:50 +0000 (15:54 -0400)]
Sweep for expired routes. Sweeps every two seconds for now, not yet configurable.

7 years agoRemove extraneous newline
Jennifer Richards [Thu, 14 Jul 2016 18:13:24 +0000 (14:13 -0400)]
Remove extraneous newline

7 years agoSelect active route after updates to the route table.
Jennifer Richards [Fri, 1 Jul 2016 21:05:47 +0000 (17:05 -0400)]
Select active route after updates to the route table.

7 years agoUpdate the routing table when TRP updates are received.
Jennifer Richards [Fri, 1 Jul 2016 19:24:32 +0000 (15:24 -0400)]
Update the routing table when TRP updates are received.

7 years agoUpdate route table when a TRP update is received. Not tested.
Jennifer Richards [Fri, 1 Jul 2016 15:02:12 +0000 (11:02 -0400)]
Update route table when a TRP update is received. Not tested.

7 years agoAdd next_hop field to route update record, filled in locally.
Jennifer Richards [Thu, 30 Jun 2016 16:32:37 +0000 (12:32 -0400)]
Add next_hop field to route update record, filled in locally.

7 years agoImproved, sorted printing, provide _to_str methods.
Jennifer Richards [Thu, 30 Jun 2016 01:47:07 +0000 (21:47 -0400)]
Improved, sorted printing, provide _to_str methods.

7 years agoDo a signed compare suitable for sorting TR_NAMEs.
Jennifer Richards [Thu, 30 Jun 2016 01:45:25 +0000 (21:45 -0400)]
Do a signed compare suitable for sorting TR_NAMEs.

7 years agoFully test trp_rtable code. All tests pass.
Jennifer Richards [Wed, 29 Jun 2016 20:15:05 +0000 (16:15 -0400)]
Fully test trp_rtable code. All tests pass.

7 years agoImplement hash-indexed routing table.
Jennifer Richards [Tue, 28 Jun 2016 20:35:12 +0000 (16:35 -0400)]
Implement hash-indexed routing table.

7 years agoTrust router: open TRP connection to self, send multiple msgs.
Jennifer Richards [Tue, 28 Jun 2016 03:58:52 +0000 (23:58 -0400)]
Trust router: open TRP connection to self, send multiple msgs.

7 years agoMake outgoing connections. Connect to self as a test.
Jennifer Richards [Mon, 27 Jun 2016 20:55:32 +0000 (16:55 -0400)]
Make outgoing connections. Connect to self as a test.

7 years agoAvoid freeing uninitialized pointer. Add -r option to trpc.
Jennifer Richards [Sat, 25 Jun 2016 18:24:03 +0000 (14:24 -0400)]
Avoid freeing uninitialized pointer. Add -r option to trpc.

The trust router can now accept multiple simultaneous connections from
trpc programs. The messages are decoded from JSON and then printed to
the screen.

7 years agoDecode JSON TRP messages, then send to main thread.
Jennifer Richards [Sat, 25 Jun 2016 01:41:28 +0000 (21:41 -0400)]
Decode JSON TRP messages, then send to main thread.

7 years agoSuccessful messages via mq to main thread.
Jennifer Richards [Fri, 24 Jun 2016 17:16:13 +0000 (13:16 -0400)]
Successful messages via mq to main thread.

7 years agoAuthenticate GSS context in separate thread. (Not fully working yet.)
Jennifer Richards [Fri, 24 Jun 2016 15:19:59 +0000 (11:19 -0400)]
Authenticate GSS context in separate thread. (Not fully working yet.)

7 years agoAdd accessor functions and check in header file.
Jennifer Richards [Thu, 23 Jun 2016 17:24:23 +0000 (13:24 -0400)]
Add accessor functions and check in header file.

7 years agoTest multithreaded functionality of tm_mq.
Jennifer Richards [Wed, 22 Jun 2016 20:59:02 +0000 (16:59 -0400)]
Test multithreaded functionality of tm_mq.

7 years agoImplement message queue and test program.
Jennifer Richards [Wed, 22 Jun 2016 17:08:32 +0000 (13:08 -0400)]
Implement message queue and test program.

7 years agoMinor patches from Adam Bishop to fix build issues from commit 1bc4bf5.
Jennifer Richards [Tue, 21 Jun 2016 15:25:18 +0000 (11:25 -0400)]
Minor patches from Adam Bishop to fix build issues from commit 1bc4bf5.

  1. Make sure that the spec file only includes systemd on el7 builds to fix an el6 build break.
  2. Fix a build break on 32 bit systems - Jansson provides a macro which I should have used.

7 years agoFix syntax of TR_EXPORT.
Jennifer Richards [Mon, 20 Jun 2016 19:15:45 +0000 (15:15 -0400)]
Fix syntax of TR_EXPORT.

7 years agoUse accessor functions for TRP objects.
Jennifer Richards [Mon, 20 Jun 2016 18:35:09 +0000 (14:35 -0400)]
Use accessor functions for TRP objects.

7 years agoSeparate trp_msg.c into trp_upd.c and trp_req.c.
Jennifer Richards [Mon, 20 Jun 2016 17:57:50 +0000 (13:57 -0400)]
Separate trp_msg.c into trp_upd.c and trp_req.c.

7 years agoMerge branch 'jennifer/march2016-patches'
Jennifer Richards [Mon, 20 Jun 2016 17:39:31 +0000 (13:39 -0400)]
Merge branch 'jennifer/march2016-patches'

Conflicts (both trivial):
common/tr_config.c
common/tr_name.c

7 years agoApply Adam Bishop's March 2016 patches.
Jennifer Richards [Mon, 20 Jun 2016 17:24:43 +0000 (13:24 -0400)]
Apply Adam Bishop's March 2016 patches.

0001: (Trivial) The trust router does not build in a minimal environment on CentOS; specifying glib2 explicitly corrects this.
0002: (Trivial) This adds a check and log entry for the serial number to the config parser.
0003: (Trivial) Correct a typo and add more information to a log message.
0004: (Trivial) Implement enough of tr_print_config to diagnose this quicker
0005: (Substantial) Fix the corruption by making sure that a dereferenced copy is performed on each realm.
0006: (Trivial) Obligatory version bump.

7 years agoSpecify string argument to tr_name() as const.
Jennifer Richards [Mon, 20 Jun 2016 16:30:13 +0000 (12:30 -0400)]
Specify string argument to tr_name() as const.

Fixes build problem with freeradius. Merges janetuk github commits
9b50472db6493fd7b5d5b6024b7899fc279fac59 and
38b9ed4c2fc284114012f1a50b357a0ae7e267c0. See:
https://github.com/janetuk/trust_router/pull/6/commits/38b9ed4c2fc284114012f1a50b357a0ae7e267c0

7 years agoMove TRP messaging to tr_msg.c. Fix old bug.
Jennifer Richards [Fri, 17 Jun 2016 01:49:26 +0000 (21:49 -0400)]
Move TRP messaging to tr_msg.c. Fix old bug.

* Move TRP message-related code to tr_msg.c
* Change names/code to match existing conventions
* Add constructor/destructor for TID_RESP struct
* Free sub-structures when freeing TR_MSG struct
* Add msgtst to Makefile.am

7 years agoFree json object after encoding.
Jennifer Richards [Thu, 16 Jun 2016 15:14:00 +0000 (11:14 -0400)]
Free json object after encoding.

7 years agoEncode update messages.
Jennifer Richards [Thu, 16 Jun 2016 02:26:19 +0000 (22:26 -0400)]
Encode update messages.

7 years agoProperly handle record types. Encoding temporarily broken.
Jennifer Richards [Wed, 15 Jun 2016 22:52:05 +0000 (18:52 -0400)]
Properly handle record types. Encoding temporarily broken.

7 years agoEncode route_req messages.
Jennifer Richards [Wed, 15 Jun 2016 16:17:17 +0000 (12:17 -0400)]
Encode route_req messages.

7 years agoDecode and print route_req messages.
Jennifer Richards [Wed, 15 Jun 2016 03:26:54 +0000 (23:26 -0400)]
Decode and print route_req messages.

7 years agoHandle update messages properly by separating records from body.
Jennifer Richards [Wed, 15 Jun 2016 02:49:58 +0000 (22:49 -0400)]
Handle update messages properly by separating records from body.

7 years agoParse update messages. Add rudimentary printing.
Jennifer Richards [Tue, 14 Jun 2016 21:08:08 +0000 (17:08 -0400)]
Parse update messages. Add rudimentary printing.

7 years agoProgress towards parsing update messages.
Jennifer Richards [Tue, 14 Jun 2016 18:36:09 +0000 (14:36 -0400)]
Progress towards parsing update messages.

7 years agoBeginning of JSON parser for TRP messages (nonfunctional)
Jennifer Richards [Tue, 14 Jun 2016 03:52:03 +0000 (23:52 -0400)]
Beginning of JSON parser for TRP messages (nonfunctional)

7 years agoSeparate TRP from main trust router code.
Jennifer Richards [Mon, 13 Jun 2016 20:05:20 +0000 (16:05 -0400)]
Separate TRP from main trust router code.

Not a functional checkin, probably does not build.

7 years agoInclude tids.service in list of %files. v1.5.1-centos7
Jennifer Richards [Fri, 3 Jun 2016 16:29:09 +0000 (16:29 +0000)]
Include tids.service in list of %files.

7 years agoAdd stub of TRP client test program, trpc.
Jennifer Richards [Thu, 26 May 2016 19:55:08 +0000 (15:55 -0400)]
Add stub of TRP client test program, trpc.

7 years agoAdd TRP handling events, plus change to cfg layout.
Jennifer Richards [Thu, 26 May 2016 02:42:13 +0000 (22:42 -0400)]
Add TRP handling events, plus change to cfg layout.

The main purpose of this commit is to add a stub for TRP event handling.
This currently amounts to listning to a TCP port and replying with a
brief message. Additionally, moved the active and new configurations
in the TR_INSTANCE struct into a container called TR_CFG_MGR. Other
instance types (TIDS, TRPS [new with this commit], and CFGWATCH)
instances now refer to the TR_CFG_MGR rather than to the TR_INSTANCE.
This resolves circular include dependencies and makes for a cycle-free
object hierarchy. Finally, introduced more complete use of talloc
for memory management, though this is probably not complete yet.

7 years agoProvide function to convert log severity to string.
Jennifer Richards [Thu, 26 May 2016 02:33:31 +0000 (22:33 -0400)]
Provide function to convert log severity to string.

7 years agoLoad config files in lexical order.
Jennifer Richards [Tue, 24 May 2016 14:45:44 +0000 (10:45 -0400)]
Load config files in lexical order.

Previously, arbitrary load order was used. Also added config options for
the config watcher polling.

7 years agoRefactor to move task code out of tr_main.c.
Jennifer Richards [Tue, 24 May 2016 01:37:49 +0000 (21:37 -0400)]
Refactor to move task code out of tr_main.c.

7 years agoResolve circular header dependencies.
Jennifer Richards [Mon, 23 May 2016 21:54:03 +0000 (17:54 -0400)]
Resolve circular header dependencies.

The use of TR_INSTANCE throughout various modules created a situation
where circular header file inclusion was occurring. Resolve this by
moving responsibility for picking out appropriate members from the
active configuration to the caller and passing only the directly
data into various functions. Also cleaned up some allocation code
to better make use of talloc.

7 years agoFix function name.
Jennifer Richards [Mon, 23 May 2016 20:24:15 +0000 (16:24 -0400)]
Fix function name.

7 years agoFix debug/error messages.
Jennifer Richards [Sat, 21 May 2016 19:47:53 +0000 (15:47 -0400)]
Fix debug/error messages.

7 years agoReload configuration dynamically when files change.
Jennifer Richards [Sat, 21 May 2016 19:39:34 +0000 (15:39 -0400)]
Reload configuration dynamically when files change.

Detect a change to the configuration files and reload when this occurs.
Any change, deletion, or addition of configuration files in the
config directory will result in reloading the configuration. If a
valid configuration results, switch to this, otherwise continue using
the old configuration. Allows a few seconds for changes to settle
before attempting to reload the configuration.

7 years agoAdd beginnings of configuration file watcher.
Jennifer Richards [Thu, 19 May 2016 05:35:15 +0000 (01:35 -0400)]
Add beginnings of configuration file watcher.

Not yet working, but does poll the config directory and notice changes
while also servicing TID requests.

7 years agoFix fcntl call to set socket to non-blocking mode.
Jennifer Richards [Wed, 18 May 2016 14:04:29 +0000 (10:04 -0400)]
Fix fcntl call to set socket to non-blocking mode.

7 years agoEliminate debugging message in main loop.
Jennifer Richards [Wed, 18 May 2016 13:53:57 +0000 (09:53 -0400)]
Eliminate debugging message in main loop.

7 years agoHandle tids connections from rudimentary event loop in main().
Jennifer Richards [Tue, 17 May 2016 23:03:07 +0000 (19:03 -0400)]
Handle tids connections from rudimentary event loop in main().

Has debugging code in place, not ready for release.

7 years agoAvoid error message after handling TID req.
Jennifer Richards [Tue, 17 May 2016 19:53:20 +0000 (15:53 -0400)]
Avoid error message after handling TID req.

Replace the return 0 with an exit(0) after a forked subprocess finishes
handling a request. This prevents an erroneous error message from
indicating that the tids server has unexpectedly exited.

7 years agoGive useful tids error on bad gss-name (bug 1325953)
Jennifer Richards [Tue, 17 May 2016 19:38:31 +0000 (15:38 -0400)]
Give useful tids error on bad gss-name (bug 1325953)

Return a meaningful error code from tids_auth_cb() when there is a
mismatch between the expected gss-name and the client name in a TID
request. Also print a helpful error message to the server log.

7 years agoUse strncmp instead of strcmp in tr_name_cmp().
Jennifer Richards [Tue, 17 May 2016 18:28:08 +0000 (14:28 -0400)]
Use strncmp instead of strcmp in tr_name_cmp().

7 years agoIgnore SIGPIPE signals when writing to GSS socket.
Jennifer Richards [Tue, 17 May 2016 17:30:58 +0000 (13:30 -0400)]
Ignore SIGPIPE signals when writing to GSS socket.

If the remote end of a GSS connection disconnects, attempts to write
to the now-broken pipe result in a SIGPIPE signal. This unceremoniously
exits. Instead, ignore those signals during the write() and let the
error handling code deal gracefully with the broken pipe.

7 years agoParse tidc command line with argp.
Jennifer Richards [Fri, 13 May 2016 21:44:12 +0000 (17:44 -0400)]
Parse tidc command line with argp.

Introduce argp here for consistency with tids and trust_router. This
adds --help and --usage options automatically.

7 years agoParse tids command line with argp (bug #1209349).
Jennifer Richards [Fri, 13 May 2016 21:17:31 +0000 (17:17 -0400)]
Parse tids command line with argp (bug #1209349).

Use the argp package to parse arguments. This provides the --help option
requested by the bug report.

7 years agoProtect against freeing config file list twice.
Jennifer Richards [Fri, 6 May 2016 15:49:14 +0000 (11:49 -0400)]
Protect against freeing config file list twice.

7 years agoProcess command-line args, add config dir option.
Jennifer Richards [Fri, 6 May 2016 02:16:38 +0000 (22:16 -0400)]
Process command-line args, add config dir option.

Add command-line processing with argp. Introduced an option to read
configuration files from other than the working directory. Also,
modified debug output in tr_parse_config to correctly indicate this
function name instead of tr_read_config.

8 years agoReject trust router config files that begin with '.'
Jennifer Richards [Wed, 20 Apr 2016 19:58:39 +0000 (15:58 -0400)]
Reject trust router config files that begin with '.'

9 years agoUpdate release
Sam Hartman [Thu, 26 Mar 2015 01:20:26 +0000 (21:20 -0400)]
Update release

9 years agoInsert into psk_keys_tab not psk_keys
Sam Hartman [Thu, 26 Mar 2015 01:19:48 +0000 (21:19 -0400)]
Insert into psk_keys_tab not psk_keys

9 years agoVersion 1.5.1; new schema
Sam Hartman [Wed, 25 Mar 2015 18:25:38 +0000 (14:25 -0400)]
Version 1.5.1; new schema

9 years agoDon't include expired keys in the psk_keys table
Sam Hartman [Wed, 25 Mar 2015 18:21:54 +0000 (14:21 -0400)]
Don't include expired keys in the psk_keys table

FreeRADIUS directly queries psk_keys.  It's important that it not
match expired keys.  Instead create a table psk_keys_tab and make
psk_keys a view that excludes expired keys.

9 years agoUpdate spec release 1.5
Sam Hartman [Wed, 18 Mar 2015 19:25:51 +0000 (15:25 -0400)]
Update spec release

9 years agoMove logging to tr_internal
Sam Hartman [Tue, 17 Mar 2015 19:18:48 +0000 (15:18 -0400)]
Move logging to tr_internal

9 years agoRequire sufficiently new moonshot-gss-eap rpm
Sam Hartman [Tue, 17 Mar 2015 16:29:12 +0000 (12:29 -0400)]
Require sufficiently new moonshot-gss-eap rpm

9 years agoUpdate release in spec
Sam Hartman [Tue, 17 Mar 2015 16:27:00 +0000 (12:27 -0400)]
Update release in spec

9 years agoExpiration should be minimum of configured and incoming from current request
Sam Hartman [Tue, 17 Mar 2015 16:26:31 +0000 (12:26 -0400)]
Expiration should be minimum of configured and incoming from current request

9 years agoUpdate spec version
Sam Hartman [Fri, 13 Mar 2015 20:25:05 +0000 (16:25 -0400)]
Update spec version

9 years agoFix sense of comparison in schema.
Sam Hartman [Fri, 13 Mar 2015 20:23:06 +0000 (16:23 -0400)]
Fix sense of comparison in schema.

9 years agoFix version string
Sam Hartman [Thu, 12 Mar 2015 18:11:22 +0000 (14:11 -0400)]
Fix version string

9 years agofix typo
Sam Hartman [Thu, 12 Mar 2015 17:09:36 +0000 (13:09 -0400)]
fix typo

9 years agoWe now require glib-devel
Sam Hartman [Thu, 12 Mar 2015 16:43:46 +0000 (12:43 -0400)]
We now require glib-devel

9 years agoSchema updates; exclude expired keys from view
Sam Hartman [Thu, 12 Mar 2015 16:33:50 +0000 (12:33 -0400)]
Schema updates; exclude expired keys from view

9 years agotids handler fixes
Sam Hartman [Thu, 12 Mar 2015 16:11:36 +0000 (12:11 -0400)]
tids handler fixes

* use talloc for server responses

* bind expiration to right value in statement

9 years agoKey expiration in minutes
Sam Hartman [Thu, 12 Mar 2015 15:34:20 +0000 (11:34 -0400)]
Key expiration in minutes

9 years agoFix logging configuration
Sam Hartman [Wed, 11 Mar 2015 22:31:55 +0000 (18:31 -0400)]
Fix logging configuration

9 years agoMerge branch 'logging_changes' of https://github.com/adam-bishop/trust_router
Sam Hartman [Wed, 11 Mar 2015 17:31:36 +0000 (13:31 -0400)]
Merge branch 'logging_changes' of https://github.com/adam-bishop/trust_router

Pull in two additional fixes from Adam.

9 years agoExplicitly call tr_log_open when we're not being used as a library
Adam Bishop [Wed, 11 Mar 2015 14:47:27 +0000 (14:47 +0000)]
Explicitly call tr_log_open when we're not being used as a library

9 years agoDon't call openlog() implicitly
Adam Bishop [Wed, 11 Mar 2015 14:46:59 +0000 (14:46 +0000)]
Don't call openlog() implicitly

9 years agoincrement version
Sam Hartman [Wed, 11 Mar 2015 14:49:31 +0000 (10:49 -0400)]
increment version

9 years agoConnection clean up
Sam Hartman [Wed, 11 Mar 2015 14:15:59 +0000 (10:15 -0400)]
Connection clean up

We need to clean up the connection file descriptor and the gss context.

* tidc_fwd_request is the wrong place to free the TID_REQ because it does not allocate it

* tid_req_dup needs to use talloc; duplicated requests are freed by
  the original request

* tidc_send_message frees its request

* The request destructor closes the connection.

* Keep track of whether a request is duplicated; only free the connection and gss context in the original request.

9 years agoLogic for expiration and path
Sam Hartman [Tue, 10 Mar 2015 20:18:07 +0000 (16:18 -0400)]
Logic for expiration and path

* Add path as requests are received at a tids

* Calculate expiration in tids

* Insert expiration into database

* Update schema

* tids now requires glib

9 years agoAdd expiration and path to messages
Sam Hartman [Tue, 10 Mar 2015 20:10:45 +0000 (16:10 -0400)]
Add expiration and path to messages

Handle path and key expiration in encoders and decoders.

9 years agoReal syslog support for trust router
Sam Hartman [Tue, 10 Mar 2015 00:45:38 +0000 (20:45 -0400)]
Real syslog support for trust router

Merge branch 'logging_changes' of https://github.com/adam-bishop/trust_router

Conflicts:
common/tr_config.c
common/tr_msg.c
tr/tr_main.c

9 years agoConfiguration of key expiration for APC
Sam Hartman [Tue, 10 Mar 2015 00:34:57 +0000 (20:34 -0400)]
Configuration of key expiration for APC

Add support for configuring the key expiration in the config and pass this allong as requests are forwarded.

9 years agoAdd key expiration to output message
Sam Hartman [Tue, 10 Mar 2015 00:32:02 +0000 (20:32 -0400)]
Add key expiration to output message

9 years agoStart depending on glib
Sam Hartman [Tue, 10 Mar 2015 00:31:21 +0000 (20:31 -0400)]
Start depending on glib

We need glib for ISO 8601 time functions and
plan to use it for more.

9 years agoWorkaround for glibc bug 14347
Adam Bishop [Wed, 10 Dec 2014 11:43:42 +0000 (11:43 +0000)]
Workaround for glibc bug 14347

9 years agoAdd logging to the default main config
Adam Bishop [Thu, 27 Nov 2014 15:56:58 +0000 (15:56 +0000)]
Add logging to the default main config

9 years agoReplace calls to fprintf with new tr_* macros
Adam Bishop [Tue, 9 Dec 2014 13:27:13 +0000 (13:27 +0000)]
Replace calls to fprintf with new tr_* macros

9 years agotr_main: clean up void pointer style
Sam Hartman [Mon, 9 Mar 2015 13:38:46 +0000 (09:38 -0400)]
tr_main: clean up void pointer style

9 years agoInitial path and expiration utilities
Sam Hartman [Mon, 9 Mar 2015 11:54:12 +0000 (07:54 -0400)]
Initial path and expiration utilities

Add path  functions to  tid_req and tid_resp

Add path members and expiration to tid_req and tid_resp

Update copyrights

9 years agotid_req_free: delete GSS context
Sam Hartman [Mon, 23 Feb 2015 16:58:14 +0000 (11:58 -0500)]
tid_req_free: delete GSS context

Free the gss context in a TID request.

9 years agoAdd logging values to the TR config struct, code to parse it, and a default value...
Adam Bishop [Thu, 27 Nov 2014 15:55:27 +0000 (15:55 +0000)]
Add logging values to the TR config struct, code to parse it, and a default value in case it is not configured

9 years agoAdd some audit messages to be logged
Adam Bishop [Tue, 9 Dec 2014 13:47:26 +0000 (13:47 +0000)]
Add some audit messages to be logged

9 years agoUpdate Makefile.am to include new sources
Adam Bishop [Mon, 8 Dec 2014 14:15:11 +0000 (14:15 +0000)]
Update Makefile.am to include new sources

9 years agoAdd functions to log trust query results handled by the TID server
Adam Bishop [Wed, 10 Dec 2014 18:13:24 +0000 (18:13 +0000)]
Add functions to log trust query results handled by the TID server

9 years agoAdding syslog into configure checks
Adam Bishop [Thu, 27 Nov 2014 13:40:53 +0000 (13:40 +0000)]
Adding syslog into configure checks