summaryrefslogtreecommitdiffstats
path: root/runtime/nsd_gtls.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-05-17 11:19:12 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2008-05-17 11:19:12 +0200
commitedf41396efc9bcbbc333651771df49d3ec68cb4d (patch)
treec2a9812d71383358243687f639e67c88fd4d55db /runtime/nsd_gtls.c
parent6ea98ec5fff21c362e28a0121b78b8e6bb3b2528 (diff)
downloadrsyslog-edf41396efc9bcbbc333651771df49d3ec68cb4d.tar.gz
rsyslog-edf41396efc9bcbbc333651771df49d3ec68cb4d.tar.xz
rsyslog-edf41396efc9bcbbc333651771df49d3ec68cb4d.zip
regained netstream driver genericity; improved drivers
- made action logic pass optional auth params only if they are actually configured - added new authMode and Fingerprint methods to ptcp netstream driver (keeping them once again generic) - added diagnostics messages when invalid auth modes were configured
Diffstat (limited to 'runtime/nsd_gtls.c')
-rw-r--r--runtime/nsd_gtls.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c
index 131a3679..df458ea3 100644
--- a/runtime/nsd_gtls.c
+++ b/runtime/nsd_gtls.c
@@ -416,7 +416,6 @@ SetAuthMode(nsd_t *pNsd, uchar *mode)
nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd;
ISOBJ_TYPE_assert((pThis), nsd_gtls);
-RUNLOG_VAR("%s", mode);
if(mode == NULL || !strcasecmp((char*)mode, "x509/name")) {
pThis->authMode = GTLS_AUTH_CERTNAME;
} else if(!strcasecmp((char*) mode, "x509/fingerprint")) {
@@ -424,7 +423,8 @@ RUNLOG_VAR("%s", mode);
} else if(!strcasecmp((char*) mode, "anon")) {
pThis->authMode = GTLS_AUTH_CERTANON;
} else {
- // TODO: logerror()?
+ errmsg.LogError(NO_ERRCODE, "authentication mode '%s' not supported by "
+ "gtls netstream driver", mode);
ABORT_FINALIZE(RS_RET_VALUE_NOT_SUPPORTED);
}
@@ -447,8 +447,11 @@ AddPermFingerprint(nsd_t *pNsd, uchar *pszFingerprint)
nsd_gtls_t *pThis = (nsd_gtls_t*) pNsd;
ISOBJ_TYPE_assert((pThis), nsd_gtls);
- if(pThis->authMode != GTLS_AUTH_CERTFINGERPRINT)
+ if(pThis->authMode != GTLS_AUTH_CERTFINGERPRINT) {
+ errmsg.LogError(NO_ERRCODE, "fingerprint authentication not supported by "
+ "gtls netstream driver in the configured authentication mode - ignored");
ABORT_FINALIZE(RS_RET_VALUE_NOT_IN_THIS_MODE);
+ }
// TODO: proper handling - but we need to redo this when we do the
// linked list. So for now, this is good enough (but MUST BE CHANGED!).