Release provisioning sdk 8d17e45
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
example/example_data/provisioner.cert
Normal file
BIN
example/example_data/provisioner.cert
Normal file
Binary file not shown.
BIN
example/example_data/provisioner.encrypted.private
Normal file
BIN
example/example_data/provisioner.encrypted.private
Normal file
Binary file not shown.
4
example/example_data/provisioner.spoid_secret
Normal file
4
example/example_data/provisioner.spoid_secret
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
Twas bryllyg, and ye slythy toves
|
||||||
|
Did gyre and gymble in ye wabe:
|
||||||
|
All mimsy were ye borogoves;
|
||||||
|
And ye mome raths outgrabe.
|
||||||
Binary file not shown.
BIN
example/example_data/root.private
Normal file
BIN
example/example_data/root.private
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -12,7 +20,7 @@
|
|||||||
using widevine::OK;
|
using widevine::OK;
|
||||||
using widevine::ProvisioningEngine;
|
using widevine::ProvisioningEngine;
|
||||||
using widevine::ProvisioningSession;
|
using widevine::ProvisioningSession;
|
||||||
using widevine::kCertDevelopment;
|
using widevine::kCertTesting;
|
||||||
|
|
||||||
std::string GetContents(const std::string& file_name) {
|
std::string GetContents(const std::string& file_name) {
|
||||||
if (file_name.empty()) {
|
if (file_name.empty()) {
|
||||||
@@ -42,12 +50,13 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
// Call Initialize to setup the engine.
|
// Call Initialize to setup the engine.
|
||||||
if (engine.Initialize(
|
if (engine.Initialize(
|
||||||
kCertDevelopment, GetContents("example_data/service.cert"),
|
kCertTesting, GetContents("example_data/service.cert"),
|
||||||
GetContents("example_data/service.encrypted.private"),
|
GetContents("example_data/service.encrypted.private"),
|
||||||
GetContents("example_data/service.passphrase"),
|
GetContents("example_data/service.passphrase"),
|
||||||
GetContents("example_data/provider.cert"),
|
GetContents("example_data/provisioner.cert"),
|
||||||
GetContents("example_data/provider.encrypted.private"),
|
GetContents("example_data/provisioner.encrypted.private"),
|
||||||
GetContents("example_data/provider.passphrase")) != OK) {
|
GetContents("example_data/provisioner.passphrase"),
|
||||||
|
GetContents("example_data/provisioner.spoid_secret")) != OK) {
|
||||||
std::cout << "Failed to initialize." << std::endl;
|
std::cout << "Failed to initialize." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -1,5 +1,11 @@
|
|||||||
// Copyright 2013 Google Inc. All Rights Reserved.
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Author: tinskip@google.com (Thomas Inskip)
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//
|
//
|
||||||
// Description:
|
// Description:
|
||||||
// Public protocol buffer definitions for Widevine Device Certificate
|
// Public protocol buffer definitions for Widevine Device Certificate
|
||||||
@@ -39,12 +45,16 @@ message ProvisioningRequest {
|
|||||||
optional bytes nonce = 2;
|
optional bytes nonce = 2;
|
||||||
// Options for type of certificate to generate. Optional.
|
// Options for type of certificate to generate. Optional.
|
||||||
optional ProvisioningOptions options = 3;
|
optional ProvisioningOptions options = 3;
|
||||||
oneof origin_id {
|
oneof spoid_param {
|
||||||
// Stable identifier, unique for each device + application (or origin).
|
// Stable identifier, unique for each device + application (or origin).
|
||||||
// Required if doing per-origin provisioning.
|
// To be deprecated.
|
||||||
bytes stable_id = 4;
|
bytes stable_id = 4;
|
||||||
// Stable content provider ID.
|
// Service provider ID from the service certificate's provider_id field.
|
||||||
|
// Preferred parameter.
|
||||||
bytes provider_id = 6;
|
bytes provider_id = 6;
|
||||||
|
// Client-generated stable per-origin identifier to be copied directly
|
||||||
|
// to the client certificate serial number.
|
||||||
|
bytes spoid = 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
// Copyright 2013 Google Inc. All Rights Reserved.
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Author: tinskip@google.com (Thomas Inskip)
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
//
|
//
|
||||||
// Description:
|
// Description:
|
||||||
// ClientIdentification messages used by provisioning and license protocols.
|
// ClientIdentification messages used by provisioning and license protocols.
|
||||||
@@ -37,6 +43,11 @@ message ClientIdentification {
|
|||||||
HDCP_NO_DIGITAL_OUTPUT = 0xff;
|
HDCP_NO_DIGITAL_OUTPUT = 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum CertificateKeyType {
|
||||||
|
RSA_2048 = 0;
|
||||||
|
RSA_3072 = 1;
|
||||||
|
}
|
||||||
|
|
||||||
optional bool client_token = 1 [default = false];
|
optional bool client_token = 1 [default = false];
|
||||||
optional bool session_token = 2 [default = false];
|
optional bool session_token = 2 [default = false];
|
||||||
optional bool video_resolution_constraints = 3 [default = false];
|
optional bool video_resolution_constraints = 3 [default = false];
|
||||||
@@ -46,6 +57,12 @@ message ClientIdentification {
|
|||||||
// storing the generation number in secure memory. For Details, see:
|
// storing the generation number in secure memory. For Details, see:
|
||||||
// https://docs.google.com/document/d/1Mm8oB51SYAgry62mEuh_2OEkabikBiS61kN7HsDnh9Y/edit#heading=h.xgjl2srtytjt
|
// https://docs.google.com/document/d/1Mm8oB51SYAgry62mEuh_2OEkabikBiS61kN7HsDnh9Y/edit#heading=h.xgjl2srtytjt
|
||||||
optional bool anti_rollback_usage_table = 6 [default = false];
|
optional bool anti_rollback_usage_table = 6 [default = false];
|
||||||
|
// The client shall report |srm_version| if available.
|
||||||
|
optional uint32 srm_version = 7;
|
||||||
|
// A device may have SRM data, and report a version, but may not be capable
|
||||||
|
// of updating SRM data.
|
||||||
|
optional bool can_update_srm = 8 [default = false];
|
||||||
|
repeated CertificateKeyType supported_certificate_key_type = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type of factory-provisioned device root of trust. Optional.
|
// Type of factory-provisioned device root of trust. Optional.
|
||||||
@@ -68,9 +85,9 @@ message ClientIdentification {
|
|||||||
// EncryptedClientIdentification message used to hold ClientIdentification
|
// EncryptedClientIdentification message used to hold ClientIdentification
|
||||||
// messages encrypted for privacy purposes.
|
// messages encrypted for privacy purposes.
|
||||||
message EncryptedClientIdentification {
|
message EncryptedClientIdentification {
|
||||||
// Service ID for which the ClientIdentifcation is encrypted (owner of service
|
// Provider ID for which the ClientIdentifcation is encrypted (owner of
|
||||||
// certificate).
|
// service certificate).
|
||||||
optional string service_id = 1;
|
optional string provider_id = 1;
|
||||||
// Serial number for the service certificate for which ClientIdentification is
|
// Serial number for the service certificate for which ClientIdentification is
|
||||||
// encrypted.
|
// encrypted.
|
||||||
optional bytes service_certificate_serial_number = 2;
|
optional bytes service_certificate_serial_number = 2;
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Description:
|
// Description:
|
||||||
// Provisioned device info format definitions.
|
// Provisioned device info format definitions.
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Signed device certificate definition.
|
// Signed device certificate definition.
|
||||||
|
|
||||||
syntax = "proto2";
|
syntax = "proto2";
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef PROVISIONING_SDK_PUBLIC_CERTIFICATE_TYPE_H_
|
#ifndef PROVISIONING_SDK_PUBLIC_CERTIFICATE_TYPE_H_
|
||||||
#define PROVISIONING_SDK_PUBLIC_CERTIFICATE_TYPE_H_
|
#define PROVISIONING_SDK_PUBLIC_CERTIFICATE_TYPE_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
// Copyright 2016 Google Inc. All rights reserved.
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_ENGINE_H_
|
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_ENGINE_H_
|
||||||
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_ENGINE_H_
|
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_ENGINE_H_
|
||||||
@@ -40,6 +46,8 @@ class ProvisioningEngine {
|
|||||||
// corresponding to the provisioning certificate.
|
// corresponding to the provisioning certificate.
|
||||||
// * |provisioning_private_key_passphrase| is the password required to
|
// * |provisioning_private_key_passphrase| is the password required to
|
||||||
// decrypt |provisioning_private_key|, if any.
|
// decrypt |provisioning_private_key|, if any.
|
||||||
|
// * |secret_spoid_sauce| is a stable secret used as a factor in the
|
||||||
|
// derivation of Stable Per-Origin IDentifiers.
|
||||||
// * Returns OK on success, or an appropriate error status code otherwise.
|
// * Returns OK on success, or an appropriate error status code otherwise.
|
||||||
ProvisioningStatus Initialize(
|
ProvisioningStatus Initialize(
|
||||||
CertificateType certificate_type,
|
CertificateType certificate_type,
|
||||||
@@ -48,7 +56,8 @@ class ProvisioningEngine {
|
|||||||
const std::string& service_private_key_passphrase,
|
const std::string& service_private_key_passphrase,
|
||||||
const std::string& provisioning_drm_certificate,
|
const std::string& provisioning_drm_certificate,
|
||||||
const std::string& provisioning_private_key,
|
const std::string& provisioning_private_key,
|
||||||
const std::string& provisioning_private_key_passphrase);
|
const std::string& provisioning_private_key_passphrase,
|
||||||
|
const std::string& secret_spoid_sauce);
|
||||||
|
|
||||||
// Set the certificate status list for this engine.
|
// Set the certificate status list for this engine.
|
||||||
// * |certificate_status_list| is a certificate status list generated by the
|
// * |certificate_status_list| is a certificate status list generated by the
|
||||||
@@ -112,7 +121,9 @@ class ProvisioningEngine {
|
|||||||
// Generate a new device DRM certificate to be provisioned by means other than
|
// Generate a new device DRM certificate to be provisioned by means other than
|
||||||
// the Widevine provisioning protocol.
|
// the Widevine provisioning protocol.
|
||||||
// NOTE: This API should only be used to provision devices which were
|
// NOTE: This API should only be used to provision devices which were
|
||||||
// manufactured without Widevine DRM support.
|
// manufactured without Widevine DRM support. It is meant to be used as
|
||||||
|
// an exception, and not the norm. Most devices should be provisioned
|
||||||
|
// by means of a ProvisioningSession.
|
||||||
// * |system_id| is the Widevine system ID for the type of device being
|
// * |system_id| is the Widevine system ID for the type of device being
|
||||||
// provisioned.
|
// provisioned.
|
||||||
// * |public_key| is a DER-encoded PKCS#1.5 RSAPublicKey message which will
|
// * |public_key| is a DER-encoded PKCS#1.5 RSAPublicKey message which will
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
// Copyright 2016 Google Inc. All rights reserved.
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|
||||||
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_SESSION_H_
|
||||||
|
|||||||
@@ -1,4 +1,10 @@
|
|||||||
// Copyright 2016 Google Inc. All rights reserved.
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_STATUS_H_
|
#ifndef PROVISIONING_SDK_PUBLIC_PROVISIONING_STATUS_H_
|
||||||
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_STATUS_H_
|
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_STATUS_H_
|
||||||
@@ -12,9 +18,9 @@ enum ProvisioningStatus {
|
|||||||
INVALID_SERVICE_DRM_CERTIFICATE = 3,
|
INVALID_SERVICE_DRM_CERTIFICATE = 3,
|
||||||
// Invalid service private key or private key passphrase.
|
// Invalid service private key or private key passphrase.
|
||||||
INVALID_SERVICE_PRIVATE_KEY = 4,
|
INVALID_SERVICE_PRIVATE_KEY = 4,
|
||||||
INVALID_PROVISIONING_DRM_CERTIFICATE = 5,
|
INVALID_PROVISIONER_DRM_CERTIFICATE = 5,
|
||||||
// Invalid provisioning private key or private key passphrase.
|
// Invalid provisioner private key or private key passphrase.
|
||||||
INVALID_PROVISIONING_PRIVATE_KEY = 6,
|
INVALID_PROVISIONER_PRIVATE_KEY = 6,
|
||||||
INVALID_INTERMEDIATE_DRM_CERTIFICATE = 7,
|
INVALID_INTERMEDIATE_DRM_CERTIFICATE = 7,
|
||||||
INVALID_INTERMEDIATE_PUBLIC_KEY = 8,
|
INVALID_INTERMEDIATE_PUBLIC_KEY = 8,
|
||||||
// Invalid intermediate private key or private key passphrase.
|
// Invalid intermediate private key or private key passphrase.
|
||||||
@@ -31,6 +37,7 @@ enum ProvisioningStatus {
|
|||||||
DEVICE_REVOKED = 19,
|
DEVICE_REVOKED = 19,
|
||||||
INVALID_SERIAL_NUMBER = 20,
|
INVALID_SERIAL_NUMBER = 20,
|
||||||
INTERNAL_ERROR = 21,
|
INTERNAL_ERROR = 21,
|
||||||
|
INVALID_SPOID_SAUCE = 22,
|
||||||
NUM_PROVISIONING_STATUS,
|
NUM_PROVISIONING_STATUS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
%include "std_string.i"
|
%include "std_string.i"
|
||||||
%include "typemaps.i"
|
%include "typemaps.i"
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Swig file to generate a Python library for:
|
// Swig file to generate a Python library for:
|
||||||
// provisioning_sdk/public/certificate_type.h
|
// provisioning_sdk/public/certificate_type.h
|
||||||
|
|
||||||
@@ -13,8 +21,8 @@
|
|||||||
|
|
||||||
%unignore widevine;
|
%unignore widevine;
|
||||||
%unignore widevine::CertificateType;
|
%unignore widevine::CertificateType;
|
||||||
|
%unignore widevine::kCertTesting;
|
||||||
%unignore widevine::kCertDevelopment;
|
%unignore widevine::kCertDevelopment;
|
||||||
|
|
||||||
%include "provisioning_sdk/public/certificate_type.h"
|
%include "provisioning_sdk/public/certificate_type.h"
|
||||||
|
|
||||||
%unignoreall
|
%unignoreall
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
"""Utility functions for cryptography."""
|
"""Utility functions for cryptography."""
|
||||||
|
|
||||||
from cryptography.hazmat import backends
|
from cryptography.hazmat import backends
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import pywrapprovisioning_engine
|
import pywrapprovisioning_engine
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import crypto_utility
|
import crypto_utility
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import pywrapcertificate_type
|
import pywrapcertificate_type
|
||||||
@@ -49,94 +57,114 @@ class InitEngineTest(unittest.TestCase):
|
|||||||
|
|
||||||
def testInitEngineInvalidServiceDrmCert(self):
|
def testInitEngineInvalidServiceDrmCert(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment, 'INVALID_CERT',
|
pywrapcertificate_type.kCertTesting, 'INVALID_CERT',
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
test_data_utility.PROVISIONING_DRM_CERT,
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_DRM_CERTIFICATE,
|
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_DRM_CERTIFICATE,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
def testInitEngineInvalidServicePrivateKey(self):
|
def testInitEngineInvalidServicePrivateKey(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment,
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT, 'INVALID_KEY',
|
test_data_utility.SERVICE_DRM_CERT, 'INVALID_KEY',
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
test_data_utility.PROVISIONING_DRM_CERT,
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
def testInitEngineWrongServicePrivateKey(self):
|
def testInitEngineWrongServicePrivateKey(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment,
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT,
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
test_data_utility.PROVISIONING_DRM_CERT,
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
def testInitEngineInvalidServicePrivateKeyPassphrase(self):
|
def testInitEngineInvalidServicePrivateKeyPassphrase(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment,
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT,
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY, 'INVALID_PASSPHRASE',
|
test_data_utility.SERVICE_PRIVATE_KEY, 'INVALID_PASSPHRASE',
|
||||||
test_data_utility.PROVISIONING_DRM_CERT,
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
def testInitEngineInvalidDrmCert(self):
|
def testInitEngineInvalidDrmCert(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment,
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT,
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS, 'INVALID_CERT',
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS, 'INVALID_CERT',
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
pywrapprovisioning_status.INVALID_PROVISIONING_DRM_CERTIFICATE, status)
|
pywrapprovisioning_status.INVALID_PROVISIONER_DRM_CERTIFICATE, status)
|
||||||
|
|
||||||
def testInitEngineInvalidDrmPrivateKey(self):
|
def testInitEngineInvalidDrmPrivateKey(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment,
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT,
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
test_data_utility.PROVISIONING_DRM_CERT, 'INVALID_KEY',
|
test_data_utility.PROVISIONER_DRM_CERT, 'INVALID_KEY',
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
|
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONER_PRIVATE_KEY,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
def testInitEngineWrongDrmPrivateKey(self):
|
def testInitEngineWrongDrmPrivateKey(self):
|
||||||
status = self._engine.Initialize(
|
status = self._engine.Initialize(
|
||||||
pywrapcertificate_type.kCertDevelopment,
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT,
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
test_data_utility.PROVISIONING_DRM_CERT,
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
|
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONER_PRIVATE_KEY,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
def testInitEngineInvalidDrmPrivateKeyPassphrase(self):
|
def testInitEngineInvalidDrmPrivateKeyPassphrase(self):
|
||||||
status = self._engine.Initialize(pywrapcertificate_type.kCertDevelopment,
|
status = self._engine.Initialize(
|
||||||
|
pywrapcertificate_type.kCertTesting,
|
||||||
test_data_utility.SERVICE_DRM_CERT,
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
test_data_utility.PROVISIONING_DRM_CERT,
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
'INVALID_PASSPHRASE')
|
'INVALID_PASSPHRASE',
|
||||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONING_PRIVATE_KEY,
|
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||||
|
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONER_PRIVATE_KEY,
|
||||||
status)
|
status)
|
||||||
|
|
||||||
|
def testInitEngineInvalidSpoidSecret(self):
|
||||||
|
status = self._engine.Initialize(
|
||||||
|
pywrapcertificate_type.kCertTesting,
|
||||||
|
test_data_utility.SERVICE_DRM_CERT,
|
||||||
|
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||||
|
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||||
|
test_data_utility.PROVISIONER_DRM_CERT,
|
||||||
|
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||||
|
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
'')
|
||||||
|
self.assertEqual(pywrapprovisioning_status.INVALID_SPOID_SAUCE, status)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import crypto_utility
|
import crypto_utility
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Swig file to generate a Python library for:
|
// Swig file to generate a Python library for:
|
||||||
// provisioning_sdk/public/provisioning_engine.h
|
// provisioning_sdk/public/provisioning_engine.h
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Swig file to generate a Python library for:
|
// Swig file to generate a Python library for:
|
||||||
// provisioning_sdk/public/provisioning_session.h
|
// provisioning_sdk/public/provisioning_session.h
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Swig file to generate a Python library for:
|
// Swig file to generate a Python library for:
|
||||||
// provisioning_sdk/public/provisioning_status.h
|
// provisioning_sdk/public/provisioning_status.h
|
||||||
|
|
||||||
@@ -17,8 +25,8 @@
|
|||||||
%unignore widevine::PROVISIONING_ENGINE_UNINITIALIZED;
|
%unignore widevine::PROVISIONING_ENGINE_UNINITIALIZED;
|
||||||
%unignore widevine::INVALID_SERVICE_DRM_CERTIFICATE;
|
%unignore widevine::INVALID_SERVICE_DRM_CERTIFICATE;
|
||||||
%unignore widevine::INVALID_SERVICE_PRIVATE_KEY;
|
%unignore widevine::INVALID_SERVICE_PRIVATE_KEY;
|
||||||
%unignore widevine::INVALID_PROVISIONING_DRM_CERTIFICATE;
|
%unignore widevine::INVALID_PROVISIONER_DRM_CERTIFICATE;
|
||||||
%unignore widevine::INVALID_PROVISIONING_PRIVATE_KEY;
|
%unignore widevine::INVALID_PROVISIONER_PRIVATE_KEY;
|
||||||
%unignore widevine::INVALID_STATUS_LIST;
|
%unignore widevine::INVALID_STATUS_LIST;
|
||||||
%unignore widevine::STATUS_LIST_EXPIRED;
|
%unignore widevine::STATUS_LIST_EXPIRED;
|
||||||
%unignore widevine::UNKNOWN_SYSTEM_ID;
|
%unignore widevine::UNKNOWN_SYSTEM_ID;
|
||||||
@@ -28,6 +36,7 @@
|
|||||||
%unignore widevine::MISSING_DRM_INTERMEDIATE_CERT;
|
%unignore widevine::MISSING_DRM_INTERMEDIATE_CERT;
|
||||||
%unignore widevine::DEVICE_REVOKED;
|
%unignore widevine::DEVICE_REVOKED;
|
||||||
%unignore widevine::INVALID_SERIAL_NUMBER;
|
%unignore widevine::INVALID_SERIAL_NUMBER;
|
||||||
|
%unignore widevine::INVALID_SPOID_SAUCE;
|
||||||
%unignore widevine::GetProvisioningStatusMessage;
|
%unignore widevine::GetProvisioningStatusMessage;
|
||||||
|
|
||||||
%include "provisioning_sdk/public/provisioning_status.h"
|
%include "provisioning_sdk/public/provisioning_status.h"
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import pywrapprovisioning_engine
|
import pywrapprovisioning_engine
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
"""setup script to build Python wrappers using swig configurations."""
|
"""setup script to build Python wrappers using swig configurations."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
"""Utility class for Provisioning SDK testing."""
|
"""Utility class for Provisioning SDK testing."""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -23,9 +31,10 @@ SERVICE_DRM_CERT = GetTestData('service.cert')
|
|||||||
SERVICE_PUBLIC_KEY = GetTestData('service.public')
|
SERVICE_PUBLIC_KEY = GetTestData('service.public')
|
||||||
SERVICE_PRIVATE_KEY = GetTestData('service.encrypted.private')
|
SERVICE_PRIVATE_KEY = GetTestData('service.encrypted.private')
|
||||||
SERVICE_PRIVATE_KEY_PASS = GetTestData('service.passphrase')
|
SERVICE_PRIVATE_KEY_PASS = GetTestData('service.passphrase')
|
||||||
PROVISIONING_DRM_CERT = GetTestData('provider.cert')
|
PROVISIONER_DRM_CERT = GetTestData('provisioner.cert')
|
||||||
PROVISIONING_PRIVATE_KEY = GetTestData('provider.encrypted.private')
|
PROVISIONER_PRIVATE_KEY = GetTestData('provisioner.encrypted.private')
|
||||||
PROVISIONING_PRIVATE_KEY_PASS = GetTestData('provider.passphrase')
|
PROVISIONER_PRIVATE_KEY_PASS = GetTestData('provisioner.passphrase')
|
||||||
|
PROVISIONER_SPOID_SECRET = GetTestData('provisioner.spoid_secret')
|
||||||
CA_PUBLIC_KEY = GetTestData('intermediate.public')
|
CA_PUBLIC_KEY = GetTestData('intermediate.public')
|
||||||
DEVICE_PUBLIC_KEY = GetTestData('user.public')
|
DEVICE_PUBLIC_KEY = GetTestData('user.public')
|
||||||
DEVICE_PRIVATE_KEY = GetTestData('user.private')
|
DEVICE_PRIVATE_KEY = GetTestData('user.private')
|
||||||
@@ -42,11 +51,12 @@ def InitProvisionEngineWithTestData(engine, verify_success=False):
|
|||||||
Returns:
|
Returns:
|
||||||
OK on success, or an appropriate error status code otherwise.
|
OK on success, or an appropriate error status code otherwise.
|
||||||
"""
|
"""
|
||||||
status = engine.Initialize(pywrapcertificate_type.kCertDevelopment,
|
status = engine.Initialize(pywrapcertificate_type.kCertTesting,
|
||||||
SERVICE_DRM_CERT, SERVICE_PRIVATE_KEY,
|
SERVICE_DRM_CERT, SERVICE_PRIVATE_KEY,
|
||||||
SERVICE_PRIVATE_KEY_PASS, PROVISIONING_DRM_CERT,
|
SERVICE_PRIVATE_KEY_PASS, PROVISIONER_DRM_CERT,
|
||||||
PROVISIONING_PRIVATE_KEY,
|
PROVISIONER_PRIVATE_KEY,
|
||||||
PROVISIONING_PRIVATE_KEY_PASS)
|
PROVISIONER_PRIVATE_KEY_PASS,
|
||||||
|
PROVISIONER_SPOID_SECRET)
|
||||||
if verify_success:
|
if verify_success:
|
||||||
AssertSuccess(status, 'Failed to initialize.')
|
AssertSuccess(status, 'Failed to initialize.')
|
||||||
return status
|
return status
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright 2016 Google Inc.
|
||||||
|
//
|
||||||
|
// This software is licensed under the terms defined in the Widevine Master
|
||||||
|
// License Agreement. For a copy of this agreement, please contact
|
||||||
|
// widevine-licensing@google.com.
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class T> class unique_ptr {};
|
template <class T> class unique_ptr {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
################################################################################
|
||||||
|
# Copyright 2016 Google Inc.
|
||||||
|
#
|
||||||
|
# This software is licensed under the terms defined in the Widevine Master
|
||||||
|
# License Agreement. For a copy of this agreement, please contact
|
||||||
|
# widevine-licensing@google.com.
|
||||||
|
################################################################################
|
||||||
#
|
#
|
||||||
# This script generates a directory that stores the intermediate artifacts
|
# This script generates a directory that stores the intermediate artifacts
|
||||||
# needed for testing.
|
# needed for testing.
|
||||||
|
|||||||
Reference in New Issue
Block a user