User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:188.8.131.52) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:184.108.40.206) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5
Firefox XForms.xpi 0.8.6ff3
XForms 1.1 defines digest(string, string, string?) and hmac(string, string, string, string?).
If the final argument is omitted, all calls to digest and hmac fail.
If an empty string is passed instead, hmac and digest use the default encoding.
I suspect a bad pointer for a missing expected argument which wasn't noticed as optional.
Created attachment 361577 [details]
digest function with no optional encoding arg, fails
Created attachment 361578 [details]
digest function with encoding arg, works
Created attachment 361581 [details]
Combining the two tests causes all to fail
I guess we should document this somewhere, but Mozilla XForms currently doesn't support optional parameters w.r.t. xpath. With the extensible xpath in FF3 we have to provide interface definitions for all of the xpath methods we handle which means no optional parameters. Instead we try to support empty parameters, like empty strings, etc.
We can leave this bug open since it is a bug as far as XForms spec compliance. And if someone wants to drive this, we might be able to figure out how to signal to xpath via interface or some other mechanism that a parameter is optional.
Note that the attached tests are not exactly the ones from the XForms test suite.
The tests insist on case-equivalence for hexadecimal representation, but that's not required. The forthcoming XForms 1.1 test suite will use
translate(digest(...), 'ABC...', 'abc...') in the "hex" tests (but not the base64 ones obviously).
documentation updated at https://developer.mozilla.org/en/XForms/Mozilla_XForms_Specials