[DO NOT MERGE] Revert "Restructed reference root of trust (2/3 DRM Cert)"
This reverts commit f6f5099604.
Reason for revert: Feature missed deadline
Bug: 135283522
Change-Id: Ic86930ee3444c5a6aa1d78ae3a12a9030c29ef92
This commit is contained in:
@@ -8,14 +8,17 @@
|
||||
#define OEMCRYPTO_AUTH_REF_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <openssl/rsa.h>
|
||||
|
||||
#include "OEMCryptoCENC.h" // Needed for enums only.
|
||||
#include "disallow_copy_and_assign.h"
|
||||
#include "oemcrypto_key_ref.h"
|
||||
#include "oemcrypto_keybox_ref.h"
|
||||
#include "oemcrypto_rsa_key.h"
|
||||
#include "oemcrypto_rsa_key_shared.h"
|
||||
#include "oemcrypto_types.h"
|
||||
|
||||
namespace wvoec_ref {
|
||||
// The AuthenticationRoot class contains the OEMCrypto information
|
||||
@@ -66,13 +69,13 @@ class AuthenticationRoot {
|
||||
|
||||
// Returns the shared RSA private key from the built-in DRM
|
||||
// Certificate.
|
||||
std::shared_ptr<RsaPrivateKey> ShareDrmCertKey() {
|
||||
return test_rsa_key_ ? test_rsa_key_ : rsa_key_;
|
||||
RSA_shared_ptr& SharedRsaKey() {
|
||||
return test_rsa_key_.get() != nullptr ? test_rsa_key_ : rsa_key_;
|
||||
}
|
||||
RsaPrivateKey* DrmCertKey() const {
|
||||
return test_rsa_key_ ? test_rsa_key_.get() : rsa_key_.get();
|
||||
RSA* rsa_key() {
|
||||
return test_rsa_key_.get() != nullptr ? test_rsa_key_.get()
|
||||
: rsa_key_.get();
|
||||
}
|
||||
bool HasDrmCertKey() const { return test_rsa_key_ || rsa_key_; }
|
||||
|
||||
// Loads the system's built-in RSA key. Only implemented for
|
||||
// devices that are that pre-provisioned with a built-in DRM
|
||||
@@ -141,10 +144,11 @@ class AuthenticationRoot {
|
||||
OEMCrypto_ProvisioningMethod prov_method_ = OEMCrypto_ProvisioningError;
|
||||
|
||||
// DRM certificate.
|
||||
// If no keybox, this is the private key of the baked-in DRM
|
||||
// Certificate.
|
||||
std::shared_ptr<RsaPrivateKey> rsa_key_;
|
||||
std::shared_ptr<RsaPrivateKey> test_rsa_key_;
|
||||
// TODO(b/168544740): Remove |rsa_key_set_| when RSA_shared_ptr has
|
||||
// been replaced with scoped RsaPrivateKey.
|
||||
bool rsa_key_set_ = false;
|
||||
RSA_shared_ptr rsa_key_; // If no keybox, this is baked in certificate.
|
||||
RSA_shared_ptr test_rsa_key_;
|
||||
|
||||
// Keybox data.
|
||||
std::unique_ptr<WvKeybox> keybox_;
|
||||
|
||||
Reference in New Issue
Block a user