summaryrefslogtreecommitdiffstats
path: root/runtime/netstrm.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-05-16 18:26:25 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-05-16 18:26:25 +0200
commit6ea98ec5fff21c362e28a0121b78b8e6bb3b2528 (patch)
tree3b4f434a5b8329acd82ef77d3d5d0144218b9e79 /runtime/netstrm.c
parent29ebd4ab3e391aea53b6e337061d226359aeb993 (diff)
downloadrsyslog-6ea98ec5fff21c362e28a0121b78b8e6bb3b2528.tar.gz
rsyslog-6ea98ec5fff21c362e28a0121b78b8e6bb3b2528.tar.xz
rsyslog-6ea98ec5fff21c362e28a0121b78b8e6bb3b2528.zip
added first rough ability to authenticate the server against its certificate
This is very experimental and needs some more work. It probably even segfaults - but the base code is there and running. The rest is refinement. While working on this, I did these two bugfixes: - bugfix: small mem leak in omfwd on exit (strmdriver name was not freed) - bugfix: $ActionSendStreamDriver had no effect
Diffstat (limited to 'runtime/netstrm.c')
-rw-r--r--runtime/netstrm.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/runtime/netstrm.c b/runtime/netstrm.c
index a1384a28..899cb3bf 100644
--- a/runtime/netstrm.c
+++ b/runtime/netstrm.c
@@ -172,6 +172,10 @@ Rcv(netstrm_t *pThis, uchar *pBuf, ssize_t *pLenBuf)
RETiRet;
}
+/* here follows a number of methods that shuffle authentication settings down
+ * to the drivers. Drivers not supporting these settings may return an error
+ * state.
+ * -------------------------------------------------------------------------- */
/* set the driver mode
* rgerhards, 2008-04-28
@@ -186,6 +190,32 @@ SetDrvrMode(netstrm_t *pThis, int iMode)
}
+/* set the driver authentication mode -- rgerhards, 2008-05-16
+ */
+static rsRetVal
+SetDrvrAuthMode(netstrm_t *pThis, uchar *mode)
+{
+ DEFiRet;
+ ISOBJ_TYPE_assert(pThis, netstrm);
+ iRet = pThis->Drvr.SetAuthMode(pThis->pDrvrData, mode);
+ RETiRet;
+}
+
+
+/* add an accepted fingerprint -- rgerhards, 2008-05-16
+ */
+static rsRetVal
+AddDrvrPermittedFingerprint(netstrm_t *pThis, uchar *fingerprint)
+{
+ DEFiRet;
+ ISOBJ_TYPE_assert(pThis, netstrm);
+ iRet = pThis->Drvr.AddPermFingerprint(pThis->pDrvrData, fingerprint);
+ RETiRet;
+}
+
+/* End of methods to shuffle autentication settings to the driver.
+ * -------------------------------------------------------------------------- */
+
/* send a buffer. On entry, pLenBuf contains the number of octets to
* write. On exit, it contains the number of octets actually written.
* If this number is lower than on entry, only a partial buffer has
@@ -280,6 +310,8 @@ CODESTARTobjQueryInterface(netstrm)
pIf->GetRemoteHName = GetRemoteHName;
pIf->GetRemoteIP = GetRemoteIP;
pIf->SetDrvrMode = SetDrvrMode;
+ pIf->SetDrvrAuthMode = SetDrvrAuthMode;
+ pIf->AddDrvrPermittedFingerprint = AddDrvrPermittedFingerprint;
pIf->GetSock = GetSock;
finalize_it:
ENDobjQueryInterface(netstrm)