[Bf-blender-cvs] [72cf67ca64e] codesign_error_tracker: Codesign: Make Windows codesign check more strict

Sergey Sharybin noreply at git.blender.org
Thu Nov 12 10:00:56 CET 2020


Commit: 72cf67ca64e8be18bd090a98ba6f208635630089
Author: Sergey Sharybin
Date:   Thu Nov 12 10:00:08 2020 +0100
Branches: codesign_error_tracker
https://developer.blender.org/rB72cf67ca64e8be18bd090a98ba6f208635630089

Codesign: Make Windows codesign check more strict

Check that signtool reported number of files successfulyl signed,
and that the number equals to 1.

===================================================================

M	build_files/buildbot/codesign/windows_code_signer.py

===================================================================

diff --git a/build_files/buildbot/codesign/windows_code_signer.py b/build_files/buildbot/codesign/windows_code_signer.py
index b5d97044468..251dd856c8a 100644
--- a/build_files/buildbot/codesign/windows_code_signer.py
+++ b/build_files/buildbot/codesign/windows_code_signer.py
@@ -67,16 +67,27 @@ class WindowsCodeSigner(BaseCodeSigner):
         codesign_output = self.check_output_or_mock(command, util.Platform.WINDOWS)
         logger_server.info(f'signtool output:\n{codesign_output}')
 
+        got_number_of_success = False
+
         for line in codesign_output.split('\n'):
             line_clean = line.strip()
             line_clean_lower = line_clean.lower()
+
             if line_clean_lower.startswith('number of warnings') or \
                line_clean_lower.startswith('number of errors'):
-                 tokens = line_clean_lower.split(':')
-                 number = int(tokens[1])
+                 number = int(line_clean_lower.split(':')[1])
                  if number != 0:
                      raise SigntoolException('Non-clean success of signtool')
 
+            if line_clean_lower.startswith('number of files successfully signed'):
+                 got_number_of_success = True
+                 number = int(line_clean_lower.split(':')[1])
+                 if number != 1:
+                     raise SigntoolException('Signtool did not consider codesign a success')
+
+        if not got_number_of_success:
+            raise SigntoolException('Signtool did not report number of files signed')
+
 
     def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
         # NOTE: Sign files one by one to avoid possible command line length



More information about the Bf-blender-cvs mailing list