Browse Source

In AutoUpdate, pass download buffer to SHA256 digester BEFORE deXORing.

pull/67/head
catbref 5 years ago
parent
commit
b48f671774
  1. 5
      src/main/java/org/qora/controller/AutoUpdate.java

5
src/main/java/org/qora/controller/AutoUpdate.java

@ -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…
Cancel
Save