// refuse to install if SHA-1 could not be computed
thrownewIOException("Failed to compute SHA-1 of downloaded file, refusing installation");
}
if(!expectedSHA1.equals(actualSha1)){
thrownewIOException("Downloaded file "+downloadedFile.getAbsolutePath()+" does not match expected SHA-1, expected "+expectedSHA1+", actual "+actualSha1);
// keep 'downloadedFile' around for investigating what's going on
}
}
}
/**
/**
* Represents the state of the installation activity of one plugin.
* Represents the state of the installation activity of one plugin.
*/
*/
...
@@ -1380,17 +1400,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
...
@@ -1380,17 +1400,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
// we have an update site that provides SHA-1 checksums, and this is not a plugin file upload
if(getComputedSHA1()==null){
// refuse to install if SHA-1 could not be computed
thrownewIOException("Failed to compute SHA-1 of downloaded file, refusing installation");
}
if(!plugin.getSha1().equals(getComputedSHA1())){
thrownewIOException("Downloaded file "+src.getAbsolutePath()+" does not match expected SHA-1, expected "+plugin.getSha1()+", actual "+getComputedSHA1());
// keep 'src' around for investigating what's going on
}
}
Filebak=Util.changeExtension(dst,".bak");
Filebak=Util.changeExtension(dst,".bak");
bak.delete();
bak.delete();
...
@@ -1525,16 +1535,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas
...
@@ -1525,16 +1535,7 @@ public class UpdateCenter extends AbstractModelObject implements Saveable, OnMas