]> wimlib.net Git - wimlib/blobdiff - src/sha1.c
Resource fixes/changes
[wimlib] / src / sha1.c
index b65d25d6c57c1a31f8912664c9b64de1fbb3a020..36ff3f150bbc4f637dcbe33054c690347ff2108b 100644 (file)
  * Steve Reid's public domain code, or based on Intel's SSSE3 SHA1 code.
  */
 
-const u8 empty_file_sha1sum[SHA1_HASH_SIZE] = {
-       0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, 
-       0xbf, 0xef, 0x95, 0x60, 0x18, 0x90, 0xaf, 0xd8, 0x07, 0x09,
-};
-
-
 #ifdef WITH_LIBCRYPTO
 
 #define sha1_init     SHA1_Init
@@ -245,10 +239,15 @@ int sha1sum(const char *filename, void *md)
 
        fp = fopen(filename, "rb");
        if (!fp) {
-               ERROR("Cannot open the file `%s' for reading: %m\n", filename);
+               ERROR_WITH_ERRNO("Cannot open the file `%s' for reading",
+                                filename);
                return WIMLIB_ERR_OPEN;
        }
        ret = sha1_stream(fp, md);
+       if (ret != 0) {
+               ERROR_WITH_ERRNO("Error calculating SHA1 message digest of "
+                                "`%s'", filename);
+       }
        fclose(fp);
        return ret;
 }