Browse Source

Log successful ISSig verification.

Martijn Laan 4 months ago
parent
commit
3fe8f683e5

+ 1 - 0
Projects/Src/Compiler.Messages.pas

@@ -53,6 +53,7 @@ const
   SCompilerStatusFilesCompressingVersion = '   Compressing: %s   (%u.%u.%u.%u)';
   SCompilerStatusFilesCompressingVersion = '   Compressing: %s   (%u.%u.%u.%u)';
   SCompilerStatusFilesStoring = '   Storing: %s';
   SCompilerStatusFilesStoring = '   Storing: %s';
   SCompilerStatusFilesStoringVersion = '   Storing: %s   (%u.%u.%u.%u)';
   SCompilerStatusFilesStoringVersion = '   Storing: %s   (%u.%u.%u.%u)';
+  SCompilerStatusFilesISSigVerified = '      ISSig verification successful.';
   SCompilerStatusCompressingSetupExe = '   Compressing Setup program executable';
   SCompilerStatusCompressingSetupExe = '   Compressing Setup program executable';
   SCompilerStatusUpdatingVersionInfo = '   Updating version info (%s)';
   SCompilerStatusUpdatingVersionInfo = '   Updating version info (%s)';
   SCompilerStatusUpdatingManifest = '   Updating manifest (%s)';
   SCompilerStatusUpdatingManifest = '   Updating manifest (%s)';

+ 3 - 1
Projects/Src/Compiler.SetupCompiler.pas

@@ -7106,10 +7106,12 @@ var
           CH.CompressFile(SourceFile, FL.OriginalSize,
           CH.CompressFile(SourceFile, FL.OriginalSize,
             floCallInstructionOptimized in FL.Flags, FL.SHA256Sum);
             floCallInstructionOptimized in FL.Flags, FL.SHA256Sum);
 
 
-          if floISSigVerify in FLExtraInfo.Flags then
+          if floISSigVerify in FLExtraInfo.Flags then begin
             if not SHA256DigestsEqual(FL.SHA256Sum, ExpectedFileHash) then
             if not SHA256DigestsEqual(FL.SHA256Sum, ExpectedFileHash) then
               AbortCompileFmt(SCompilerSourceFileISSigInvalidSignature,
               AbortCompileFmt(SCompilerSourceFileISSigInvalidSignature,
                 [FileLocationEntryFilenames[I], SCompilerSourceFileISSigFileHashIncorrect]);
                 [FileLocationEntryFilenames[I], SCompilerSourceFileISSigFileHashIncorrect]);
+            AddStatus(SCompilerStatusFilesISSigVerified);
+          end;
         finally
         finally
           SourceFile.Free;
           SourceFile.Free;
         end;
         end;

+ 3 - 1
Projects/Src/Setup.Install.pas

@@ -333,9 +333,11 @@ begin
     ProcessEvents;
     ProcessEvents;
   end;
   end;
 
 
-  if ISSigVerify then
+  if ISSigVerify then begin
     if not SHA256DigestsEqual(SHA256Final(Context), ExpectedFileHash) then
     if not SHA256DigestsEqual(SHA256Final(Context), ExpectedFileHash) then
       ISSigVerifyError(ISSigFileHashIncorrect, SetupMessages[msgSourceIsCorrupted]);
       ISSigVerifyError(ISSigFileHashIncorrect, SetupMessages[msgSourceIsCorrupted]);
+    Log('ISSig verification successful.');
+  end;
 
 
   { In case the source file was shorter than we thought it was, bump the
   { In case the source file was shorter than we thought it was, bump the
     progress bar to the maximum amount }
     progress bar to the maximum amount }