mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
wip
This commit is contained in:
@ -222,12 +222,12 @@ int verifyChecksumFromFile(char *mess, char *clientChecksum, char *fname, ssize_
|
|||||||
char lastByte = buf[0];
|
char lastByte = buf[0];
|
||||||
// bytes = 128
|
// bytes = 128
|
||||||
while (bytes > 0) {
|
while (bytes > 0) {
|
||||||
buf[0] = lastbyte;
|
buf[0] = lastByte;
|
||||||
// shift by 4 bits to the left
|
// shift by 4 bits to the left
|
||||||
for (int i = 0; i < bytes; ++i) {
|
for (int i = 0; i < bytes; ++i) {
|
||||||
buf[i] = ((buf[i] & 0xf) << 4) + ((buf[i + 1] >> 4) & 0xf);
|
buf[i] = ((buf[i] & 0xf) << 4) + ((buf[i + 1] >> 4) & 0xf);
|
||||||
}
|
}
|
||||||
lastbyte = buf[bytes];
|
lastByte = buf[bytes];
|
||||||
if (!MD5_Update(&c, buf, bytes)) {
|
if (!MD5_Update(&c, buf, bytes)) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
strcpy(mess, "Unable to calculate checksum (MD5_Update)\n");
|
strcpy(mess, "Unable to calculate checksum (MD5_Update)\n");
|
||||||
|
Reference in New Issue
Block a user