diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-03-19 15:26:21 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-03-19 15:26:21 +0100 |
commit | 785e0c3c8b00614b6f780f902442025f4558a160 (patch) | |
tree | bc9a0a9172e426ae5debcf52ef91183e551eea14 /runtime/librsgt.c | |
parent | 4ec4e12fe706387e26405e127ffa1438b79c0bc9 (diff) | |
download | rsyslog-785e0c3c8b00614b6f780f902442025f4558a160.tar.gz rsyslog-785e0c3c8b00614b6f780f902442025f4558a160.tar.bz2 rsyslog-785e0c3c8b00614b6f780f902442025f4558a160.zip |
logsig: complete initial version of verifier
Diffstat (limited to 'runtime/librsgt.c')
-rw-r--r-- | runtime/librsgt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/librsgt.c b/runtime/librsgt.c index 20c8fd79..e24c3769 100644 --- a/runtime/librsgt.c +++ b/runtime/librsgt.c @@ -325,8 +325,11 @@ writeStateFile(gtfile gf) memcpy(sf.hdr, "GTSTAT10", 8); sf.hashID = hashIdentifier(gf->hashAlg); sf.lenHash = gf->x_prev->digest_length; - write(fd, &sf, sizeof(sf)); - write(fd, gf->x_prev->digest, gf->x_prev->digest_length); + /* if the write fails, we cannot do anything against that. We check + * the condition just to keep the compiler happy. + */ + if(write(fd, &sf, sizeof(sf))){}; + if(write(fd, gf->x_prev->digest, gf->x_prev->digest_length)){}; close(fd); done: return; } @@ -387,7 +390,7 @@ seedIV(gtfile gf) * will always work...). -- TODO -- rgerhards, 2013-03-06 */ if((fd = open("/dev/urandom", O_RDONLY)) > 0) { - read(fd, gf->IV, hashlen); + if(read(fd, gf->IV, hashlen)) {}; /* keep compiler happy */ close(fd); } } |