REBOL3 tracker
  0.9.12 beta
Ticket #0001685 User: anonymous

Project:



rss
TypeWish Statustested Date20-Oct-2010 13:44
Versionalpha 107 CategoryMezzanine Submitted byBrianH
PlatformAll Severityminor Priorityhigh

Summary Script checksum verification
Description If a script had a checksum field in its header, that checksum could be verified on load. An error could be triggered if the checksum doesn't match. This would allow you to screen for file corruption, line errors and such.

The checksum would be calculated with CHECKSUM/secure, would start after an optional newline after the REBOL header, and end at the end of the script. The end of the script is normally the end of file. For script-in-a-block it would be the position of the ending ] of the enclosing block (non-inclusive). For length-bound scripts (see #1684) the end would be at the length. For compressed scripts (see #1466), the checksum would apply to the decompressed binary script source.

All checksums are binary. Changing line endings changes the checksum.

SAVE will generate the checksum whenever the provided with a header with a 'checksum filed set to a TRUE? value. In practice, that value will probably be a previous checksum or the value true. SAVE will generate its own checksum even if one is provided, and ignore whether its own checksum matches the one provided.

LOAD will verify the checksum on load, if the 'checksum field is in the header. If the checksum doesn't match then LOAD should trigger a 'syntax 'bad-checksum error. The same error should be triggered if the 'checksum field is set to some other type than binary! or none!. For the sake of convenience, system/standard/header should have a 'checksum field.
Example code
>> to-string save/header none [print "Hello REBOL!"] [checksum: true]
== {REBOL [
    checksum: #{4DC8C9EE0414047082FF60E6A26A908DC7873FCD}
]
print "Hello REBOL!"
}
>> load save/header none [print "Hello REBOL!"] [checksum: true]
== [print "Hello REBOL!"]

Assigned ton/a Fixed inalpha 109 Last Update21-Oct-2010 06:14


Comments

Date User Field Action Change
21-Oct-2010 06:14 BrianH Status Modified built => tested
21-Oct-2010 01:56 carl Fixedin Modified => alpha 109
21-Oct-2010 01:56 carl Status Modified pending => built
20-Oct-2010 15:46 BrianH Code Modified -
20-Oct-2010 15:35 BrianH Fixedin Modified alpha 108 => none
20-Oct-2010 15:35 BrianH Status Modified tested => pending
20-Oct-2010 13:44 BrianH Description Modified -
20-Oct-2010 13:44 BrianH Code Modified -
20-Oct-2010 13:44 BrianH Fixedin Modified => alpha 108
20-Oct-2010 13:44 BrianH Status Modified submitted => tested
20-Oct-2010 13:44 BrianH Ticket Added -