Exemplo n.º 1
0
 bool JSectFooter::checkHash(const void* begin, int len) const {
     if( !magicOk() ) { 
         log() << "journal footer not valid" << endl;
         return false;
     }
     Checksum c;
     c.gen(begin, len);
     DEV log() << "checkHash len:" << len << " hash:" << toHex(hash, 16) << " current:" << toHex(c.bytes, 16) << endl;
     if( memcmp(hash, c.bytes, sizeof(hash)) == 0 ) 
         return true;
     log() << "journal checkHash mismatch, got: " << toHex(c.bytes, 16) << " expected: " << toHex(hash,16) << endl;
     return false;
 }