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

Fix for Issue #4665 #4666

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

thetar
Copy link
Contributor

@thetar thetar commented Apr 27, 2022

This PR will resolve issue webcrypto usage reverting to software aes decrypt.

Why is this Pull Request needed.

Webcrypto compatibility for Webkit based browsers.

Are there any points in the code the reviewer needs to double check?

Best practice around calling new proto for each AES decrypt action.

Resolves issues: #4665

Checklist

  • [ X ] changes have been done against master branch, and PR does not conflict
  • [ X ] new unit / functional tests have been added (whenever applicable)
  • [ X ] API or design changes are documented in API.md

@@ -158,8 +158,8 @@ export default class Decrypter {
if (!subtle) {
return Promise.reject(new Error('web crypto not initialized'));
}

const crypto = new AESCrypto(subtle, iv);
this.logOnce('WebCrypto AES decrypt');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove new log messages.


const crypto = new AESCrypto(subtle, iv);
this.logOnce('WebCrypto AES decrypt');
const crypto = new AESCrypto(subtle, new Uint8Array(iv));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If Webcrypto requires an ArrayBufferView in some cases, let's make all our methods strongly typed to require a Uint8Array explicitly. That way we're not extracting the buffer in our stream controllers which call webCryptoDecrypt and we're just passing the original view through all places where we're passing iv (decrypt, softwareDecrypt, and here).

@robwalch robwalch merged commit 8f55f85 into video-dev:master Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants