This CL updates has several changes. The document WidevineModularDRMSecurityIntegrationGuideforCENC_v14.pdf had an incorrect definition of the PST_Report structure. The header file had the correct definition. This has been updated and the version number of the document was rolled to 14.1 The unit tests TwoHundredEntries has been modifed to make sure that if the usage table is full, then OEMCrypto will return the error OEMCrypto_ERROR_INSUFFICIENT_RESOURCES. This is important for the CDM layer to correctly delete old licenses and secure stops when this happens. Several other unit tests covering corner cases have been added. The reference code has been cleaned up a bit. Some logging that might be dangerous has been removed.
33 lines
1.2 KiB
C++
33 lines
1.2 KiB
C++
// 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 WVCDM_UTIL_STRING_CONVERSIONS_H_
|
|
#define WVCDM_UTIL_STRING_CONVERSIONS_H_
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace wvcdm {
|
|
|
|
std::vector<uint8_t> a2b_hex(const std::string& b);
|
|
std::vector<uint8_t> a2b_hex(const std::string& label, const std::string& b);
|
|
std::string a2bs_hex(const std::string& b);
|
|
std::string b2a_hex(const std::vector<uint8_t>& b);
|
|
std::string b2a_hex(const std::string& b);
|
|
std::string Base64Encode(const std::vector<uint8_t>& bin_input);
|
|
std::vector<uint8_t> Base64Decode(const std::string& bin_input);
|
|
std::string Base64SafeEncode(const std::vector<uint8_t>& bin_input);
|
|
std::string Base64SafeEncodeNoPad(const std::vector<uint8_t>& bin_input);
|
|
std::vector<uint8_t> Base64SafeDecode(const std::string& bin_input);
|
|
std::string HexEncode(const uint8_t* bytes, unsigned size);
|
|
std::string IntToString(int value);
|
|
int64_t htonll64(int64_t x);
|
|
inline int64_t ntohll64(int64_t x) { return htonll64(x); }
|
|
|
|
} // namespace wvcdm
|
|
|
|
#endif // WVCDM_UTIL_STRING_CONVERSIONS_H_
|