In order to get good coverage fuzzing code has to either calculate
checksums correctly or to disable their verification. This change
implements the latter for the "REGF_FILE" structure used by the
"regfio_*" family of functions.
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
prs_mem_free( &ps );
- if ( file->checksum != checksum ) {
+ if ( file->checksum != checksum && !file->ignore_checksums) {
DEBUG(0,("read_regf_block: invalid checksum\n" ));
return False;
}
}
ZERO_STRUCTP( rb );
rb->fd = -1;
+ rb->ignore_checksums = false;
if ( !(rb->mem_ctx = talloc_init( "regfio_open" )) ) {
regfio_close( rb );
REGF_SK_REC *sec_desc_list; /* list of security descriptors referenced by NK records */
+ /* Ignore checksums in input data. Used by fuzzing code to allow more
+ * coverage without having to calcuate a valid checksum. The checksums
+ * are merely to detect data corruption and don't provide a security
+ * value.
+ */
+ bool ignore_checksums;
+
/* unknowns used to simply writing */
uint32_t unknown1;