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 <stdio.h>
|
||||
#include <iostream>
|
||||
@@ -12,7 +20,7 @@
|
||||
using widevine::OK;
|
||||
using widevine::ProvisioningEngine;
|
||||
using widevine::ProvisioningSession;
|
||||
using widevine::kCertDevelopment;
|
||||
using widevine::kCertTesting;
|
||||
|
||||
std::string GetContents(const std::string& file_name) {
|
||||
if (file_name.empty()) {
|
||||
@@ -42,12 +50,13 @@ int main(int argc, char** argv) {
|
||||
|
||||
// Call Initialize to setup the engine.
|
||||
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.passphrase"),
|
||||
GetContents("example_data/provider.cert"),
|
||||
GetContents("example_data/provider.encrypted.private"),
|
||||
GetContents("example_data/provider.passphrase")) != OK) {
|
||||
GetContents("example_data/provisioner.cert"),
|
||||
GetContents("example_data/provisioner.encrypted.private"),
|
||||
GetContents("example_data/provisioner.passphrase"),
|
||||
GetContents("example_data/provisioner.spoid_secret")) != OK) {
|
||||
std::cout << "Failed to initialize." << std::endl;
|
||||
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:
|
||||
// Public protocol buffer definitions for Widevine Device Certificate
|
||||
@@ -39,12 +45,16 @@ message ProvisioningRequest {
|
||||
optional bytes nonce = 2;
|
||||
// Options for type of certificate to generate. Optional.
|
||||
optional ProvisioningOptions options = 3;
|
||||
oneof origin_id {
|
||||
oneof spoid_param {
|
||||
// Stable identifier, unique for each device + application (or origin).
|
||||
// Required if doing per-origin provisioning.
|
||||
// To be deprecated.
|
||||
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;
|
||||
// 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:
|
||||
// ClientIdentification messages used by provisioning and license protocols.
|
||||
@@ -37,6 +43,11 @@ message ClientIdentification {
|
||||
HDCP_NO_DIGITAL_OUTPUT = 0xff;
|
||||
}
|
||||
|
||||
enum CertificateKeyType {
|
||||
RSA_2048 = 0;
|
||||
RSA_3072 = 1;
|
||||
}
|
||||
|
||||
optional bool client_token = 1 [default = false];
|
||||
optional bool session_token = 2 [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:
|
||||
// https://docs.google.com/document/d/1Mm8oB51SYAgry62mEuh_2OEkabikBiS61kN7HsDnh9Y/edit#heading=h.xgjl2srtytjt
|
||||
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.
|
||||
@@ -68,9 +85,9 @@ message ClientIdentification {
|
||||
// EncryptedClientIdentification message used to hold ClientIdentification
|
||||
// messages encrypted for privacy purposes.
|
||||
message EncryptedClientIdentification {
|
||||
// Service ID for which the ClientIdentifcation is encrypted (owner of service
|
||||
// certificate).
|
||||
optional string service_id = 1;
|
||||
// Provider ID for which the ClientIdentifcation is encrypted (owner of
|
||||
// service certificate).
|
||||
optional string provider_id = 1;
|
||||
// Serial number for the service certificate for which ClientIdentification is
|
||||
// encrypted.
|
||||
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:
|
||||
// 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.
|
||||
|
||||
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_
|
||||
#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_
|
||||
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_ENGINE_H_
|
||||
@@ -40,6 +46,8 @@ class ProvisioningEngine {
|
||||
// corresponding to the provisioning certificate.
|
||||
// * |provisioning_private_key_passphrase| is the password required to
|
||||
// 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.
|
||||
ProvisioningStatus Initialize(
|
||||
CertificateType certificate_type,
|
||||
@@ -48,7 +56,8 @@ class ProvisioningEngine {
|
||||
const std::string& service_private_key_passphrase,
|
||||
const std::string& provisioning_drm_certificate,
|
||||
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.
|
||||
// * |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
|
||||
// the Widevine provisioning protocol.
|
||||
// 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
|
||||
// provisioned.
|
||||
// * |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_
|
||||
#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_
|
||||
#define PROVISIONING_SDK_PUBLIC_PROVISIONING_STATUS_H_
|
||||
@@ -12,9 +18,9 @@ enum ProvisioningStatus {
|
||||
INVALID_SERVICE_DRM_CERTIFICATE = 3,
|
||||
// Invalid service private key or private key passphrase.
|
||||
INVALID_SERVICE_PRIVATE_KEY = 4,
|
||||
INVALID_PROVISIONING_DRM_CERTIFICATE = 5,
|
||||
// Invalid provisioning private key or private key passphrase.
|
||||
INVALID_PROVISIONING_PRIVATE_KEY = 6,
|
||||
INVALID_PROVISIONER_DRM_CERTIFICATE = 5,
|
||||
// Invalid provisioner private key or private key passphrase.
|
||||
INVALID_PROVISIONER_PRIVATE_KEY = 6,
|
||||
INVALID_INTERMEDIATE_DRM_CERTIFICATE = 7,
|
||||
INVALID_INTERMEDIATE_PUBLIC_KEY = 8,
|
||||
// Invalid intermediate private key or private key passphrase.
|
||||
@@ -31,6 +37,7 @@ enum ProvisioningStatus {
|
||||
DEVICE_REVOKED = 19,
|
||||
INVALID_SERIAL_NUMBER = 20,
|
||||
INTERNAL_ERROR = 21,
|
||||
INVALID_SPOID_SAUCE = 22,
|
||||
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 "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:
|
||||
// provisioning_sdk/public/certificate_type.h
|
||||
|
||||
@@ -13,8 +21,8 @@
|
||||
|
||||
%unignore widevine;
|
||||
%unignore widevine::CertificateType;
|
||||
%unignore widevine::kCertTesting;
|
||||
%unignore widevine::kCertDevelopment;
|
||||
|
||||
%include "provisioning_sdk/public/certificate_type.h"
|
||||
|
||||
%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."""
|
||||
|
||||
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 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 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 pywrapcertificate_type
|
||||
@@ -49,94 +57,114 @@ class InitEngineTest(unittest.TestCase):
|
||||
|
||||
def testInitEngineInvalidServiceDrmCert(self):
|
||||
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_PASS,
|
||||
test_data_utility.PROVISIONING_DRM_CERT,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
test_data_utility.PROVISIONER_DRM_CERT,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_DRM_CERTIFICATE,
|
||||
status)
|
||||
|
||||
def testInitEngineInvalidServicePrivateKey(self):
|
||||
status = self._engine.Initialize(
|
||||
pywrapcertificate_type.kCertDevelopment,
|
||||
pywrapcertificate_type.kCertTesting,
|
||||
test_data_utility.SERVICE_DRM_CERT, 'INVALID_KEY',
|
||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONING_DRM_CERT,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
test_data_utility.PROVISIONER_DRM_CERT,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
||||
status)
|
||||
|
||||
def testInitEngineWrongServicePrivateKey(self):
|
||||
status = self._engine.Initialize(
|
||||
pywrapcertificate_type.kCertDevelopment,
|
||||
pywrapcertificate_type.kCertTesting,
|
||||
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.PROVISIONING_DRM_CERT,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
test_data_utility.PROVISIONER_DRM_CERT,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
||||
status)
|
||||
|
||||
def testInitEngineInvalidServicePrivateKeyPassphrase(self):
|
||||
status = self._engine.Initialize(
|
||||
pywrapcertificate_type.kCertDevelopment,
|
||||
pywrapcertificate_type.kCertTesting,
|
||||
test_data_utility.SERVICE_DRM_CERT,
|
||||
test_data_utility.SERVICE_PRIVATE_KEY, 'INVALID_PASSPHRASE',
|
||||
test_data_utility.PROVISIONING_DRM_CERT,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
test_data_utility.PROVISIONER_DRM_CERT,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_SERVICE_PRIVATE_KEY,
|
||||
status)
|
||||
|
||||
def testInitEngineInvalidDrmCert(self):
|
||||
status = self._engine.Initialize(
|
||||
pywrapcertificate_type.kCertDevelopment,
|
||||
pywrapcertificate_type.kCertTesting,
|
||||
test_data_utility.SERVICE_DRM_CERT,
|
||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS, 'INVALID_CERT',
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(
|
||||
pywrapprovisioning_status.INVALID_PROVISIONING_DRM_CERTIFICATE, status)
|
||||
pywrapprovisioning_status.INVALID_PROVISIONER_DRM_CERTIFICATE, status)
|
||||
|
||||
def testInitEngineInvalidDrmPrivateKey(self):
|
||||
status = self._engine.Initialize(
|
||||
pywrapcertificate_type.kCertDevelopment,
|
||||
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.PROVISIONING_DRM_CERT, 'INVALID_KEY',
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_DRM_CERT, 'INVALID_KEY',
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONER_PRIVATE_KEY,
|
||||
status)
|
||||
|
||||
def testInitEngineWrongDrmPrivateKey(self):
|
||||
status = self._engine.Initialize(
|
||||
pywrapcertificate_type.kCertDevelopment,
|
||||
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.PROVISIONING_DRM_CERT,
|
||||
test_data_utility.PROVISIONER_DRM_CERT,
|
||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY_PASS)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONING_PRIVATE_KEY,
|
||||
test_data_utility.PROVISIONER_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONER_PRIVATE_KEY,
|
||||
status)
|
||||
|
||||
def testInitEngineInvalidDrmPrivateKeyPassphrase(self):
|
||||
status = self._engine.Initialize(pywrapcertificate_type.kCertDevelopment,
|
||||
test_data_utility.SERVICE_DRM_CERT,
|
||||
test_data_utility.SERVICE_PRIVATE_KEY,
|
||||
test_data_utility.SERVICE_PRIVATE_KEY_PASS,
|
||||
test_data_utility.PROVISIONING_DRM_CERT,
|
||||
test_data_utility.PROVISIONING_PRIVATE_KEY,
|
||||
'INVALID_PASSPHRASE')
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONING_PRIVATE_KEY,
|
||||
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,
|
||||
'INVALID_PASSPHRASE',
|
||||
test_data_utility.PROVISIONER_SPOID_SECRET)
|
||||
self.assertEqual(pywrapprovisioning_status.INVALID_PROVISIONER_PRIVATE_KEY,
|
||||
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__':
|
||||
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 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:
|
||||
// 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:
|
||||
// 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:
|
||||
// provisioning_sdk/public/provisioning_status.h
|
||||
|
||||
@@ -17,8 +25,8 @@
|
||||
%unignore widevine::PROVISIONING_ENGINE_UNINITIALIZED;
|
||||
%unignore widevine::INVALID_SERVICE_DRM_CERTIFICATE;
|
||||
%unignore widevine::INVALID_SERVICE_PRIVATE_KEY;
|
||||
%unignore widevine::INVALID_PROVISIONING_DRM_CERTIFICATE;
|
||||
%unignore widevine::INVALID_PROVISIONING_PRIVATE_KEY;
|
||||
%unignore widevine::INVALID_PROVISIONER_DRM_CERTIFICATE;
|
||||
%unignore widevine::INVALID_PROVISIONER_PRIVATE_KEY;
|
||||
%unignore widevine::INVALID_STATUS_LIST;
|
||||
%unignore widevine::STATUS_LIST_EXPIRED;
|
||||
%unignore widevine::UNKNOWN_SYSTEM_ID;
|
||||
@@ -28,6 +36,7 @@
|
||||
%unignore widevine::MISSING_DRM_INTERMEDIATE_CERT;
|
||||
%unignore widevine::DEVICE_REVOKED;
|
||||
%unignore widevine::INVALID_SERIAL_NUMBER;
|
||||
%unignore widevine::INVALID_SPOID_SAUCE;
|
||||
%unignore widevine::GetProvisioningStatusMessage;
|
||||
|
||||
%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 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."""
|
||||
|
||||
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."""
|
||||
|
||||
import os
|
||||
@@ -23,9 +31,10 @@ SERVICE_DRM_CERT = GetTestData('service.cert')
|
||||
SERVICE_PUBLIC_KEY = GetTestData('service.public')
|
||||
SERVICE_PRIVATE_KEY = GetTestData('service.encrypted.private')
|
||||
SERVICE_PRIVATE_KEY_PASS = GetTestData('service.passphrase')
|
||||
PROVISIONING_DRM_CERT = GetTestData('provider.cert')
|
||||
PROVISIONING_PRIVATE_KEY = GetTestData('provider.encrypted.private')
|
||||
PROVISIONING_PRIVATE_KEY_PASS = GetTestData('provider.passphrase')
|
||||
PROVISIONER_DRM_CERT = GetTestData('provisioner.cert')
|
||||
PROVISIONER_PRIVATE_KEY = GetTestData('provisioner.encrypted.private')
|
||||
PROVISIONER_PRIVATE_KEY_PASS = GetTestData('provisioner.passphrase')
|
||||
PROVISIONER_SPOID_SECRET = GetTestData('provisioner.spoid_secret')
|
||||
CA_PUBLIC_KEY = GetTestData('intermediate.public')
|
||||
DEVICE_PUBLIC_KEY = GetTestData('user.public')
|
||||
DEVICE_PRIVATE_KEY = GetTestData('user.private')
|
||||
@@ -42,11 +51,12 @@ def InitProvisionEngineWithTestData(engine, verify_success=False):
|
||||
Returns:
|
||||
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_PRIVATE_KEY_PASS, PROVISIONING_DRM_CERT,
|
||||
PROVISIONING_PRIVATE_KEY,
|
||||
PROVISIONING_PRIVATE_KEY_PASS)
|
||||
SERVICE_PRIVATE_KEY_PASS, PROVISIONER_DRM_CERT,
|
||||
PROVISIONER_PRIVATE_KEY,
|
||||
PROVISIONER_PRIVATE_KEY_PASS,
|
||||
PROVISIONER_SPOID_SECRET)
|
||||
if verify_success:
|
||||
AssertSuccess(status, 'Failed to initialize.')
|
||||
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 {
|
||||
template <class T> class unique_ptr {};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
#!/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
|
||||
# needed for testing.
|
||||
|
||||
Reference in New Issue
Block a user