- sha1_final(hash, &ctx);
- if (!hashes_equal(hash, lte->hash)) {
- #ifdef ENABLE_ERROR_MESSAGES
- ERROR("Invalid checksum on the following WIM resource:");
- print_lookup_table_entry(lte);
- #endif
- return WIMLIB_ERR_INVALID_RESOURCE_HASH;
+ if (check_hash) {
+ sha1_final(hash, &ctx);
+ if (!hashes_equal(hash, lte->hash)) {
+ #ifdef ENABLE_ERROR_MESSAGES
+ ERROR("Invalid checksum on the following WIM resource:");
+ print_lookup_table_entry(lte, stderr);
+ #endif
+ return WIMLIB_ERR_INVALID_RESOURCE_HASH;
+ }