Commit Graph

20 Commits

Author SHA1 Message Date
Fred Gylys-Colwell
c5e0b1bb05 Docment OEMCrypto changes from v9 to v10.
This is a merge of http://go/wvgerrit/13391 from the Widevine
repository.  Most of the changes were already merged, but I forgot to
"git add" this new file.

Change-Id: Ie6875dc7f0d5a81c04bc5247e7d5ae0d033f695b
2015-03-12 11:59:40 -07:00
Fred Gylys-Colwell
68034dd900 OEMCrypto Version 10 API
This is a merge of http://go/wvgerrit/13391 from the Widevine repository.

This CL adds the OEMCrypto version 10 API to the header, and changes
just enough code so that code still compiles.  There are no unit tests
or implementation.

The level 3 libraries are just stubs so that tests will compile.
level3/arm/libwvlevel3.a  Level3 Library Mar 11 2015 13:33:21
level3/x86/libwvlevel3.a  Level3 Library Mar 11 2015 15:20:27

Change-Id: I41de753a2a60da29b756c3327341ece72069d8bb
2015-03-11 15:29:45 -07:00
Fred Gylys-Colwell
72b47e5789 Clarify Documentation
This is a copy of
https://widevine-internal-review.googlesource.com/#/c/11115/

This CL just updates the integration guide.  In particular, the
following clarifiaction is made about usage tables:

The sentence:
  When the session using this key is closed, the entry in the table will
    be marked as inactive.
is replaced by
      After the session using this key is closed, the application will
      request that the entry in the table will be marked as inactive.

This should make it clear that OEMCrypto should not automaically
deactivate usage entries.  This behaviour is already verified by unit
tests.

bug: 17405160

Change-Id: If836c7c76205e6759c1c194a6f31232c52c4f179
2014-09-05 17:44:42 +00:00
Fred Gylys-Colwell
e51f8ba7a1 Catch null pst in OEMCrypto
This is a copy of
https://widevine-internal-review.googlesource.com/#/c/11030

It is an error for the key control block to have a nonzero replay
control flag and a null pst.  This CL adds unit tests to
oemcrypto_test to verify that oemcrypto checkes this.  A unit test is
also added for verifying that an offline license has a valid nonce the
first time it is loaded.

It also updates the reference implementation (mock) to check that the
pst is not empty when the replay control flag is nonzero.

It also updates the level 3 implementation to check that the pst is
not empty when the replay control flag is nonzero.

This change is compiled into the arm library, but because of
compilation errors, is not included in x86 or mips.

    Current Library Version:
    arm:  Level3 Library Aug 27 2014 18:42:40

bug: 16525204 OEMCrypto unit test for reloading offline license
bug: 16844305 Mock OEMCrypto does not catch null pst
Change-Id: Icdb090e80fc92522c187b26f30e5ba082f26363b
2014-09-03 11:46:10 -07:00
Fred Gylys-Colwell
b5e8b87fed Merge Changes from CDM repository
This CL merges the following changes from the Widevine repository:

Avoid CdmSession reinitialization
https://widevine-internal-review.googlesource.com/#/c/10530/

Fix timer-related unit tests.
https://widevine-internal-review.googlesource.com/#/c/10510/

Correct return statement
bug: 15590802
https://widevine-internal-review.googlesource.com/#/c/10553/

Usage reporting fixes
bug/15388863
https://widevine-internal-review.googlesource.com/#/c/10460/

Make public methods virtual
https://widevine-internal-review.googlesource.com/#/c/10500/

Fix the SetTimer contract in the CDM.
https://widevine-internal-review.googlesource.com/#/c/10493/

Move inline CDM methods, add OVERRIDE.
https://widevine-internal-review.googlesource.com/#/c/10475/

Simplify storage APIs related cleanup.
https://widevine-internal-review.googlesource.com/#/c/10473/

Duration values are not correctly reported when queried
b/15592374
https://widevine-internal-review.googlesource.com/#/c/10437/

Propagate IsKeyValid() through ContentDecryptionModule.
https://widevine-internal-review.googlesource.com/#/c/10483/

Minor clean up in config_test_env.
https://widevine-internal-review.googlesource.com/#/c/10440/

General clean up.
https://widevine-internal-review.googlesource.com/#/c/10441/

Refactor HttpSocket and simplify UrlRequest interface.
https://widevine-internal-review.googlesource.com/#/c/10410/

Install good keybox at end of unit tests
b/15385981
https://widevine-internal-review.googlesource.com/#/c/10374/

Privacy crypto fixes
b/15475012
https://widevine-internal-review.googlesource.com/#/c/10383/

Incorporate header files to resolve build issued based on customers feedback.
https://widevine-internal-review.googlesource.com/#/c/10420/

Support unprovisioning
b/12247651
https://widevine-internal-review.googlesource.com/#/c/10356/

Correct usage of Host::Allocate and Cdm::Decrypt.
https://widevine-internal-review.googlesource.com/#/c/10378/

Fix logging bug, arguments in wrong order.
https://widevine-internal-review.googlesource.com/#/c/10380/

Rename types that look like constants.
https://widevine-internal-review.googlesource.com/#/c/10379/

Fix offline test failures
b/13909635
https://widevine-internal-review.googlesource.com/#/c/10348/

Add -DUNIT_TEST to the unit test makefile for Android
https://widevine-internal-review.googlesource.com/#/c/10375/

Refactor privacy-crypto and add dummy version.
https://widevine-internal-review.googlesource.com/#/c/10353/

Remove References to Apiary
https://widevine-internal-review.googlesource.com/#/c/9924/

Delete oldest entry in usage table when full
bug: 15184824
https://widevine-internal-review.googlesource.com/#/c/10295/

Port DeviceFiles to iOS.
https://widevine-internal-review.googlesource.com/#/c/10355/

Make testing functions in DeviceFiles private.
https://widevine-internal-review.googlesource.com/#/c/10354/

Add RSA encryption to haystack
https://widevine-internal-review.googlesource.com/#/c/10280/

Add string and vector includes to CDM header.
https://widevine-internal-review.googlesource.com/#/c/10352/

First version of oemcrypto logging
https://widevine-internal-review.googlesource.com/#/c/10252/

Update Names of Secure Stop Methods
bug: 11987015
https://widevine-internal-review.googlesource.com/#/c/10152/

Adjust timing on the Usage Table unit test
https://widevine-internal-review.googlesource.com/#/c/10307/

Fix all compiler warnings in CDM source release.
https://widevine-internal-review.googlesource.com/#/c/10293/

Fix memset bug: args in wrong order
https://widevine-internal-review.googlesource.com/#/c/10292/

Partial revert of 'Remove refs to test prov server, Level3 support...'
https://widevine-internal-review.googlesource.com/#/c/10281/

Pack structure OEMCrypto_PST_Report
https://widevine-internal-review.googlesource.com/#/c/10243/

Remove refs to test prov server, Level3 support; remove dead code
https://widevine-internal-review.googlesource.com/#/c/10220/

Partial revert of 'Document data strings; clean up license server parameters.'
https://widevine-internal-review.googlesource.com/#/c/10188/

Document data strings; clean up license server parameters.
https://widevine-internal-review.googlesource.com/#/c/10120/

Fix broken build after partner branch merge.
https://widevine-internal-review.googlesource.com/#/c/10181/

TODO Cleanup - core/src, core/include
https://widevine-internal-review.googlesource.com/#/c/9965/

TODO Cleanup - cdm, chromium, core/test.
https://widevine-internal-review.googlesource.com/#/c/9419/

Remove unneeded properties.
https://widevine-internal-review.googlesource.com/#/c/10162/

Change-Id: If2bb9d743a562a3875bebb91933c0aaadea286b2
2014-06-27 18:59:56 +00:00
Fred Gylys-Colwell
6f3e866882 Pack structure OEMCrypto_PST_Report
Because the OEMCrypto_PST_Report is sent as a signed block to the
server, it needs to be a fixed, platform independent, size.  This CL
adds the packed attribute to the structure, which reduces its size
from 56 bytes to 48 bytes.

Copy of widevine change:
https://widevine-internal-review.googlesource.com/#/c/10321/

Library Versions:
libwvdrmengine/level3/x86/libwvlevel3.a  Level3 Library May 30 2014 15:40:50
libwvdrmengine/level3/arm/libwvlevel3.a  Level3 Library May 30 2014 15:39:04

bug: 15184821
Change-Id: I54db2c3bbc4e20ee0c19c33d6fd56f86f432e110
2014-05-30 15:47:16 -07:00
Edwin Wong
8c73bde53f Add password to prevent vendors from editing CENC pdfs.
What can the user do with the security setting:
 - open and view the doc
 - print the doc
 - no copying of content
 - can add comment, filling in forms and signing existing signature fields
 (no forms or signature fields in the doc),this option is bundled together
 (it is nice to allow the user to add notes to the doc)

bug: 14294953
Change-Id: I8690ccd16daffbd62549c1e4e137880b196c12d4
2014-05-21 17:47:22 -07:00
Fred Gylys-Colwell
4b83f96adf Pack structure OEMCrypto_PST_Report
This change is copied from the widevine CL:
https://widevine-internal-review.googlesource.com/#/c/10163/

Because the OEMCrypto_PST_Report is sent as a signed block to the
server, it needs to be a fixed, platform independent, size.  This CL
adds the packed attribute to the structure, which reduces its size
from 56 bytes to 47 bytes.

Change-Id: I2bae058b7eb0ac54ba9fad355f3d85ddc2cd4a58
2014-05-16 13:16:51 -07:00
Fred Gylys-Colwell
1cd8195d88 OEMCrypto Usage Tables
This CL adds usage tables to the OEMCrypto reference implementation
(mock) and unit tests.

There is also a new parameter called oem_crypto_require_usage_tables
that determines if the usage tables are required or not.  This is set
to true for Android and false for all other platforms.

This CL is most of OEMCrypto version 9 updates.

This CL is a copy of
https://widevine-internal-review.googlesource.com/#/c/9720
https://widevine-internal-review.googlesource.com/#/c/9874
https://widevine-internal-review.googlesource.com/#/c/9873

Change-Id: I78c4f7651306f9f79ba2260c3e04fb1eca7e20e3
2014-04-24 11:40:30 -07:00
Fred Gylys-Colwell
026a04701e Test Key Control Block with HDCP Version
This is a copy of the Widevine CL:
https://widevine-internal-review.googlesource.com/#/c/9480/

This change is part of OEMCrypto API version 9.

This CL adds verification that a key control block which requires a
specific version of HDCP can be loaded.  Also, if secure data path is
not set, it verifies that data is still decrypted.

This CL also adds test that verify DecryptCTR fails when the current
HDCP version is below that in the key control block.  The expected
error is OEMCrypto_ERROR_INSUFFICIENT_HDCP.  This error code is newly
introduced in this CL.

This is one attempt to clarify HDCP, as specified in b/13626021, and
is a slight modification from previous behavior for the mock and the
level 3 haystacked code.

This CL also tests the two valid verification codes "kctl"
and "kc09".

bug: 13626021
Change-Id: If380709d2306a3489470b29fb148a45b609b089d
2014-04-10 16:22:25 -07:00
Fred Gylys-Colwell
dd75655102 Changes from Widevine CDM repo
Squashed commit of these CLs from the widevine cdm repo:

Update YT CP server URI to point to the UAT server
https://widevine-internal-review.googlesource.com/#/c/9327/

OEMCrypto Version 9 API
https://widevine-internal-review.googlesource.com/#/c/9142/

Correct Device ID length in OEMCrypto reference version
https://widevine-internal-review.googlesource.com/#/c/8723/

Modify tests to prevent intermittent failures
https://widevine-internal-review.googlesource.com/#/c/8982/

Generate a unique license request ID
https://widevine-internal-review.googlesource.com/#/c/8721/

Re-enable android timer mechanisms
https://widevine-internal-review.googlesource.com/#/c/8833/

Do not close CDM session on removeKeys
https://widevine-internal-review.googlesource.com/#/c/8703/

And numerous changes required by Eureka, Steel, and CTE versions of
Widevine CDM, as highlighted here:
https://widevine-internal-review.googlesource.com/#/c/8596/
https://widevine-internal-review.googlesource.com/#/c/8955/
https://widevine-internal-review.googlesource.com/#/c/8922/
https://widevine-internal-review.googlesource.com/#/c/8890/
https://widevine-internal-review.googlesource.com/#/c/8871/
https://widevine-internal-review.googlesource.com/#/c/8706/
https://widevine-internal-review.googlesource.com/#/c/8425/

Change-Id: Iafd33905227e74eb2132c240b929d2282ab68042
2014-03-17 20:29:51 +00:00
Jeff Tinker
b2af1e6303 OEMCrypto Version 9 API (KLP Modular Version)
This CL changes the header file and documentation for OEMCrypto
version 9.

It is a cherry pick of Change-Id: I1a43a686ef5d345132affc672bc1c6acf7b3f661

I modified the reference implementation and the calling functions just
enough that existing unit tests still pass.  Acutal implementation of this
API will be in future CLs.

Comments on the documentation can be made in the Google Doc here:
    https://docs.google.com/a/google.com/document/d/1pHSJ2IKL0axmQz2gmDZ7olxPWb_ZcULaJrYwDZAeS7k/edit?usp=sharing

Merge of https://widevine-internal-review.googlesource.com/#/c/9170/
from the widevine cdm repo.

Change-Id: I0197b1dfadedd6cc85710c7408e739cedeb45dce
2014-03-10 11:08:41 -07:00
Jeff Tinker
adfd599175 Remove external links from PDF documents.
A bug (b/8132682) in "Download as PDF" from Google Docs makes table of
contents links point back to the original document.  This causes
problems with external customers.

This change uses the following work around: print the document, and
select "Save as PDF" as the printer.

This only removes the links.  It does not fix them.  When bug 8132682
is fixed we can re-download the documents with proper links.

bug: 12585419

Merge of https://widevine-internal-review.googlesource.com/#/c/8775/
from the widevine cdm repo.

Change-Id: I5344b85bee213aba3a99913a4bb7be824fdd7acf
2014-03-10 10:25:35 -07:00
John "Juce" Bruce
e3ed6194fe Report Insufficient Resources for Crypto
This merges the following changes from the Widevine CDM repository:

bef58bc  Add new error codes
  Adds new error codes to OEMCryptoCENC.h and rearranges it to more
  closely match the documentation.

5fcfbca  Handle OEMCrypto_ERROR_INSUFFICIENT_RESOURCES on Decrypt
  Changes the CDM to support the new errors from the previous change.

d59c09d  Report Insufficient Crypto Resources
  Changes the DrmEngine to support the new errors from the previous
  change.

1085a21  Respond to Too Many Keys or Sessions Errors
  Allows errors around having too many keys or sessions to result in
  a unique error in the CDM.

Bug: 9695816
Change-Id: I826bc655109fa57e4f75de7158d7f392053666b1
2013-08-08 14:55:11 -07:00
Fred Gylys-Colwell
9fdeabe3ed Update Widevine Modular DRM Integration Guide
The function OEMCrypto_LoadKeys should accept a null pointer for the
enc_mac_keys pointer.   This indicates that the mac_keys are not being
updated. This CL just updates the documentation to clarify this behavior.

bug: 9549308
Change-Id: I1073e72f9c8d0fa712ad02e4c2d517202b3defab
2013-06-24 17:23:30 -07:00
Jeff Tinker
898d870126 Merge "Disable OEMCrypto tests that install a test keybox." into jb-mr2-dev 2013-05-14 05:36:29 +00:00
Jeff Tinker
5d7ac644c5 Disable OEMCrypto tests that install a test keybox.
Because we do not want to accidentally install a test keybox on a
production device, most of the oemcrypto unit tests are being disabled
by default.

If you wish to run these tests, you can override this choice, by
running:
adb shell /system/bin/oemcrypto_test --gtest_also_run_disabled_tests

This change prompts for and requires positive confirmation before
running the disabled tests on a device that has a non-test keybox
already installed.

Bug: 8907626

Merge of https://widevine-internal-review.googlesource.com/#/c/5531/
from the Widevine CDM repository

Change-Id: Ib8e3605129ebf0861b4af15d04676f7a06cc5b78
2013-05-13 14:56:01 -07:00
Jeff Tinker
3342e33143 Resize signature buffer
There is an ambiguity in the use of the signature length in
OEMCrypto_GenerateRSASignature.  If the pointer to the vector is null,
the function should set the length parameter to be the size of the
buffer needed.

This ambiguity has been clarified in the documentation: the
length returned should be the exact length of the buffer.  It
will be corrected in a future release of Qualcomm's L1.  However,
we are putting this change in both as a stop-gap and as a
belt-and-suspenders fix.

Bug: 8878371

Merge of https://widevine-internal-review.googlesource.com/#/c/5494/
from the Widevine CDM repository

Change-Id: I7574874884ca10da68d15674c971a565d015767d
2013-05-13 14:13:00 -07:00
Jeff Tinker
d291efc823 Update Integration Documentation
This CL updates to the latetest Widevine Integration document.

bug: 8698129

Merge of https://widevine-internal-review.googlesource.com/#/c/5330/
from the Widevine CDM repo.

Change-Id: I3f0ce88915057285ce6de80582d75a0514b92f79
2013-04-25 17:25:12 -07:00
Jeff Tinker
d1e2925cf0 Add Widevine Security Integration Guide to tree
Having the integration docs in the tree helps with version
management and distribution to partners.

bug: 8698129
Change-Id: I4c1e4f5902457815eaf58e6bd5313951d2b773ca
2013-04-25 13:54:27 -07:00