Files
ce_cdm/oemcrypto/test/oemcrypto_session_tests_helper.h
2018-06-29 15:59:47 -07:00

43 lines
1.2 KiB
C++

#include <assert.h>
#include <algorithm>
#include <iostream>
#include <openssl/aes.h>
#include <openssl/rand.h>
#include "oec_session_util.h"
#include "OEMCryptoCENC.h"
#include "test_keybox.h"
#include "test_rsa_key.h"
namespace wvoec {
class SessionUtil {
public:
SessionUtil()
: encoded_rsa_key_(
wvcdm_test_auth::kTestRSAPKCS8PrivateKeyInfo2_2048,
wvcdm_test_auth::kTestRSAPKCS8PrivateKeyInfo2_2048 +
wvcdm_test_auth::kTestRSAPKCS8PrivateKeyInfo2_2048_Size) {}
// If force is true, we assert that the key loads successfully.
void CreateWrappedRSAKeyFromKeybox(uint32_t allowed_schemes, bool force);
// If force is true, we assert that the key loads successfully.
void CreateWrappedRSAKeyFromOEMCert(uint32_t allowed_schemes, bool force);
// If force is true, we assert that the key loads successfully.
void CreateWrappedRSAKey(uint32_t allowed_schemes, bool force);
void InstallKeybox(const wvcdm_test_auth::WidevineKeybox& keybox, bool good);
void EnsureTestKeys();
void InstallTestSessionKeys(Session* s);
std::vector<uint8_t> encoded_rsa_key_;
std::vector<uint8_t> wrapped_rsa_key_;
wvcdm_test_auth::WidevineKeybox keybox_;
};
} // namespace wvoec