summaryrefslogtreecommitdiffstats
path: root/runtime/nsd_gtls.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-05-27 14:49:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-05-27 14:49:45 +0200
commit531f27a8c3d6c988650e09bb126f792b8bac5421 (patch)
tree4988ea4f0347e8c1d4dc8fa611d31346f60e92fa /runtime/nsd_gtls.c
parentae387d6900c02ba655bd970c8053103a1b3f1dcd (diff)
downloadrsyslog-531f27a8c3d6c988650e09bb126f792b8bac5421.tar.gz
rsyslog-531f27a8c3d6c988650e09bb126f792b8bac5421.tar.xz
rsyslog-531f27a8c3d6c988650e09bb126f792b8bac5421.zip
implemented wildcards inside certificate name check authentication
Diffstat (limited to 'runtime/nsd_gtls.c')
-rw-r--r--runtime/nsd_gtls.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index d1f87e90..e3ff3477 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -60,6 +60,7 @@ MODULE_TYPE_LIB
DEFobjStaticHelpers
DEFobjCurrIf(errmsg)
DEFobjCurrIf(glbl)
+DEFobjCurrIf(net)
DEFobjCurrIf(nsd_ptcp)
static int bGlblSrvrInitDone = 0; /**< 0 - server global init not yet done, 1 - already done */
@@ -741,12 +742,11 @@ gtlsChkOnePeerName(nsd_gtls_t *pThis, uchar *pszPeerID, int *pbFoundPositiveMatc
if(pThis->pPermPeers) { /* do we have configured peer IDs? */
pPeer = pThis->pPermPeers;
- while(pPeer != NULL && !*pbFoundPositiveMatch) {
- if(!strcmp((char*)pszPeerID, (char*)pPeer->pszID)) {
- *pbFoundPositiveMatch = 1;
- } else {
- pPeer = pPeer->pNext;
- }
+ while(pPeer != NULL) {
+ CHKiRet(net.PermittedPeerWildcardMatch(pPeer, pszPeerID, pbFoundPositiveMatch));
+ if(*pbFoundPositiveMatch)
+ break;
+ pPeer = pPeer->pNext;
}
} else {
/* we do not have configured peer IDs, so we use defaults */
@@ -756,6 +756,7 @@ gtlsChkOnePeerName(nsd_gtls_t *pThis, uchar *pszPeerID, int *pbFoundPositiveMatc
}
}
+finalize_it:
RETiRet;
}
@@ -1520,6 +1521,7 @@ CODESTARTObjClassExit(nsd_gtls)
/* release objects we no longer need */
objRelease(nsd_ptcp, LM_NSD_PTCP_FILENAME);
+ objRelease(net, LM_NET_FILENAME);
objRelease(glbl, CORE_COMPONENT);
objRelease(errmsg, CORE_COMPONENT);
ENDObjClassExit(nsd_gtls)
@@ -1533,6 +1535,7 @@ BEGINObjClassInit(nsd_gtls, 1, OBJ_IS_LOADABLE_MODULE) /* class, version */
/* request objects we use */
CHKiRet(objUse(errmsg, CORE_COMPONENT));
CHKiRet(objUse(glbl, CORE_COMPONENT));
+ CHKiRet(objUse(net, LM_NET_FILENAME));
CHKiRet(objUse(nsd_ptcp, LM_NSD_PTCP_FILENAME));
/* now do global TLS init stuff */