Fix MD5 when using gnutls with nettle

This matches the non-nettle definition of s3fs_md5_fd.
This commit is contained in:
Andrew Gaul 2020-09-25 23:05:42 +09:00
parent 041b4ec05c
commit 9a55c9fd9f

View File

@ -194,6 +194,14 @@ unsigned char* s3fs_md5_fd(int fd, off_t start, off_t size)
off_t bytes; off_t bytes;
unsigned char* result; unsigned char* result;
if(-1 == size){
struct stat st;
if(-1 == fstat(fd, &st)){
return NULL;
}
size = st.st_size;
}
md5_init(&ctx_md5); md5_init(&ctx_md5);
for(off_t total = 0; total < size; total += bytes){ for(off_t total = 0; total < size; total += bytes){