Merge branch 'master' into jennifer/trp-devel
authorJennifer Richards <jennifer@painless-security.com>
Wed, 11 Jan 2017 16:25:23 +0000 (11:25 -0500)
committerJennifer Richards <jennifer@painless-security.com>
Wed, 11 Jan 2017 16:25:23 +0000 (11:25 -0500)
Makefile.am
common/tests/thread_test.c
configure.ac
include/tr_config.h
redhat/default-internal.cfg [new file with mode: 0644]
redhat/default-main.cfg [deleted file]
redhat/organizations.cfg [new file with mode: 0644]
redhat/tr-test-internal.cfg [moved from redhat/tr-test-main.cfg with 100% similarity]
redhat/trusts.cfg [deleted file]
tr/internal.cfg
trust_router.spec

index 402cb02..a063673 100644 (file)
@@ -36,6 +36,17 @@ common/tr_mq.c
 check_PROGRAMS = common/t_constraint
 TESTS = common/t_constraint
 
+lib_LTLIBRARIES = libtr_tid.la
+
+libtr_tid_la_SOURCES = $(tid_srcs) \
+$(common_srcs) \
+trp/trp_req.c \
+trp/trp_upd.c
+
+libtr_tid_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
+libtr_tid_la_LIBADD = gsscon/libgsscon.la $(GLIB_LIBS)
+libtr_tid_la_LDFLAGS = $(AM_LDFLAGS) -version-info 3 -no-undefined
+
 common_t_constraint_SOURCES = common/t_constraint.c \
 common/tr_debug.c \
 common/tr_name.c \
@@ -134,7 +145,7 @@ common_tests_commtest_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
 common_tests_thread_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
 
 pkginclude_HEADERS = include/trust_router/tid.h include/trust_router/tr_name.h \
-       include/tr_debug.h \
+       include/tr_debug.h include/trust_router/trp.h \
        include/trust_router/tr_dh.h \
        include/trust_router/tr_constraint.h \
        include/trust_router/tr_versioning.h 
@@ -144,16 +155,19 @@ noinst_HEADERS = include/gsscon.h include/tr_config.h \
        include/tr_idp.h include/tr_rp.h \
        include/tr_comm.h include/tr_apc.h \
        include/tr_tid.h include/tr_trp.h \
-       include/tr_filter.h \
-       include/tid_internal.h
+       include/tr_filter.h include/tr_gss.h \
+       include/tid_internal.h include/trp_internal.h \
+       include/tr_cfgwatch.h include/tr_event.h \
+       include/tr_mq.h include/trp_ptable.h \
+       include/trp_rtable.h include/tr_util.h
 
 pkgdata_DATA=schema.sql
-nobase_dist_pkgdata_DATA=redhat/init redhat/sysconfig redhat/trusts.cfg redhat/tidc-wrapper redhat/trust_router-wrapper redhat/tr-test-main.cfg redhat/default-main.cfg redhat/tids-wrapper redhat/sysconfig.tids
+nobase_dist_pkgdata_DATA=redhat/init redhat/sysconfig redhat/organizations.cfg redhat/tidc-wrapper redhat/trust_router-wrapper redhat/tr-test-internal.cfg redhat/default-internal.cfg redhat/tids-wrapper redhat/sysconfig.tids
 
 if HAVE_SYSTEMD
 systemdsystemunit_DATA = tids.service
 endif
 
 EXTRA_DIST = trust_router.spec common/tests.json schema.sql tids.service \
-       tr/manual.cfg tr/portal.cfg \
+       tr/internal.cfg tr/organizations.cfg \
        redhat/tids.init
index 2cf1438..14aac6f 100644 (file)
@@ -39,6 +39,7 @@
 #include <talloc.h>
 #include <time.h>
 #include <errno.h>
+#include <assert.h>
 
 #include <tr_mq.h>
 
@@ -53,7 +54,7 @@ static TR_MQ_MSG *make_msg(char *label, int n)
 {
   TR_MQ_MSG *msg=NULL;
   msg=tr_mq_msg_new(NULL, "Message", TR_MQ_PRIO_NORMAL);
-  asprintf((char **)&(msg->p), "%s: %d messages to go...", label, n);
+  assert(-1!=asprintf((char **)&(msg->p), "%s: %d messages to go...", label, n));
   msg->p_free=free;
   return msg;
 }
@@ -128,7 +129,7 @@ int main(void)
     thread_data[ii].mq=mq;
     thread_data[ii].msg_dly=dly[ii];
     thread_data[ii].n_msgs=10;
-    asprintf(&(thread_data[ii].label), "thread %d", ii+1);
+    assert(-1!=asprintf(&(thread_data[ii].label), "thread %d", ii+1));
     pthread_create(&(thread[ii]), NULL, thread_start, &thread_data[ii]);
     printf("%s started.\n", thread_data[ii].label);
   }
index 73ae920..2b20bc4 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ(2.63)
-AC_INIT([trust_router],[2.0.0],
+AC_INIT([trust_router],[2.1.0],
 [bugs@project-moonshot.org])
 AC_CONFIG_MACRO_DIR(m4)
 AC_CONFIG_AUX_DIR(build-aux)
index 14c136e..62c5fa1 100644 (file)
@@ -55,7 +55,7 @@
 #define TR_DEFAULT_CONSOLE_THRESHOLD LOG_NOTICE
 #define TR_DEFAULT_APC_EXPIRATION_INTERVAL 43200
 #define TR_DEFAULT_TRP_CONNECT_INTERVAL 10
-#define TR_DEFAULT_TRP_UPDATE_INTERVAL 120
+#define TR_DEFAULT_TRP_UPDATE_INTERVAL 30
 #define TR_DEFAULT_TRP_SWEEP_INTERVAL 30
 #define TR_DEFAULT_TID_REQ_TIMEOUT 5
 #define TR_DEFAULT_TID_RESP_NUMER 2
diff --git a/redhat/default-internal.cfg b/redhat/default-internal.cfg
new file mode 100644 (file)
index 0000000..7bfe0f5
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "tr_internal": {
+    "max_tree_depth": 12,
+    "hostname":"beta.example.com",
+    "trps_port":25308,
+    "tids_port":25309,
+    "cfg_poll_interval": 1,
+    "cfg_settling_time": 5,
+    "trp_sweep_interval": 30,
+    "trp_update_interval": 30,
+    "trp_connect_interval": 10,
+    "tid_request_timeout": 5,
+    "tid_response_numerator": 2,
+    "tid_response_denominator": 3,
+    "logging": {
+      "log_threshold": "info",
+      "console_threshold":"notice"
+    }
+  }
+}
diff --git a/redhat/default-main.cfg b/redhat/default-main.cfg
deleted file mode 100644 (file)
index 1dca690..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{"tr_internal": {"max_tree_depth": 4,
-                "hostname":"tr.moonshot.local",
-                "tids_port": 12309,
-
-                "logging": { "console_threshold": "debug",
-                             "log_threshold": "info"
-                           }
-               }
-}
diff --git a/redhat/organizations.cfg b/redhat/organizations.cfg
new file mode 100644 (file)
index 0000000..5c190b8
--- /dev/null
@@ -0,0 +1,84 @@
+{
+  "communities": [
+    {
+      "apcs": [],
+      "community_id": "apc.x",
+      "idp_realms": ["idp.x", "other.idp.x"],
+      "rp_realms": ["rp.x", "other.rp.x"],
+      "type": "apc",
+      "expiration_interval": 10
+    },
+    {
+      "apcs": ["apc."],
+      "community_id": "coi.x",
+      "idp_realms": ["idp.x"],
+      "rp_realms": ["rp.x"],
+      "type": "coi"
+    }
+  ],
+  "local_organizations": [
+    {
+      "organization_name": "Demo Organization",
+      "realms": [
+       {
+         "realm": "rp.x",
+         "gss_names": ["alpha-cred@apc.x",
+                       "beta-cred@apc.x",
+                       "gamma-cred@apc.x"],
+         "filters": {
+           "tid_inbound": [
+             {
+               "action": "accept",
+               "domain_constraints": [
+                 "*.local"
+               ],
+               "specs": [
+                 {
+                   "field": "rp_realm",
+                   "match": "rp.x"
+                 },
+                 {
+                   "field": "rp_realm",
+                   "match": "*.rp.x"
+                 }
+               ],
+               "realm_constraints": [
+                 "rp.x", "*.rp.x"
+               ]
+             }
+           ]
+         }
+       },
+        {
+          "realm": "other.rp.x",
+          "gss_names": ["something@apc.x"]
+        },
+       {
+         "realm": "idp.x",
+         "gss_names": ["alpha-cred@apc.x"],
+         "identity_provider": {
+           "aaa_servers": ["alpha.local"],
+           "apcs": ["apc.x"],
+           "shared_config": "no"
+         }
+        },
+       {
+         "realm": "other.idp.x",
+         "gss_names": ["beta-cred@apc.x"],
+         "identity_provider": {
+           "aaa_servers": ["alpha.local"],
+           "apcs": ["apc.x"],
+           "shared_config": "no"
+         }
+       }
+      ]
+    }
+  ],
+  "peer_organizations": [
+    {
+      "hostname": "gamma.local",
+      "port": 12310,
+      "gss_names": ["gamma-cred@apc.x"]
+    }
+  ]
+}
diff --git a/redhat/trusts.cfg b/redhat/trusts.cfg
deleted file mode 100644 (file)
index 0998e1f..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-{
-  "communities": [
-    {
-      "apcs": [
-        "pci-community.ja.net"
-      ],
-      "community_id": "comm.offcenter.org",
-      "idp_realms": [
-        "idr2.offcenter.org"
-      ],
-      "rp_realms": [
-        "sr3.offcenter.org"
-      ],
-      "type": "coi"
-    },
-    {
-      "apcs": [
-
-      ],
-      "community_id": "pci-community.ja.net",
-      "idp_realms": [
-        "idr1.offcenter.org",
-        "idr2.offcenter.org",
-        "ja.net",
-        "no-longer-untitled.offcenter.org"
-      ],
-      "rp_realms": [
-        "exchange.ja.net",
-        "sr3.offcenter.org"
-      ],
-      "type": "apc"
-    }
-  ],
-  "idp_realms": [
-    {
-      "aaa_servers": [
-        "127.0.0.1"
-      ],
-      "apcs": [
-        "pci-community.ja.net"
-      ],
-      "realm_id": "idr1.offcenter.org",
-      "shared_config": "yes"
-    },
-    {
-      "aaa_servers": [
-        "127.0.0.1"
-      ],
-      "apcs": [
-        "pci-community.ja.net"
-      ],
-      "realm_id": "idr2.offcenter.org",
-      "shared_config": "no"
-    },
-    {
-      "aaa_servers": [
-        "10.1.10.90"
-      ],
-      "apcs": [
-        "pci-community.ja.net"
-      ],
-      "realm_id": "ja.net",
-      "shared_config": "no"
-    },
-    {
-      "aaa_servers": [
-        "127.0.0.1"
-      ],
-      "apcs": [
-        "pci-community.ja.net"
-      ],
-      "realm_id": "no-longer-untitled.offcenter.org",
-      "shared_config": "yes"
-    }
-  ],
-  "rp_clients": [
-    {
-      "filter": {
-        "filter_lines": [
-          {
-            "action": "accept",
-            "domain_constraints": ["*.exchange.ja.net"],
-            "filter_specs": [
-              {
-                "field": "rp_realm",
-                "match": "exchange.ja.net"
-              },
-              {
-                "field": "rp_realm",
-                "match": "*.exchange.ja.net"
-              }
-            ],
-            "realm_constraints": ["*.exchange.ja.net", "a.com"]
-          }
-        ],
-        "type": "rp_permitted"
-      },
-      "gss_names": [
-        "01b80aa9-8753-4691-8f8a-f49f7793546f@portal-realm.ja.net"
-      ]
-    },
-    {
-      "filter": {
-        "filter_lines": [
-          {
-            "action": "accept",
-            "domain_constraints": ["*.bob.sr3.offcenter.org"],
-            "filter_specs": [
-              {
-                "field": "rp_realm",
-                "match": "sr3.offcenter.org"
-              },
-              {
-                "field": "rp_realm",
-                "match": "*.sr3.offcenter.org"
-              }
-            ],
-            "realm_constraints": ["*.sr3.offcenter.org" ]
-          }
-        ],
-        "type": "rp_permitted"
-      },
-      "gss_names": [
-        "895c308a-5624-4055-bb4f-ea24b77e6637@portal-realm.ja.net"
-      ]
-    }
-  ]
-}
index 5e94c34..7bfe0f5 100644 (file)
@@ -7,7 +7,7 @@
     "cfg_poll_interval": 1,
     "cfg_settling_time": 5,
     "trp_sweep_interval": 30,
-    "trp_update_interval": 120,
+    "trp_update_interval": 30,
     "trp_connect_interval": 10,
     "tid_request_timeout": 5,
     "tid_response_numerator": 2,
index 40dcc68..c6d6b00 100644 (file)
@@ -1,6 +1,6 @@
 %global optflags %{optflags} -Wno-parentheses
 Name:           trust_router
-Version:        2.0.0
+Version:        2.1.0
 Release:        1%{?dist}
 Summary:        Moonshot Trust Router
 
@@ -57,16 +57,16 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
 
 # Install config files
 install -D -m 755 redhat/init $RPM_BUILD_ROOT/%{_initrddir}/trust_router
-install -D -m 640 redhat/trusts.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/trusts.cfg
-install -D -m 640 redhat/default-main.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/main.cfg
-install -D -m 640 redhat/tr-test-main.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/main.cfg
+install -D -m 640 redhat/organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/organizations.cfg
+install -D -m 640 redhat/default-internal.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/internal.cfg
+install -D -m 640 redhat/tr-test-internal.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/internal.cfg
 install -D -m 640 redhat/sysconfig $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/trust_router
 install -D -m 640 redhat/sysconfig.tids $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/tids
 install -D -m 755 redhat/tids.init $RPM_BUILD_ROOT/%{_initrddir}/tids
 
 # Link shared config
-ln -s ../../trusts.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/trusts.cfg
-ln -s ../../trusts.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/trusts.cfg
+ln -s ../../organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/default/organizations.cfg
+ln -s ../../organizations.cfg $RPM_BUILD_ROOT/%{_sysconfdir}/trust_router/conf.d/tr-test/organizations.cfg
 
 # Install wrapper scripts
 install -D -m 755 redhat/tidc-wrapper $RPM_BUILD_ROOT/%{_bindir}/tidc-wrapper
@@ -135,11 +135,11 @@ chmod 770 /var/log/trust_router
 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/default
 %dir %attr(755,root,trustrouter) %{_sysconfdir}/trust_router/conf.d/tr-test
 
-%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/trusts.cfg
-%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/main.cfg
-%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/main.cfg
-%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/trusts.cfg
-%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/trusts.cfg
+%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/organizations.cfg
+%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/internal.cfg
+%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/internal.cfg
+%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/default/organizations.cfg
+%attr(640,root,trustrouter) %config(noreplace) %{_sysconfdir}/trust_router/conf.d/tr-test/organizations.cfg
 
 %files libs
 %defattr(-,root,root,-)