Loading drm/libmediadrmrkp/include/DrmRemotelyProvisionedComponent.h +3 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ using ::ndk::ScopedAStatus; class DrmRemotelyProvisionedComponent : public BnRemotelyProvisionedComponent { public: DrmRemotelyProvisionedComponent(std::shared_ptr<IDrmPlugin> drm, std::string drmVendor, std::string drmDesc, std::vector<uint8_t> bcc); std::string drmDesc, std::vector<uint8_t> bcc, std::vector<uint8_t> bcc_signature); ScopedAStatus getHardwareInfo(RpcHardwareInfo* info) override; ScopedAStatus generateEcdsaP256KeyPair(bool testMode, MacedPublicKey* macedPublicKey, Loading @@ -60,6 +61,7 @@ class DrmRemotelyProvisionedComponent : public BnRemotelyProvisionedComponent { std::string mDrmVendor; std::string mDrmDesc; std::vector<uint8_t> mBcc; std::vector<uint8_t> mBccSignature; }; } // namespace android::mediadrm Loading drm/libmediadrmrkp/src/DrmRemotelyProvisionedComponent.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -28,11 +28,13 @@ namespace android::mediadrm { DrmRemotelyProvisionedComponent::DrmRemotelyProvisionedComponent(std::shared_ptr<IDrmPlugin> drm, std::string drmVendor, std::string drmDesc, std::vector<uint8_t> bcc) std::vector<uint8_t> bcc, std::vector<uint8_t> bcc_signature) : mDrm(std::move(drm)), mDrmVendor(std::move(drmVendor)), mDrmDesc(std::move(drmDesc)), mBcc(std::move(bcc)) {} mBcc(std::move(bcc)), mBccSignature(std::move(bcc_signature)) {} ScopedAStatus DrmRemotelyProvisionedComponent::getHardwareInfo(RpcHardwareInfo* info) { info->versionNumber = 3; Loading Loading @@ -161,12 +163,16 @@ ScopedAStatus DrmRemotelyProvisionedComponent::generateCertificateRequestV2( } // assemble AuthenticatedRequest (definition in IRemotelyProvisionedComponent.aidl) *out = cppbor::Array() .add(1 /* version */) .add(cppbor::Map() /* UdsCerts */) .add(cppbor::EncodedItem(mBcc)) .add(cppbor::EncodedItem(std::move(deviceSignedCsrPayload))) .encode(); cppbor::Array request_array = cppbor::Array().add(1 /* version */); if (!mBccSignature.empty()) { request_array.add(cppbor::EncodedItem(mBccSignature) /* UdsCerts */); } else { request_array.add(cppbor::Map() /* empty UdsCerts */); } request_array.add(cppbor::EncodedItem(mBcc)) .add(cppbor::EncodedItem(std::move(deviceSignedCsrPayload))); *out = request_array.encode(); return ScopedAStatus::ok(); } } // namespace android::mediadrm No newline at end of file drm/libmediadrmrkp/src/DrmRkpAdapter.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -87,13 +87,21 @@ getDrmRemotelyProvisionedComponents() { status.getDescription().c_str()); return; } std::vector<uint8_t> bcc_signature; status = mDrm->getPropertyByteArray("bootCertificateChainSignature", &bcc_signature); if (!status.isOk()) { ALOGW("mDrm->getPropertyByteArray(\"bootCertificateChainSignature\") failed." "Detail: [%s].", status.getDescription().c_str()); // bcc signature is optional, no need to return when it is unavailable. } std::string compName(instance); auto comps = static_cast< std::map<std::string, std::shared_ptr<IRemotelyProvisionedComponent>>*>( context); (*comps)[compName] = ::ndk::SharedRefBase::make<DrmRemotelyProvisionedComponent>( mDrm, drmVendor, drmDesc, bcc); mDrm, drmVendor, drmDesc, bcc, bcc_signature); }); return comps; } Loading Loading
drm/libmediadrmrkp/include/DrmRemotelyProvisionedComponent.h +3 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,8 @@ using ::ndk::ScopedAStatus; class DrmRemotelyProvisionedComponent : public BnRemotelyProvisionedComponent { public: DrmRemotelyProvisionedComponent(std::shared_ptr<IDrmPlugin> drm, std::string drmVendor, std::string drmDesc, std::vector<uint8_t> bcc); std::string drmDesc, std::vector<uint8_t> bcc, std::vector<uint8_t> bcc_signature); ScopedAStatus getHardwareInfo(RpcHardwareInfo* info) override; ScopedAStatus generateEcdsaP256KeyPair(bool testMode, MacedPublicKey* macedPublicKey, Loading @@ -60,6 +61,7 @@ class DrmRemotelyProvisionedComponent : public BnRemotelyProvisionedComponent { std::string mDrmVendor; std::string mDrmDesc; std::vector<uint8_t> mBcc; std::vector<uint8_t> mBccSignature; }; } // namespace android::mediadrm Loading
drm/libmediadrmrkp/src/DrmRemotelyProvisionedComponent.cpp +15 −9 Original line number Diff line number Diff line Loading @@ -28,11 +28,13 @@ namespace android::mediadrm { DrmRemotelyProvisionedComponent::DrmRemotelyProvisionedComponent(std::shared_ptr<IDrmPlugin> drm, std::string drmVendor, std::string drmDesc, std::vector<uint8_t> bcc) std::vector<uint8_t> bcc, std::vector<uint8_t> bcc_signature) : mDrm(std::move(drm)), mDrmVendor(std::move(drmVendor)), mDrmDesc(std::move(drmDesc)), mBcc(std::move(bcc)) {} mBcc(std::move(bcc)), mBccSignature(std::move(bcc_signature)) {} ScopedAStatus DrmRemotelyProvisionedComponent::getHardwareInfo(RpcHardwareInfo* info) { info->versionNumber = 3; Loading Loading @@ -161,12 +163,16 @@ ScopedAStatus DrmRemotelyProvisionedComponent::generateCertificateRequestV2( } // assemble AuthenticatedRequest (definition in IRemotelyProvisionedComponent.aidl) *out = cppbor::Array() .add(1 /* version */) .add(cppbor::Map() /* UdsCerts */) .add(cppbor::EncodedItem(mBcc)) .add(cppbor::EncodedItem(std::move(deviceSignedCsrPayload))) .encode(); cppbor::Array request_array = cppbor::Array().add(1 /* version */); if (!mBccSignature.empty()) { request_array.add(cppbor::EncodedItem(mBccSignature) /* UdsCerts */); } else { request_array.add(cppbor::Map() /* empty UdsCerts */); } request_array.add(cppbor::EncodedItem(mBcc)) .add(cppbor::EncodedItem(std::move(deviceSignedCsrPayload))); *out = request_array.encode(); return ScopedAStatus::ok(); } } // namespace android::mediadrm No newline at end of file
drm/libmediadrmrkp/src/DrmRkpAdapter.cpp +10 −2 Original line number Diff line number Diff line Loading @@ -87,13 +87,21 @@ getDrmRemotelyProvisionedComponents() { status.getDescription().c_str()); return; } std::vector<uint8_t> bcc_signature; status = mDrm->getPropertyByteArray("bootCertificateChainSignature", &bcc_signature); if (!status.isOk()) { ALOGW("mDrm->getPropertyByteArray(\"bootCertificateChainSignature\") failed." "Detail: [%s].", status.getDescription().c_str()); // bcc signature is optional, no need to return when it is unavailable. } std::string compName(instance); auto comps = static_cast< std::map<std::string, std::shared_ptr<IRemotelyProvisionedComponent>>*>( context); (*comps)[compName] = ::ndk::SharedRefBase::make<DrmRemotelyProvisionedComponent>( mDrm, drmVendor, drmDesc, bcc); mDrm, drmVendor, drmDesc, bcc, bcc_signature); }); return comps; } Loading