Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2174)

Unified Diff: media/crypto/aes_decryptor.cc

Issue 11830024: Do not require a key before processing unencrypted frames within a potentially encrypted stream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/crypto/aes_decryptor.cc
diff --git a/media/crypto/aes_decryptor.cc b/media/crypto/aes_decryptor.cc
index 83f818e60d015118785d090f1b31c35e786195d3..324d955e9f8a98d75335d6f0be13405dc4d2f46c 100644
--- a/media/crypto/aes_decryptor.cc
+++ b/media/crypto/aes_decryptor.cc
@@ -234,13 +234,6 @@ void AesDecryptor::Decrypt(StreamType stream_type,
CHECK(encrypted->GetDecryptConfig());
const std::string& key_id = encrypted->GetDecryptConfig()->key_id();
- DecryptionKey* key = GetKey(key_id);
- if (!key) {
- DVLOG(1) << "Could not find a matching key for the given key ID.";
- decrypt_cb.Run(kNoKey, NULL);
- return;
- }
-
scoped_refptr<DecoderBuffer> decrypted;
// An empty iv string signals that the frame is unencrypted.
if (encrypted->GetDecryptConfig()->iv().empty()) {
@@ -248,6 +241,13 @@ void AesDecryptor::Decrypt(StreamType stream_type,
decrypted = DecoderBuffer::CopyFrom(encrypted->GetData() + data_offset,
encrypted->GetDataSize() - data_offset);
} else {
xhwang 2013/01/09 21:18:21 move line 235 here?
ddorwin 2013/01/10 04:44:46 Done.
+ DecryptionKey* key = GetKey(key_id);
+ if (!key) {
+ DVLOG(1) << "Could not find a matching key for the given key ID.";
+ decrypt_cb.Run(kNoKey, NULL);
+ return;
+ }
+
crypto::SymmetricKey* decryption_key = key->decryption_key();
decrypted = DecryptData(*encrypted, decryption_key);
if (!decrypted) {
« no previous file with comments | « no previous file | media/filters/pipeline_integration_test.cc » ('j') | media/filters/pipeline_integration_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698