Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 27506 - Inconsistent error for AES-CTR's "get key length" operation #45

Closed
mwatson2 opened this issue May 23, 2016 · 4 comments
Closed
Assignees

Comments

@mwatson2
Copy link
Collaborator

Bug 27506:

AES-CTR throws a DataError in its "get key length" operation if the length is not one of {128, 192, 256}.

Whereas the other AES algorithms throw an OperationError in this case.

I suggest using OperationError for AES-CTR to match the others.

@mwatson2
Copy link
Collaborator Author

mwatson2 commented May 24, 2016

@jimsch wrote:

I agree that this should be made consistent. However I believe that DataError would be the correct error returned in this case. The data provided is incorrect.

I believe we are using DataError for the cases where encoded key import data (raw, ASN.1 or JWK) is in error and we are using OperationError for anything where the directly supplied parameters are in error.

Get key length is used by deriveKey to peek the length of the desired derived key, so it does not process encoded key import data, only directly provided parameters.

So, I think OperationError is correct.

@jimsch
Copy link
Contributor

jimsch commented May 26, 2016

I can live with this

@mwatson2 mwatson2 self-assigned this Jun 8, 2016
mwatson2 added a commit to mwatson2/webcrypto that referenced this issue Jul 11, 2016
@mwatson2
Copy link
Collaborator Author

PR #112

@engelke
Copy link

engelke commented Jul 13, 2016

The PR looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants