@@ -683,9 +683,29 @@ def urlopen_index(self, url):
683683 )
684684 raise
685685
686- def verify (self , previous_verified , url , data , params ):
687- if previous_verified is not None or not params or not params .get ("requires_signature" ):
688- return previous_verified
686+ def verify (self , url , data , params , show_settings = False ):
687+ if not params or not params .get ("requires_signature" ):
688+ return None
689+
690+ if show_settings :
691+ relevant_params = {k : params [k ] for k in [
692+ "requires_signature" ,
693+ "required_root_subject" ,
694+ "required_publisher_subject" ,
695+ "required_publisher_eku" ,
696+ ] if k in params }
697+ if relevant_params :
698+ LOGGER .info ("Using verification settings from the index." )
699+ LOGGER .info (
700+ "Check the log file or verbose output for the settings "
701+ "being used. Copying these into your configuration "
702+ "file's !G!'source_settings'!W! section to detect "
703+ "changes."
704+ )
705+ LOGGER .verbose (
706+ "Verifying with the below settings.\n %r" ,
707+ {sanitise_url (url ): relevant_params }
708+ )
689709
690710 try :
691711 cat = self ._cache [url + ".cat" ]
@@ -767,12 +787,13 @@ def __next__(self):
767787 )
768788 raise
769789
770- source_settings = ( self .cmd .source_settings if self .cmd else None ) or {}
771- verified = self .verify (verified , url , data , source_settings . get ( s_url ) )
790+ source_settings = self .cmd .source_settings . get ( s_url ) if self .cmd else None
791+ verified = self .verify (url , data , source_settings )
772792 parsed = json .loads (data )
773793
774794 # The parsed index may also have its own verification parameters
775- verified = self .verify (verified , url , data , parsed )
795+ if not source_settings and not verified :
796+ verified = self .verify (url , data , parsed , show_settings = True )
776797
777798 if verified is True :
778799 LOGGER .info ("!G!The signature for %s was successfully verified.!W!" , s_url )
0 commit comments