diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-03-17 14:29:17 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-03-17 14:29:17 +0100 |
commit | 03901766c7f452c637ac57ec526b98895da510d5 (patch) | |
tree | 8d8a8bb0121c8353e5f8550262640756f6e6e547 /tools/rsgtutil.c | |
parent | d2467c38d42f590deecd807741324fc0e5522a8a (diff) | |
download | rsyslog-03901766c7f452c637ac57ec526b98895da510d5.tar.gz rsyslog-03901766c7f452c637ac57ec526b98895da510d5.tar.bz2 rsyslog-03901766c7f452c637ac57ec526b98895da510d5.zip |
logsig: milestone/verfier: tree hashes are verified; ALSO a bugfix
bugfix: the initial vector was used incorrectly during hash computation.
Diffstat (limited to 'tools/rsgtutil.c')
-rw-r--r-- | tools/rsgtutil.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/rsgtutil.c b/tools/rsgtutil.c index d94a63cd..d4c58d2d 100644 --- a/tools/rsgtutil.c +++ b/tools/rsgtutil.c @@ -151,12 +151,16 @@ doVerifyRec(FILE *logfp, FILE *sigfp, block_sig_t *bs, gtfile gf) size_t lenRec; char rec[128*1024]; - fgets(rec, sizeof(rec), logfp); + if(fgets(rec, sizeof(rec), logfp) == NULL) { + r = feof(logfp) ? RSGTE_EOF : RSGTE_IO; + goto done; + } lenRec = strlen(rec); if(rec[lenRec-1] == '\n') --lenRec; r = rsgt_vrfy_nextRec(bs, gf, sigfp, (unsigned char*)rec, lenRec); +done: return r; } |