-
Couldn't load subscription status.
- Fork 159
Correct algorithm parameter types in SubtleCrypto interface #190
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. Other algorithms (e.g. ECDH and DH) also support deriveKey and deriveBits http://www.w3.org/TR/WebCryptoAPI/#algorithm-overview. These two are asymmetric ciphers, not hash algorithms. This makes me think AlgorithmIdentifier is the only correct typing here. (Similar to how you have relaxed verify to verify both HMAC, RSA and AES varients).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking. I'll relax the type here. I'll relax the type in sign method as well.
I think I'll create another pull request in the future introducing MacAlgorithm type for verify and sign. I'll do it in another PR since I think it will need some more discussion.
|
@sjrd Can you please take a look at this PR? |
|
Sorry about the delay- things got a little idle over christmas, I'll review this tomorrow properly. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sjrd do we want this example + deps in the example project?
|
That's all really, the fixes seem good- overall relaxing those signatures solves the underlying problem, and the strengthening of digest to require |
build.sbt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependency is a deal breaker. We cannot afford to have scala-js-dom depend on anything but Scala.js core; otherwise we'll be unable to publish scala-js-dom for new versions of Scala.js until base64 is published, and that will be a nightmare.
|
Alright, suggest we drop commit 6c4db04 and squash the rest, pending any other style issues. |
|
I agree. (I don't have other style issues to report) |
|
@povder Post a comment when this is done so we'll notice and we can merge, thanks for the fix! |
|
Oh also, if you add "Fix: #196" to the beginning of the commit message, that will also close that issue once merged. |
|
Commit 6c4db04 removed, other commits squashed. Thanks for the review. |
|
Thanks! |
|
@sjrd okay for a merge? |
|
I suggest removing the changes to Maybe we need a different discussion about how we want to go about more complex examples. But in the current state, it should not be included. |
|
Changes to |
|
LGTM |
Correct algorithm parameter types in SubtleCrypto interface
This PR is an outcome of this discussion: bblfish@d0800da#commitcomment-15037842