@Test(expected = Updater.Ex.InsufficientSigners.class) public void replayedSig() throws Exception { byte[] fakePatch = new byte[1024]; Arrays.fill(fakePatch, (byte) 0x42); paths.put("/2.jar.bpatch", fakePatch); UFXProtocol.SignedUpdates.Builder builder = makeWrongIndex(); builder.setSignatures(0, Crypto.signMessage("hash from some other project", privKeys.get(0))); paths.put("/index", builder.build().toByteArray()); updater = new TestUpdater(indexURL, "UnitTest", dir, null); updater.call(); }
@Override protected UpdateSummary call() throws Exception { highestLocalVersion = UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar, localUpdatesDir)); newHighestVersion = highestLocalVersion; UFXProtocol.Updates updates = processSignedIndex(downloadSignedIndex()); return new UpdateSummary(newHighestVersion, updates); }
Updater extends Task<UpdateSummary> { @Override protected UpdateSummary call() throws Exception { highestLocalVersion = UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar, localUpdatesDir)); newHighestVersion = highestLocalVersion; UFXProtocol.Updates updates = processSignedIndex(downloadSignedIndex()); return new UpdateSummary(newHighestVersion, updates); } }
Updater extends Task<UpdateSummary> { @Override protected UpdateSummary call() throws Exception { highestLocalVersion = UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar, localUpdatesDir)); newHighestVersion = highestLocalVersion; UFXProtocol.Updates updates = processSignedIndex(downloadSignedIndex()); return new UpdateSummary(newHighestVersion, updates); } Updater(URI indexURL, String userAgent, Path localUpdatesDir,
                   Path pathToOrigJar, List<ECPoint> pubkeys, int requiredSigningThreshold); }
Updater extends Task<UpdateSummary> { @Override protected UpdateSummary call() throws Exception { highestLocalVersion = UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar, localUpdatesDir)); newHighestVersion = highestLocalVersion; UFXProtocol.Updates updates = processSignedIndex(downloadSignedIndex()); return new UpdateSummary(newHighestVersion, updates); } Updater(URI indexURL, String userAgent, Path localUpdatesDir,
                   Path pathToOrigJar, List<ECPoint> pubkeys, int requiredSigningThreshold); void setOverrideURLs(boolean overrideURLs); }
Updater extends Task<UpdateSummary> { @Override protected UpdateSummary call() throws Exception { highestLocalVersion = UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar, localUpdatesDir)); newHighestVersion = highestLocalVersion; UFXProtocol.Updates updates = processSignedIndex(downloadSignedIndex()); return new UpdateSummary(newHighestVersion, updates); } Updater(URI indexURL, String userAgent, Path localUpdatesDir,
                   Path pathToOrigJar, List<ECPoint> pubkeys, int requiredSigningThreshold); void setOverrideURLs(boolean overrideURLs);  }