digest and hmac without optional encoding argument causes all digests or hmac to fail on page



Core Graveyard
9 years ago
a year ago


(Reporter: Leigh L. Klotz, Jr., Unassigned)


Firefox Tracking Flags

(Not tracked)




(3 attachments)



9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: 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.

Reproducible: Always

Comment 1

9 years ago
Created attachment 361577 [details]
digest function with no optional encoding arg, fails

Comment 2

9 years ago
Created attachment 361578 [details]
digest function with encoding arg, works

Comment 3

9 years ago
Created attachment 361581 [details]
Combining the two tests causes all to fail

Comment 4

9 years ago
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.
Ever confirmed: true

Comment 5

9 years ago
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
RIP xforms
Last Resolved: 2 years ago
Resolution: --- → WONTFIX


a year ago
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.