1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-20 14:54:31 +01:00

Added warning about forcing untrusted contributions

This commit is contained in:
Cristian Maglie 2019-08-02 18:13:39 +02:00
parent 94dd695355
commit 842c35be3e

View File

@ -86,8 +86,12 @@ public class ContributionsIndexer {
File defaultIndexFile = getIndexFile(Constants.DEFAULT_INDEX_FILE_NAME);
if (defaultIndexFile.exists()) {
// Check main index signature
if (!PreferencesData.areInsecurePackagesAllowed() && !signatureVerifier.isSigned(defaultIndexFile)) {
throw new SignatureVerificationFailedException(Constants.DEFAULT_INDEX_FILE_NAME);
if (!signatureVerifier.isSigned(defaultIndexFile)) {
if (PreferencesData.areInsecurePackagesAllowed()) {
System.err.println(format(tr("Warning: forced trusting untrusted contributions")));
} else {
throw new SignatureVerificationFailedException(Constants.DEFAULT_INDEX_FILE_NAME);
}
}
mergeContributions(defaultIndexFile);