Projects
Essentials
libaacs
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
libaacs.changes
Changed
@@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Tue May 16 11:29:17 UTC 2017 - joerg.lorenzen@ki.tng.de + +- update to 0.9.0 + * Add aacs_decrypt_bus(). + * Add aacs_get_bdj_root_cert_hash(). + * Add aacs_get_content_cert_id(). + * Add support for unencrypted content in AACS-enabled discs. + * Improve error resilience. + * Improve support for broken discs (use on-disc backup files). + * Verify content certificate signature. + * Load and merge multiple KEYDB.cfg files. + * Fix build with gcrypt < 1.6.0. + * Fix possible crash (debug log output that includes discid). + * Fix config file path issues in Windows (non-ASCII paths). + * Fix dll exports in Windows. + * Fix resource leaks. + * Reduced memory footprint. + +------------------------------------------------------------------- Wed Feb 22 13:51:59 UTC 2017 - scarabeus@opensuse.org - Cleanup a bit with spec-cleaner
View file
libaacs.spec
Changed
@@ -19,14 +19,13 @@ %define libname %{name}0 Name: libaacs -Version: 0.8.1 +Version: 0.9.0 Release: 0 Summary: Open implentation of AACS specification License: LGPL-2.1+ Group: System/Libraries Url: http://www.videolan.org/developers/libaacs.html Source: ftp://ftp.videolan.org/pub/videolan/libaacs/%{version}/libaacs-%{version}.tar.bz2 -Patch1: libaacs-pthread.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bison @@ -59,7 +58,6 @@ %prep %setup -q -%patch1 %build autoreconf -fvi
View file
libaacs-pthread.patch
Deleted
@@ -1,10 +0,0 @@ ---- src/libaacs/crypto.c.orig 2015-03-16 12:59:58.682853468 +0100 -+++ src/libaacs/crypto.c 2015-03-16 12:59:58.707852962 +0100 -@@ -38,6 +38,7 @@ - #ifdef HAVE_PTHREAD_H - #if GCRYPT_VERSION_NUMBER < 0x010600 - #include <pthread.h> -+#include <errno.h> - #endif - #endif -
View file
libaacs-0.8.1.tar.bz2/ChangeLog -> libaacs-0.9.0.tar.bz2/ChangeLog
Changed
@@ -1,3 +1,19 @@ +2017-05-04: Version 0.9.0 +- Add aacs_decrypt_bus(). +- Add aacs_get_bdj_root_cert_hash(). +- Add aacs_get_content_cert_id(). +- Add support for unencrypted content in AACS-enabled discs. +- Improve error resilience. +- Improve support for broken discs (use on-disc backup files). +- Verify content certificate signature. +- Load and merge multiple KEYDB.cfg files. +- Fix build with gcrypt < 1.6.0. +- Fix possible crash (debug log output that includes discid) +- Fix config file path issues in Windows (non-ASCII paths) +- Fix dll exports in Windows. +- Fix resource leaks. +- Reduced memory footprint. + 2015-03-13: Version 0.8.1 - Accept NULL mount / device path when application handles file system access. - Fix FreeBSD build.
View file
libaacs-0.8.1.tar.bz2/Makefile.am -> libaacs-0.9.0.tar.bz2/Makefile.am
Changed
@@ -11,17 +11,25 @@ lib_LTLIBRARIES = libaacs.la libaacs_la_SOURCES=\ src/libaacs/aacs.h \ - src/libaacs/mmc.h \ - src/libaacs/mkb.h \ src/libaacs/aacs.c \ - src/libaacs/mmc.c \ - src/libaacs/crypto.c \ + src/libaacs/cci_data.h \ + src/libaacs/cci.h \ + src/libaacs/cci.c \ + src/libaacs/content_cert.h \ + src/libaacs/content_cert.c \ src/libaacs/crypto.h \ + src/libaacs/crypto.c \ + src/libaacs/mkb.h \ src/libaacs/mkb.c \ + src/libaacs/mmc.h \ + src/libaacs/mmc.c \ + src/libaacs/unit_key.h \ + src/libaacs/unit_key.c \ src/file/dirs.h \ src/file/file.h \ + src/file/file.c \ src/file/filesystem.h \ - src/file/file_posix.c \ + src/file/filesystem.c \ src/file/keydbcfg.c \ src/file/keydbcfg.h \ src/file/keydb.h \ @@ -42,15 +50,18 @@ if HAVE_DARWIN libaacs_la_SOURCES+= \ src/file/dirs_darwin.c \ + src/file/file_posix.c \ src/file/mmc_device_darwin.c else if HAVE_WIN32 libaacs_la_SOURCES+= \ src/file/dirs_win32.c \ + src/file/file_win32.c \ src/file/mmc_device_win32.c else libaacs_la_SOURCES+= \ src/file/dirs_xdg.c \ + src/file/file_posix.c \ src/file/mmc_device_linux.c \ src/file/path.c endif
View file
libaacs-0.8.1.tar.bz2/Makefile.in -> libaacs-0.9.0.tar.bz2/Makefile.in
Changed
@@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,17 @@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -84,36 +94,23 @@ target_triplet = @target@ @HAVE_DARWIN_TRUE@am__append_1 = \ @HAVE_DARWIN_TRUE@ src/file/dirs_darwin.c \ +@HAVE_DARWIN_TRUE@ src/file/file_posix.c \ @HAVE_DARWIN_TRUE@ src/file/mmc_device_darwin.c @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__append_2 = \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dirs_win32.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/file_win32.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/mmc_device_win32.c @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__append_3 = \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dirs_xdg.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/file_posix.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/mmc_device_linux.c \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/path.c noinst_PROGRAMS = parser_test$(EXEEXT) bin_PROGRAMS = aacs_info$(EXEEXT) subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(top_srcdir)/src/libaacs.pc.in \ - $(top_srcdir)/src/libaacs/aacs-version.h.in \ - src/file/keydbcfg-parser.h src/file/keydbcfg-parser.c \ - src/file/keydbcfg-lexer.c $(top_srcdir)/build-aux/depcomp \ - $(top_srcdir)/build-aux/ylwrap $(pkginclude_HEADERS) COPYING \ - ChangeLog build-aux/compile build-aux/config.guess \ - build-aux/config.sub build-aux/depcomp build-aux/install-sh \ - build-aux/missing build-aux/ylwrap build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/compile \ - $(top_srcdir)/build-aux/config.guess \ - $(top_srcdir)/build-aux/config.sub \ - $(top_srcdir)/build-aux/install-sh \ - $(top_srcdir)/build-aux/ltmain.sh \ - $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ $(top_srcdir)/m4/gpg-error.m4 $(top_srcdir)/m4/libgcrypt.m4 \ @@ -122,6 +119,8 @@ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(pkginclude_HEADERS) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -160,32 +159,40 @@ LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = libaacs_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am__libaacs_la_SOURCES_DIST = src/libaacs/aacs.h src/libaacs/mmc.h \ - src/libaacs/mkb.h src/libaacs/aacs.c src/libaacs/mmc.c \ - src/libaacs/crypto.c src/libaacs/crypto.h src/libaacs/mkb.c \ - src/file/dirs.h src/file/file.h src/file/filesystem.h \ - src/file/file_posix.c src/file/keydbcfg.c src/file/keydbcfg.h \ +am__libaacs_la_SOURCES_DIST = src/libaacs/aacs.h src/libaacs/aacs.c \ + src/libaacs/cci_data.h src/libaacs/cci.h src/libaacs/cci.c \ + src/libaacs/content_cert.h src/libaacs/content_cert.c \ + src/libaacs/crypto.h src/libaacs/crypto.c src/libaacs/mkb.h \ + src/libaacs/mkb.c src/libaacs/mmc.h src/libaacs/mmc.c \ + src/libaacs/unit_key.h src/libaacs/unit_key.c src/file/dirs.h \ + src/file/file.h src/file/file.c src/file/filesystem.h \ + src/file/filesystem.c src/file/keydbcfg.c src/file/keydbcfg.h \ src/file/keydb.h src/file/keydbcfg-parser.y \ src/file/keydbcfg-lexer.l src/file/mmc_device.h \ src/file/path.h src/util/attributes.h src/util/macro.h \ src/util/logging.c src/util/logging.h src/util/strutl.c \ - src/util/strutl.h src/file/dirs_darwin.c \ + src/util/strutl.h src/file/dirs_darwin.c src/file/file_posix.c \ src/file/mmc_device_darwin.c src/file/dirs_win32.c \ - src/file/mmc_device_win32.c src/file/dirs_xdg.c \ - src/file/mmc_device_linux.c src/file/path.c + src/file/file_win32.c src/file/mmc_device_win32.c \ + src/file/dirs_xdg.c src/file/mmc_device_linux.c \ + src/file/path.c am__dirstamp = $(am__leading_dot)dirstamp @HAVE_DARWIN_TRUE@am__objects_1 = src/file/dirs_darwin.lo \ +@HAVE_DARWIN_TRUE@ src/file/file_posix.lo \ @HAVE_DARWIN_TRUE@ src/file/mmc_device_darwin.lo @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/dirs_win32.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/file_win32.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ src/file/mmc_device_win32.lo @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/dirs_xdg.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/file_posix.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/mmc_device_linux.lo \ @HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ src/file/path.lo -am_libaacs_la_OBJECTS = src/libaacs/aacs.lo src/libaacs/mmc.lo \ - src/libaacs/crypto.lo src/libaacs/mkb.lo \ - src/file/file_posix.lo src/file/keydbcfg.lo \ +am_libaacs_la_OBJECTS = src/libaacs/aacs.lo src/libaacs/cci.lo \ + src/libaacs/content_cert.lo src/libaacs/crypto.lo \ + src/libaacs/mkb.lo src/libaacs/mmc.lo src/libaacs/unit_key.lo \ + src/file/file.lo src/file/filesystem.lo src/file/keydbcfg.lo \ src/file/keydbcfg-parser.lo src/file/keydbcfg-lexer.lo \ src/util/logging.lo src/util/strutl.lo $(am__objects_1) \ $(am__objects_2) $(am__objects_3) @@ -302,6 +309,20 @@ CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing $(top_srcdir)/build-aux/ylwrap \ + $(top_srcdir)/src/libaacs.pc.in \ + $(top_srcdir)/src/libaacs/aacs-version.h.in COPYING ChangeLog \ + build-aux/compile build-aux/config.guess build-aux/config.sub \ + build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \ + build-aux/missing build-aux/ylwrap src/file/keydbcfg-lexer.c \ + src/file/keydbcfg-parser.c src/file/keydbcfg-parser.h DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -373,6 +394,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_VERSION_INFO = @LT_VERSION_INFO@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ @@ -445,6 +467,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -463,11 +486,14 @@ AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) AM_YFLAGS = -d -p libaacs_yy lib_LTLIBRARIES = libaacs.la -libaacs_la_SOURCES = src/libaacs/aacs.h src/libaacs/mmc.h \ - src/libaacs/mkb.h src/libaacs/aacs.c src/libaacs/mmc.c \ - src/libaacs/crypto.c src/libaacs/crypto.h src/libaacs/mkb.c \ - src/file/dirs.h src/file/file.h src/file/filesystem.h \ - src/file/file_posix.c src/file/keydbcfg.c src/file/keydbcfg.h \ +libaacs_la_SOURCES = src/libaacs/aacs.h src/libaacs/aacs.c \ + src/libaacs/cci_data.h src/libaacs/cci.h src/libaacs/cci.c \ + src/libaacs/content_cert.h src/libaacs/content_cert.c \ + src/libaacs/crypto.h src/libaacs/crypto.c src/libaacs/mkb.h \ + src/libaacs/mkb.c src/libaacs/mmc.h src/libaacs/mmc.c \ + src/libaacs/unit_key.h src/libaacs/unit_key.c src/file/dirs.h \ + src/file/file.h src/file/file.c src/file/filesystem.h \ + src/file/filesystem.c src/file/keydbcfg.c src/file/keydbcfg.h \ src/file/keydb.h src/file/keydbcfg-parser.y \ src/file/keydbcfg-lexer.l src/file/mmc_device.h \ src/file/path.h src/util/attributes.h src/util/macro.h \ @@ -519,7 +545,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -600,19 +625,27 @@ @: > src/libaacs/$(DEPDIR)/$(am__dirstamp) src/libaacs/aacs.lo: src/libaacs/$(am__dirstamp) \ src/libaacs/$(DEPDIR)/$(am__dirstamp) -src/libaacs/mmc.lo: src/libaacs/$(am__dirstamp) \
View file
libaacs-0.8.1.tar.bz2/aclocal.m4 -> libaacs-0.9.0.tar.bz2/aclocal.m4
Changed
@@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.)) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN(AM_AUTOMAKE_VERSION, -am__api_version='1.14' +am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.14.1, , +m4_if($1, 1.15, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.14.1)dnl +AM_AUTOMAKE_VERSION(1.15)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +103,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN(AM_AUX_DIR_EXPAND, -dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ(2.50)dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +AC_REQUIRE(AC_CONFIG_AUX_DIR_DEFAULT)dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +141,7 @@ Usually this means the macro was only invoked conditionally.) fi)) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,7 +332,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -409,7 +408,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -499,8 +498,8 @@ # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> AC_SUBST(mkdir_p, '$(MKDIR_P)') -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE(AC_PROG_AWK)dnl AC_REQUIRE(AC_PROG_MAKE_SET)dnl AC_REQUIRE(AM_SET_LEADING_DOT)dnl @@ -574,6 +573,9 @@ AC_MSG_ERROR(Your 'rm' program is bad, sorry.) fi fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -603,7 +605,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME("$_am_arg")`/stamp-h$_am_stamp_count) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -614,7 +616,7 @@ # Define $install_sh. AC_DEFUN(AM_PROG_INSTALL_SH, AC_REQUIRE(AM_AUX_DIR_EXPAND)dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -624,7 +626,7 @@ fi AC_SUBST(install_sh)) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -643,7 +645,7 @@ rmdir .tst 2>/dev/null AC_SUBST(am__leading_dot)) -# Copyright (C) 1998-2013 Free Software Foundation, Inc. +# Copyright (C) 1998-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -664,7 +666,7 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -699,7 +701,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -749,7 +751,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -788,7 +790,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -817,7 +819,7 @@ AC_DEFUN(_AM_IF_OPTION, m4_ifset(_AM_MANGLE_OPTION($1), $2, $3)) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -864,7 +866,7 @@ # For backward compatibility. AC_DEFUN_ONCE(AM_PROG_CC_C_O, AC_REQUIRE(AC_PROG_CC))
View file
libaacs-0.8.1.tar.bz2/build-aux/compile -> libaacs-0.9.0.tar.bz2/build-aux/compile
Changed
@@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify
View file
libaacs-0.8.1.tar.bz2/build-aux/config.guess -> libaacs-0.9.0.tar.bz2/build-aux/config.guess
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2014-03-23' +timestamp='2016-04-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -24,12 +24,12 @@ # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # -# Originally written by Per Bothner. +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to <config-patches@gnu.org>. me=`echo "$0" | sed -e 's,.*/,,'` @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -168,20 +168,27 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || \ + echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv0-9\).*$,\1,'` + endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) + arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -197,6 +204,13 @@ os=netbsd ;; esac + # Determine ABI tags. + case "${UNAME_MACHINE_ARCH}" in + earm*) + expr='s/^earmv0-9/-eabi/;s/eb$//' + abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + ;; + esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need @@ -207,13 +221,13 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/-_.*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/-_.*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" + echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` @@ -223,6 +237,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -235,6 +253,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -251,42 +272,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^PVTX//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^PVTX//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -359,16 +380,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if "$CC_FOR_BUILD" != 'no_compiler_found' ; then + if "$CC_FOR_BUILD" != no_compiler_found ; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` @@ -393,7 +414,7 @@ exit ;;
View file
libaacs-0.8.1.tar.bz2/build-aux/config.sub -> libaacs-0.9.0.tar.bz2/build-aux/config.sub
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2014 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2014-09-11' +timestamp='2016-03-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ # of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches with a ChangeLog entry to config-patches@gnu.org. +# Please send patches to <config-patches@gnu.org>. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 OPTION CPU-MFR-OPSYS - $0 OPTION ALIAS +Usage: $0 OPTION CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2014 Free Software Foundation, Inc. +Copyright 1992-2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -117,7 +116,7 @@ case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -255,12 +254,13 @@ | arc | arceb \ | arm | armble | armelb | armv2-8 | armv3-8lb | armv7arm \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ + | e2k | epiphany \ + | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.01 | hppa2.0 | hppa2.0nw | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ @@ -305,7 +305,7 @@ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh1234 | sh24a | sh24aeb | sh23e | sh34eb | sheb | shbe | shle | sh1234le | sh3ele \ + | sh | sh1234 | sh24a | sh24aeb | sh23e | sh234eb | sheb | shbe | shle | sh1234le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -313,6 +313,7 @@ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -327,6 +328,9 @@ c6x) basic_machine=tic6x-unknown ;; + leon|leon3-9) + basic_machine=sparc-$basic_machine + ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none @@ -372,12 +376,13 @@ | alphapca567-* | alpha64pca567-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c123* | c30-* | cjt90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ + | e2k-* | elxsi-* \ | f3001-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.01-* | hppa2.0-* | hppa2.0nw-* | hppa64-* \ @@ -424,12 +429,13 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh1234-* | sh24a-* | sh24aeb-* | sh23e-* | sh34eb-* | sheb-* | shbe-* \ | shle-* | sh1234le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -437,6 +443,7 @@ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ + | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -513,6 +520,9 @@ basic_machine=i386-pc os=-aros ;; + asmjs) + basic_machine=asmjs-unknown + ;; aux) basic_machine=m68k-apple os=-aux @@ -774,6 +784,9 @@ basic_machine=m68k-isi os=-sysv ;; + leon-*|leon3-9-*) + basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + ;; m68knommu) basic_machine=m68k-unknown os=-linux @@ -1365,11 +1378,11 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ @@ -1385,7 +1398,8 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1517,6 +1531,8 @@ ;; -nacl*) ;; + -ios) + ;; -none) ;; *)
View file
libaacs-0.8.1.tar.bz2/build-aux/depcomp -> libaacs-0.9.0.tar.bz2/build-aux/depcomp
Changed
@@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by
View file
libaacs-0.8.1.tar.bz2/build-aux/install-sh -> libaacs-0.9.0.tar.bz2/build-aux/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2014-09-12.12; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 OPTION... -T SRCFILE DSTFILE @@ -137,46 +122,57 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *''*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *''*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | =\(\)!) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | =\(\)!) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ *0-7) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*^/\)//*^/^/*/*$' \| \ - X"$dst" : 'X\(//\)^/' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*^/\)\/\/*^/^/*\/*$/{ - s//\1/
View file
libaacs-0.8.1.tar.bz2/build-aux/ltmain.sh -> libaacs-0.9.0.tar.bz2/build-aux/ltmain.sh
Changed
@@ -1,9 +1,12 @@ +#! /bin/sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2014-01-03.01 -# libtool (GNU libtool) 2.4.2 +# libtool (GNU libtool) 2.4.6 +# Provide generalized library-building support services. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -23,881 +26,2112 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see <http://www.gnu.org/licenses/>. -# Usage: $progname OPTION... MODE-ARG... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.10ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to <bug-libtool@gnu.org>. -# GNU libtool home page: <http://www.gnu.org/software/libtool/>. -# General help using GNU software: <http://www.gnu.org/gethelp/>. PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.10ubuntu1" -TIMESTAMP="" -package_revision=1.3337 +VERSION="2.4.6 Debian-2.4.6-1" +package_revision=2.4.6 -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2015-01-20.17; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. + +# As a special exception to the GNU General Public License, if you distribute +# this file as part of a program or library that is built using GNU Libtool, +# you may include this file under the same distribution terms that you use +# for the rest of that program. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Please report bugs or propose patches to gary@gnu.org. + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|^/*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do - eval "if test \"\${$lt_var+set}\" = set; then
View file
libaacs-0.8.1.tar.bz2/build-aux/missing -> libaacs-0.9.0.tar.bz2/build-aux/missing
Changed
@@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify
View file
libaacs-0.8.1.tar.bz2/build-aux/ylwrap -> libaacs-0.9.0.tar.bz2/build-aux/ylwrap
Changed
@@ -3,7 +3,7 @@ scriptversion=2013-01-12.17; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # Written by Tom Tromey <tromey@cygnus.com>. #
View file
libaacs-0.8.1.tar.bz2/config.h.in -> libaacs-0.9.0.tar.bz2/config.h.in
Changed
@@ -97,8 +97,7 @@ /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ +/* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */
View file
libaacs-0.8.1.tar.bz2/configure -> libaacs-0.9.0.tar.bz2/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libaacs 0.8.1. +# Generated by GNU Autoconf 2.69 for libaacs 0.9.0. # # Report bugs to <http://www.videolan.org/developers/libaacs.html>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libaacs' PACKAGE_TARNAME='libaacs' -PACKAGE_VERSION='0.8.1' -PACKAGE_STRING='libaacs 0.8.1' +PACKAGE_VERSION='0.9.0' +PACKAGE_STRING='libaacs 0.9.0' PACKAGE_BUGREPORT='http://www.videolan.org/developers/libaacs.html' PACKAGE_URL='' @@ -655,6 +655,7 @@ LEX AS CPP +LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO @@ -758,6 +759,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -790,6 +792,7 @@ enable_static with_pic enable_fast_install +with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock @@ -806,6 +809,7 @@ LDFLAGS LIBS CPPFLAGS +LT_SYS_LIBRARY_PATH CPP YACC YFLAGS' @@ -847,6 +851,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1099,6 +1104,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1236,7 +1250,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1349,7 +1363,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libaacs 0.8.1 to adapt to many kinds of systems. +\`configure' configures libaacs 0.9.0 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1389,6 +1403,7 @@ --sysconfdir=DIR read-only single-machine data PREFIX/etc --sharedstatedir=DIR modifiable architecture-independent data PREFIX/com --localstatedir=DIR modifiable single-machine data PREFIX/var + --runstatedir=DIR modifiable per-process data LOCALSTATEDIR/run --libdir=DIR object code libraries EPREFIX/lib --includedir=DIR C header files PREFIX/include --oldincludedir=DIR C header files for non-gcc /usr/include @@ -1420,7 +1435,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libaacs 0.8.1:";; + short | recursive ) echo "Configuration of libaacs 0.9.0:";; esac cat <<\_ACEOF @@ -1454,9 +1469,12 @@ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic=PKGS try to use only PIC/non-PIC objects default=use both + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, default=aix. --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). + --with-sysroot=DIR Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). --with-libgcrypt-prefix=PFX prefix where LIBGCRYPT is installed (optional) --with-libgpg-error-prefix=PFX @@ -1471,6 +1489,8 @@ LIBS libraries to pass to the linker, e.g. -l<library> CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', @@ -1545,7 +1565,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libaacs configure 0.8.1 +libaacs configure 0.9.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2017,7 +2037,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libaacs $as_me 0.8.1, which was +It was created by libaacs $as_me 0.9.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2506,7 +2526,7 @@ NONENONEs,x,x, && program_prefix=${target_alias}- -am__api_version='1.14' +am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2678,8 +2698,8 @@ ac_script='s/\\$/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2698,7 +2718,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2992,7 +3012,7 @@ # Define the identity of the package. PACKAGE='libaacs' - VERSION='0.8.1' + VERSION='0.9.0' cat >>confdefs.h <<_ACEOF @@ -3026,8 +3046,8 @@ # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ...
View file
libaacs-0.8.1.tar.bz2/configure.ac -> libaacs-0.9.0.tar.bz2/configure.ac
Changed
@@ -1,7 +1,7 @@ dnl library version number m4_define(aacs_major, 0) -m4_define(aacs_minor, 8) -m4_define(aacs_micro, 1) +m4_define(aacs_minor, 9) +m4_define(aacs_micro, 0) m4_define(aacs_version,aacs_major.aacs_minor.aacs_micro) dnl shared library version (.so version) @@ -14,9 +14,9 @@ dnl dnl Library file name will be libaacs.(current-age).age.revision -m4_define(lt_current, 5) -m4_define(lt_age, 5) -m4_define(lt_revision, 1) +m4_define(lt_current, 6) +m4_define(lt_age, 6) +m4_define(lt_revision, 0) dnl initilization AC_INIT(libaacs, aacs_version, http://www.videolan.org/developers/libaacs.html)
View file
libaacs-0.8.1.tar.bz2/m4/libtool.m4 -> libaacs-0.9.0.tar.bz2/m4/libtool.m4
Changed
@@ -1,8 +1,6 @@ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives @@ -10,36 +8,30 @@ # modifications, as long as this notice is preserved. m4_define(_LT_COPYING, dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of of the License, or +# (at your option) any later version. # -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. # -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with this program. If not, see <http://www.gnu.org/licenses/>. ) -# serial 57 LT_INIT +# serial 58 LT_INIT # LT_PREREQ(VERSION) @@ -67,7 +59,7 @@ # LT_INIT(OPTIONS) # ------------------ AC_DEFUN(LT_INIT, -AC_PREREQ(2.58)dnl We use AC_INCLUDES_DEFAULT +AC_PREREQ(2.62)dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE(AC_CONFIG_AUX_DIR_DEFAULT)dnl AC_BEFORE($0, LT_LANG)dnl AC_BEFORE($0, LT_OUTPUT)dnl @@ -91,7 +83,7 @@ _LT_SET_OPTIONS($0, $1) # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" +LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -111,26 +103,43 @@ dnl AC_DEFUN(AM_PROG_LIBTOOL, ) +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun(_LT_PREPARE_CC_BASENAME, +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *\\/compile | ccache | *\\/ccache ) ;; + distcc | *\\/distcc | purify | *\\/purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +)# _LT_PREPARE_CC_BASENAME + + # _LT_CC_BASENAME(CC) # ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. m4_defun(_LT_CC_BASENAME, -for cc_temp in $1""; do - case $cc_temp in - compile | *\\/compile | ccache | *\\/ccache ) ;; - distcc | *\\/distcc | purify | *\\/purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +m4_require(_LT_PREPARE_CC_BASENAME)dnl +AC_REQUIRE(_LT_DECL_SED)dnl +AC_REQUIRE(_LT_PROG_ECHO_BACKSLASH)dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result ) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set -# sensibly after `m4_require(_LT_FILEUTILS_DEFAULTS)'. +# sensibly after 'm4_require(_LT_FILEUTILS_DEFAULTS)'. m4_defun(_LT_FILEUTILS_DEFAULTS, : ${CP="cp -f"} : ${MV="mv -f"} @@ -177,15 +186,16 @@ m4_require(_LT_CMD_OLD_ARCHIVE)dnl m4_require(_LT_CMD_GLOBAL_SYMBOLS)dnl m4_require(_LT_WITH_SYSROOT)dnl +m4_require(_LT_CMD_TRUNCATE)dnl _LT_CONFIG_LIBTOOL_INIT( -# See if we are running on zsh, and set the options which allow our +# See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then +if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ) -if test -n "${ZSH_VERSION+set}" ; then +if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi @@ -198,7 +208,7 @@ # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then + if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi @@ -209,14 +219,14 @@ ofile=libtool can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, +# All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a -with_gnu_ld="$lt_cv_prog_gnu_ld" +with_gnu_ld=$lt_cv_prog_gnu_ld -old_CC="$CC" -old_CFLAGS="$CFLAGS" +old_CC=$CC +old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc @@ -269,14 +279,14 @@ # _LT_PROG_LTMAIN # --------------- -# Note that this code is called both from `configure', and `config.status' +# Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun(_LT_PROG_LTMAIN, m4_ifdef(AC_REQUIRE_AUX_FILE, AC_REQUIRE_AUX_FILE(ltmain.sh))dnl _LT_CONFIG_LIBTOOL_INIT(ac_aux_dir='$ac_aux_dir') -ltmain="$ac_aux_dir/ltmain.sh" +ltmain=$ac_aux_dir/ltmain.sh )# _LT_PROG_LTMAIN
View file
libaacs-0.8.1.tar.bz2/m4/ltoptions.m4 -> libaacs-0.9.0.tar.bz2/m4/ltoptions.m4
Changed
@@ -1,14 +1,14 @@ # Helper functions for option handling. -*- Autoconf -*- # -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 7 ltoptions.m4 +# serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN(LTOPTIONS_VERSION, m4_if(1)) @@ -29,7 +29,7 @@ m4_define(_LT_MANGLE_OPTION($1, $2))dnl m4_ifdef(_LT_MANGLE_DEFUN($1, $2), _LT_MANGLE_DEFUN($1, $2), - m4_warning(Unknown $1 option `$2'))dnl + m4_warning(Unknown $1 option '$2'))dnl ) @@ -75,13 +75,15 @@ dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS(LT_INIT, shared disable-shared, _LT_ENABLE_SHARED) _LT_UNLESS_OPTIONS(LT_INIT, static disable-static, _LT_ENABLE_STATIC) _LT_UNLESS_OPTIONS(LT_INIT, pic-only no-pic, _LT_WITH_PIC) _LT_UNLESS_OPTIONS(LT_INIT, fast-install disable-fast-install, - _LT_ENABLE_FAST_INSTALL) + _LT_ENABLE_FAST_INSTALL) + _LT_UNLESS_OPTIONS(LT_INIT, aix-soname=aix aix-soname=both aix-soname=svr4, + _LT_WITH_AIX_SONAME(aix)) ) )# _LT_SET_OPTIONS @@ -112,7 +114,7 @@ _LT_SET_OPTION(LT_INIT, dlopen) AC_DIAGNOSE(obsolete, $0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.) +put the 'dlopen' option into LT_INIT's first parameter.) ) dnl aclocal-1.4 backwards compatibility: @@ -148,7 +150,7 @@ _LT_SET_OPTION(LT_INIT, win32-dll) AC_DIAGNOSE(obsolete, $0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.) +put the 'win32-dll' option into LT_INIT's first parameter.) ) dnl aclocal-1.4 backwards compatibility: @@ -157,9 +159,9 @@ # _LT_ENABLE_SHARED(DEFAULT) # ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define(_LT_ENABLE_SHARED, m4_define(_LT_ENABLE_SHARED_DEFAULT, m4_if($1, no, no, yes))dnl AC_ARG_ENABLE(shared, @@ -172,14 +174,14 @@ *) enable_shared=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac, enable_shared=_LT_ENABLE_SHARED_DEFAULT) @@ -211,9 +213,9 @@ # _LT_ENABLE_STATIC(DEFAULT) # ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define(_LT_ENABLE_STATIC, m4_define(_LT_ENABLE_STATIC_DEFAULT, m4_if($1, no, no, yes))dnl AC_ARG_ENABLE(static, @@ -226,14 +228,14 @@ *) enable_static=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac, enable_static=_LT_ENABLE_STATIC_DEFAULT) @@ -265,9 +267,9 @@ # _LT_ENABLE_FAST_INSTALL(DEFAULT) # ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define(_LT_ENABLE_FAST_INSTALL, m4_define(_LT_ENABLE_FAST_INSTALL_DEFAULT, m4_if($1, no, no, yes))dnl AC_ARG_ENABLE(fast-install, @@ -280,14 +282,14 @@ *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do - IFS="$lt_save_ifs" + IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done - IFS="$lt_save_ifs" + IFS=$lt_save_ifs ;; esac, enable_fast_install=_LT_ENABLE_FAST_INSTALL_DEFAULT) @@ -304,14 +306,14 @@ _LT_SET_OPTION(LT_INIT, m4_if($1, no, disable-)fast-install) AC_DIAGNOSE(obsolete, $0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.) +the 'fast-install' option into LT_INIT's first parameter.) ) AU_DEFUN(AC_DISABLE_FAST_INSTALL, _LT_SET_OPTION(LT_INIT, disable-fast-install) AC_DIAGNOSE(obsolete, $0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.) +the 'disable-fast-install' option into LT_INIT's first parameter.) ) dnl aclocal-1.4 backwards compatibility: @@ -319,11 +321,64 @@ dnl AC_DEFUN(AM_DISABLE_FAST_INSTALL, ) +# _LT_WITH_AIX_SONAME(DEFAULT) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define(_LT_WITH_AIX_SONAME, +m4_define(_LT_WITH_AIX_SONAME_DEFAULT, m4_if($1, svr4, svr4, m4_if($1, both, both, aix)))dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix5-9*,yes) + AC_MSG_CHECKING(which variant of shared library versioning to provide) + AC_ARG_WITH(aix-soname, + AS_HELP_STRING(--with-aix-soname=aix|svr4|both, + shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=_LT_WITH_AIX_SONAME_DEFAULT@:>@.), + case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR(Unknown argument to --with-aix-soname) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname, + AC_CACHE_VAL(lt_cv_with_aix_soname,
View file
libaacs-0.8.1.tar.bz2/m4/ltsugar.m4 -> libaacs-0.9.0.tar.bz2/m4/ltsugar.m4
Changed
@@ -1,6 +1,7 @@ # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software +# Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives @@ -33,7 +34,7 @@ # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. +# Autoconf-2.59, which quotes differently. m4_define(lt_car, $1) m4_define(lt_cdr, m4_if($#, 0, m4_fatal($0: cannot be called without arguments), @@ -44,7 +45,7 @@ # lt_append(MACRO-NAME, STRING, SEPARATOR) # ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different
View file
libaacs-0.8.1.tar.bz2/m4/ltversion.m4 -> libaacs-0.9.0.tar.bz2/m4/ltversion.m4
Changed
@@ -1,6 +1,6 @@ # ltversion.m4 -- version numbers -*- Autoconf -*- # -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives @@ -9,15 +9,15 @@ # @configure_input@ -# serial 3337 ltversion.m4 +# serial 4179 ltversion.m4 # This file is part of GNU Libtool -m4_define(LT_PACKAGE_VERSION, 2.4.2) -m4_define(LT_PACKAGE_REVISION, 1.3337) +m4_define(LT_PACKAGE_VERSION, 2.4.6) +m4_define(LT_PACKAGE_REVISION, 2.4.6) AC_DEFUN(LTVERSION_VERSION, -macro_version='2.4.2' -macro_revision='1.3337' +macro_version='2.4.6' +macro_revision='2.4.6' _LT_DECL(, macro_version, 0, Which release of libtool.m4 was used?) _LT_DECL(, macro_revision, 0) )
View file
libaacs-0.8.1.tar.bz2/m4/lt~obsolete.m4 -> libaacs-0.9.0.tar.bz2/m4/lt~obsolete.m4
Changed
@@ -1,6 +1,7 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software +# Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives @@ -11,7 +12,7 @@ # These exist entirely to fool aclocal when bootstrapping libtool. # -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # @@ -25,7 +26,7 @@ # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until
View file
libaacs-0.8.1.tar.bz2/src/examples/aacs_info.c -> libaacs-0.9.0.tar.bz2/src/examples/aacs_info.c
Changed
@@ -1,6 +1,6 @@ /* * This file is part of libaacs - * Copyright (C) 2010 npzacs + * Copyright (C) 2010-2016 npzacs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -89,6 +89,7 @@ int main (int argc, char **argv) { int major, minor, micro, error_code = AACS_SUCCESS; + AACS *aacs = NULL; if (argc < 2) { fprintf(stderr, "Usage: aacs_info <path-to-disc-root> <path-to-config-file>\n"); @@ -98,30 +99,41 @@ aacs_get_version(&major, &minor, µ); printf("Opening %s using libaacs %d.%d.%d ...\n", argv1, major, minor, micro); - AACS *aacs = aacs_open2(argv1, argc > 2 ? argv2 : NULL, &error_code); + aacs = aacs_init(); + if (!aacs) { + exit(EXIT_FAILURE); + } + + error_code = aacs_open_device(aacs, argv1, argc > 2 ? argv2 : NULL); + if (error_code) { fprintf(stderr, "libaacs open failed: %s\n", _error_str(error_code)); } else { printf("libaacs open succeed.\n"); } - if (!aacs) { - exit(EXIT_FAILURE); - } const uint8_t *vid = aacs_get_vid(aacs); + const uint8_t *mk = aacs_get_mk(aacs); const uint8_t *id = aacs_get_disc_id(aacs); const uint8_t *pmsn = aacs_get_pmsn(aacs); const int bec = aacs_get_bus_encryption(aacs); const uint8_t *binding_id = aacs_get_device_binding_id(aacs); + const uint8_t *bdj_hash = aacs_get_bdj_root_cert_hash(aacs); + const uint8_t *cc_id = aacs_get_content_cert_id(aacs); + printf("Disc ID: %s\n", id ? _hex2str(id, 20) : "???"); printf("VID : %s\n", vid ? _hex2str(vid, 16) : "???"); + printf("MK : %s\n", mk ? _hex2str(mk, 16) : "???"); printf("MKBv : %d\n", aacs_get_mkb_version(aacs)); printf("PMSN : %s\n", pmsn ? _hex2str(pmsn, 16) : "???"); printf("Bus encryption:\n"); printf(" Device support: %s\n", (bec & AACS_BUS_ENCRYPTION_CAPABLE) ? "yes" : "no"); printf(" Enabled in media: %s\n", (bec & AACS_BUS_ENCRYPTION_ENABLED) ? "yes" : "no"); - printf("Device binding ID: %s\n", binding_id ? _hex2str(binding_id, 16) : "???"); + printf("Content Certificate ID: %s\n", cc_id ? _hex2str(cc_id, 6) : "???"); + printf("BD-J Root Cert hash: %s\n", bdj_hash ? _hex2str(bdj_hash, 20) : "???"); + printf("Device binding ID: %s\n", binding_id ? _hex2str(binding_id, 16) : "???"); + aacs_close(aacs);
View file
libaacs-0.8.1.tar.bz2/src/examples/parser_test.c -> libaacs-0.9.0.tar.bz2/src/examples/parser_test.c
Changed
@@ -22,6 +22,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> static int print_digit_key_pair_enties(digit_key_pair_list *list); static int print_title_entries(title_entry_list *list); @@ -52,6 +53,7 @@ /* Function that prints all entries parsed from a config file */ static int print_title_entries(title_entry_list *list) { + static const uint8_t empty_key16 = {0}; char tmp256; if (!list) @@ -63,24 +65,26 @@ title_entry_list *cursor = list; while (cursor) { - if (!cursor->entry.discid) - break; - printf("DISCID: %s\n", str_print_hex(tmp, cursor->entry.discid, 20)); +#if 0 printf(" Title: %s\n", cursor->entry.title); printf(" Date: %u-%u-%u\n", cursor->entry.date.year, cursor->entry.date.month, cursor->entry.date.day); +#endif if (cursor->entry.mek) printf(" MEK: %s\n", cursor->entry.mek); if (cursor->entry.vid) printf(" VID: %s\n", cursor->entry.vid); +#if 0 if (cursor->entry.bn) { printf(" BN:\n"); print_digit_key_pair_enties(cursor->entry.bn); } - if (cursor->entry.vuk) - printf(" VUK: %s\n", cursor->entry.vuk); +#endif + if (memcmp(cursor->entry.vuk, empty_key, 16)) + printf(" VUK: %s\n", str_print_hex(tmp, cursor->entry.vuk, 16)); +#if 0 if (cursor->entry.pak) { printf(" PAK:\n"); @@ -91,6 +95,7 @@ printf(" TK:\n"); print_digit_key_pair_enties(cursor->entry.tk); } +#endif if (cursor->entry.uk) { printf(" UK:\n");
View file
libaacs-0.8.1.tar.bz2/src/file/dirs.h -> libaacs-0.9.0.tar.bz2/src/file/dirs.h
Changed
@@ -22,10 +22,6 @@ #include "util/attributes.h" -#ifdef _WIN32 -BD_PRIVATE int win32_mkdir(const char *dir); -#endif - /* * Config, cache and data dirs */
View file
libaacs-0.8.1.tar.bz2/src/file/dirs_darwin.c -> libaacs-0.9.0.tar.bz2/src/file/dirs_darwin.c
Changed
@@ -73,23 +73,10 @@ const char *file_get_config_system(const char *dir) { - static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0" - - if (!dirs) { - dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0); - } - if (!dir) { // first call - dir = dirs; - } else { - // next call - dir += strlen(dir) + 1; - if (!*dir) { - // end of list - dir = NULL; - } + return SYSTEM_CFG_DIR; } - return dir; + return NULL; }
View file
libaacs-0.8.1.tar.bz2/src/file/dirs_win32.c -> libaacs-0.9.0.tar.bz2/src/file/dirs_win32.c
Changed
@@ -28,19 +28,10 @@ #include <stdio.h> #include <string.h> -#include <shlobj.h> #include <windows.h> +#include <shlobj.h> #include <limits.h> -#include <direct.h> - - -int win32_mkdir(const char *dir) -{ - wchar_t wdirMAX_PATH; - MultiByteToWideChar(CP_UTF8, 0, dir, -1, wdir, MAX_PATH); - return _wmkdir(wdir); -} char *file_get_config_home(void) { @@ -56,7 +47,9 @@ NULL, SHGFP_TYPE_CURRENT, wdir)) { int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); char *appdir = malloc(len); - WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + if (appdir) { + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + } return appdir; } @@ -85,7 +78,9 @@ NULL, SHGFP_TYPE_CURRENT, wdir)) { int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); appdir = malloc(len); - WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + if (appdir) { + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + } return appdir; } else { BD_DEBUG(DBG_FILE, "Can't find common configuration directory !\n");
View file
libaacs-0.8.1.tar.bz2/src/file/dirs_xdg.c -> libaacs-0.9.0.tar.bz2/src/file/dirs_xdg.c
Changed
@@ -26,7 +26,6 @@ #include "util/strutl.h" #include "util/logging.h" -#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -45,7 +44,7 @@ { const char *xdg_home = getenv("XDG_CONFIG_HOME"); if (xdg_home && *xdg_home) { - return str_printf("%s", xdg_home); + return str_dup(xdg_home); } const char *user_home = getenv("HOME"); @@ -61,7 +60,7 @@ { const char *xdg_home = getenv("XDG_DATA_HOME"); if (xdg_home && *xdg_home) { - return str_printf("%s", xdg_home); + return str_dup(xdg_home); } const char *user_home = getenv("HOME"); @@ -77,7 +76,7 @@ { const char *xdg_cache = getenv("XDG_CACHE_HOME"); if (xdg_cache && *xdg_cache) { - return str_printf("%s", xdg_cache); + return str_dup(xdg_cache); } const char *user_home = getenv("HOME"); @@ -99,6 +98,9 @@ if (xdg_sys && *xdg_sys) { dirs = calloc(1, strlen(xdg_sys) + 2); + if (!dirs) { + return NULL; + } strcpy(dirs, xdg_sys); char *pt = dirs;
View file
libaacs-0.9.0.tar.bz2/src/file/file.c
Added
@@ -0,0 +1,93 @@ +/* + * This file is part of libbluray + * Copyright (C) 2014 VideoLAN + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "file.h" + +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include <stdio.h> // SEEK_* +#include <string.h> // strchr + + +int64_t file_size(AACS_FILE_H *fp) +{ + int64_t pos = file_tell(fp); + int64_t res1 = file_seek(fp, 0, SEEK_END); + int64_t length = file_tell(fp); + int64_t res2 = file_seek(fp, pos, SEEK_SET); + + if (res1 < 0 || res2 < 0 || pos < 0 || length < 0) { + return -1; + } + + return length; +} + +int file_mkdirs(const char *path) +{ + int result = 0; + char *dir = str_dup(path); + char *end = dir; + char *p; + + if (!dir) { + return -1; + } + + /* strip file name */ + if (!(end = strrchr(end, DIR_SEP_CHAR))) { + X_FREE(dir); + return -1; + } + *end = 0; + + /* tokenize, stop to first existing dir */ + while ((p = strrchr(dir, DIR_SEP_CHAR))) { + if (!file_path_exists(dir)) { + break; + } + *p = 0; + } + + /* create missing dirs */ + p = dir; + while (p < end) { + + /* concatenate next non-existing dir */ + while (*p) p++; + if (p >= end) break; + *p = DIR_SEP_CHAR; + + result = file_mkdir(dir); + if (result < 0) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error creating directory %s\n", dir); + break; + } + BD_DEBUG(DBG_FILE, " created directory %s\n", dir); + } + + X_FREE(dir); + return result; +}
View file
libaacs-0.8.1.tar.bz2/src/file/file.h -> libaacs-0.9.0.tar.bz2/src/file/file.h
Changed
@@ -38,13 +38,30 @@ * file access */ -#define file_close(X) X->close(X) +#define file_close(X) X->close(X) #define file_seek(X,Y,Z) X->seek(X,Y,Z) -#define file_tell(X) X->tell(X) -#define file_read(X,Y,Z) X->read(X,Y,Z) +#define file_tell(X) X->tell(X) +static inline int64_t file_read(AACS_FILE_H *fp, void *buf, int64_t size) { + return fp->read(fp, buf, size); +} + +static inline int64_t file_write(AACS_FILE_H *fp, const void *buf, int64_t size) { + return fp->write ? fp->write(fp, buf, size) : 0; +} + + +BD_PRIVATE int64_t file_size(AACS_FILE_H *fp); BD_PRIVATE extern AACS_FILE_H *(*file_open)(const char* filename, const char *mode); +/* + * local filesystem + */ + +BD_PRIVATE int file_unlink(const char *file); +BD_PRIVATE int file_path_exists(const char *path); +BD_PRIVATE int file_mkdir(const char *dir); +BD_PRIVATE int file_mkdirs(const char *path); #endif /* FILE_H_ */
View file
libaacs-0.8.1.tar.bz2/src/file/file_posix.c -> libaacs-0.9.0.tar.bz2/src/file/file_posix.c
Changed
@@ -21,81 +21,154 @@ #include "config.h" #endif -#if defined(__MINGW32__) -/* ftello64() and fseeko64() prototypes from stdio.h */ -# undef __STRICT_ANSI__ -#endif - #include "file.h" #include "util/macro.h" #include "util/logging.h" -#include <stdio.h> +#include <errno.h> +#include <inttypes.h> +#include <stdio.h> // remove() #include <stdlib.h> +#include <string.h> -static void file_close_linux(AACS_FILE_H *file) +#include <fcntl.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/types.h> + +static void _file_close(AACS_FILE_H *file) { if (file) { - fclose((FILE *)file->internal); + close((int)(intptr_t)file->internal); - BD_DEBUG(DBG_FILE, "Closed LINUX file (%p)\n", (void*)file); + BD_DEBUG(DBG_FILE, "Closed POSIX file (%p)\n", (void*)file); X_FREE(file); } } -static int64_t file_seek_linux(AACS_FILE_H *file, int64_t offset, int32_t origin) +static int64_t _file_seek(AACS_FILE_H *file, int64_t offset, int32_t origin) { -#if defined(__MINGW32__) - return fseeko64((FILE *)file->internal, offset, origin); -#else - return fseeko((FILE *)file->internal, offset, origin); -#endif + off_t result = lseek((int)(intptr_t)file->internal, offset, origin); + if (result == (off_t)-1) { + BD_DEBUG(DBG_FILE, "lseek() failed (%p)\n", (void*)file); + return -1; + } + return (int64_t)result; } -static int64_t file_tell_linux(AACS_FILE_H *file) +static int64_t _file_tell(AACS_FILE_H *file) { -#if defined(__MINGW32__) - return ftello64((FILE *)file->internal); -#else - return ftello((FILE *)file->internal); -#endif + return _file_seek(file, 0, SEEK_CUR); +} + +static int64_t _file_read(AACS_FILE_H *file, uint8_t *buf, int64_t size) +{ + ssize_t got, result; + + if (size <= 0 || size >= BD_MAX_SSIZE) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid read of size %"PRId64" (%p)\n", size, (void*)file); + return 0; + } + + for (got = 0; got < (ssize_t)size; got += result) { + result = read((int)(intptr_t)file->internal, buf + got, size - got); + if (result < 0) { + if (errno != EINTR) { + BD_DEBUG(DBG_FILE, "read() failed (%p)\n", (void*)file); + break; + } + result = 0; + } else if (result == 0) { + // hit EOF. + break; + } + } + return (int64_t)got; } -static int64_t file_read_linux(AACS_FILE_H *file, uint8_t *buf, int64_t size) +static int64_t _file_write(AACS_FILE_H *file, const uint8_t *buf, int64_t size) { - return fread(buf, 1, size, (FILE *)file->internal); + ssize_t written, result; + + if (size <= 0 || size >= BD_MAX_SSIZE) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid write of size %"PRId64" (%p)\n", size, (void*)file); + return 0; + } + + for (written = 0; written < (ssize_t)size; written += result) { + result = write((int)(intptr_t)file->internal, buf + written, size - written); + if (result < 0) { + if (errno != EINTR) { + BD_DEBUG(DBG_FILE, "write() failed (%p)\n", (void*)file); + break; + } + result = 0; + } + } + return (int64_t)written; } -static AACS_FILE_H *file_open_linux(const char* filename, const char *mode) +static AACS_FILE_H *_file_open(const char* filename, const char *cmode) { - FILE *fp = NULL; - AACS_FILE_H *file = calloc(1, sizeof(AACS_FILE_H)); + AACS_FILE_H *file; + int fd = -1; + int flags = 0; + int mode = 0; + + if (strchr(cmode, 'w')) { + flags = O_WRONLY | O_CREAT | O_TRUNC; + mode = S_IRUSR | S_IWUSR; + } else { + flags = O_RDONLY; + } - BD_DEBUG(DBG_FILE, "Opening LINUX file %s... (%p)\n", filename, (void*)file); - file->close = file_close_linux; - file->seek = file_seek_linux; - file->read = file_read_linux; - file->tell = file_tell_linux; +#ifdef O_CLOEXEC + flags |= O_CLOEXEC; +#endif +#ifdef O_BINARY + flags |= O_BINARY; +#endif - if ((fp = fopen(filename, mode))) { - file->internal = fp; + if ((fd = open(filename, flags, mode)) < 0) { + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; + } - return file; + file = calloc(1, sizeof(AACS_FILE_H)); + if (!file) { + close(fd); + BD_DEBUG(DBG_FILE, "Error opening file %s (out of memory)\n", filename); + return NULL; } - BD_DEBUG(DBG_FILE, "Error opening file %s ! (%p)\n", filename, (void*)file); + file->close = _file_close; + file->seek = _file_seek; + file->read = _file_read; + file->write = _file_write; + file->tell = _file_tell; - X_FREE(file); + file->internal = (void*)(intptr_t)fd; - return NULL; + BD_DEBUG(DBG_FILE, "Opened POSIX file %s (%p)\n", filename, (void*)file); + + return file; } -AACS_FILE_H* (*file_open)(const char* filename, const char *mode) = file_open_linux; +AACS_FILE_H* (*file_open)(const char* filename, const char *mode) = _file_open; + +int file_unlink(const char *file) +{ + return remove(file); +} + +int file_path_exists(const char *path) +{ + struct stat s; + return stat(path, &s); +} -AACS_FILE_OPEN aacs_register_file(AACS_FILE_OPEN p) +int file_mkdir(const char *dir) { - AACS_FILE_OPEN old = file_open; - file_open = p; - return old; + return mkdir(dir, S_IRWXU); }
View file
libaacs-0.9.0.tar.bz2/src/file/file_win32.c
Added
@@ -0,0 +1,156 @@ +/* + * This file is part of libaacs + * Copyright (C) 2009-2010 Obliter0n + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined(__MINGW32__) +/* ftello64() and fseeko64() prototypes from stdio.h */ +# undef __STRICT_ANSI__ +#endif + +#include "file.h" +#include "util/macro.h" +#include "util/logging.h" + +#include <stdio.h> +#include <stdlib.h> +#include <inttypes.h> + +#include <windows.h> + +static void _file_close(AACS_FILE_H *file) +{ + if (file) { + fclose((FILE *)file->internal); + + BD_DEBUG(DBG_FILE, "Closed WIN32 file (%p)\n", (void*)file); + + X_FREE(file); + } +} + +static int64_t _file_seek(AACS_FILE_H *file, int64_t offset, int32_t origin) +{ +#if defined(__MINGW32__) + return fseeko64((FILE *)file->internal, offset, origin); +#else + return _fseeki64((FILE *)file->internal, offset, origin); +#endif +} + +static int64_t _file_tell(AACS_FILE_H *file) +{ +#if defined(__MINGW32__) + return ftello64((FILE *)file->internal); +#else + return _ftelli64((FILE *)file->internal); +#endif +} + +static int64_t _file_read(AACS_FILE_H *file, uint8_t *buf, int64_t size) +{ + if (size > 0 && size < BD_MAX_SSIZE) { + return (int64_t)fread(buf, 1, (size_t)size, (FILE *)file->internal); + } + + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid read of size %"PRId64" (%p)\n", size, (void*)file); + return 0; +} + +static int64_t _file_write(AACS_FILE_H *file, const uint8_t *buf, int64_t size) +{ + if (size > 0 && size < BD_MAX_SSIZE) { + return (int64_t)fwrite(buf, 1, (size_t)size, (FILE *)file->internal); + } + + BD_DEBUG(DBG_FILE | DBG_CRIT, "Ignoring invalid write of size %"PRId64" (%p)\n", size, (void*)file); + return 0; +} + +static AACS_FILE_H *_file_open(const char* filename, const char *mode) +{ + AACS_FILE_H *file; + FILE *fp; + wchar_t wfilenameMAX_PATH, wmode8; + + if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename, -1, wfilename, MAX_PATH) || + !MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, mode, -1, wmode, 8)) { + + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; + } + + fp = _wfopen(wfilename, wmode); + if (!fp) { + BD_DEBUG(DBG_FILE, "Error opening file %s\n", filename); + return NULL; + } + + file = calloc(1, sizeof(AACS_FILE_H)); + if (!file) { + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error opening file %s (out of memory)\n", filename); + fclose(fp); + return NULL; + } + + file->internal = fp; + file->close = _file_close; + file->seek = _file_seek; + file->read = _file_read; + file->write = _file_write; + file->tell = _file_tell; + + BD_DEBUG(DBG_FILE, "Opened WIN32 file %s (%p)\n", filename, (void*)file); + return file; +} + +AACS_FILE_H* (*file_open)(const char* filename, const char *mode) = _file_open; + +int file_unlink(const char *file) +{ + wchar_t wfileMAX_PATH; + + MultiByteToWideChar(CP_UTF8, 0, file, -1, wfile, MAX_PATH); + return _wremove(wfile); +} + +int file_path_exists(const char *path) +{ + wchar_t wpathMAX_PATH; + + MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_PATH); + + DWORD dwAttrib = GetFileAttributesW(wpath); + if (dwAttrib != INVALID_FILE_ATTRIBUTES) { + return 0; + } + return -1; +} + +int file_mkdir(const char *dir) +{ + wchar_t wdirMAX_PATH; + + MultiByteToWideChar(CP_UTF8, 0, dir, -1, wdir, MAX_PATH); + if (!CreateDirectoryW(wdir, NULL)) + return -1; + return 0; +}
View file
libaacs-0.9.0.tar.bz2/src/file/filesystem.c
Added
@@ -0,0 +1,32 @@ +/* + * This file is part of libaacs + * Copyright (C) 2009-2010 Obliter0n + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "file.h" + + +AACS_FILE_OPEN aacs_register_file(AACS_FILE_OPEN p) +{ + AACS_FILE_OPEN old = file_open; + file_open = p; + return old; +}
View file
libaacs-0.8.1.tar.bz2/src/file/filesystem.h -> libaacs-0.9.0.tar.bz2/src/file/filesystem.h
Changed
@@ -43,7 +43,7 @@ * @param p function pointer * @return previous function pointer registered */ -AACS_FILE_OPEN aacs_register_file(AACS_FILE_OPEN p); +AACS_PUBLIC AACS_FILE_OPEN aacs_register_file(AACS_FILE_OPEN p); /** * @@ -66,7 +66,7 @@ * @param p function pointer */ struct aacs; -void aacs_set_fopen(struct aacs *aacs, void *handle, AACS_FILE_OPEN2 p); +AACS_PUBLIC void aacs_set_fopen(struct aacs *aacs, void *handle, AACS_FILE_OPEN2 p); #endif /* AACS_FILESYSTEM_H_ */
View file
libaacs-0.8.1.tar.bz2/src/file/keydbcfg-parser.y -> libaacs-0.9.0.tar.bz2/src/file/keydbcfg-parser.y
Changed
@@ -28,6 +28,10 @@ #include <stdlib.h> #include <string.h> +#ifdef _WIN32 +#include <windows.h> +#endif + /* Disable some warnings triggered by generated parser */ #if defined __GNUC__ #pragma GCC diagnostic ignored "-Wimplicit-function-declaration" @@ -54,14 +58,14 @@ enum { ENTRY_TYPE_DISCID, - ENTRY_TYPE_TITLE, - ENTRY_TYPE_DATE, + /*ENTRY_TYPE_TITLE,*/ + /*ENTRY_TYPE_DATE,*/ ENTRY_TYPE_MEK, ENTRY_TYPE_VID, - ENTRY_TYPE_BN, + /*ENTRY_TYPE_BN,*/ ENTRY_TYPE_VUK, - ENTRY_TYPE_PAK, - ENTRY_TYPE_TK, + /*ENTRY_TYPE_PAK,*/ + /*ENTRY_TYPE_TK,*/ ENTRY_TYPE_UK }; @@ -78,8 +82,10 @@ static digit_key_pair_list *new_digit_key_pair_list(void); static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list, int type, unsigned int digit, char *key); +/* static int add_date_entry(title_entry_list *list, unsigned int year, unsigned int month, unsigned int day); +*/ void yyerror (void *scanner, config_file *cf, title_entry_list *celist, digit_key_pair_list *dkplist, const char *msg); @@ -284,7 +290,7 @@ celist = celist->next; } add_entry(celist, ENTRY_TYPE_DISCID, $1); - add_entry(celist, ENTRY_TYPE_TITLE, $3); + /*add_entry(celist, ENTRY_TYPE_TITLE, $3);*/ } ; @@ -314,9 +320,11 @@ date_entry : ENTRY_ID_DATE DIGIT PUNCT_HYPHEN DIGIT PUNCT_HYPHEN DIGIT + /* { add_date_entry(celist, $2, $4, $6); } + */ ; mek_entry @@ -347,6 +355,7 @@ bn_data : DIGIT PUNCT_HYPHEN hexstring_list + /* { if (!dkplist) { @@ -355,6 +364,7 @@ } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_BN, $1, $3); } + */ ; vuk_entry @@ -378,6 +388,7 @@ pak_data : DIGIT PUNCT_HYPHEN hexstring_list + /* { if (!dkplist) { @@ -386,6 +397,7 @@ } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_PAK, $1, $3); } + */ ; tk_entry @@ -402,7 +414,8 @@ tk_data : DIGIT PUNCT_HYPHEN hexstring_list - { + /* + { if (!dkplist) { dkplist = new_digit_key_pair_list(); @@ -410,6 +423,7 @@ } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_TK, $1, $3); } + */ ; uk_entry @@ -440,15 +454,19 @@ : hexstring_list HEXSTRING { char *str = (char*)malloc(strlen($1) + strlen($2) + 1); - strcpy(str, $1); - strcat(str, $2); + if (str) { + strcpy(str, $1); + strcat(str, $2); + } $$ = str; X_FREE($1); } | HEXSTRING { char *str = (char*)malloc(strlen($1) + 1); - strcpy(str, $1); + if (str) { + strcpy(str, $1); + } $$ = str; } ; @@ -459,14 +477,22 @@ if (!cfgfile || !path) return 0; - FILE * fp = fopen(path, "r"); +#ifdef _WIN32 + wchar_t wfilenameMAX_PATH; + if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, path, -1, wfilename, MAX_PATH)) { + return 0; + } + FILE *fp = _wfopen(wfilename, L"r"); +#else + FILE *fp = fopen(path, "r"); +#endif if (!fp) return 0; void *scanner; libaacs_yylex_init(&scanner); libaacs_yyset_in(fp, scanner); - int retval = yyparse(scanner, cfgfile, NULL, NULL); + int retval = yyparse(scanner, cfgfile, cfgfile->list, NULL); libaacs_yylex_destroy(scanner); fclose(fp); @@ -480,8 +506,7 @@ /* Function that returns pointer to new config file object */ config_file *keydbcfg_new_config_file(void) { - config_file *cfgfile = (config_file *)malloc(sizeof(*cfgfile)); - memset(cfgfile, 0, sizeof(*cfgfile)); + config_file *cfgfile = (config_file *)calloc(1, sizeof(*cfgfile)); return cfgfile; } @@ -520,13 +545,12 @@ while (cfgfile->list) { title_entry_list *next = cfgfile->list->next; - X_FREE(cfgfile->list->entry.title); + /*X_FREE(cfgfile->list->entry.title);*/ X_FREE(cfgfile->list->entry.mek); X_FREE(cfgfile->list->entry.vid); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.bn); - X_FREE(cfgfile->list->entry.vuk); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.pak); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.tk); + /*DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.bn);*/ + /*DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.pak);*/ + /*DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.tk);*/ DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.uk); X_FREE(cfgfile->list); cfgfile->list = next; @@ -541,18 +565,19 @@ /* Function to return new dk_list object */ static dk_list *new_dk_list(void) { - dk_list *dkl = (dk_list *)malloc(sizeof(*dkl)); - memset(dkl, 0, sizeof(*dkl)); + dk_list *dkl = (dk_list *)calloc(1, sizeof(*dkl)); + if (!dkl) { + fprintf(stderr, "Error allocating memory for new certificate list!\n"); + } return dkl;
View file
libaacs-0.8.1.tar.bz2/src/file/keydbcfg.c -> libaacs-0.9.0.tar.bz2/src/file/keydbcfg.c
Changed
@@ -20,25 +20,14 @@ #include "keydbcfg.h" #include "dirs.h" +#include "file.h" #include "util/strutl.h" #include "util/logging.h" #include "util/macro.h" -#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/types.h> -#include <sys/stat.h> - -#ifdef _WIN32 -# define mkdir(p,m) win32_mkdir(p) -# define DIR_SEP_CHAR '\\' -# define DIR_SEP "\\" -#else -# define DIR_SEP_CHAR '/' -# define DIR_SEP "/" -#endif #define CFG_DIR "aacs" @@ -50,64 +39,30 @@ #define MIN_FILE_SIZE 20 #define MAX_FILE_SIZE 65535 -static int _mkpath(const char *path) -{ - struct stat s; - int result = 1; - char *dir = str_printf("%s", path); - char *end = dir; - -#ifdef _WIN32 - end += 2; /* skip drive */ -#endif - while (*end == DIR_SEP_CHAR) - end++; - - while ((end = strchr(end, DIR_SEP_CHAR))) { - *end = 0; - - if (stat(dir, &s) != 0 || !S_ISDIR(s.st_mode)) { - BD_DEBUG(DBG_FILE, "Creating directory %s\n", dir); - - if (mkdir(dir, S_IRWXU|S_IRWXG|S_IRWXO) == -1) { - BD_DEBUG(DBG_FILE | DBG_CRIT, "Error creating directory %s\n", dir); - result = 0; - break; - } - } - - *end++ = DIR_SEP_CHAR; - } - - X_FREE(dir); - return result; -} - -static char *_load_file(FILE *fp) +static char *_load_file(AACS_FILE_H *fp) { char *data = NULL; - long file_size, read_size; + int64_t size; - fseek(fp, 0, SEEK_END); - file_size = ftell(fp); - fseek(fp, 0, SEEK_SET); - - if (file_size < MIN_FILE_SIZE || file_size > MAX_FILE_SIZE) { + size = file_size(fp); + if (size < MIN_FILE_SIZE || size > MAX_FILE_SIZE) { BD_DEBUG(DBG_FILE, "Invalid file size\n"); return NULL; } - data = malloc(file_size + 1); - read_size = fread(data, 1, file_size, fp); + data = malloc(size + 1); + if (!data) { + return NULL; + } - if (read_size != file_size) { + if (file_read(fp, data, size) != size) { BD_DEBUG(DBG_FILE, "Error reading file\n"); X_FREE(data); return NULL; } - datafile_size = 0; + datasize = 0; return data; } @@ -126,7 +81,7 @@ return result; } -static FILE *_open_cfg_file_user(const char *file_name, char **path, const char *mode) +static AACS_FILE_H *_open_cfg_file_user(const char *file_name, char **path, const char *mode) { char *cfg_file = _config_file_user(file_name); @@ -135,13 +90,13 @@ } if (*mode == 'w') { - if (!_mkpath(cfg_file)) { + if (file_mkdirs(cfg_file) < 0) { X_FREE(cfg_file); return NULL; } } - FILE *fp = fopen(cfg_file, mode); + AACS_FILE_H *fp = file_open(cfg_file, mode); BD_DEBUG(DBG_FILE, fp ? "Opened %s for %s\n" : "%s not found\n", cfg_file, mode); @@ -154,15 +109,18 @@ return fp; } -static FILE *_open_cfg_file_system(const char *file_name, char **path) +static AACS_FILE_H *_open_cfg_file_system(const char *file_name, char **path) { const char *dir = NULL; while (NULL != (dir = file_get_config_system(dir))) { char *cfg_file = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s", dir, CFG_DIR, file_name); + if (!cfg_file) { + continue; + } - FILE *fp = fopen(cfg_file, "r"); + AACS_FILE_H *fp = file_open(cfg_file, "r"); if (fp) { BD_DEBUG(DBG_FILE, "Reading %s\n", cfg_file); @@ -194,7 +152,7 @@ return 0; } -static int _parse_pk_file(config_file *cf, FILE *fp) +static int _parse_pk_file(config_file *cf, AACS_FILE_H *fp) { char *data = _load_file(fp); int result = 0; @@ -209,18 +167,19 @@ BD_DEBUG(DBG_FILE, "Found processing key %s\n", str); pk_list *e = calloc(1, sizeof(pk_list)); - - hexstring_to_hex_array(e->key, 16, str); - - if (_is_duplicate_pk(cf->pkl, e->key)) { - BD_DEBUG(DBG_FILE, "Skipping duplicate processing key %s\n", str); - X_FREE(e); - } else { - e->next = cf->pkl; - cf->pkl = e; + if (e) { + hexstring_to_hex_array(e->key, 16, str); + + if (_is_duplicate_pk(cf->pkl, e->key)) { + BD_DEBUG(DBG_FILE, "Skipping duplicate processing key %s\n", str); + X_FREE(e); + } else { + e->next = cf->pkl; + cf->pkl = e; + } + + result++; } - - result++; } X_FREE(str); @@ -247,7 +206,7 @@ return 0; } -static int _parse_cert_file(config_file *cf, FILE *fp) +static int _parse_cert_file(config_file *cf, AACS_FILE_H *fp) { char *data = _load_file(fp); int result = 0; @@ -269,16 +228,18 @@ BD_DEBUG(DBG_FILE, "Found certificate: %s %s\n", host_priv_key, host_cert);
View file
libaacs-0.8.1.tar.bz2/src/file/keydbcfg.h -> libaacs-0.9.0.tar.bz2/src/file/keydbcfg.h
Changed
@@ -23,6 +23,7 @@ #include "util/attributes.h" #include <stdint.h> +#include <stddef.h> /* size_t */ /* struct holding a digit and key pair for <ENTRY NUMBER> - <ENTRY> entries */ typedef struct digit_key_pair_t digit_key_pair; @@ -41,6 +42,7 @@ }; /* date entry struct */ +#if 0 typedef struct date_entry_t date_entry; struct date_entry_t { @@ -48,6 +50,7 @@ unsigned int month; unsigned int day; }; +#endif /* dk entry */ typedef struct dk_entry dk_list; @@ -84,14 +87,14 @@ struct title_entry_t { uint8_t discid20; - char *title; - date_entry date; + //char *title; + //date_entry date; char *mek; char *vid; - digit_key_pair_list *bn; - char *vuk; - digit_key_pair_list *pak; - digit_key_pair_list *tk; + //digit_key_pair_list *bn; + uint8_t vuk16; + //digit_key_pair_list *pak; + //digit_key_pair_list *tk; digit_key_pair_list *uk; }; @@ -127,12 +130,10 @@ BD_PRIVATE int keycache_find(const char *type, const uint8_t *disc_id, uint8_t *key, unsigned int len); -BD_PRIVATE int cache_get(const char *name, uint32_t *version, uint32_t *len, void *buf); /* use buf=NULL to get version and size */ +BD_PRIVATE int cache_get(const char *name, uint32_t *version, uint32_t *len, void *buf, size_t buf_size); /* use buf=NULL to get version and size */ BD_PRIVATE int cache_save(const char *name, uint32_t version, const void *data, uint32_t len); BD_PRIVATE int cache_remove(const char *name); -BD_PRIVATE void *cache_get_or_update(const char *type, const void *data, uint32_t *len, uint32_t version); - BD_PRIVATE int config_get(const char *name, uint32_t *len, void *buf); /* use buf=NULL to get size */ BD_PRIVATE int config_save(const char *name, const void *data, uint32_t len);
View file
libaacs-0.8.1.tar.bz2/src/file/mmc_device_darwin.c -> libaacs-0.9.0.tar.bz2/src/file/mmc_device_darwin.c
Changed
@@ -399,6 +399,10 @@ int rc; dev = calloc(1, sizeof(MMCDEV)); + if (!dev) { + BD_DEBUG(DBG_MKB | DBG_CRIT, "out of memory\n"); + return NULL; + } rc = mmc_open_iokit (path, dev); if (0 != rc) {
View file
libaacs-0.8.1.tar.bz2/src/file/mmc_device_linux.c -> libaacs-0.9.0.tar.bz2/src/file/mmc_device_linux.c
Changed
@@ -115,7 +115,6 @@ size_t path_len; struct stat st; int fd = -1; - MMCDEV *dev = NULL; /* resolve path */ if (!aacs_resolve_path(path, resolved_path)) { @@ -134,8 +133,6 @@ return NULL; } - dev = calloc(1, sizeof(MMCDEV)); - if (S_ISBLK(st.st_mode)) { /* opening device */ BD_DEBUG(DBG_MMC, "Opening block device %s\n", resolved_path); @@ -185,10 +182,15 @@ #endif if (fd >= 0) { - dev = calloc(1, sizeof(MMCDEV)); - dev->fd = fd; + MMCDEV *dev = calloc(1, sizeof(MMCDEV)); + if (dev) { + dev->fd = fd; + return dev; + } + close(fd); } - return dev; + + return NULL; } void device_close(MMCDEV **pp)
View file
libaacs-0.8.1.tar.bz2/src/file/mmc_device_win32.c -> libaacs-0.9.0.tar.bz2/src/file/mmc_device_win32.c
Changed
@@ -161,6 +161,12 @@ BD_DEBUG(DBG_MMC, "Windows MMC drive %s opened\n", volume); dev = calloc(1, sizeof(MMCDEV)); + if (!dev) { + BD_DEBUG(DBG_MKB | DBG_CRIT, "out of memory\n"); + CloseHandle(fd); + return NULL; + } + dev->fd = fd; return dev; }
View file
libaacs-0.8.1.tar.bz2/src/file/path.c -> libaacs-0.9.0.tar.bz2/src/file/path.c
Changed
@@ -17,6 +17,10 @@ * <http://www.gnu.org/licenses/>. */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "path.h" #include <unistd.h>
View file
libaacs-0.8.1.tar.bz2/src/libaacs/aacs.c -> libaacs-0.9.0.tar.bz2/src/libaacs/aacs.c
Changed
@@ -26,9 +26,13 @@ #include "aacs-version.h" #include "aacs.h" +#include "cci.h" +#include "cci_data.h" +#include "content_cert.h" #include "crypto.h" #include "mmc.h" #include "mkb.h" +#include "unit_key.h" #include "file/file.h" #include "file/keydbcfg.h" #include "util/macro.h" @@ -64,33 +68,38 @@ /* Media key is cached for BD+ */ uint8_t mk16; - /* unit key for each CPS unit */ - uint32_t num_uks; - uint8_t *uks; + /* Unit keys */ + AACS_UK *uk; /* CPS unit of currently selected title */ uint16_t current_cps_unit; uint8_t cps_unit_selected; - /* title -> CPS unit mappings */ - uint32_t num_titles; - uint16_t *cps_units; /* 0 = first play ; 1 = top menu ; 2 = title 1 ... */ + int no_cache; /* do not use cached keys */ /* bus encryption */ int bee; /* bus encryption enabled flag in content certificate */ int bec; /* bus encryption capable flag in drive certificate */ uint8_t read_data_key16; + /* content certificate */ + CONTENT_CERT *cc; + /* AACS Online (BD-J) */ uint8_t device_nonce16; uint8_t device_binding_id16; }; -static const uint8_t empty_key16 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static const uint8_t empty_key20 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; static const uint8_t aacs_iv16 = { 0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 0x1f, 0xb3, 0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 0x0f, 0x78 }; +/* + * Validate processing key using media key verification data + */ + static int _validate_pk(const uint8_t *pk, const uint8_t *cvalue, const uint8_t *uv, const uint8_t *vd, uint8_t *mk) @@ -126,12 +135,25 @@ return AACS_ERROR_NO_PK; } +/* + * Revocation lists + */ + static int _rl_verify_signature(const uint8_t *rl, size_t size) { - int entries = MKINT_BE32(rl + 12 + 8); - size_t len = 12 + 12 + 8 * entries; /* type_and_version_rec=12, rl_header=12, rl=entries*8 */ + if (size < 40) { + BD_DEBUG(DBG_AACS, "too small revocation list\n"); + return 0; + } - if (len + 40 > size) { + uint32_t entries = MKINT_BE32(rl + 12 + 8); + if (entries >= (0xffffffff - 24 - 40) / 8) { + BD_DEBUG(DBG_AACS, "invalid revocation list\n"); + return 0; + } + + size_t len = 12 + 12 + 8 * entries; /* type_and_version_rec=12, rl_header=12, rl=entries*8 */ + if (len > size - 40) { BD_DEBUG(DBG_AACS, "revocation list size mismatch\n"); return 0; } @@ -149,17 +171,17 @@ return; } - if (rl_rec && version_rec) { - rl_rec -= 4; - rl_len += 4; + rl_rec -= 4; + rl_len += 4; - uint8_t *data = malloc(12 + rl_len); + uint8_t *data = malloc(12 + rl_len); + if (data) { memcpy(data, version_rec, 12); memcpy(data + 12, rl_rec, rl_len); if (!_rl_verify_signature(data, rl_len + 12)) { - BD_DEBUG(DBG_AACS | DBG_CRIT, "invalid %s signature, not using it\n", name); + BD_DEBUG(DBG_AACS | DBG_CRIT, "invalid %s signature, not using it\n", name); } else { - cache_save(name, version, data, rl_len + 12); + cache_save(name, version, data, rl_len + 12); } X_FREE(data); } @@ -171,22 +193,26 @@ uint32_t cache_version; size_t rl_len; - if (!cache_get("drl", &cache_version, NULL, NULL) || cache_version < version) { + if (!cache_get("drl", &cache_version, NULL, NULL, 0) || cache_version < version) { const uint8_t *version_rec = mkb_type_and_version_record(mkb); const uint8_t *drl_rec = mkb_drive_revokation_entries(mkb, &rl_len); - if (drl_rec && rl_len > 8) { + if (drl_rec && version_rec && rl_len > 8) { _save_rl("drl", version, version_rec, drl_rec, rl_len); } } - if (!cache_get("hrl", &cache_version, NULL, NULL) || cache_version < version) { + if (!cache_get("hrl", &cache_version, NULL, NULL, 0) || cache_version < version) { const uint8_t *version_rec = mkb_type_and_version_record(mkb); const uint8_t *hrl_rec = mkb_host_revokation_entries(mkb, &rl_len); - if (hrl_rec && rl_len > 8) { + if (hrl_rec && version_rec && rl_len > 8) { _save_rl("hrl", version, version_rec, hrl_rec, rl_len); } } } +/* + * Derive media key using full set of device keys + */ + static uint32_t _calc_v_mask(uint32_t uv) { uint32_t v_mask = 0xffffffff; @@ -214,7 +240,7 @@ } uint8_t curr_key16; - if (!(uv & (1ul << i))) { + if (i < 0 || !(uv & (1ul << i))) { memcpy(curr_key, left_child, 16); } else { memcpy(curr_key, right_child, 16); @@ -266,11 +292,11 @@ return dkl; } -static int _calc_pk_mk(MKB *mkb, dk_list *dkl, uint8_t *mk) +static int _calc_mk_dks(MKB *mkb, dk_list *dkl, uint8_t *mk) { /* calculate processing key and media key using device keys */ - const uint8_t *uvs, *cvalues; + const uint8_t *uvs, *cvalues, *mk_dv; unsigned num_uvs; size_t len; char str128; @@ -279,9 +305,18 @@ uvs = mkb_subdiff_records(mkb, &len); cvalues = mkb_cvalues(mkb, &len); + mk_dv = mkb_mk_dv(mkb); + + if (!uvs || !cvalues || !mk_dv) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Missing MKB records (uvs %p, cvalues %p, mk_dv %p)\n", + (const void*)uvs, (const void*)cvalues, (const void*)mk_dv); + return AACS_ERROR_CORRUPTED_DISC; + } + num_uvs = len / 5; if (num_uvs < 1) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "No UVS detected - corrupted disc\n"); return AACS_ERROR_CORRUPTED_DISC; } @@ -358,7 +393,7 @@ if ( _validate_pk(pk, cvalues + uvs_idx * 16, uvs + 1 + uvs_idx * 5, - mkb_mk_dv(mkb), + mk_dv, mk) == AACS_SUCCESS) { @@ -374,6 +409,10 @@ return AACS_ERROR_NO_DK; }
View file
libaacs-0.8.1.tar.bz2/src/libaacs/aacs.h -> libaacs-0.9.0.tar.bz2/src/libaacs/aacs.h
Changed
@@ -27,7 +27,9 @@ # define AACS_PUBLIC #endif -/* aacs_open2() error codes */ +/** + * aacs_open_device() error codes + */ #define AACS_SUCCESS 0 /* no errors */ #define AACS_ERROR_CORRUPTED_DISC -1 /* opening or reading of AACS files failed */ #define AACS_ERROR_NO_CONFIG -2 /* missing config file */ @@ -38,32 +40,129 @@ #define AACS_ERROR_MMC_FAILURE -7 /* MMC failed */ #define AACS_ERROR_NO_DK -8 /* no matching device key */ +/** + * Opaque type for AACS object + */ typedef struct aacs AACS; +/** + * Get version of AACS library. + * + * @param major where to store libaacs major version + * @param minor where to store libaacs minor version + * @param micro where to store libaacs micro version + */ AACS_PUBLIC void aacs_get_version(int *major, int *minor, int *micro); -AACS_PUBLIC AACS *aacs_init (void); -AACS_PUBLIC int aacs_open_device(AACS *, const char *path, const char *keyfile_path); +/* + * open / close a disc + */ +/** + * Initialize an AACS object. + * + * Disc must be opened with aacs_open_device(). + * + * @return AACS object, NULL on error + */ +AACS_PUBLIC AACS *aacs_init(void); + +/** + * Open AACS disc / device. + * + * If device is not accessible (reading from .iso file or network stream), + * path can be NULL. + * + * If files stored in AACS/ are not accessible from the file system (ex. unmounted disc), + * application should provide file system access for libaacs (see aacs_set_fopen()). + * + * @param aacs AACS object + * @param path path to device or disc root or NULL + * @param keyfile_path optional path to AACS key file + * @return AACS_SUCCESS or ACS_ERROR_* error code + */ +AACS_PUBLIC int aacs_open_device(AACS *, const char *path, const char *keyfile_path); + +/* deprecated */ AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path); + +/* deprecated */ AACS_PUBLIC AACS *aacs_open2(const char *path, const char *keyfile_path, int *error_code); +/** + * Closes and cleans up the AACS object. + * + * @param aacs AACS object + */ AACS_PUBLIC void aacs_close(AACS *aacs); -AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */ + +/* + * decryption + */ + +#define AACS_TITLE_FIRST_PLAY 0 +#define AACS_TITLE_TOP_MENU 0xffff + +/** + * Select title (optional). + * + * Titles can be stored in different CPS units and use different encryption key. + * + * If current title is not set, CPS unit is autodetected (with minor performance cost). + * If application does not provide current title to libaacs, current CPS unit + * should be reset by selecting First Play title (0xffff) when a new playlist is + * started. + * + * @param aacs AACS object + * @param title Current title from disc index + */ +AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title_number); + +/** + * Decrypt data unit + * + * Remove possible bus encryption and AACS encryption. + * + * NOTE: only units from the same CPS unit may be decrypted in paraller. + * + * @param aacs AACS object + * @param buf unit to decrypt + * @return 1 on success, 0 on error + */ AACS_PUBLIC int aacs_decrypt_unit(AACS *aacs, uint8_t *buf); -/* Disc information */ +/** + * Remove bus encryption. + * + * If bus encryption is used, remove bus encryption. + * Like aacs_decrypt_unit(), but does not perform AACS decryption. + * + * @param aacs AACS object + * @param buf unit to decrypt + * @return 1 on success, 0 on error + */ +AACS_PUBLIC int aacs_decrypt_bus(AACS *aacs, uint8_t *buf); + +/* + * Disc information + */ AACS_PUBLIC int aacs_get_mkb_version(AACS *aacs); AACS_PUBLIC const uint8_t *aacs_get_disc_id(AACS *aacs); AACS_PUBLIC const uint8_t *aacs_get_vid(AACS *aacs); /* may fail even if disc can be decrypted */ AACS_PUBLIC const uint8_t *aacs_get_pmsn(AACS *aacs); /* may fail even if disc can be decrypted */ AACS_PUBLIC const uint8_t *aacs_get_mk(AACS *aacs); /* may fail even if disc can be decrypted */ +AACS_PUBLIC const uint8_t *aacs_get_content_cert_id(AACS *aacs); +AACS_PUBLIC const uint8_t *aacs_get_bdj_root_cert_hash(AACS *aacs); -/* AACS Online */ +/* + * AACS Online + */ AACS_PUBLIC const uint8_t *aacs_get_device_binding_id(AACS *aacs); AACS_PUBLIC const uint8_t *aacs_get_device_nonce(AACS *aacs); -/* revocation lists */ +/* + * Revocation lists + */ typedef struct { uint16_t range; uint8_t id6; @@ -73,11 +172,21 @@ AACS_PUBLIC AACS_RL_ENTRY *aacs_get_drl(int *num_entries, int *mkb_version); AACS_PUBLIC void aacs_free_rl(AACS_RL_ENTRY **rl); -/* bus encryption info */ +/* + * Bus encryption information + */ #define AACS_BUS_ENCRYPTION_ENABLED 0x01 /* Bus encryption enabled in the media */ #define AACS_BUS_ENCRYPTION_CAPABLE 0x02 /* Bus encryption capable drive */ AACS_PUBLIC uint32_t aacs_get_bus_encryption(AACS *); +/* + * Copy Control Information + */ + +struct aacs_basic_cci; + +AACS_PUBLIC struct aacs_basic_cci *aacs_get_basic_cci(AACS *, uint32_t title); + #endif /* AACS_H_ */
View file
libaacs-0.9.0.tar.bz2/src/libaacs/cci.c
Added
@@ -0,0 +1,218 @@ +/* + * This file is part of libaacs + * Copyright (C) 2016 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "cci.h" + +#include "cci_data.h" + +#include "util/logging.h" +#include "util/macro.h" + +#include <stdlib.h> +#include <stdint.h> +#include <string.h> + +#define DBG_CCI DBG_AACS + + +/* CCI type */ +enum { + cci_AACS_BASIC_CCI = 0x0101, + cci_AACS_ENHANCED_TITLE_USAGE = 0x0111, +}; + +typedef struct { + uint16_t type; + uint16_t version; + uint16_t data_length; + union { + AACS_BASIC_CCI basic_cci; + } u; +} AACS_CCI_ENTRY; + +struct aacs_cci { + unsigned int num_entry; + AACS_CCI_ENTRY *entry; +}; + + +static void _bitcpy(void *dst, const const void *src, size_t num_bits) +{ + size_t bytes = num_bits >> 3; + size_t bits = num_bits & 3; + if (bytes) { + memcpy(dst, src, bytes); + } + if (bits) { + uint8_t mask = (((1 << (8 - bits))) - 1) ^ 0xff; + ((uint8_t *)dst)bytes = ((const uint8_t *)src)bytes & mask; + } +} + +static int cci_parse_entry(AACS_CCI_ENTRY *e, const uint8_t *data, size_t size) +{ + memset(e, 0, sizeof(AACS_CCI_ENTRY)); + + if (size < 6) { + return -1; + } + + e->type = MKINT_BE16(data); + e->version = MKINT_BE16(data + 2); + e->data_length = MKINT_BE16(data + 4); + + if (size + 6 < e->data_length) { + BD_DEBUG(DBG_CCI, "CCI: not enough data (type 0x%04x)\n", e->type); + return -1; + } + + switch (e->type) { + case cci_AACS_BASIC_CCI: + if (e->data_length == 0x84) { + BD_DEBUG(DBG_CCI, "CCI: AACS basic CCI found\n"); + e->u.basic_cci.epn = (data6 & 0x04) >> 2; + e->u.basic_cci.cci = data6 & 0x03; + e->u.basic_cci.image_constraint = (data7 & 0x10) >> 4; + e->u.basic_cci.digital_only = (data7 & 0x40) >> 3; + e->u.basic_cci.apstb = data7 & 0x07; + e->u.basic_cci.num_titles = MKINT_BE16(data + 8); + if (e->u.basic_cci.num_titles > 1024) { + BD_DEBUG(DBG_CCI, "CCI: title type map too large (%u)\n", e->u.basic_cci.num_titles); + return -1; + } + _bitcpy(e->u.basic_cci.title_type, data + 10, e->u.basic_cci.num_titles); + return 1; + } + break; + case cci_AACS_ENHANCED_TITLE_USAGE: + BD_DEBUG(DBG_CCI, "CCI: AACS enhanced title usage CCI found\n"); + return 1; + default: + BD_DEBUG(DBG_CCI, "CCI: AACS CCI 0x%04x found\n", e->type); + break; + } + + return 0; +} + +AACS_CCI *cci_parse(const void *data, size_t size) +{ + AACS_CCI *cci; + const uint8_t *p = data; + unsigned int ii; + + if (size < 16) { + return NULL; + } + + cci = calloc(1, sizeof(*cci)); + if (!cci) { + return NULL; + } + + cci->num_entry = MKINT_BE16(p); + p += 16; + size -= 16; + + cci->entry = calloc(cci->num_entry, sizeof(*(cci->entry))); + if (!cci->entry) { + cci_free(&cci); + return NULL; + } + + BD_DEBUG(DBG_CCI, "CCI: %d entries\n", cci->num_entry); + for (ii = 0; ii < cci->num_entry; ii++) { + AACS_CCI_ENTRY *e = &cci->entryii; + if (cci_parse_entry(e, p, size) < 0) { + BD_DEBUG(DBG_CCI, "CCI parsing failed\n"); + cci_free(&cci); + return NULL; + } + p += 6 + e->data_length; + size -= 6 + e->data_length; + } + + return cci; +} + +void cci_free(AACS_CCI **pp) +{ + if (pp && *pp) { + X_FREE((*pp)->entry); + X_FREE(*pp); + } +} + +int cci_is_unencrypted(AACS_CCI *cci) +{ + unsigned int ii; + + for (ii = 0; ii < cci->num_entry; ii++) { + AACS_CCI_ENTRY *e = &cci->entryii; + + if (e->type == cci_AACS_ENHANCED_TITLE_USAGE) { + BD_DEBUG(DBG_CCI, "Enhanced title usage CCI found\n"); + return 0; + } + + if (e->type == cci_AACS_BASIC_CCI) { + BD_DEBUG(DBG_CCI, "AACS basic CCI found\n"); + + /* Blu-ray Disc Pre-recorded Book, chapters 3.9.4.2 and 7.2 */ + if (e->version == 0x0100 && e->data_length == 0x84 && + e->u.basic_cci.cci == 0 && e->u.basic_cci.epn == 1 && /* copy freely, EPN unasserted */ + e->u.basic_cci.image_constraint && /* High Definition Analog Output in High Definition Analog Form */ + !e->u.basic_cci.digital_only && /* Output of decrypted content is allowed for Analog/Digital Outputs */ + !e->u.basic_cci.apstb /* APS off */ ) { + + /* check all titles are basic titles */ + int jj; + for (jj = 0; jj < (e->u.basic_cci.num_titles + 7) / 8; jj++) { + if (e->u.basic_cci.title_typejj) { + BD_DEBUG(DBG_CCI, "CCI: Enhanced title found\n"); + return 0; + } + } + + return 1; + } +
View file
libaacs-0.9.0.tar.bz2/src/libaacs/cci.h
Added
@@ -0,0 +1,36 @@ +/* + * This file is part of libaacs + * Copyright (C) 2016 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef AACS_CCI_H_ +#define AACS_CCI_H_ + +#include "util/attributes.h" + +#include <stddef.h> + +typedef struct aacs_cci AACS_CCI; + +BD_PRIVATE AACS_CCI *cci_parse(const void *data, size_t len); +BD_PRIVATE void cci_free(AACS_CCI **); + +BD_PRIVATE int cci_is_unencrypted(AACS_CCI *cci); + +BD_PRIVATE struct aacs_basic_cci *cci_get_basic_cci(AACS_CCI *cci); + +#endif /* AACS_CCI_H_ */
View file
libaacs-0.9.0.tar.bz2/src/libaacs/cci_data.h
Added
@@ -0,0 +1,38 @@ +/* + * This file is part of libaacs + * Copyright (C) 2016 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef AACS_CCI_DATA_H_ +#define AACS_CCI_DATA_H_ + +#include <stdint.h> + +/* Blu-ray Disc Pre-recorded Book, 3.9.4.2 Basic CCI for AACS */ +typedef struct aacs_basic_cci { + uint8_t epn; /* Encryption Plus Non-assertion. Valid if cci == 0. */ + uint8_t cci; /* Copy Control Information. 0 == copy freely. */ + uint8_t image_constraint; /* High Definition Analog Output in High Definition Analog Form */ + uint8_t digital_only; /* Output of decrypted content is allowed only for Digital Outputs */ + uint8_t apstb; /* Analog copy protection information */ + + uint16_t num_titles; + /* title types (bit mask) */ + uint8_t title_type1024/8; /* Title type bit mask. 0 == basic title. 1 == enhanced title. */ +} AACS_BASIC_CCI; + +#endif /* AACS_CCI_DATA_H_ */
View file
libaacs-0.9.0.tar.bz2/src/libaacs/content_cert.c
Added
@@ -0,0 +1,84 @@ +/* + * This file is part of libaacs + * Copyright (C) 2015 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "content_cert.h" + +#include "crypto.h" + +#include "util/logging.h" +#include "util/macro.h" + +#include <stdlib.h> +#include <stdint.h> +#include <string.h> + +CONTENT_CERT *cc_parse(const void *data, size_t len) +{ + const uint8_t *p = data; + + if (len < 87) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Invalid content certificate (length %zd < 87)\n", len); + return NULL; + } + if (p0 != 0) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Invalid content certificate type 0x%02x\n", p0); + return NULL; + } + + /* calculate certificate length */ + + size_t length_format_specific = MKINT_BE16(p + 24); + size_t num_digest = MKINT_BE16(p + 12); + + size_t cert_data_len = 26 + length_format_specific + num_digest*8; + + if (len < cert_data_len + 40) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Invalid content certificate (length %zd < %zd)\n", + len, cert_data_len + 40); + return NULL; + } + + /* check signature */ + + if (!crypto_aacs_verify_aacscc(p + cert_data_len, p, cert_data_len)) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Invalid content certificate signature\n"); + return NULL; + } + + /* return useful data */ + + CONTENT_CERT *c = calloc(1, sizeof(CONTENT_CERT)); + if (c) { + c->bus_encryption_enabled_flag = p1 >> 7; + memcpy(c->cc_id, p + 14, 6); + memcpy(c->bdj_root_cert_hash, p + 46, 20); + } + return c; +} + +void cc_free(CONTENT_CERT **pc) +{ + if (pc && *pc) { + X_FREE(*pc); + } +}
View file
libaacs-0.9.0.tar.bz2/src/libaacs/content_cert.h
Added
@@ -0,0 +1,41 @@ +/* + * This file is part of libaacs + * Copyright (C) 2015 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef CONTENT_CERT_H_ +#define CONTENT_CERT_H_ + +#include "util/attributes.h" + +#include <stdlib.h> +#include <stdint.h> + +typedef struct content_cert CONTENT_CERT; + +struct content_cert { + uint8_t bus_encryption_enabled_flag; + + uint8_t cc_id6; + uint8_t bdj_root_cert_hash20; +}; + + +BD_PRIVATE CONTENT_CERT *cc_parse(const void *data, size_t len); +BD_PRIVATE void cc_free(CONTENT_CERT **); + +#endif /* CONTENT_CERT_H_ */
View file
libaacs-0.8.1.tar.bz2/src/libaacs/crypto.c -> libaacs-0.9.0.tar.bz2/src/libaacs/crypto.c
Changed
@@ -38,6 +38,7 @@ #ifdef HAVE_PTHREAD_H #if GCRYPT_VERSION_NUMBER < 0x010600 #include <pthread.h> +#include <errno.h> #endif #endif @@ -322,6 +323,12 @@ mpi_d ? "(d %m)" : "" ); + if (!strfmt) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "out of memory\n"); + err = GPG_ERR_ENOMEM; + goto error; + } + /* Now build the S-expression */ GCRY_VERIFY("gcry_sexp_build", gcry_sexp_build(p_sexp_key, NULL, strfmt, mpi_d)); @@ -538,6 +545,16 @@ return !_aacs_verify(signature, aacs_la_pubkey_x, aacs_la_pubkey_y, data, len); } +int crypto_aacs_verify_aacscc(const uint8_t *signature, const uint8_t *data, uint32_t len) +{ + static const uint8_t aacs_cc_pubkey_x = { 0x78, 0x4C, 0xF5, 0xC3, 0x63, 0x97, 0xA4, 0x39, 0x04, 0x06, + 0xA4, 0x9F, 0x78, 0x00, 0xC7, 0x7D, 0xE9, 0x0C, 0xB3, 0x4C }; + static const uint8_t aacs_cc_pubkey_y = { 0x00, 0x1D, 0xF3, 0x6B, 0x8F, 0x2E, 0xCF, 0x83, 0xCD, 0xEE, + 0x43, 0x8F, 0x7F, 0xD1, 0xF4, 0x80, 0x6F, 0xD2, 0x0D, 0xE7 }; + + return !_aacs_verify(signature, aacs_cc_pubkey_x, aacs_cc_pubkey_y, data, len); +} + int crypto_aacs_verify_cert(const uint8_t *cert) { if (MKINT_BE16(cert+2) != 0x5c) {
View file
libaacs-0.8.1.tar.bz2/src/libaacs/crypto.h -> libaacs-0.9.0.tar.bz2/src/libaacs/crypto.h
Changed
@@ -38,6 +38,7 @@ BD_PRIVATE int crypto_aacs_verify(const uint8_t *cert, const uint8_t *signature, const uint8_t *data, uint32_t len); BD_PRIVATE int crypto_aacs_verify_aacsla(const uint8_t *signature, const uint8_t *data, uint32_t len); +BD_PRIVATE int crypto_aacs_verify_aacscc(const uint8_t *signature, const uint8_t *data, uint32_t len); BD_PRIVATE int crypto_aacs_verify_cert(const uint8_t *cert); BD_PRIVATE int crypto_aacs_verify_host_cert(const uint8_t *cert); BD_PRIVATE int crypto_aacs_verify_drive_cert(const uint8_t *cert);
View file
libaacs-0.8.1.tar.bz2/src/libaacs/mkb.c -> libaacs-0.9.0.tar.bz2/src/libaacs/mkb.c
Changed
@@ -17,8 +17,12 @@ * <http://www.gnu.org/licenses/>. */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "mkb.h" -#include "file/file.h" + #include "util/macro.h" #include "util/logging.h" #include "util/strutl.h" @@ -48,23 +52,29 @@ return mkb->buf + pos; } + if (len == 0) { + BD_DEBUG(DBG_MKB, "Couldn't retrieve MKB record 0x%02x - len=0 (%p)\n", type, + (void*)(mkb->buf + pos)); + break; + } + pos += len; } return NULL; } -MKB *mkb_read(AACS_FILE_H *fp) +MKB *mkb_init(uint8_t *data, size_t len) { MKB *mkb = malloc(sizeof(MKB)); - file_seek(fp, 0, SEEK_END); - mkb->size = file_tell(fp); - file_seek(fp, 0, SEEK_SET); - - mkb->buf = malloc(mkb->size); + if (!mkb) { + BD_DEBUG(DBG_MKB | DBG_CRIT, "out of memory\n"); + return NULL; + } - file_read(fp, mkb->buf, mkb->size); + mkb->size = len; + mkb->buf = data; BD_DEBUG(DBG_MKB, "MKB size: %u\n", (unsigned)mkb->size); BD_DEBUG(DBG_MKB, "MKB version: %d\n", mkb_version(mkb)); @@ -72,16 +82,6 @@ return mkb; } -MKB *mkb_init(uint8_t *data, int len) -{ - MKB *mkb = malloc(sizeof(MKB)); - - mkb->size = len; - mkb->buf = data; - - return mkb; -} - void mkb_close(MKB *mkb) { if (mkb) { @@ -112,21 +112,34 @@ uint8_t mkb_type(MKB *mkb) { - const uint8_t *rec = _record(mkb, 0x10, NULL); + const uint8_t *rec = mkb_type_and_version_record(mkb); + + if (!rec) { + return 0; + } return MKINT_BE32(rec + 4); } uint32_t mkb_version(MKB *mkb) { - const uint8_t *rec = _record(mkb, 0x10, NULL); + const uint8_t *rec = mkb_type_and_version_record(mkb); + + if (!rec) { + return 0; + } return MKINT_BE32(rec + 8); } const uint8_t *mkb_type_and_version_record(MKB *mkb) { - const uint8_t *rec = _record(mkb, 0x10, NULL); + size_t len = 0; + const uint8_t *rec = _record(mkb, 0x10, &len); + + if (len < 12) { + return NULL; + } return rec; } @@ -136,6 +149,9 @@ { const uint8_t *rec = _record(mkb, 0x21, len); + if (*len < 4) { + return NULL; + } if (rec) { rec += 4; *len -= 4; @@ -148,6 +164,9 @@ { const uint8_t *rec = _record(mkb, 0x20, len); + if (*len < 4) { + return NULL; + } if (rec) { rec += 4; *len -= 4; @@ -158,41 +177,77 @@ const uint8_t *mkb_subdiff_records(MKB *mkb, size_t *len) { - const uint8_t *rec = _record(mkb, 0x04, len) + 4; - *len -= 4; + const uint8_t *rec = _record(mkb, 0x04, len); + + if (*len < 4) { + return NULL; + } + if (rec) { + rec += 4; + *len -= 4; + } return rec; } const uint8_t *mkb_cvalues(MKB *mkb, size_t *len) { - const uint8_t *rec = _record(mkb, 0x05, len) + 4; - *len -= 4; + const uint8_t *rec = _record(mkb, 0x05, len); + + if (*len < 4) { + return NULL; + } + if (rec) { + rec += 4; + *len -= 4; + } return rec; } const uint8_t *mkb_mk_dv(MKB *mkb) { - return _record(mkb, 0x81, NULL) + 4; + size_t len; + const uint8_t *rec = _record(mkb, 0x81, &len); + + if (len < 20) { + return NULL; + } + if (rec) { + rec += 4; + } + + return rec; } const uint8_t *mkb_signature(MKB *mkb, size_t *len) { const uint8_t *rec = _record(mkb, 0x02, len); - *len -= 4; - return rec + 4; + if (*len < 4) { + return NULL; + } + if (rec) { + rec += 4; + *len -= 4; + } + + return rec; } static int _cert_is_revoked(const uint8_t *rl, size_t rl_size, const uint8_t *cert_id_bin) { - if (rl) { + if (rl && rl_size > 8) {
View file
libaacs-0.8.1.tar.bz2/src/libaacs/mkb.h -> libaacs-0.9.0.tar.bz2/src/libaacs/mkb.h
Changed
@@ -29,8 +29,7 @@ struct aacs_file_s; -BD_PRIVATE MKB *mkb_read(struct aacs_file_s *fp); // init MKB -BD_PRIVATE MKB *mkb_init(uint8_t *data, int len); // init MKB from data +BD_PRIVATE MKB *mkb_init(uint8_t *data, size_t len); // init MKB from data BD_PRIVATE void mkb_close(MKB *mkb); // free MKB BD_PRIVATE const uint8_t *mkb_data(MKB *mkb);
View file
libaacs-0.8.1.tar.bz2/src/libaacs/mmc.c -> libaacs-0.9.0.tar.bz2/src/libaacs/mmc.c
Changed
@@ -255,9 +255,15 @@ if (_mmc_report_disc_structure(mmc, agid, 0x83, layer, address, buf, sizeof(buf))) { unsigned pack, num_packs = buf3; int32_t len = MKINT_BE16(buf) - 2; - mkb = malloc(32768 * num_packs); BD_DEBUG(DBG_MMC, "got mkb: pack 0/%d %d bytes\n", num_packs, len); + + mkb = malloc(32768 * num_packs); + if (!mkb) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "out of memory\n"); + return NULL; + } + memcpy(mkb, buf + 4, len); *size += len; @@ -347,6 +353,9 @@ } mmc = calloc(1, sizeof(MMC)); + if (!mmc) { + return NULL; + } crypto_create_nonce(mmc->host_nonce, sizeof(mmc->host_nonce));
View file
libaacs-0.9.0.tar.bz2/src/libaacs/unit_key.c
Added
@@ -0,0 +1,226 @@ +/* + * This file is part of libaacs + * Copyright (C) 2016 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#include "unit_key.h" + +#include "util/logging.h" +#include "util/macro.h" + +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#define DBG_UK DBG_AACS + + +static void _uk_clean(AACS_UK *p) +{ + /* erase sensitive data */ + if (p->uk) { + memset(p->uk, 0, 16 * p->num_uk); + X_FREE(p->uk); + } + + X_FREE(p->enc_uk); + X_FREE(p->title_cps_unit); +} + +void uk_free(AACS_UK **pp) +{ + if (pp && *pp) { + _uk_clean(*pp); + X_FREE(*pp); + } +} + +static int _parse_header(AACS_UK *uk, const uint8_t *p, size_t size) +{ + /* parse header */ + + if (size < 20) { + BD_DEBUG(DBG_UK | DBG_CRIT, "unexpected EOF (@20)\n"); + return -1; + } + + uk->app_type = p16; + uk->num_bdmv_dir = p17; + uk->use_skb_mkb = p18 >> 7; + + /* check if suported */ + + if (uk->num_bdmv_dir < 1) { + BD_DEBUG(DBG_UK | DBG_CRIT, "No BDMV directories\n"); + return -1; + } + if (uk->num_bdmv_dir > 1) { + BD_DEBUG(DBG_UK | DBG_CRIT, "WARNING: possibly unsupported disc: %d BDMV directories\n", + uk->num_bdmv_dir); + } + + if (uk->app_type != 1) { + BD_DEBUG(DBG_UK | DBG_CRIT, "WARNING: possibly unsupported disc: application type %d\n", + uk->app_type); + } + if (uk->use_skb_mkb) { + BD_DEBUG(DBG_UK | DBG_CRIT, "WARNING: possibly unsupported disc: SKB used\n"); + } + + return 0; +} + +static int _assign_titles(AACS_UK *uk, const uint8_t *p, size_t size) +{ + uint16_t first_play, top_menu; + unsigned i, num_titles; + + /* assign titles */ + + BD_DEBUG(DBG_UK, "Assigning CPS units to titles ...\n"); + + if (size < 26) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Unexpected EOF (@26)\n"); + return -1; + } + + first_play = MKINT_BE16(p + 20); + top_menu = MKINT_BE16(p + 22); + num_titles = MKINT_BE16(p + 24); + + BD_DEBUG(DBG_UK, "Title FP : CPS unit %d\n", first_play); + BD_DEBUG(DBG_UK, "Title TM : CPS unit %d\n", top_menu); + + if (size < 26 + 4 * num_titles) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Unexpected EOF (title map)\n"); + uk->num_titles = 0; + return -1; + } + + uk->title_cps_unit = calloc(sizeof(uint16_t), num_titles + 2); + if (!uk->title_cps_unit) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Out of memory\n"); + return -1; + } + uk->num_titles = num_titles; + + uk->title_cps_unit0 = first_play; + uk->title_cps_unit1 = top_menu; + + for (i = 0; i < uk->num_titles; i++) { + uk->title_cps_uniti + 2 = MKINT_BE16(p + 26 + 2 + (4 * i)); + BD_DEBUG(DBG_UK, "Title %02d : CPS unit %d\n", i + 1, uk->title_cps_uniti); + } + + /* validate */ + for (i = 0; i < num_titles + 2; i++) { + if (uk->title_cps_uniti < 1 || uk->title_cps_uniti > uk->num_uk) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Invalid CPS unit for title #%d: %d\n", (int) i - 1, uk->title_cps_uniti); + uk->title_cps_uniti = 0; + } else { + uk->title_cps_uniti--; /* number 1...N --> index 0...N-1 */ + } + } + + return 0; +} + +static int _parse_uks(AACS_UK *uk, const uint8_t *p, size_t size) +{ + uint32_t uk_pos; + unsigned int i; + + if (size < 4) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Empty unit key file\n"); + return -1; + } + + /* check key storage area */ + + uk_pos = MKINT_BE32(p); + + if (size < uk_pos + 2) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Unexpected EOF (key data missing)\n"); + return -1; + } + + uk->num_uk = MKINT_BE16(p + uk_pos); + if (uk->num_uk < 1) { + BD_DEBUG(DBG_UK | DBG_CRIT, "No unit keys\n"); + return 0; + } + + if (size < uk_pos + 48 * uk->num_uk + 16) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Unexpected EOF (key data truncated)\n"); + return -1; + } + + /* alloc storage for keys */ + + uk->enc_uk = calloc(uk->num_uk, sizeof(AACS_UK)); + if (!uk->enc_uk) { + BD_DEBUG(DBG_UK | DBG_CRIT, "Out of memory\n"); + return -1; + } + + BD_DEBUG(DBG_UK, "%d CPS unit keys\n", uk->num_uk); + + /* get encrypted keys */ + + for (i = 0; i < uk->num_uk; i++) { + uk_pos += 48; + memcpy(uk->enc_uki.key, p + uk_pos, 16); + } + + return 0; +} + +static int _parse(AACS_UK *uk, const uint8_t *data, size_t len) +{ + int result; +
View file
libaacs-0.9.0.tar.bz2/src/libaacs/unit_key.h
Added
@@ -0,0 +1,56 @@ +/* + * This file is part of libaacs + * Copyright (C) 2016 npzacs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef AACS_UK_H_ +#define AACS_UK_H_ + +#include "util/attributes.h" + +#include <stddef.h> +#include <stdint.h> + +typedef struct aacs_uk AACS_UK; + +typedef struct UNIT_KEY { + uint8_t key16; +} UNIT_KEY; + +struct aacs_uk { + + /* header */ + uint8_t num_bdmv_dir; + uint8_t app_type; + uint8_t use_skb_mkb; + + /* unit keys */ + unsigned num_uk; + UNIT_KEY *uk; /* decrypted unit keys (NULL if not decrypted yet) */ + UNIT_KEY *enc_uk; /* encrypted unit keys */ + + /* title -> CPS unit mappings */ + /* 0 = first play ; 1 = top menu ; 2 = title 1 ... */ + /* NOTE: may be unset (num_titles = 0). */ + uint16_t num_titles; + uint16_t *title_cps_unit; /* map title to CPS unit (key index) */ +}; + +BD_PRIVATE AACS_UK *uk_parse(const void *data, size_t len); +BD_PRIVATE void uk_free(AACS_UK **); + +#endif /* AACS_UK_H_ */
View file
libaacs-0.8.1.tar.bz2/src/util/logging.c -> libaacs-0.9.0.tar.bz2/src/util/logging.c
Changed
@@ -18,6 +18,10 @@ * <http://www.gnu.org/licenses/>. */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "logging.h" #include "file/file.h"
View file
libaacs-0.8.1.tar.bz2/src/util/macro.h -> libaacs-0.9.0.tar.bz2/src/util/macro.h
Changed
@@ -24,10 +24,12 @@ #define MKINT_BE16(X) ( (X)0 << 8 | (X)1 ) #define MKINT_BE24(X) ( (X)0 << 16 | (X)1 << 8 | (X)2 ) -#define MKINT_BE32(X) ( (X)0 << 24 | (X)1 << 16 | (X)2 << 8 | (X)3 ) +#define MKINT_BE32(X) ( (uint32_t)(X)0 << 24 | (X)1 << 16 | (X)2 << 8 | (X)3 ) #define MKINT_BE48(X) ( (uint64_t)((X)0) << 40 | (uint64_t)((X)1) << 32 | (uint64_t)((X)2) << 24 | \ (uint64_t)((X)3) << 16 | (uint64_t)((X)4) << 8 | (uint64_t)((X)5) ) #define X_FREE(X) ( free(X), X = NULL ) +#define BD_MAX_SSIZE ((int64_t)(((size_t)-1)>>1)) + #endif /* MACRO_H_ */
View file
libaacs-0.8.1.tar.bz2/src/util/strutl.c -> libaacs-0.9.0.tar.bz2/src/util/strutl.c
Changed
@@ -18,6 +18,10 @@ * <http://www.gnu.org/licenses/>. */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + #include "strutl.h" #include "macro.h" @@ -153,9 +157,18 @@ return 1; } -char * str_dup(const char *str) +char *str_dup(const char *str) { - return str ? strcpy (malloc(strlen(str) + 1), str) : NULL; + char *dup = NULL; + + if (str) { + size_t size = strlen(str) + 1; + dup = malloc(size); + if (dup) { + memcpy(dup, str, size); + } + } + return dup; } char *str_printf(const char *fmt, ...) @@ -164,11 +177,17 @@ va_list ap; int len; int size = 100; - char *tmp, *str; + char *tmp, *str = NULL; + + while (1) { + + tmp = realloc(str, size); + if (tmp == NULL) { + X_FREE(str); + return NULL; + } + str = tmp; - str = malloc(size); - while (1) - { /* Try to print in the allocated space. */ va_start(ap, fmt); len = vsnprintf(str, size, fmt, ap); @@ -184,12 +203,6 @@ size = len+1; /* precisely what is needed */ else /* glibc 2.0 */ size *= 2; /* twice the old size */ - - tmp = realloc(str, size); - if (tmp == NULL) { - return str; - } - str = tmp; } } @@ -198,7 +211,7 @@ while (*p && *p != '\r' && *p != '\n') { p++; } - while (*p && (*p == '\r' || *p == '\n')) { + while (*p && (*p == '\r' || *p == '\n' || *p == ' ')) { p++; } @@ -242,8 +255,10 @@ } char *s = malloc(n + 1); - memcpy(s, p, n); - sn = 0; + if (s) { + memcpy(s, p, n); + sn = 0; + } return s; }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.