summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/lmcry_gcry.c2
-rw-r--r--runtime/queue.c1
-rw-r--r--runtime/stream.c10
3 files changed, 6 insertions, 7 deletions
diff --git a/runtime/lmcry_gcry.c b/runtime/lmcry_gcry.c
index 041cd581..9a0c0072 100644
--- a/runtime/lmcry_gcry.c
+++ b/runtime/lmcry_gcry.c
@@ -233,7 +233,7 @@ OnFileOpen(void *pT, uchar *fn, void *pGF, char openMode)
lmcry_gcry_t *pThis = (lmcry_gcry_t*) pT;
gcryfile *pgf = (gcryfile*) pGF;
DEFiRet;
-dbgprintf("DDDD: open file '%s', mode '%c'\n", fn, openMode);
+ DBGPRINTF("lmcry_gcry: open file '%s', mode '%c'\n", fn, openMode);
CHKiRet(rsgcryInitCrypt(pThis->ctx, pgf, fn, openMode));
finalize_it:
diff --git a/runtime/queue.c b/runtime/queue.c
index d569318d..699e2a66 100644
--- a/runtime/queue.c
+++ b/runtime/queue.c
@@ -791,7 +791,6 @@ qqueueTryLoadPersistedInfo(qqueue_t *pThis)
CHKiRet(strm.SetcryprovData(pThis->tVars.disk.pReadDel, pThis->cryprovData));
}
-dbgprintf("DDDD: seeking offsets (here we need crypto)\n");
CHKiRet(strm.SeekCurrOffs(pThis->tVars.disk.pWrite));
CHKiRet(strm.SeekCurrOffs(pThis->tVars.disk.pReadDel));
CHKiRet(strm.SeekCurrOffs(pThis->tVars.disk.pReadDeq));
diff --git a/runtime/stream.c b/runtime/stream.c
index 5b1e105c..3f42953e 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -581,7 +581,7 @@ strmReadBuf(strm_t *pThis, int *padBytes)
toRead = pThis->sIOBufSize;
} else {
CHKiRet(pThis->cryprov->GetBytesLeftInBlock(pThis->cryprovFileData, &bytesLeft));
- if(bytesLeft == -1 || bytesLeft > pThis->sIOBufSize) {
+ if(bytesLeft == -1 || bytesLeft > (ssize_t) pThis->sIOBufSize) {
toRead = pThis->sIOBufSize;
} else {
toRead = (size_t) bytesLeft;
@@ -601,7 +601,8 @@ strmReadBuf(strm_t *pThis, int *padBytes)
pThis->cryprov->Decrypt(pThis->cryprovFileData, pThis->pIOBuf, &actualDataLen);
*padBytes = iLenRead - actualDataLen;
iLenRead = actualDataLen;
-dbgprintf("DDDD: data read (padBytes %d), decrypted: %1024.1024s\n", *padBytes, pThis->pIOBuf);
+ DBGOPRINT((obj_t*) pThis, "encrypted file %d pad bytes %d, actual "
+ "data %ld\n", pThis->fd, *padBytes, iLenRead);
}
pThis->iBufPtrMax = iLenRead;
bRun = 0; /* exit loop */
@@ -1521,12 +1522,11 @@ static rsRetVal strmSeekCurrOffs(strm_t *pThis)
/* As the cryprov may use CBC or similiar things, we need to read skip data */
targetOffs = pThis->iCurrOffs;
pThis->iCurrOffs = 0;
-dbgprintf("DDDD: skip read offs %lld, data: ", (long long) targetOffs);
+ DBGOPRINT((obj_t*) pThis, "encrypted, doing skip read of %lld bytes\n",
+ (long long) targetOffs);
while(targetOffs != pThis->iCurrOffs) {
CHKiRet(strmReadChar(pThis, &c));
-dbgprintf("%c", c);
}
-dbgprintf("\n");
finalize_it:
RETiRet;
}