2929
3030package cc .arduino .contributions ;
3131
32+ import cc .arduino .Constants ;
3233import cc .arduino .utils .FileHash ;
3334import cc .arduino .utils .MultiStepProgress ;
3435import cc .arduino .utils .Progress ;
@@ -199,11 +200,9 @@ public boolean verifyDomain(URL url) {
199200 public boolean checkSignature (MultiStepProgress progress , URL signatureUrl , ProgressListener progressListener , SignatureVerifier signatureVerifier , String statusText , File fileToVerify ) throws Exception {
200201
201202 final boolean allowInsecurePackages =
202- PreferencesData .getBoolean ("allow_insecure_packages" , false );
203- if (allowInsecurePackages ) {
204- log .info ("Allow insecure packages is true the signature will be skip and return always verified" );
205- return true ;
206- }
203+ PreferencesData .getBoolean (Constants .ALLOW_INSECURE_PACKAGES , false );
204+ final boolean trustAll = PreferencesData .getBoolean (Constants .PREF_CONTRIBUTIONS_TRUST_ALL );
205+ final boolean skipVerification = allowInsecurePackages || trustAll ;
207206
208207 // Signature file name
209208 final String signatureFileName = FilenameUtils .getName (signatureUrl .getPath ());
@@ -215,6 +214,12 @@ public boolean checkSignature(MultiStepProgress progress, URL signatureUrl, Prog
215214 // Download signature
216215 download (signatureUrl , packageIndexSignatureTemp , progress , statusText , progressListener , true );
217216
217+ if (skipVerification ) {
218+ log .info ("Allowing insecure packages because allow_insecure_packages is set to true in preferences.txt" +
219+ " but the signature was download" );
220+ return true ;
221+ }
222+
218223 // Verify the signature before move the files
219224 final boolean signatureVerified = signatureVerifier .isSigned (fileToVerify , packageIndexSignatureTemp );
220225 if (signatureVerified ) {
0 commit comments