V18.4.0 CAS plugin

Note that this version does not have Widevine Provisioning 4.0 support.
It is only suitable for device upgrades. A new patch with provisioning
4.0 support will be made later.
This commit is contained in:
Lu Chen
2024-02-22 13:45:32 -08:00
parent ff9728aaa2
commit 5f209e6980
92 changed files with 25729 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
// Copyright 2018 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine Master
// License Agreement.
#ifndef CAS_STATUS_H
#define CAS_STATUS_H
#include <string>
namespace wvcas {
// TODO(jfore): Add more detailed error status codes.
enum class CasStatusCode : int32_t {
kUnknownError = 0,
kNoError = 1,
kCryptoInterfaceError = 2,
kCryptoSessionError = 3,
kCasLicenseError = 4,
kIndividualizationError = 5,
kInvalidParameter = 6,
kDecryptionError = 7,
kKeyNotFound = 8,
kSessionNotFound = 9,
kUnknownLicenseType = 10,
kLicenseFileParseError = 11,
kInvalidLicenseFile = 12,
kInvalidPesData = 13,
kDeferedEcmProcessing = 14,
kAccessDeniedByParentalControl = 15,
kUnknownEvent = 16,
kOEMCryptoVersionMismatch = 17,
};
class CasStatus {
public:
CasStatus(CasStatusCode status = CasStatusCode::kNoError,
const std::string& err_string = std::string())
: status_(status), err_string_(err_string) {}
static CasStatus OkStatus() { return CasStatus(); }
virtual ~CasStatus() {}
virtual CasStatusCode status_code() const { return status_; }
virtual const std::string& error_string() const { return err_string_; }
virtual bool ok() const { return status_ == CasStatusCode::kNoError; }
private:
CasStatusCode status_;
std::string err_string_;
};
} // namespace wvcas
#endif // CAS_STATUS_H