-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
use immutable buffers in SubtleCrypto methods #3797
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.
LGTM!
Can you add an entry in the changelog?
c98276d
to
c1cd484
Compare
Added a changelog entry. Rebased due to merge conflicts in the changelog; I made no other changes from the previous version. |
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.
Thank you!
|
AFAIK changing a parameter from Is that what you meant or did I miss something else? |
@daxpedda Oops, you're right. (Though it's |
This change makes all the methods in
SubtleCrypto
use&[u8]
parameters instead of&mut [u8]
.Here are the affected parameters:
decrypt(data)
: the WebCrypto API states:digest(data)
: the WebCrypto API states:encrypt(data)
: the WebCrypto API states:sign(data)
: the WebCrypto API states:unwrapKey(wrapped_key)
: the WebCrypto API states:verify(signature, data)
: the WebCrypto API states:I take the API documentation language "getting a copy of the bytes" to mean that the original buffer is left unmodified.
I can't find any evidence that these buffers would be modified. I'm not sure how strong an argument that is.
Fixes #3795.