From b810f0dd3ade85efeb7dc9b99fade798764d0ac2 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 25 Sep 2013 17:15:58 +0200 Subject: mmrfc5424addhmac: complete initial implementation hash is now also persisted back to structured-data rsyslog property --- runtime/msg.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'runtime/msg.c') diff --git a/runtime/msg.c b/runtime/msg.c index b15b76f8..18f72086 100644 --- a/runtime/msg.c +++ b/runtime/msg.c @@ -4067,6 +4067,22 @@ finalize_it: RETiRet; } +rsRetVal +MsgAddToStructuredData(msg_t *pMsg, uchar *toadd, rs_size_t len) +{ + uchar *newptr; + rs_size_t newlen; + DEFiRet; + newlen = pMsg->lenStrucData + len; + CHKmalloc(newptr = (uchar*) realloc(pMsg->pszStrucData, newlen+1)); + pMsg->pszStrucData = newptr; + memcpy(pMsg->pszStrucData+pMsg->lenStrucData, toadd, len); + pMsg->pszStrucData[newlen] = '\0'; + pMsg->lenStrucData = newlen; +finalize_it: + RETiRet; +} + /* dummy */ rsRetVal msgQueryInterface(void) { return RS_RET_NOT_IMPLEMENTED; } -- cgit v1.2.3