This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22596 - Does verify fulfill or reject when a MAC/Signature does not verify
Summary: Does verify fulfill or reject when a MAC/Signature does not verify
Status: RESOLVED FIXED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Ryan Sleevi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-08 18:02 UTC by Ryan Sleevi
Modified: 2013-07-22 19:19 UTC (History)
1 user (show)

See Also:


Attachments

Description Ryan Sleevi 2013-07-08 18:02:45 UTC
Raised by Jim Schaad as http://www.w3.org/2012/webcrypto/track/issues/48

It is not explicitly stated if verify returns true/false as the result or something else.

The correct answer for decrypt using AE algorithms would be a reject if the tags don't match as the result returned is an ArrayBuffer.

However verify is currently stated to return a boolean and thus false would seem to be an appropriate response.
Comment 1 Ryan Sleevi 2013-07-22 19:18:23 UTC
Resolved in https://dvcs.w3.org/hg/webcrypto-api/rev/1ab461fb0e57

As described in the commit message, each algorithm is responsible for defining it's behaviour for the steps of 'process data'.

An example of this can be seen in the ECDSA case. As specified in https://dvcs.w3.org/hg/webcrypto-api/raw-file/1ab461fb0e57/spec/Overview.html#ecdsa-operations , Steps 9-11 describe that value is initialized to a boolean indicating success or failure, and that's returned from the verify operation.

As described in https://dvcs.w3.org/hg/webcrypto-api/raw-file/1ab461fb0e57/spec/Overview.html#dfn-CryptoOperation-process-data and https://dvcs.w3.org/hg/webcrypto-api/raw-file/1ab461fb0e57/spec/Overview.html#CryptoOperation-method-finish , the result of the underlying algorithm is passed to the associated resolver's resolve() algorithm.

Thus, a mismatched signature would resolve(false), while a matching signature would be resolve(true), and an unrelated failure would be reject(null) (12.1.2.4)