- static const int sha256sum_bin_len = 32;
- static const int sha256sum_hex_len = 64;
-
- static const unsigned char bin2hex[16] = {
- '0', '1', '2', '3',
- '4', '5', '6', '7',
- '8', '9', 'a', 'b',
- 'c', 'd', 'e', 'f'
- };
-
- int i, err;
- FILE *file;
- char *sha256sum_hex;
- unsigned char sha256sum_bin[sha256sum_bin_len];
-
- sha256sum_hex = xcalloc(1, sha256sum_hex_len + 1);
-
- file = fopen(file_name, "r");
- if (file == NULL) {
- opkg_perror(ERROR, "Failed to open file %s", file_name);
- free(sha256sum_hex);
- return NULL;
- }
-
- err = sha256_stream(file, sha256sum_bin);
- if (err) {
- opkg_msg(ERROR, "Could't compute sha256sum for %s.\n", file_name);
- fclose(file);
- free(sha256sum_hex);
- return NULL;
- }
+ static const int sha256sum_bin_len = 32;
+ static const int sha256sum_hex_len = 64;
+
+ static const unsigned char bin2hex[16] = {
+ '0', '1', '2', '3',
+ '4', '5', '6', '7',
+ '8', '9', 'a', 'b',
+ 'c', 'd', 'e', 'f'
+ };
+
+ int i, err;
+ FILE *file;
+ char *sha256sum_hex;
+ unsigned char sha256sum_bin[sha256sum_bin_len];
+
+ sha256sum_hex = xcalloc(1, sha256sum_hex_len + 1);
+
+ file = fopen(file_name, "r");
+ if (file == NULL) {
+ opkg_perror(ERROR, "Failed to open file %s", file_name);
+ free(sha256sum_hex);
+ return NULL;
+ }
+
+ err = sha256_stream(file, sha256sum_bin);
+ if (err) {
+ opkg_msg(ERROR, "Could't compute sha256sum for %s.\n",
+ file_name);
+ fclose(file);
+ free(sha256sum_hex);
+ return NULL;
+ }