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

Side by Side Diff: media/crypto/aes_decryptor.cc

Issue 10822026: Implement "Key Presence" step in "Encrypted Block Encounted" algorithm in EME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/crypto/aes_decryptor.h" 5 #include "media/crypto/aes_decryptor.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 DVLOG(1) << "Decryption failed."; 295 DVLOG(1) << "Decryption failed.";
296 decrypt_cb.Run(kError, NULL); 296 decrypt_cb.Run(kError, NULL);
297 return; 297 return;
298 } 298 }
299 299
300 decrypted->SetTimestamp(encrypted->GetTimestamp()); 300 decrypted->SetTimestamp(encrypted->GetTimestamp());
301 decrypted->SetDuration(encrypted->GetDuration()); 301 decrypted->SetDuration(encrypted->GetDuration());
302 decrypt_cb.Run(kSuccess, decrypted); 302 decrypt_cb.Run(kSuccess, decrypted);
303 } 303 }
304 304
305 void AesDecryptor::Stop() {
306 }
307
305 void AesDecryptor::SetKey(const std::string& key_id, 308 void AesDecryptor::SetKey(const std::string& key_id,
306 scoped_ptr<DecryptionKey> decryption_key) { 309 scoped_ptr<DecryptionKey> decryption_key) {
307 base::AutoLock auto_lock(key_map_lock_); 310 base::AutoLock auto_lock(key_map_lock_);
308 KeyMap::iterator found = key_map_.find(key_id); 311 KeyMap::iterator found = key_map_.find(key_id);
309 if (found != key_map_.end()) { 312 if (found != key_map_.end()) {
310 delete found->second; 313 delete found->second;
311 key_map_.erase(found); 314 key_map_.erase(found);
312 } 315 }
313 key_map_[key_id] = decryption_key.release(); 316 key_map_[key_id] = decryption_key.release();
314 } 317 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return false; 351 return false;
349 352
350 hmac_key_ = DeriveKey(secret_, kWebmHmacSeed, kWebmSha1DigestSize); 353 hmac_key_ = DeriveKey(secret_, kWebmHmacSeed, kWebmSha1DigestSize);
351 if (hmac_key_.empty()) 354 if (hmac_key_.empty())
352 return false; 355 return false;
353 356
354 return true; 357 return true;
355 } 358 }
356 359
357 } // namespace media 360 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698