Last Comment Bug 477857 - digest and hmac without optional encoding argument causes all digests or hmac to fail on page
: digest and hmac without optional encoding argument causes all digests or hmac...
Status: RESOLVED WONTFIX
:
Product: Core
Classification: Components
Component: XForms (show other bugs)
: unspecified
: x86 Linux
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://www.w3.org/TR/xforms11/#fn-digest
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-10 11:37 PST by Leigh L. Klotz, Jr.
Modified: 2016-02-04 12:22 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
digest function with no optional encoding arg, fails (1.55 KB, application/xhtml+xml)
2009-02-10 11:39 PST, Leigh L. Klotz, Jr.
no flags Details
digest function with encoding arg, works (4.32 KB, application/xhtml+xml)
2009-02-10 11:40 PST, Leigh L. Klotz, Jr.
no flags Details
Combining the two tests causes all to fail (4.93 KB, application/xhtml+xml)
2009-02-10 11:41 PST, Leigh L. Klotz, Jr.
no flags Details

Description Leigh L. Klotz, Jr. 2009-02-10 11:37:59 PST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) 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 Leigh L. Klotz, Jr. 2009-02-10 11:39:34 PST
Created attachment 361577 [details]
digest function with no optional encoding arg, fails
Comment 2 Leigh L. Klotz, Jr. 2009-02-10 11:40:06 PST
Created attachment 361578 [details]
digest function with encoding arg, works
Comment 3 Leigh L. Klotz, Jr. 2009-02-10 11:41:36 PST
Created attachment 361581 [details]
Combining the two tests causes all to fail
Comment 4 aaronr 2009-02-10 12:14:38 PST
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.
Comment 5 Leigh L. Klotz, Jr. 2009-02-10 14:06:15 PST
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).
Comment 6 Philipp Wagner [:imphil] 2010-07-09 16:33:53 PDT
documentation updated at https://developer.mozilla.org/en/XForms/Mozilla_XForms_Specials
Comment 7 David Bolter [:davidb] 2016-02-04 12:22:21 PST
RIP xforms

Note You need to log in before you can comment on or make changes to this bug.