Open BenWiederhake opened 3 weeks ago
Thanks for the report! I also agree that throwing OperationError
is the obvious outcome; unfortunately it seems Safari's current implementation doesn't agree and returns an empty ArrayBuffer
for your test case (cc @nmahendru).
So, I agree it's technically a substantive change, though a fairly minor and hopefully non-controversial one. And clearly we should have a WPT test for this.
And, makes sense! I'll make a PR.
Context: https://w3c.github.io/webcrypto/#aes-cbc-operations
Some observations:
Suggestion: Insert between Step 1 and Step 2: "If ciphertext does not have a length that is a multiple of 16 bytes, then throw an OperationError." (Or some other Error type.)
Minimal-ish reproducer:
I can't find a WPT test that covers this edge case. Note that bigPadChar, inconsistentPadChars, and zeroPadChar are different edge cases.
It seems that Firefox and Chrome agree that this should result in an OperationError. However, I'm not entirely confident that all the other implementors agree with that. Given that there is no WPT test for this, I don't want to assume that this as a given, even though
OperationError
is the obvious choice here.EDIT: That's why I think this would be a substantive change, because it clears up an […] under-specified part of the specification in such a way that […] an agent whose conformance was once unclear becomes clearly either conforming or non-conforming, even though it's only a hypothetical such agent. For example, that hypothetical agent might raise a
DataError
.I tried to sign up using the link you provided to me, @twiss, but it seems I'm not allowed to do so without a special affiliation. (I do not work for a W3C Member organization, and strongly prefer to not pull my employer into this. Therefore my only option is to "participate as an Invited Expert", which sounds bureaucratically and legally intense.)
Therefore, I'm unable to write a PR.