@@ -381,18 +381,22 @@ func LoadIndex(jsonIndexFile *paths.Path) (*Index, error) {
381
381
}
382
382
383
383
jsonSignatureFile := jsonIndexFile .Parent ().Join (jsonIndexFile .Base () + ".sig" )
384
- trusted , _ , err := security .VerifyArduinoDetachedSignature (jsonIndexFile , jsonSignatureFile )
385
- if err != nil {
386
- logrus .
387
- WithField ("index" , jsonIndexFile ).
388
- WithField ("signatureFile" , jsonSignatureFile ).
389
- WithError (err ).Infof ("Checking signature" )
384
+ if jsonSignatureFile .Exist () {
385
+ trusted , _ , err := security .VerifyArduinoDetachedSignature (jsonIndexFile , jsonSignatureFile )
386
+ if err != nil {
387
+ logrus .
388
+ WithField ("index" , jsonIndexFile ).
389
+ WithField ("signatureFile" , jsonSignatureFile ).
390
+ WithError (err ).Warnf ("Checking signature" )
391
+ } else {
392
+ logrus .
393
+ WithField ("index" , jsonIndexFile ).
394
+ WithField ("signatureFile" , jsonSignatureFile ).
395
+ WithField ("trusted" , trusted ).Infof ("Checking signature" )
396
+ index .IsTrusted = trusted
397
+ }
390
398
} else {
391
- logrus .
392
- WithField ("index" , jsonIndexFile ).
393
- WithField ("signatureFile" , jsonSignatureFile ).
394
- WithField ("trusted" , trusted ).Infof ("Checking signature" )
395
- index .IsTrusted = trusted
399
+ logrus .WithField ("index" , jsonIndexFile ).Infof ("Missing signature file" )
396
400
}
397
401
return & index , nil
398
402
}
0 commit comments