This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
My interpretation of section "3. Conformance" is that yes, the order of errors must match that enumerated by the spec's pseudo-code. I would like to relax this requirement since some of the error orders given by the spec restrict implementations. For instance: * Empty usages is tested _after_ having generated/imported a key. However it would make more sense for an implementation to test for this error before creating the key (also faster failure for caller) * Usage testing when unwrapping a key is done after decryption (as part of importKey). Whereas implementations could rejected invalid usages (in many cases) sooner before doing the decryption.
Won't it make the test suite very complex if different implementations can return different errors for the same input (because they perform checks in a different order) ? Or am I being optimistic to think that the test suite would get as far as testing combinations of multiple input errors ;-)
Perhaps then I should file individual bugs for the error orders I am not satisfied with.
Based on my reading of the current section 3 I would disagree that the order of errors is strict. The text states that the algorithms are laid out to be understandable not to be high performance (although I have never run across the word performant and would probably say it could be changed). For single errors, the correct error needs to be returned. For multiple errors, I would say that any of the errors can be checked first and returned.
(In reply to jimsch from comment #3) > Based on my reading of the current section 3 I would disagree that the order > of errors is strict. The text states that the algorithms are laid out to be > understandable not to be high performance (although I have never run across > the word performant and would probably say it could be changed). But also that the observable effects remain the same. The observable effects include errors. So yes, the order of errors is strict.
Moved to https://github.com/w3c/webcrypto/issues/50