mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Removes explicit references to MD5.
This commit is contained in:
parent
21569be70d
commit
bbd8e95a44
7 changed files with 26 additions and 26 deletions
8
sync.c
8
sync.c
|
|
@ -103,7 +103,7 @@ static int state_sync_process(struct snapraid_state* state, int parity_f, block_
|
|||
/* for each disk, process the block */
|
||||
for(j=0;j<diskmax;++j) {
|
||||
int read_size;
|
||||
unsigned char hash[MD5_SIZE];
|
||||
unsigned char hash[HASH_SIZE];
|
||||
struct snapraid_block* block;
|
||||
|
||||
block = disk_block_get(handle[j].disk, i);
|
||||
|
|
@ -159,11 +159,11 @@ static int state_sync_process(struct snapraid_state* state, int parity_f, block_
|
|||
}
|
||||
|
||||
/* now compute the hash */
|
||||
memmd5(hash, block_buffer, read_size);
|
||||
memhash(hash, block_buffer, read_size);
|
||||
|
||||
if (bit_has(block->flag, BLOCK_HAS_HASH)) {
|
||||
/* compare the hash */
|
||||
if (memcmp(hash, block->hash, MD5_SIZE) != 0) {
|
||||
if (memcmp(hash, block->hash, HASH_SIZE) != 0) {
|
||||
fprintf(stderr, "%u: Data error for file %s at position %u\n", i, block->file->sub, block_file_pos(block));
|
||||
fprintf(stderr, "DANGER! Unexpected data error in a data disk, it isn't possible to sync.\n");
|
||||
fprintf(stderr, "Stopping to allow recovery. Try with 'snapraid -s %u check'\n", i);
|
||||
|
|
@ -173,7 +173,7 @@ static int state_sync_process(struct snapraid_state* state, int parity_f, block_
|
|||
} else {
|
||||
/* copy the hash, but doesn't mark the block as hashed */
|
||||
/* this allow on error to do not save the failed computation */
|
||||
memcpy(block->hash, hash, MD5_SIZE);
|
||||
memcpy(block->hash, hash, HASH_SIZE);
|
||||
}
|
||||
|
||||
/* compute the parity */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue