<pre style='margin:0'>
Ken (kencu) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/3ea6bea96320a3d01c77762f50bb2f314304a9fa">https://github.com/macports/macports-ports/commit/3ea6bea96320a3d01c77762f50bb2f314304a9fa</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 3ea6bea9632 libaacs: update to 0.11.0
</span>3ea6bea9632 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 3ea6bea96320a3d01c77762f50bb2f314304a9fa
</span>Author: i0ntempest <szf1234@me.com>
AuthorDate: Thu Jul 23 05:31:56 2020 -0400
<span style='display:block; white-space:pre;color:#404040;'> libaacs: update to 0.11.0
</span>---
multimedia/libaacs/Portfile | 14 +-
multimedia/libaacs/files/Makefile.in.diff | 12 -
multimedia/libaacs/files/patch-error-check.diff | 425 ------------------------
3 files changed, 5 insertions(+), 446 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/libaacs/Portfile b/multimedia/libaacs/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 5e276be7817..393668f85d1 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/multimedia/libaacs/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/multimedia/libaacs/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -3,7 +3,7 @@
</span> PortSystem 1.0
name libaacs
<span style='display:block; white-space:pre;background:#ffe0e0;'>-version 0.10.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 0.11.0
</span> revision 0
categories multimedia
license LGPL-2.1
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -14,7 +14,7 @@ description AACS support library for Blu-ray playback
</span> long_description Implementation of the Advanced Access Content System Specification
homepage https://www.videolan.org/developers/libaacs.html
<span style='display:block; white-space:pre;background:#ffe0e0;'>-master_sites https://get.videolan.org/libaacs/${version}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+master_sites https://download.videolan.org/pub/videolan/libaacs/${version}
</span>
use_bzip2 yes
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -27,13 +27,9 @@ depends_lib port:libgcrypt \
</span> port:libgpg-error \
port:libiconv
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums rmd160 a90aef4304b0182b8394b7b911879ced7d4cf846 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sha256 93f6b19ef71e6f73e77bd7535946c09c45330e9b42e832a63a1d6b042f6b12fe \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size 319890
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://trac.macports.org/ticket/60782
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Patch from upstream to fix segfault (https://code.videolan.org/videolan/libaacs/-/issues/6)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles Makefile.in.diff patch-error-check.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums rmd160 937e27ed120f87fd960bd9095b06ccd96684c306 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sha256 6d884381fbb659e2a565eba91e72499778635975e4b3d6fd94ab364a25965387 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size 324061
</span>
configure.perl ${prefix}/bin/perl5
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/libaacs/files/Makefile.in.diff b/multimedia/libaacs/files/Makefile.in.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index d115bda30ea..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/multimedia/libaacs/files/Makefile.in.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,12 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- Makefile.in.orig 2017-05-04 17:29:17.000000000 +1000
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ Makefile.in 2020-07-05 18:49:48.000000000 +1000
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -483,7 +508,8 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ACLOCAL_AMFLAGS = -I m4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- EXTRA_DIST = bootstrap COPYING KEYDB.cfg README.txt ChangeLog
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SET_INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src/libaacs
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+AM_CFLAGS = -std=c99 $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+AM_CPPFLAGS = $(SET_FEATURES) $(SET_INCLUDES)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AM_YFLAGS = -d -p libaacs_yy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lib_LTLIBRARIES = libaacs.la
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- libaacs_la_SOURCES = src/libaacs/aacs.h src/libaacs/aacs.c \
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/multimedia/libaacs/files/patch-error-check.diff b/multimedia/libaacs/files/patch-error-check.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 384df216ca5..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/multimedia/libaacs/files/patch-error-check.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,425 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git Makefile.am Makefile.am
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 1531246..67f0a26 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- Makefile.am
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ Makefile.am
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -5,7 +5,8 @@ EXTRA_DIST=bootstrap COPYING KEYDB.cfg README.txt ChangeLog
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SET_FEATURES = @SET_FEATURES@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- SET_INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src/libaacs
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+AM_CFLAGS = -std=c99 $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+AM_CPPFLAGS = $(SET_FEATURES) $(SET_INCLUDES)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AM_YFLAGS = -d -p libaacs_yy
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lib_LTLIBRARIES = libaacs.la
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -96,7 +97,7 @@ noinst_PROGRAMS = parser_test
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bin_PROGRAMS = aacs_info
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- parser_test_SOURCES = \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- src/examples/parser_test.c \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ src/devtools/parser_test.c \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- src/file/keydbcfg-parser.y \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- src/file/keydbcfg-lexer.l \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- src/util/strutl.c \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/examples/parser_test.c src/devtools/parser_test.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-similarity index 100%
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-rename from src/examples/parser_test.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-rename to src/devtools/parser_test.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/file/mmc_device_darwin.c src/file/mmc_device_darwin.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 7a3372a..afb0389 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/file/mmc_device_darwin.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/file/mmc_device_darwin.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -371,13 +371,13 @@ static DADissenterRef iokit_mount_approval_cb(DADiskRef disk, void *context)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int iokit_da_init(MMCDEV *mmc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mmc->session = DASessionCreate(kCFAllocatorDefault);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (NULL == mmc->session) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- BD_DEBUG(DBG_MMC, "Could not create a disc arbitration session\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_MMC | DBG_CRIT, "Could not create a disc arbitration session\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mmc->disk = DADiskCreateFromBSDName(kCFAllocatorDefault, mmc->session, mmc->bsd_name);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (NULL == mmc->disk) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- BD_DEBUG(DBG_MMC, "Could not create a disc arbitration disc for the device\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_MMC | DBG_CRIT, "Could not create a disc arbitration disc for the device\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CFRelease(mmc->session);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mmc->session = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -429,14 +429,14 @@ static int mmc_open_iokit(const char *path, MMCDEV *mmc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* get the bsd name associated with this mount */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rc = get_mounted_device_from_path(mmc, path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (0 != rc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- BD_DEBUG(DBG_MMC, "Could not locate mounted device associated with %s\n", path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_MMC | DBG_CRIT, "Could not locate mounted device associated with %s\n", path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return rc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* find a matching io service (IOBDServices) */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rc = iokit_find_service_matching(mmc, &service);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (0 != rc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- BD_DEBUG(DBG_MMC, "Could not find matching IOBDServices mounted @ %s\n", path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_MMC | DBG_CRIT, "Could not find matching IOBDServices mounted @ %s\n", path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return rc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -446,6 +446,10 @@ static int mmc_open_iokit(const char *path, MMCDEV *mmc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* done with the ioservice. release it */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- (void) IOObjectRelease(service);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (0 != rc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return rc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Init DiskArbitration */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rc = iokit_da_init(mmc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (0 != rc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -463,7 +467,7 @@ static int mmc_open_iokit(const char *path, MMCDEV *mmc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* finally, obtain exclusive access */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rc = (*mmc->taskInterface)->ObtainExclusiveAccess(mmc->taskInterface);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (kIOReturnSuccess != rc) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- BD_DEBUG(DBG_MMC, "Failed to obtain exclusive access. rc = %x\n", rc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_MMC | DBG_CRIT, "Failed to obtain exclusive access. rc = %x\n", rc);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -533,6 +537,12 @@ void device_close(MMCDEV **pp)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- IODestroyPlugInInterface(mmc->plugInInterface);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!mmc->sync_sem) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* open failed before iokit_da_init() */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ X_FREE(*pp);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* Wait for disc to re-appear for 20 seconds.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * This timeout was figured out by experimentation with
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- * a USB BD drive which sometimes can take really long to
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/libaacs/aacs.c src/libaacs/aacs.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 10c8553..ab7671c 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/libaacs/aacs.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/libaacs/aacs.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -81,6 +81,7 @@ struct aacs {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int bee; /* bus encryption enabled flag in content certificate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int bec; /* bus encryption capable flag in drive certificate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint8_t read_data_key[16];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uint8_t drive_cert_hash[20];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* content certificate */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- CONTENT_CERT *cc;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -561,6 +562,12 @@ static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl, dk_list *dkl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return AACS_SUCCESS;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* get cached mk */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!aacs->no_cache && keycache_find("mk", aacs->disc_id, mk, 16)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_AACS, "Using cached MK\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return AACS_SUCCESS;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_AACS, "Calculate media key...\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mkb = _mkb_open(aacs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -585,6 +592,12 @@ static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl, dk_list *dkl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (result == AACS_SUCCESS) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- memcpy(aacs->mk, mk, sizeof(aacs->mk));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* cache mk */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!aacs->no_cache) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (memcmp(aacs->disc_id, empty_key, sizeof(aacs->disc_id))) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ keycache_save("mk", aacs->disc_id, mk, 16);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mkb_close(mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -668,10 +681,33 @@ static int _read_vid(AACS *aacs, cert_list *hcl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- static int _read_read_data_key(AACS *aacs, cert_list *hcl)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- int error_code = _mmc_read_auth(aacs, hcl, MMC_READ_DATA_KEYS, aacs->read_data_key, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int error_code;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char *cache_path = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ char str[41];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ cache_path = str_printf("rdk" DIR_SEP "%s", str_print_hex(str, aacs->drive_cert_hash, 20));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error_code =_mmc_read_auth(aacs, hcl, MMC_READ_DATA_KEYS, aacs->read_data_key, NULL);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (error_code == AACS_SUCCESS) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* cache read data key */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!aacs->no_cache) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ keycache_save(cache_path, aacs->disc_id, aacs->read_data_key, 16);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* get cached read data key */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!aacs->no_cache && keycache_find(cache_path, aacs->disc_id, aacs->read_data_key, 16)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_AACS, "Using cached READ DATA KEY\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ error_code = AACS_SUCCESS;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ X_FREE(cache_path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (error_code != AACS_SUCCESS) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_AACS, "Error reading data keys!\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return error_code;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -764,6 +800,7 @@ static void _find_config_entry(AACS *aacs, title_entry_list *ce,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (ce->entry.mek) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- hexstring_to_hex_array(mk, 16, ce->entry.mek);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memcpy(aacs->mk, mk, 16);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_AACS, "Found media key for %s: %s\n",
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- str_print_hex(str2, ce->entry.discid, 20), str_print_hex(str, mk, 16));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -957,10 +994,11 @@ static int _calc_title_hash(AACS *aacs)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size_t size;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- char str[48];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int result = AACS_SUCCESS;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ int aacs2 = aacs->cc ? aacs->cc->aacs2 : 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size = _read_file(aacs, "AACS" DIR_SEP "Unit_Key_RO.inf", &data);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (size > 2048) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- aacs->uk = uk_parse(data, size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ aacs->uk = uk_parse(data, size, aacs2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* failed, try backup */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -968,7 +1006,7 @@ static int _calc_title_hash(AACS *aacs)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- X_FREE(data);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size = _read_file(aacs, "AACS" DIR_SEP "DUPLICATE" DIR_SEP "Unit_Key_RO.inf", &data);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (size > 2048) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- aacs->uk = uk_parse(data, size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ aacs->uk = uk_parse(data, size, aacs2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1022,7 +1060,7 @@ static int _get_bus_encryption_enabled(AACS *aacs)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static int _get_bus_encryption_capable(const char *path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int _get_bus_encryption_capable(AACS *aacs, const char *path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- MMC* mmc = NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint8_t drive_cert[92];
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1033,9 +1071,11 @@ static int _get_bus_encryption_capable(const char *path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (mmc_read_drive_cert(mmc, drive_cert) == MMC_SUCCESS) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ crypto_aacs_title_hash(drive_cert, 92, aacs->drive_cert_hash);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- bec = drive_cert[1] & 1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_AACS, "Bus Encryption Capable flag in drive certificate: %d\n", bec);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ memset(aacs->drive_cert_hash, 0, sizeof(aacs->drive_cert_hash));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_AACS | DBG_CRIT, "Unable to read drive certificate\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1206,6 +1246,8 @@ int aacs_open_device(AACS *aacs, const char *path, const char *configfile_path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- aacs->path = path ? str_dup(path) : NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ aacs->cc = _read_cc_any(aacs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- error_code = _calc_title_hash(aacs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (error_code != AACS_SUCCESS) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return error_code;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -1219,10 +1261,8 @@ int aacs_open_device(AACS *aacs, const char *path, const char *configfile_path)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_AACS, "Failed to initialize AACS!\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- aacs->cc = _read_cc_any(aacs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- aacs->bee = _get_bus_encryption_enabled(aacs);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- aacs->bec = _get_bus_encryption_capable(path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ aacs->bec = _get_bus_encryption_capable(aacs, path);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (error_code == AACS_SUCCESS && aacs->bee && aacs->bec) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/libaacs/mkb.c src/libaacs/mkb.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 2342497..9bf0730 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/libaacs/mkb.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/libaacs/mkb.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -77,6 +77,7 @@ MKB *mkb_init(uint8_t *data, size_t len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mkb->buf = data;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_MKB, "MKB size: %u\n", (unsigned)mkb->size);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_MKB, "MKB type: 0x%x\n", mkb_type(mkb));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_MKB, "MKB version: %d\n", mkb_version(mkb));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return mkb;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -110,7 +111,7 @@ size_t mkb_data_size(MKB *mkb)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--uint8_t mkb_type(MKB *mkb)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+uint32_t mkb_type(MKB *mkb)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const uint8_t *rec = mkb_type_and_version_record(mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -207,12 +208,29 @@ const uint8_t *mkb_cvalues(MKB *mkb, size_t *len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- const uint8_t *mkb_mk_dv(MKB *mkb)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const uint8_t *rec;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uint8_t dv_record;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- size_t len;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- const uint8_t *rec = _record(mkb, 0x81, &len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ switch (mkb_type(mkb)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case MKB_20_CATEGORY_C:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case MKB_21_CATEGORY_C:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ dv_record = 0x86;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case MKB_TYPE_3:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case MKB_TYPE_4:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ case MKB_TYPE_10_CLASS_II:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ default:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ dv_record = 0x81;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ break;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ rec = _record(mkb, dv_record, &len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (len < 20) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if (rec) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- rec += 4;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/libaacs/mkb.h src/libaacs/mkb.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 6691211..f817470 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/libaacs/mkb.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/libaacs/mkb.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -29,6 +29,12 @@ typedef struct mkb MKB;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- struct aacs_file_s;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MKB_TYPE_3 0x00031003
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MKB_TYPE_4 0x00041003
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MKB_TYPE_10_CLASS_II 0x000A1003
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MKB_20_CATEGORY_C 0x48141003
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+#define MKB_21_CATEGORY_C 0x48151003
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_PRIVATE MKB *mkb_init(uint8_t *data, size_t len); // init MKB from data
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_PRIVATE void mkb_close(MKB *mkb); // free MKB
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -36,7 +42,7 @@ BD_PRIVATE const uint8_t *mkb_data(MKB *mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_PRIVATE size_t mkb_data_size(MKB *mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // returns type
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--BD_PRIVATE uint8_t mkb_type(MKB *mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+BD_PRIVATE uint32_t mkb_type(MKB *mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // returns version
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_PRIVATE uint32_t mkb_version(MKB *mkb);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- // returns type and version record (required to verify signatures)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/libaacs/unit_key.c src/libaacs/unit_key.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index dc4382f..afb412c 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/libaacs/unit_key.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/libaacs/unit_key.c
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -143,8 +143,9 @@ static int _assign_titles(AACS_UK *uk, const uint8_t *p, size_t size)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static int _parse_uks(AACS_UK *uk, const uint8_t *p, size_t size)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int _parse_uks(AACS_UK *uk, const uint8_t *p, size_t size, int aacs2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ const uint8_t empty_key[16] = {0};
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint32_t uk_pos;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- unsigned int i;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -173,6 +174,17 @@ static int _parse_uks(AACS_UK *uk, const uint8_t *p, size_t size)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (aacs2 && uk->num_uk > 1) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* do some sanity checks ... */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!memcmp(empty_key, p + 48 + 48 + 16, 16)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_UK | DBG_CRIT, "AACS2 unit key not found from expected location ?\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ aacs2 = 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ } else if (size < uk_pos + 64 * uk->num_uk + 16) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_UK | DBG_CRIT, "Unexpected EOF (AACS2 unit key data truncated)\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* alloc storage for keys */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uk->enc_uk = calloc(uk->num_uk, sizeof(AACS_UK));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -181,19 +193,29 @@ static int _parse_uks(AACS_UK *uk, const uint8_t *p, size_t size)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- BD_DEBUG(DBG_UK, "%d CPS unit keys\n", uk->num_uk);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_UK, "%d CPS unit keys (AACS%d)\n", uk->num_uk, aacs2 ? 2 : 1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* get encrypted keys */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- for (i = 0; i < uk->num_uk; i++) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uk_pos += 48;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- memcpy(uk->enc_uk[i].key, p + uk_pos, 16);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (!memcmp(empty_key, uk->enc_uk[i].key, 16)) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ BD_DEBUG(DBG_UK | DBG_CRIT, "WARNING: Unit key %d is empty!\n", i+1);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* XXX there seems to be nothing in this file that could be used to detect this ... */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (aacs2) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ /* skip unknown */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ uk_pos += 16;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return 0;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--static int _parse(AACS_UK *uk, const uint8_t *data, size_t len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+static int _parse(AACS_UK *uk, const uint8_t *data, size_t len, int aacs2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- int result;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -201,7 +223,7 @@ static int _parse(AACS_UK *uk, const uint8_t *data, size_t len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -1;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- result = _parse_uks(uk, data, len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ result = _parse_uks(uk, data, len, aacs2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- /* not fatal, just speeds up things ... */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- _assign_titles(uk, data, len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -209,7 +231,7 @@ static int _parse(AACS_UK *uk, const uint8_t *data, size_t len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return result;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--AACS_UK *uk_parse(const void *data, size_t len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+AACS_UK *uk_parse(const void *data, size_t len, int aacs2)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- AACS_UK *uk = calloc(1, sizeof(*uk));
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -217,7 +239,7 @@ AACS_UK *uk_parse(const void *data, size_t len)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return NULL;
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-- if (_parse(uk, data, len) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+ if (_parse(uk, data, len, aacs2) < 0) {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_DEBUG(DBG_UK | DBG_CRIT, "Corrupt unit key file (AACS/Unit_Key_RO.inf)\n");
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- X_FREE(uk);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-diff --git src/libaacs/unit_key.h src/libaacs/unit_key.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-index 7797e2e..b722837 100644
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- src/libaacs/unit_key.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ src/libaacs/unit_key.h
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -50,7 +50,7 @@ struct aacs_uk {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- uint16_t *title_cps_unit; /* map title to CPS unit (key index) */
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- };
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--BD_PRIVATE AACS_UK *uk_parse(const void *data, size_t len);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+BD_PRIVATE AACS_UK *uk_parse(const void *data, size_t len, int aacs2);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- BD_PRIVATE void uk_free(AACS_UK **);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #endif /* AACS_UK_H_ */
</span></pre><pre style='margin:0'>
</pre>