diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-05-13 08:04:13 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-05-13 08:04:13 +0200 |
commit | 0d000a8b1096abb26f9e47a4083dc560fed0282d (patch) | |
tree | 5f62c0e9bc51fc63c65b50de3942754e3420376f /runtime/stream.c | |
parent | 415b26d5a19d8b1fd50d8e0b7b29cc8527537316 (diff) | |
download | rsyslog-0d000a8b1096abb26f9e47a4083dc560fed0282d.tar.gz rsyslog-0d000a8b1096abb26f9e47a4083dc560fed0282d.tar.bz2 rsyslog-0d000a8b1096abb26f9e47a4083dc560fed0282d.zip |
basic queue file encryption
Diffstat (limited to 'runtime/stream.c')
-rw-r--r-- | runtime/stream.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/stream.c b/runtime/stream.c index b781324a..e411577f 100644 --- a/runtime/stream.c +++ b/runtime/stream.c @@ -257,7 +257,8 @@ doPhysOpen(strm_t *pThis) if(pThis->cryprov != NULL) { CHKiRet(pThis->cryprov->OnFileOpen(pThis->cryprovData, - pThis->pszCurrFName, &pThis->cryprovFileData)); + pThis->pszCurrFName, &pThis->cryprovFileData, + (pThis->tOperationsMode == STREAMMODE_READ) ? 'r' : 'w')); } finalize_it: RETiRet; @@ -568,11 +569,16 @@ strmReadBuf(strm_t *pThis) CHKiRet(strmOpenFile(pThis)); iLenRead = read(pThis->fd, pThis->pIOBuf, pThis->sIOBufSize); DBGOPRINT((obj_t*) pThis, "file %d read %ld bytes\n", pThis->fd, iLenRead); + /* end crypto */ if(iLenRead == 0) { CHKiRet(strmHandleEOF(pThis)); } else if(iLenRead < 0) ABORT_FINALIZE(RS_RET_IO_ERROR); else { /* good read */ + /* here we place our crypto interface */ + if(pThis->cryprov != NULL) { + pThis->cryprov->Decrypt(pThis->cryprovFileData, pThis->pIOBuf, &iLenRead); + } pThis->iBufPtrMax = iLenRead; bRun = 0; /* exit loop */ } |