forked from Qortal/qortal
In AutoUpdate, pass download buffer to SHA256 digester BEFORE deXORing.
This commit is contained in:
parent
8727780b77
commit
b48f671774
@ -173,10 +173,13 @@ public class AutoUpdate extends Thread {
|
|||||||
if (nread == -1)
|
if (nread == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Hash is based on XORed version
|
||||||
|
sha256.update(buffer, 0, nread);
|
||||||
|
|
||||||
|
// ReXOR before writing
|
||||||
for (int i = 0; i < nread; ++i)
|
for (int i = 0; i < nread; ++i)
|
||||||
buffer[i] ^= XOR_VALUE;
|
buffer[i] ^= XOR_VALUE;
|
||||||
|
|
||||||
sha256.update(buffer, 0, nread);
|
|
||||||
out.write(buffer, 0, nread);
|
out.write(buffer, 0, nread);
|
||||||
} while (true);
|
} while (true);
|
||||||
out.flush();
|
out.flush();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user