Author Topic: Script Checksum Errors  (Read 2964 times)

Offline steve71291

  • Newcomer
  • Posts: 9
Script Checksum Errors
« on: 2015 November 27 16:09:37 »
With the new version installed today on Win 7-64, thus far all process icons for scripts which I have saved fail to run due to a checksum error, mainly for batch preprocessing but also subframe analysis. This includes icons saved in projects.

Offline steve71291

  • Newcomer
  • Posts: 9
Re: Script Checksum Errors
« Reply #1 on: 2015 November 27 16:36:54 »
Let me clarify that the error occurs with process icons saved in a previous version of PI. New ones work okay.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Script Checksum Errors
« Reply #2 on: 2015 November 27 23:59:04 »
This is normal behavior.

Script instances compute a source code checksum when scripts are executed. These checksums are stored in process icons. When the source code of a script changes (typically, because a new version of the script has been released, or because some platform headers have changed), the stored checksums from previous executions are no longer valid.

To execute one of these icons:

- Double click the icon to launch it with the Script tool.

- On the Script tool, clear the MD5 checksum field.

- Press F6 to execute the script globally in the usual way.

- From the script's dialog window, save a new icon to the workspace. You can replace the old icon.

Scripts can change dynamically without control. In other words, the PixInsight core application cannot guarantee that when you execute a stored script instance, the code that you are going to execute is exactly the same code that you executed when you (or a script) created the instance. This makes scripts extremely vulnerable by nature. Binary modules can also be altered, or course, but this is much more difficult, and the core application can verify module integrity. Modules are also digitally signed, which makes then much more robust.

Before you ask, script checksums exist for two main reasons:

- Checksums are the best way to ensure that you are executing *exactly* the same code when you launch a saved script instance. This is important because modified source code may cause behavior changes, or different/unexpected results, and you should always be aware of such differences.

- With checksums, malicious script modifications can be detected easily. For example, if a script icon suddenly fails to validate its checksum without a known version change or any justified reason, you know that something bad is happening. In such case, if you run the icon by just clearing its checksum, that is your sole responsibility.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline steve71291

  • Newcomer
  • Posts: 9
Re: Script Checksum Errors
« Reply #3 on: 2015 November 28 07:37:13 »
Thanks for the explanation and solution to the problem. I have never noticed it to happen before on version changes but perhaps there were not changes in those scripts.