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

Unified Diff: media/webm/webm_content_encodings_client.cc

Issue 10535029: Add support for encrypted WebM files as defined in the RFC. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 6 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/webm/webm_content_encodings_client.cc
diff --git a/media/webm/webm_content_encodings_client.cc b/media/webm/webm_content_encodings_client.cc
index 086f85b60b5e8151488f5e97cc7d2bcafa7a50f7..c9f61cb761d53af57d83e6af49b4fb7430c24cfd 100644
--- a/media/webm/webm_content_encodings_client.cc
+++ b/media/webm/webm_content_encodings_client.cc
@@ -50,6 +50,11 @@ WebMParserClient* WebMContentEncodingsClient::OnListStart(int id) {
return this;
}
+ if (id == kWebMIdContentEncAESSettings) {
+ DCHECK(cur_content_encoding_.get());
+ return this;
+ }
+
// This should not happen if WebMListParser is working properly.
DCHECK(false);
return NULL;
@@ -121,6 +126,13 @@ bool WebMContentEncodingsClient::OnListEnd(int id) {
return true;
}
+ if (id == kWebMIdContentEncAESSettings) {
+ if (cur_content_encoding_->cipher_mode() ==
+ ContentEncoding::kCipherModeInvalid)
+ cur_content_encoding_->set_cipher_mode(ContentEncoding::kCipherModeCTR);
+ return true;
+ }
+
// This should not happen if WebMListParser is working properly.
DCHECK(false);
return false;
@@ -206,6 +218,23 @@ bool WebMContentEncodingsClient::OnUInt(int id, int64 val) {
return true;
}
+ if (id == kWebMIdAESSettingsCipherMode) {
+ if (cur_content_encoding_->cipher_mode() !=
+ ContentEncoding::kCipherModeInvalid) {
+ DVLOG(1) << "Unexpected multiple AESSettingsCipherMode.";
+ return false;
+ }
+
+ if (val != ContentEncoding::kCipherModeCTR) {
+ DVLOG(1) << "Unexpected AESSettingsCipherMode " << val << ".";
+ return false;
+ }
+
+ cur_content_encoding_->set_cipher_mode(
+ static_cast<ContentEncoding::CipherMode>(val));
+ return true;
+ }
+
// This should not happen if WebMListParser is working properly.
DCHECK(false);
return false;

Powered by Google App Engine
This is Rietveld 408576698