(1) Move the CryptoMode enum definition to media_cas_packager_sdk partners can use it when calling libraries in the SDK.

(2) Add a new enum value for kDvbCsa.
(3) Allow caller to specify CTR, CBC, as well as CSA when using the ecm genertor from the SDK.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219707788
This commit is contained in:
Widevine Buildbot
2018-11-01 22:31:08 +00:00
parent 2c05ca1be2
commit a30ffdd7c6
6 changed files with 23 additions and 13 deletions

View File

@@ -12,11 +12,10 @@
#include <string>
#include "media_cas_packager_sdk/public/wv_cas_ecm.h"
#include "media_cas_packager_sdk/public/wv_cas_status.h"
#include "media_cas_packager_sdk/public/wv_cas_types.h"
const int kContentIvSize = 16;
const bool kKeyRotationEnabled = true;
const int kCryptoMode = 1; // CTR
const char kEvenKey[] = "even_content_key"; // 16 bytes
const char kEvenContentIv8Bytes[] = "evencont"; // 8 bytes
const char kEvenContentIv16Bytes[] = "evencontevencont"; // 16 bytes
@@ -29,7 +28,8 @@ const char kEntitlementKey[] = "entitlement_key................."; // 32 bytes
int main(int argc, char **argv) {
widevine::cas::WvCasEcm wv_cas_ecm;
widevine::cas::WvCasStatus status =
wv_cas_ecm.Initialize(kContentIvSize, kKeyRotationEnabled, kCryptoMode);
wv_cas_ecm.Initialize(kContentIvSize, kKeyRotationEnabled,
widevine::cas::CryptoMode::kDvbCsa);
if (status != widevine::cas::OK) {
std::cerr << "Failed to initialize WV CAS ECM, error: "
<< widevine::cas::GetWvCasStatusMessage(status)