mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixed bug in sha1sum calculation
This commit is contained in:
parent
5f17ed7786
commit
0290fe03f1
1 changed files with 5 additions and 1 deletions
|
@ -437,8 +437,10 @@ int sha1sum(FILE *f, unsigned char *sha1)
|
|||
SHA_CTX c;
|
||||
char buf[512];
|
||||
ssize_t bytes;
|
||||
long seek;
|
||||
|
||||
rewind(f); /* Rewind the file in order to calculate over the whole file. */
|
||||
seek = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
SHA1_Init(&c);
|
||||
|
||||
|
@ -449,6 +451,8 @@ int sha1sum(FILE *f, unsigned char *sha1)
|
|||
}
|
||||
|
||||
SHA1_Final(sha1, &c);
|
||||
|
||||
fseek(f, seek, SEEK_SET);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Reference in a new issue