[Webkit-unassigned] [Bug 90053] New: Javascript SHA-512 gives wrong hash on second and subsequent runs unless Web Inspector Javascript Debugging is on

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 27 00:44:26 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=90053

           Summary: Javascript SHA-512 gives wrong hash on second and
                    subsequent runs unless Web Inspector Javascript
                    Debugging is on
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bi5FiEJOYWtA at meltmail.com


Created an attachment (id=149698)
 --> (https://bugs.webkit.org/attachment.cgi?id=149698&action=review)
Peasy test code and two Javasc SHA-512 implems

(Test file enc.)

If I run Javasc SHA-512 twice or more on a Webkit browser, only the first hash is correct. Ironically, this means the usual hash method of an initial test won't work because that passes but the real one then mismatches.

The test file runs two different SHA-512 implems, hashing the word "test" separately eight times for each. On non-Webk browsers (eg, Firefox) all 16 hashes are identical and match the expected result. On Webk browsers (eg, iCab) the first in each set are correct, but the remaining 14 are wrong -- but match each other.

Tiny Webkit (eg, Mobile Safari) is fine.

The beardy-weirdy thing is that I discovered by chance the tests work if you switch on Javasc Debugging in the Web Inspector. (My wild guess is that the non-debug Javasc is optimised to the point of reusing some info it should have cleared instead. This would explain why it's the same incorrect hash each time rather than random results.)

If the test file doesn't work, you can also see the effect at http://jssha.sourceforge.net/ -- input "test" in the Hashing Demo section and select SHA-512. Now delete and retype "test" and the hash changes. Switch on Javasc Debugging and try again and the hash is solid.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list