Skip to content

Commit

Permalink
[LICENSE] The KeyBox is licensed material, it can not be made availab…
Browse files Browse the repository at this point in the history
…le publicly.
  • Loading branch information
pwielders committed Feb 27, 2020
1 parent 8fb04da commit adb0c34
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 495 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ find_package(WideVine REQUIRED)

set(PLUGIN_SOURCES
HostImplementation.cpp
DeviceCertificate.cpp
MediaSession.cpp
MediaSystem.cpp)

Expand Down
337 changes: 0 additions & 337 deletions DeviceCertificate.cpp

This file was deleted.

29 changes: 0 additions & 29 deletions DeviceCertificate.h

This file was deleted.

1 change: 0 additions & 1 deletion HostImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

#include "HostImplementation.h"
#include "DeviceCertificate.h"

using namespace widevine;
using namespace WPEFramework;
Expand Down
3 changes: 3 additions & 0 deletions HostImplementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include "cdm.h"
#include "override.h"

extern uint8_t* kDeviceCert;
extern size_t kDeviceCertSize;

#include <core/core.h>

namespace CDMi {
Expand Down
49 changes: 49 additions & 0 deletions MediaSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#include <iostream>
#include <sstream>
#include <sys/utsname.h>
#include <core/core.h>

uint8_t* kDeviceCert = nullptr;
size_t kDeviceCertSize = 0;

using namespace WPEFramework;

namespace CDMi {

Expand All @@ -33,6 +39,24 @@ class WideVine : public IMediaKeys, public widevine::Cdm::IEventListener

typedef std::map<std::string, MediaKeySession*> SessionMap;

class Config : public Core::JSON::Container {
public:
Config(const Config&) = delete;
Config& operator=(const Config&) = delete;
Config()
: Core::JSON::Container()
, KeyBox()
{
Add(_T("keybox"), &KeyBox);
}
~Config()
{
}

public:
Core::JSON::String KeyBox;
};

public:
WideVine()
: _adminLock()
Expand Down Expand Up @@ -86,6 +110,31 @@ class WideVine : public IMediaKeys, public widevine::Cdm::IEventListener
if (_cdm != nullptr) {
delete _cdm;
}

if (kDeviceCert != nullptr) {
delete [] kDeviceCert;
kDeviceCert = nullptr;
kDeviceCertSize = 0;
}
}

void Initialize(const WPEFramework::PluginHost::IShell * shell, const std::string& configline)
{
Config config;
config.FromString(configline);

if (config.KeyBox.IsSet() == true) {
Core::DataElementFile dataBuffer(config.KeyBox.Value(), Core::File::USER_READ);

if(dataBuffer.IsValid() == false) {
TRACE_L1(_T("Failed to open %s"), config.KeyBox.Value().c_str());
} else {
kDeviceCertSize = dataBuffer.Size();
kDeviceCert = new uint8_t[kDeviceCertSize];

::memcpy(kDeviceCert, dataBuffer.Buffer(), dataBuffer.Size());
}
}
}

virtual CDMi_RESULT CreateMediaKeySession(
Expand Down
127 changes: 0 additions & 127 deletions tools/keybox/main.c

This file was deleted.

Binary file removed tools/keybox/testkeybox.bin
Binary file not shown.

0 comments on commit adb0c34

Please sign in to comment.