Projects
Essentials
libaacs
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 6
View file
libaacs.changes
Changed
@@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Tue Jan 27 12:39:43 UTC 2015 - joerg.lorenzen@ki.tng.de + +- update to 0.8.0 + * Add improved file system interface + * Support opening raw devices + * Reduce log level of failed PMSN query + * Optimizations + +------------------------------------------------------------------- Wed Dec 17 14:57:22 UTC 2014 - joerg.lorenzen@ki.tng.de - update to 0.7.1
View file
libaacs.spec
Changed
@@ -19,7 +19,7 @@ Name: libaacs -Version: 0.7.1 +Version: 0.8.0 Release: 1.1 License: LGPL-2.1+ Summary: Open implentation of AACS specification
View file
libaacs-0.7.1.tar.bz2/src/Makefile.am
Deleted
@@ -1,88 +0,0 @@ -SET_FEATURES = @SET_FEATURES@ -SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibaacs - -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=\ - libaacs/aacs.h \ - libaacs/mmc.h \ - libaacs/mkb.h \ - libaacs/aacs.c \ - libaacs/mmc.c \ - libaacs/crypto.c \ - libaacs/crypto.h \ - libaacs/mkb.c \ - file/dirs.h \ - file/file.h \ - file/filesystem.h \ - file/file_posix.c \ - file/keydbcfg.c \ - file/keydbcfg.h \ - file/keydb.h \ - file/keydbcfg-parser.y \ - file/keydbcfg-lexer.l \ - file/path.h \ - util/attributes.h \ - util/macro.h \ - util/logging.c \ - util/logging.h \ - util/strutl.c \ - util/strutl.h - -EXTRA_libaacs_la_SOURCES=\ - libaacs/ec.c - -if HAVE_DARWIN -libaacs_la_SOURCES+= \ - file/dirs_darwin.c -else -if HAVE_WIN32 -libaacs_la_SOURCES+= \ - file/dirs_win32.c -else -libaacs_la_SOURCES+= \ - file/dirs_xdg.c \ - file/path.c -endif -endif - -pkginclude_HEADERS = \ - libaacs/aacs.h \ - file/filesystem.h \ - libaacs/aacs-version.h - -libaacs_la_LDFLAGS= -no-undefined -version-info $(LT_VERSION_INFO) -libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libaacs.pc - -BUILT_SOURCES = file/keydbcfg-parser.h file/keydbcfg-parser.c file/keydbcfg-lexer.c - -CLEANFILES = $(BUILT_SOURCES) - -clean-lex-yacc: - -rm -f $(BUILT_SOURCES) - -# do not distribute files that should be generated by lex/yacc locally -dist-hook: - (cd $(distdir) && rm -f $(BUILT_SOURCES)) - -# -# programs -# - -noinst_PROGRAMS = parser_test -bin_PROGRAMS = aacs_info - -parser_test_SOURCES = examples/parser_test.c \ - file/keydbcfg-parser.y \ - file/keydbcfg-lexer.l \ - util/strutl.c \ - util/logging.c -parser_test_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) - -aacs_info_SOURCES = examples/aacs_info.c -aacs_info_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) -aacs_info_LDADD = libaacs.la
View file
libaacs-0.7.1.tar.bz2/src/Makefile.in
Deleted
@@ -1,1095 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in 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. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - - -VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\\ \ *) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs$$bs $$bs *//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -dEDm) skip_next=yes;; \ - -JT) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -@HAVE_DARWIN_TRUE@am__append_1 = \ -@HAVE_DARWIN_TRUE@ file/dirs_darwin.c - -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__append_2 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dirs_win32.c - -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__append_3 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/dirs_xdg.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/path.c - -noinst_PROGRAMS = parser_test$(EXEEXT) -bin_PROGRAMS = aacs_info$(EXEEXT) -subdir = src -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libaacs.pc.in file/keydbcfg-parser.h \ - file/keydbcfg-parser.c file/keydbcfg-lexer.c \ - $(top_srcdir)/build-aux/depcomp $(top_srcdir)/build-aux/ylwrap \ - $(pkginclude_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/attributes.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = libaacs.pc -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/.^$$\\*|/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/^/*$$,\1,' | \ - $(AWK) 'BEGIN { files"." = "" } { files$$2 = files$$2 " " $$1; \ - if (++n$$2 == $(am__install_max)) \ - { print $$2, files$$2; n$$2 = 0; files$$2 = "" } } \ - END { for (dir in files) print dir, filesdir }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libaacs_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -am__libaacs_la_SOURCES_DIST = libaacs/aacs.h libaacs/mmc.h \ - libaacs/mkb.h libaacs/aacs.c libaacs/mmc.c libaacs/crypto.c \ - libaacs/crypto.h libaacs/mkb.c file/dirs.h file/file.h \ - file/filesystem.h file/file_posix.c file/keydbcfg.c \ - file/keydbcfg.h file/keydb.h file/keydbcfg-parser.y \ - file/keydbcfg-lexer.l file/path.h util/attributes.h \ - util/macro.h util/logging.c util/logging.h util/strutl.c \ - util/strutl.h file/dirs_darwin.c file/dirs_win32.c \ - file/dirs_xdg.c file/path.c -am__dirstamp = $(am__leading_dot)dirstamp -@HAVE_DARWIN_TRUE@am__objects_1 = file/dirs_darwin.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/dirs_win32.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = file/dirs_xdg.lo \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/path.lo -am_libaacs_la_OBJECTS = libaacs/aacs.lo libaacs/mmc.lo \ - libaacs/crypto.lo libaacs/mkb.lo file/file_posix.lo \ - file/keydbcfg.lo file/keydbcfg-parser.lo \ - file/keydbcfg-lexer.lo util/logging.lo util/strutl.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) -libaacs_la_OBJECTS = $(am_libaacs_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libaacs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libaacs_la_LDFLAGS) $(LDFLAGS) -o $@ -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -am_aacs_info_OBJECTS = examples/aacs_info-aacs_info.$(OBJEXT) -aacs_info_OBJECTS = $(am_aacs_info_OBJECTS) -aacs_info_DEPENDENCIES = libaacs.la -aacs_info_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(aacs_info_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -am_parser_test_OBJECTS = examples/parser_test-parser_test.$(OBJEXT) \ - file/parser_test-keydbcfg-parser.$(OBJEXT) \ - file/parser_test-keydbcfg-lexer.$(OBJEXT) \ - util/parser_test-strutl.$(OBJEXT) \ - util/parser_test-logging.$(OBJEXT) -parser_test_OBJECTS = $(am_parser_test_OBJECTS) -parser_test_LDADD = $(LDADD) -parser_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(parser_test_CFLAGS) \ - $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || -LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) -LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) -AM_V_LEX = $(am__v_LEX_@AM_V@) -am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) -am__v_LEX_0 = @echo " LEX " $@; -am__v_LEX_1 = -YLWRAP = $(top_srcdir)/build-aux/ylwrap -@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || -am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ - -e s/c++$$/h++/ -e s/c$$/h/ -YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) -LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) -AM_V_YACC = $(am__v_YACC_@AM_V@) -am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) -am__v_YACC_0 = @echo " YACC " $@; -am__v_YACC_1 = -SOURCES = $(libaacs_la_SOURCES) $(EXTRA_libaacs_la_SOURCES) \ - $(aacs_info_SOURCES) $(parser_test_SOURCES) -DIST_SOURCES = $(am__libaacs_la_SOURCES_DIST) \ - $(EXTRA_libaacs_la_SOURCES) $(aacs_info_SOURCES) \ - $(parser_test_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(pkgconfig_DATA) -HEADERS = $(pkginclude_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items$$0 = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -AACS_VERSION_MAJOR = @AACS_VERSION_MAJOR@ -AACS_VERSION_MICRO = @AACS_VERSION_MICRO@ -AACS_VERSION_MINOR = @AACS_VERSION_MINOR@ -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ -GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ -GPG_ERROR_LIBS = @GPG_ERROR_LIBS@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_VERSION_INFO = @LT_VERSION_INFO@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_FEATURES = @SET_FEATURES@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibaacs -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 = libaacs/aacs.h libaacs/mmc.h libaacs/mkb.h \ - libaacs/aacs.c libaacs/mmc.c libaacs/crypto.c libaacs/crypto.h \ - libaacs/mkb.c file/dirs.h file/file.h file/filesystem.h \ - file/file_posix.c file/keydbcfg.c file/keydbcfg.h file/keydb.h \ - file/keydbcfg-parser.y file/keydbcfg-lexer.l file/path.h \ - util/attributes.h util/macro.h util/logging.c util/logging.h \ - util/strutl.c util/strutl.h $(am__append_1) $(am__append_2) \ - $(am__append_3) -EXTRA_libaacs_la_SOURCES = \ - libaacs/ec.c - -pkginclude_HEADERS = \ - libaacs/aacs.h \ - file/filesystem.h \ - libaacs/aacs-version.h - -libaacs_la_LDFLAGS = -no-undefined -version-info $(LT_VERSION_INFO) -libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libaacs.pc -BUILT_SOURCES = file/keydbcfg-parser.h file/keydbcfg-parser.c file/keydbcfg-lexer.c -CLEANFILES = $(BUILT_SOURCES) -parser_test_SOURCES = examples/parser_test.c \ - file/keydbcfg-parser.y \ - file/keydbcfg-lexer.l \ - util/strutl.c \ - util/logging.c - -parser_test_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) -aacs_info_SOURCES = examples/aacs_info.c -aacs_info_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) -aacs_info_LDADD = libaacs.la -all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -libaacs.pc: $(top_builddir)/config.status $(srcdir)/libaacs.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^^/*$$|.|; s|/^/*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libaacs/$(am__dirstamp): - @$(MKDIR_P) libaacs - @: > libaacs/$(am__dirstamp) -libaacs/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) libaacs/$(DEPDIR) - @: > libaacs/$(DEPDIR)/$(am__dirstamp) -libaacs/aacs.lo: libaacs/$(am__dirstamp) \ - libaacs/$(DEPDIR)/$(am__dirstamp) -libaacs/mmc.lo: libaacs/$(am__dirstamp) \ - libaacs/$(DEPDIR)/$(am__dirstamp) -libaacs/crypto.lo: libaacs/$(am__dirstamp) \ - libaacs/$(DEPDIR)/$(am__dirstamp) -libaacs/mkb.lo: libaacs/$(am__dirstamp) \ - libaacs/$(DEPDIR)/$(am__dirstamp) -file/$(am__dirstamp): - @$(MKDIR_P) file - @: > file/$(am__dirstamp) -file/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) file/$(DEPDIR) - @: > file/$(DEPDIR)/$(am__dirstamp) -file/file_posix.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/keydbcfg.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/keydbcfg-parser.h: file/keydbcfg-parser.c - @if test ! -f $@; then rm -f file/keydbcfg-parser.c; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) file/keydbcfg-parser.c; else :; fi -file/keydbcfg-parser.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/keydbcfg-lexer.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -util/$(am__dirstamp): - @$(MKDIR_P) util - @: > util/$(am__dirstamp) -util/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) util/$(DEPDIR) - @: > util/$(DEPDIR)/$(am__dirstamp) -util/logging.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) -util/strutl.lo: util/$(am__dirstamp) util/$(DEPDIR)/$(am__dirstamp) -file/dirs_darwin.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/dirs_win32.lo: file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/dirs_xdg.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -file/path.lo: file/$(am__dirstamp) file/$(DEPDIR)/$(am__dirstamp) -libaacs/ec.lo: libaacs/$(am__dirstamp) \ - libaacs/$(DEPDIR)/$(am__dirstamp) - -libaacs.la: $(libaacs_la_OBJECTS) $(libaacs_la_DEPENDENCIES) $(EXTRA_libaacs_la_DEPENDENCIES) - $(AM_V_CCLD)$(libaacs_la_LINK) -rpath $(libdir) $(libaacs_la_OBJECTS) $(libaacs_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files"." = ""; dirs"." = 1 } \ - { d=$$3; if (dirsd != 1) { print "d", d; dirsd = 1 } \ - if ($$2 == $$4) filesd = filesd " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, filesd }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -examples/$(am__dirstamp): - @$(MKDIR_P) examples - @: > examples/$(am__dirstamp) -examples/$(DEPDIR)/$(am__dirstamp): - @$(MKDIR_P) examples/$(DEPDIR) - @: > examples/$(DEPDIR)/$(am__dirstamp) -examples/aacs_info-aacs_info.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) - -aacs_info$(EXEEXT): $(aacs_info_OBJECTS) $(aacs_info_DEPENDENCIES) $(EXTRA_aacs_info_DEPENDENCIES) - @rm -f aacs_info$(EXEEXT) - $(AM_V_CCLD)$(aacs_info_LINK) $(aacs_info_OBJECTS) $(aacs_info_LDADD) $(LIBS) -examples/parser_test-parser_test.$(OBJEXT): examples/$(am__dirstamp) \ - examples/$(DEPDIR)/$(am__dirstamp) -file/parser_test-keydbcfg-parser.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -file/parser_test-keydbcfg-lexer.$(OBJEXT): file/$(am__dirstamp) \ - file/$(DEPDIR)/$(am__dirstamp) -util/parser_test-strutl.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) -util/parser_test-logging.$(OBJEXT): util/$(am__dirstamp) \ - util/$(DEPDIR)/$(am__dirstamp) - -parser_test$(EXEEXT): $(parser_test_OBJECTS) $(parser_test_DEPENDENCIES) $(EXTRA_parser_test_DEPENDENCIES) - @rm -f parser_test$(EXEEXT) - $(AM_V_CCLD)$(parser_test_LINK) $(parser_test_OBJECTS) $(parser_test_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -rm -f examples/*.$(OBJEXT) - -rm -f file/*.$(OBJEXT) - -rm -f file/*.lo - -rm -f libaacs/*.$(OBJEXT) - -rm -f libaacs/*.lo - -rm -f util/*.$(OBJEXT) - -rm -f util/*.lo - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/aacs_info-aacs_info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@examples/$(DEPDIR)/parser_test-parser_test.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_darwin.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_win32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/dirs_xdg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/file_posix.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/keydbcfg-lexer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/keydbcfg-parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/keydbcfg.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/parser_test-keydbcfg-lexer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/parser_test-keydbcfg-parser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@file/$(DEPDIR)/path.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libaacs/$(DEPDIR)/aacs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libaacs/$(DEPDIR)/crypto.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libaacs/$(DEPDIR)/ec.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libaacs/$(DEPDIR)/mkb.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@libaacs/$(DEPDIR)/mmc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/logging.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/parser_test-logging.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/parser_test-strutl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@util/$(DEPDIR)/strutl.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|^/*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|^/*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|^/*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ -@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -examples/aacs_info-aacs_info.o: examples/aacs_info.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -MT examples/aacs_info-aacs_info.o -MD -MP -MF examples/$(DEPDIR)/aacs_info-aacs_info.Tpo -c -o examples/aacs_info-aacs_info.o `test -f 'examples/aacs_info.c' || echo '$(srcdir)/'`examples/aacs_info.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/aacs_info-aacs_info.Tpo examples/$(DEPDIR)/aacs_info-aacs_info.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/aacs_info.c' object='examples/aacs_info-aacs_info.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -c -o examples/aacs_info-aacs_info.o `test -f 'examples/aacs_info.c' || echo '$(srcdir)/'`examples/aacs_info.c - -examples/aacs_info-aacs_info.obj: examples/aacs_info.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -MT examples/aacs_info-aacs_info.obj -MD -MP -MF examples/$(DEPDIR)/aacs_info-aacs_info.Tpo -c -o examples/aacs_info-aacs_info.obj `if test -f 'examples/aacs_info.c'; then $(CYGPATH_W) 'examples/aacs_info.c'; else $(CYGPATH_W) '$(srcdir)/examples/aacs_info.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/aacs_info-aacs_info.Tpo examples/$(DEPDIR)/aacs_info-aacs_info.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/aacs_info.c' object='examples/aacs_info-aacs_info.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -c -o examples/aacs_info-aacs_info.obj `if test -f 'examples/aacs_info.c'; then $(CYGPATH_W) 'examples/aacs_info.c'; else $(CYGPATH_W) '$(srcdir)/examples/aacs_info.c'; fi` - -examples/parser_test-parser_test.o: examples/parser_test.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT examples/parser_test-parser_test.o -MD -MP -MF examples/$(DEPDIR)/parser_test-parser_test.Tpo -c -o examples/parser_test-parser_test.o `test -f 'examples/parser_test.c' || echo '$(srcdir)/'`examples/parser_test.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/parser_test-parser_test.Tpo examples/$(DEPDIR)/parser_test-parser_test.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/parser_test.c' object='examples/parser_test-parser_test.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o examples/parser_test-parser_test.o `test -f 'examples/parser_test.c' || echo '$(srcdir)/'`examples/parser_test.c - -examples/parser_test-parser_test.obj: examples/parser_test.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT examples/parser_test-parser_test.obj -MD -MP -MF examples/$(DEPDIR)/parser_test-parser_test.Tpo -c -o examples/parser_test-parser_test.obj `if test -f 'examples/parser_test.c'; then $(CYGPATH_W) 'examples/parser_test.c'; else $(CYGPATH_W) '$(srcdir)/examples/parser_test.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) examples/$(DEPDIR)/parser_test-parser_test.Tpo examples/$(DEPDIR)/parser_test-parser_test.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='examples/parser_test.c' object='examples/parser_test-parser_test.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o examples/parser_test-parser_test.obj `if test -f 'examples/parser_test.c'; then $(CYGPATH_W) 'examples/parser_test.c'; else $(CYGPATH_W) '$(srcdir)/examples/parser_test.c'; fi` - -file/parser_test-keydbcfg-parser.o: file/keydbcfg-parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT file/parser_test-keydbcfg-parser.o -MD -MP -MF file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo -c -o file/parser_test-keydbcfg-parser.o `test -f 'file/keydbcfg-parser.c' || echo '$(srcdir)/'`file/keydbcfg-parser.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo file/$(DEPDIR)/parser_test-keydbcfg-parser.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/keydbcfg-parser.c' object='file/parser_test-keydbcfg-parser.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o file/parser_test-keydbcfg-parser.o `test -f 'file/keydbcfg-parser.c' || echo '$(srcdir)/'`file/keydbcfg-parser.c - -file/parser_test-keydbcfg-parser.obj: file/keydbcfg-parser.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT file/parser_test-keydbcfg-parser.obj -MD -MP -MF file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo -c -o file/parser_test-keydbcfg-parser.obj `if test -f 'file/keydbcfg-parser.c'; then $(CYGPATH_W) 'file/keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/file/keydbcfg-parser.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo file/$(DEPDIR)/parser_test-keydbcfg-parser.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/keydbcfg-parser.c' object='file/parser_test-keydbcfg-parser.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o file/parser_test-keydbcfg-parser.obj `if test -f 'file/keydbcfg-parser.c'; then $(CYGPATH_W) 'file/keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/file/keydbcfg-parser.c'; fi` - -file/parser_test-keydbcfg-lexer.o: file/keydbcfg-lexer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT file/parser_test-keydbcfg-lexer.o -MD -MP -MF file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo -c -o file/parser_test-keydbcfg-lexer.o `test -f 'file/keydbcfg-lexer.c' || echo '$(srcdir)/'`file/keydbcfg-lexer.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo file/$(DEPDIR)/parser_test-keydbcfg-lexer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/keydbcfg-lexer.c' object='file/parser_test-keydbcfg-lexer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o file/parser_test-keydbcfg-lexer.o `test -f 'file/keydbcfg-lexer.c' || echo '$(srcdir)/'`file/keydbcfg-lexer.c - -file/parser_test-keydbcfg-lexer.obj: file/keydbcfg-lexer.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT file/parser_test-keydbcfg-lexer.obj -MD -MP -MF file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo -c -o file/parser_test-keydbcfg-lexer.obj `if test -f 'file/keydbcfg-lexer.c'; then $(CYGPATH_W) 'file/keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/file/keydbcfg-lexer.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo file/$(DEPDIR)/parser_test-keydbcfg-lexer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file/keydbcfg-lexer.c' object='file/parser_test-keydbcfg-lexer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o file/parser_test-keydbcfg-lexer.obj `if test -f 'file/keydbcfg-lexer.c'; then $(CYGPATH_W) 'file/keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/file/keydbcfg-lexer.c'; fi` - -util/parser_test-strutl.o: util/strutl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT util/parser_test-strutl.o -MD -MP -MF util/$(DEPDIR)/parser_test-strutl.Tpo -c -o util/parser_test-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/parser_test-strutl.Tpo util/$(DEPDIR)/parser_test-strutl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/strutl.c' object='util/parser_test-strutl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o util/parser_test-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c - -util/parser_test-strutl.obj: util/strutl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT util/parser_test-strutl.obj -MD -MP -MF util/$(DEPDIR)/parser_test-strutl.Tpo -c -o util/parser_test-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/parser_test-strutl.Tpo util/$(DEPDIR)/parser_test-strutl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/strutl.c' object='util/parser_test-strutl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o util/parser_test-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` - -util/parser_test-logging.o: util/logging.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT util/parser_test-logging.o -MD -MP -MF util/$(DEPDIR)/parser_test-logging.Tpo -c -o util/parser_test-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/parser_test-logging.Tpo util/$(DEPDIR)/parser_test-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/logging.c' object='util/parser_test-logging.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o util/parser_test-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c - -util/parser_test-logging.obj: util/logging.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT util/parser_test-logging.obj -MD -MP -MF util/$(DEPDIR)/parser_test-logging.Tpo -c -o util/parser_test-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) util/$(DEPDIR)/parser_test-logging.Tpo util/$(DEPDIR)/parser_test-logging.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util/logging.c' object='util/parser_test-logging.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o util/parser_test-logging.obj `if test -f 'util/logging.c'; then $(CYGPATH_W) 'util/logging.c'; else $(CYGPATH_W) '$(srcdir)/util/logging.c'; fi` - -.l.c: - $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) - -.y.c: - $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -rm -rf file/.libs file/_libs - -rm -rf libaacs/.libs libaacs/_libs - -rm -rf util/.libs util/_libs -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) -install-pkgincludeHEADERS: $(pkginclude_HEADERS) - @$(NORMAL_INSTALL) - @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ - done - -uninstall-pkgincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - \\/* | ?:\\/*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/.^$$\\*/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/.^$$\\*/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/^/*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/^/*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -rm -f examples/$(DEPDIR)/$(am__dirstamp) - -rm -f examples/$(am__dirstamp) - -rm -f file/$(DEPDIR)/$(am__dirstamp) - -rm -f file/$(am__dirstamp) - -rm -f libaacs/$(DEPDIR)/$(am__dirstamp) - -rm -f libaacs/$(am__dirstamp) - -rm -f util/$(DEPDIR)/$(am__dirstamp) - -rm -f util/$(am__dirstamp) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -rm -f file/keydbcfg-lexer.c - -rm -f file/keydbcfg-parser.c - -rm -f file/keydbcfg-parser.h - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -rf examples/$(DEPDIR) file/$(DEPDIR) libaacs/$(DEPDIR) util/$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-pkgconfigDATA install-pkgincludeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf examples/$(DEPDIR) file/$(DEPDIR) libaacs/$(DEPDIR) util/$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ - uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS - -.MAKE: all check install install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ - clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ - ctags-am dist-hook distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ - uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS - - -clean-lex-yacc: - -rm -f $(BUILT_SOURCES) - -# do not distribute files that should be generated by lex/yacc locally -dist-hook: - (cd $(distdir) && rm -f $(BUILT_SOURCES)) - -# Tell versions 3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
View file
libaacs-0.7.1.tar.bz2/src/libaacs/aacs-version.h
Deleted
@@ -1,37 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2011 libaacs - * - * 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_VERSION_H_ -#define AACS_VERSION_H_ - -#define AACS_VERSION_CODE(major, minor, micro) \ - (((major) * 10000) + \ - ((minor) * 100) + \ - ((micro) * 1)) - -#define AACS_VERSION_MAJOR 0 -#define AACS_VERSION_MINOR 7 -#define AACS_VERSION_MICRO 1 - -#define AACS_VERSION_STRING "0.7.1" - -#define AACS_VERSION \ - AACS_VERSION_CODE(AACS_VERSION_MAJOR, AACS_VERSION_MINOR, AACS_VERSION_MICRO) - -#endif /* AACS_VERSION_H_ */
View file
libaacs-0.7.1.tar.bz2/ChangeLog -> libaacs-0.8.0.tar.bz2/ChangeLog
Changed
@@ -1,3 +1,9 @@ +2015-01-23: Version 0.8.0 + - Add improved file system interface + - Support opening raw devices + - Reduce log level of failed PMSN query + - Optimizations + 2014-05-27: Version 0.7.1 - Add support for gcrypt 1.6.0. - Do not retrieve MKB using MMC commands during AACS-Auth
View file
libaacs-0.7.1.tar.bz2/Makefile.am -> libaacs-0.8.0.tar.bz2/Makefile.am
Changed
@@ -1,8 +1,97 @@ -SUBDIRS=src - ACLOCAL_AMFLAGS=-I m4 EXTRA_DIST=bootstrap COPYING KEYDB.cfg README.txt ChangeLog +SET_FEATURES = @SET_FEATURES@ +SET_INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src/libaacs + +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 \ + 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 + +EXTRA_libaacs_la_SOURCES=\ + src/libaacs/ec.c + +if HAVE_DARWIN +libaacs_la_SOURCES+= \ + src/file/dirs_darwin.c \ + src/file/mmc_device_darwin.c +else +if HAVE_WIN32 +libaacs_la_SOURCES+= \ + src/file/dirs_win32.c \ + src/file/mmc_device_win32.c +else +libaacs_la_SOURCES+= \ + src/file/dirs_xdg.c \ + src/file/mmc_device_linux.c \ + src/file/path.c +endif +endif + +pkginclude_HEADERS = \ + src/libaacs/aacs.h \ + src/file/filesystem.h \ + src/libaacs/aacs-version.h + +libaacs_la_LDFLAGS= -no-undefined -version-info $(LT_VERSION_INFO) +libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = src/libaacs.pc + +BUILT_SOURCES = src/libaacs.pc src/libaacs/aacs-version.h src/file/keydbcfg-parser.h src/file/keydbcfg-parser.c src/file/keydbcfg-lexer.c + +CLEANFILES = $(BUILT_SOURCES) + clean-lex-yacc: - $(MAKE) -C src $@ + -rm -f $(BUILT_SOURCES) + +# do not distribute files that should be generated by lex/yacc locally +dist-hook: + (cd $(distdir) && rm -f $(BUILT_SOURCES)) + +# +# programs +# + +noinst_PROGRAMS = parser_test +bin_PROGRAMS = aacs_info + +parser_test_SOURCES = \ + src/examples/parser_test.c \ + src/file/keydbcfg-parser.y \ + src/file/keydbcfg-lexer.l \ + src/util/strutl.c \ + src/util/logging.c +parser_test_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) + +aacs_info_SOURCES = src/examples/aacs_info.c +aacs_info_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) +aacs_info_LDADD = libaacs.la
View file
libaacs-0.7.1.tar.bz2/Makefile.in -> libaacs-0.8.0.tar.bz2/Makefile.in
Changed
@@ -13,6 +13,10 @@ # PARTICULAR PURPOSE. @SET_MAKE@ + + + + VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ @@ -78,14 +82,32 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@HAVE_DARWIN_TRUE@am__append_1 = \ +@HAVE_DARWIN_TRUE@ src/file/dirs_darwin.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/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/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/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/missing \ - build-aux/ylwrap build-aux/ltmain.sh \ + $(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 \ @@ -103,8 +125,95 @@ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = src/libaacs/aacs-version.h +CONFIG_CLEAN_FILES = src/libaacs.pc src/libaacs/aacs-version.h CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/.^$$\\*|/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/^/*$$,\1,' | \ + $(AWK) 'BEGIN { files"." = "" } { files$$2 = files$$2 " " $$1; \ + if (++n$$2 == $(am__install_max)) \ + { print $$2, files$$2; n$$2 = 0; files$$2 = "" } } \ + END { for (dir in files) print dir, filesdir }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" +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 \ + 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/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 +am__dirstamp = $(am__leading_dot)dirstamp +@HAVE_DARWIN_TRUE@am__objects_1 = src/file/dirs_darwin.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/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/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 \ + 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) +libaacs_la_OBJECTS = $(am_libaacs_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libaacs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libaacs_la_LDFLAGS) $(LDFLAGS) -o $@ +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am_aacs_info_OBJECTS = src/examples/aacs_info-aacs_info.$(OBJEXT) +aacs_info_OBJECTS = $(am_aacs_info_OBJECTS) +aacs_info_DEPENDENCIES = libaacs.la +aacs_info_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(aacs_info_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_parser_test_OBJECTS = \ + src/examples/parser_test-parser_test.$(OBJEXT) \ + src/file/parser_test-keydbcfg-parser.$(OBJEXT) \ + src/file/parser_test-keydbcfg-lexer.$(OBJEXT) \ + src/util/parser_test-strutl.$(OBJEXT) \ + src/util/parser_test-logging.$(OBJEXT) +parser_test_OBJECTS = $(am_parser_test_OBJECTS) +parser_test_LDADD = $(LDADD) +parser_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(parser_test_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -117,29 +226,59 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) +LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) +AM_V_LEX = $(am__v_LEX_@AM_V@) +am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) +am__v_LEX_0 = @echo " LEX " $@; +am__v_LEX_1 = +YLWRAP = $(top_srcdir)/build-aux/ylwrap +@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || +am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ + -e s/c++$$/h++/ -e s/c$$/h/ +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) +AM_V_YACC = $(am__v_YACC_@AM_V@) +am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) +am__v_YACC_0 = @echo " YACC " $@; +am__v_YACC_1 = +SOURCES = $(libaacs_la_SOURCES) $(EXTRA_libaacs_la_SOURCES) \ + $(aacs_info_SOURCES) $(parser_test_SOURCES) +DIST_SOURCES = $(am__libaacs_la_SOURCES_DIST) \ + $(EXTRA_libaacs_la_SOURCES) $(aacs_info_SOURCES) \ + $(parser_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck +DATA = $(pkgconfig_DATA) +HEADERS = $(pkginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -161,7 +300,7 @@ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) +AM_RECURSIVE_TARGETS = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -172,31 +311,6 @@ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\(^/*\)/.*$$,\1,'; \ - sed_rest='s,^^/*/*,,'; \ - sed_last='s,^.*/\(^/*\)$$,\1,'; \ - sed_butlast='s,/*^/*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" GZIP_ENV = --best DIST_ARCHIVES = $(distdir).tar.bz2 DIST_TARGETS = dist-bzip2 @@ -340,13 +454,53 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap COPYING KEYDB.cfg README.txt ChangeLog -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive +SET_INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src/libaacs +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 \ + 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 $(am__append_1) $(am__append_2) \ + $(am__append_3) +EXTRA_libaacs_la_SOURCES = \ + src/libaacs/ec.c + +pkginclude_HEADERS = \ + src/libaacs/aacs.h \ + src/file/filesystem.h \ + src/libaacs/aacs-version.h + +libaacs_la_LDFLAGS = -no-undefined -version-info $(LT_VERSION_INFO) +libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = src/libaacs.pc +BUILT_SOURCES = src/libaacs.pc src/libaacs/aacs-version.h src/file/keydbcfg-parser.h src/file/keydbcfg-parser.c src/file/keydbcfg-lexer.c +CLEANFILES = $(BUILT_SOURCES) +parser_test_SOURCES = \ + src/examples/parser_test.c \ + src/file/keydbcfg-parser.y \ + src/file/keydbcfg-lexer.l \ + src/util/strutl.c \ + src/util/logging.c + +parser_test_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) +aacs_info_SOURCES = src/examples/aacs_info.c +aacs_info_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) +aacs_info_LDADD = libaacs.la +all: $(BUILT_SOURCES) config.h + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: +.SUFFIXES: .c .l .lo .o .obj .y am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @@ -396,73 +550,406 @@ distclean-hdr: -rm -f config.h stamp-h1 +src/libaacs.pc: $(top_builddir)/config.status $(top_srcdir)/src/libaacs.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ src/libaacs/aacs-version.h: $(top_builddir)/config.status $(top_srcdir)/src/libaacs/aacs-version.h.in cd $(top_builddir) && $(SHELL) ./config.status $@ +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^^/*$$|.|; s|/^/*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +src/libaacs/$(am__dirstamp): + @$(MKDIR_P) src/libaacs + @: > src/libaacs/$(am__dirstamp) +src/libaacs/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/libaacs/$(DEPDIR) + @: > 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) \ + src/libaacs/$(DEPDIR)/$(am__dirstamp) +src/libaacs/crypto.lo: src/libaacs/$(am__dirstamp) \ + src/libaacs/$(DEPDIR)/$(am__dirstamp) +src/libaacs/mkb.lo: src/libaacs/$(am__dirstamp) \ + src/libaacs/$(DEPDIR)/$(am__dirstamp) +src/file/$(am__dirstamp): + @$(MKDIR_P) src/file + @: > src/file/$(am__dirstamp) +src/file/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/file/$(DEPDIR) + @: > src/file/$(DEPDIR)/$(am__dirstamp) +src/file/file_posix.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/keydbcfg.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/keydbcfg-parser.h: src/file/keydbcfg-parser.c + @if test ! -f $@; then rm -f src/file/keydbcfg-parser.c; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) src/file/keydbcfg-parser.c; else :; fi +src/file/keydbcfg-parser.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/keydbcfg-lexer.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/util/$(am__dirstamp): + @$(MKDIR_P) src/util + @: > src/util/$(am__dirstamp) +src/util/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/util/$(DEPDIR) + @: > src/util/$(DEPDIR)/$(am__dirstamp) +src/util/logging.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/strutl.lo: src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/file/dirs_darwin.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/mmc_device_darwin.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dirs_win32.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/mmc_device_win32.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/dirs_xdg.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/mmc_device_linux.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/file/path.lo: src/file/$(am__dirstamp) \ + src/file/$(DEPDIR)/$(am__dirstamp) +src/libaacs/ec.lo: src/libaacs/$(am__dirstamp) \ + src/libaacs/$(DEPDIR)/$(am__dirstamp) + +libaacs.la: $(libaacs_la_OBJECTS) $(libaacs_la_DEPENDENCIES) $(EXTRA_libaacs_la_DEPENDENCIES) + $(AM_V_CCLD)$(libaacs_la_LINK) -rpath $(libdir) $(libaacs_la_OBJECTS) $(libaacs_la_LIBADD) $(LIBS) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files"." = ""; dirs"." = 1 } \ + { d=$$3; if (dirsd != 1) { print "d", d; dirsd = 1 } \ + if ($$2 == $$4) filesd = filesd " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, filesd }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +src/examples/$(am__dirstamp): + @$(MKDIR_P) src/examples + @: > src/examples/$(am__dirstamp) +src/examples/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/examples/$(DEPDIR) + @: > src/examples/$(DEPDIR)/$(am__dirstamp) +src/examples/aacs_info-aacs_info.$(OBJEXT): \ + src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) + +aacs_info$(EXEEXT): $(aacs_info_OBJECTS) $(aacs_info_DEPENDENCIES) $(EXTRA_aacs_info_DEPENDENCIES) + @rm -f aacs_info$(EXEEXT) + $(AM_V_CCLD)$(aacs_info_LINK) $(aacs_info_OBJECTS) $(aacs_info_LDADD) $(LIBS) +src/examples/parser_test-parser_test.$(OBJEXT): \ + src/examples/$(am__dirstamp) \ + src/examples/$(DEPDIR)/$(am__dirstamp) +src/file/parser_test-keydbcfg-parser.$(OBJEXT): \ + src/file/$(am__dirstamp) src/file/$(DEPDIR)/$(am__dirstamp) +src/file/parser_test-keydbcfg-lexer.$(OBJEXT): \ + src/file/$(am__dirstamp) src/file/$(DEPDIR)/$(am__dirstamp) +src/util/parser_test-strutl.$(OBJEXT): src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) +src/util/parser_test-logging.$(OBJEXT): src/util/$(am__dirstamp) \ + src/util/$(DEPDIR)/$(am__dirstamp) + +parser_test$(EXEEXT): $(parser_test_OBJECTS) $(parser_test_DEPENDENCIES) $(EXTRA_parser_test_DEPENDENCIES) + @rm -f parser_test$(EXEEXT) + $(AM_V_CCLD)$(parser_test_LINK) $(parser_test_OBJECTS) $(parser_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f src/examples/*.$(OBJEXT) + -rm -f src/file/*.$(OBJEXT) + -rm -f src/file/*.lo + -rm -f src/libaacs/*.$(OBJEXT) + -rm -f src/libaacs/*.lo + -rm -f src/util/*.$(OBJEXT) + -rm -f src/util/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/aacs_info-aacs_info.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/examples/$(DEPDIR)/parser_test-parser_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dirs_darwin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dirs_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/dirs_xdg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/file_posix.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/keydbcfg-lexer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/keydbcfg-parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/keydbcfg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/mmc_device_darwin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/mmc_device_linux.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/mmc_device_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/file/$(DEPDIR)/path.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libaacs/$(DEPDIR)/aacs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libaacs/$(DEPDIR)/crypto.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libaacs/$(DEPDIR)/ec.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libaacs/$(DEPDIR)/mkb.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/libaacs/$(DEPDIR)/mmc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/logging.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/parser_test-logging.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/parser_test-strutl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/util/$(DEPDIR)/strutl.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|^/*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|^/*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|^/*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +src/examples/aacs_info-aacs_info.o: src/examples/aacs_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -MT src/examples/aacs_info-aacs_info.o -MD -MP -MF src/examples/$(DEPDIR)/aacs_info-aacs_info.Tpo -c -o src/examples/aacs_info-aacs_info.o `test -f 'src/examples/aacs_info.c' || echo '$(srcdir)/'`src/examples/aacs_info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/aacs_info-aacs_info.Tpo src/examples/$(DEPDIR)/aacs_info-aacs_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/aacs_info.c' object='src/examples/aacs_info-aacs_info.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -c -o src/examples/aacs_info-aacs_info.o `test -f 'src/examples/aacs_info.c' || echo '$(srcdir)/'`src/examples/aacs_info.c + +src/examples/aacs_info-aacs_info.obj: src/examples/aacs_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -MT src/examples/aacs_info-aacs_info.obj -MD -MP -MF src/examples/$(DEPDIR)/aacs_info-aacs_info.Tpo -c -o src/examples/aacs_info-aacs_info.obj `if test -f 'src/examples/aacs_info.c'; then $(CYGPATH_W) 'src/examples/aacs_info.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/aacs_info.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/aacs_info-aacs_info.Tpo src/examples/$(DEPDIR)/aacs_info-aacs_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/aacs_info.c' object='src/examples/aacs_info-aacs_info.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -c -o src/examples/aacs_info-aacs_info.obj `if test -f 'src/examples/aacs_info.c'; then $(CYGPATH_W) 'src/examples/aacs_info.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/aacs_info.c'; fi` + +src/examples/parser_test-parser_test.o: src/examples/parser_test.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/examples/parser_test-parser_test.o -MD -MP -MF src/examples/$(DEPDIR)/parser_test-parser_test.Tpo -c -o src/examples/parser_test-parser_test.o `test -f 'src/examples/parser_test.c' || echo '$(srcdir)/'`src/examples/parser_test.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/parser_test-parser_test.Tpo src/examples/$(DEPDIR)/parser_test-parser_test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/parser_test.c' object='src/examples/parser_test-parser_test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/examples/parser_test-parser_test.o `test -f 'src/examples/parser_test.c' || echo '$(srcdir)/'`src/examples/parser_test.c + +src/examples/parser_test-parser_test.obj: src/examples/parser_test.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/examples/parser_test-parser_test.obj -MD -MP -MF src/examples/$(DEPDIR)/parser_test-parser_test.Tpo -c -o src/examples/parser_test-parser_test.obj `if test -f 'src/examples/parser_test.c'; then $(CYGPATH_W) 'src/examples/parser_test.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/parser_test.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/examples/$(DEPDIR)/parser_test-parser_test.Tpo src/examples/$(DEPDIR)/parser_test-parser_test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/examples/parser_test.c' object='src/examples/parser_test-parser_test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/examples/parser_test-parser_test.obj `if test -f 'src/examples/parser_test.c'; then $(CYGPATH_W) 'src/examples/parser_test.c'; else $(CYGPATH_W) '$(srcdir)/src/examples/parser_test.c'; fi` + +src/file/parser_test-keydbcfg-parser.o: src/file/keydbcfg-parser.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/file/parser_test-keydbcfg-parser.o -MD -MP -MF src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo -c -o src/file/parser_test-keydbcfg-parser.o `test -f 'src/file/keydbcfg-parser.c' || echo '$(srcdir)/'`src/file/keydbcfg-parser.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/file/keydbcfg-parser.c' object='src/file/parser_test-keydbcfg-parser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/file/parser_test-keydbcfg-parser.o `test -f 'src/file/keydbcfg-parser.c' || echo '$(srcdir)/'`src/file/keydbcfg-parser.c + +src/file/parser_test-keydbcfg-parser.obj: src/file/keydbcfg-parser.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/file/parser_test-keydbcfg-parser.obj -MD -MP -MF src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo -c -o src/file/parser_test-keydbcfg-parser.obj `if test -f 'src/file/keydbcfg-parser.c'; then $(CYGPATH_W) 'src/file/keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/src/file/keydbcfg-parser.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Tpo src/file/$(DEPDIR)/parser_test-keydbcfg-parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/file/keydbcfg-parser.c' object='src/file/parser_test-keydbcfg-parser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/file/parser_test-keydbcfg-parser.obj `if test -f 'src/file/keydbcfg-parser.c'; then $(CYGPATH_W) 'src/file/keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/src/file/keydbcfg-parser.c'; fi` + +src/file/parser_test-keydbcfg-lexer.o: src/file/keydbcfg-lexer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/file/parser_test-keydbcfg-lexer.o -MD -MP -MF src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo -c -o src/file/parser_test-keydbcfg-lexer.o `test -f 'src/file/keydbcfg-lexer.c' || echo '$(srcdir)/'`src/file/keydbcfg-lexer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/file/keydbcfg-lexer.c' object='src/file/parser_test-keydbcfg-lexer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/file/parser_test-keydbcfg-lexer.o `test -f 'src/file/keydbcfg-lexer.c' || echo '$(srcdir)/'`src/file/keydbcfg-lexer.c + +src/file/parser_test-keydbcfg-lexer.obj: src/file/keydbcfg-lexer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/file/parser_test-keydbcfg-lexer.obj -MD -MP -MF src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo -c -o src/file/parser_test-keydbcfg-lexer.obj `if test -f 'src/file/keydbcfg-lexer.c'; then $(CYGPATH_W) 'src/file/keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/src/file/keydbcfg-lexer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Tpo src/file/$(DEPDIR)/parser_test-keydbcfg-lexer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/file/keydbcfg-lexer.c' object='src/file/parser_test-keydbcfg-lexer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/file/parser_test-keydbcfg-lexer.obj `if test -f 'src/file/keydbcfg-lexer.c'; then $(CYGPATH_W) 'src/file/keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/src/file/keydbcfg-lexer.c'; fi` + +src/util/parser_test-strutl.o: src/util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/util/parser_test-strutl.o -MD -MP -MF src/util/$(DEPDIR)/parser_test-strutl.Tpo -c -o src/util/parser_test-strutl.o `test -f 'src/util/strutl.c' || echo '$(srcdir)/'`src/util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/util/$(DEPDIR)/parser_test-strutl.Tpo src/util/$(DEPDIR)/parser_test-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/util/strutl.c' object='src/util/parser_test-strutl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/util/parser_test-strutl.o `test -f 'src/util/strutl.c' || echo '$(srcdir)/'`src/util/strutl.c + +src/util/parser_test-strutl.obj: src/util/strutl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/util/parser_test-strutl.obj -MD -MP -MF src/util/$(DEPDIR)/parser_test-strutl.Tpo -c -o src/util/parser_test-strutl.obj `if test -f 'src/util/strutl.c'; then $(CYGPATH_W) 'src/util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/src/util/strutl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/util/$(DEPDIR)/parser_test-strutl.Tpo src/util/$(DEPDIR)/parser_test-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/util/strutl.c' object='src/util/parser_test-strutl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/util/parser_test-strutl.obj `if test -f 'src/util/strutl.c'; then $(CYGPATH_W) 'src/util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/src/util/strutl.c'; fi` + +src/util/parser_test-logging.o: src/util/logging.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/util/parser_test-logging.o -MD -MP -MF src/util/$(DEPDIR)/parser_test-logging.Tpo -c -o src/util/parser_test-logging.o `test -f 'src/util/logging.c' || echo '$(srcdir)/'`src/util/logging.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/util/$(DEPDIR)/parser_test-logging.Tpo src/util/$(DEPDIR)/parser_test-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/util/logging.c' object='src/util/parser_test-logging.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/util/parser_test-logging.o `test -f 'src/util/logging.c' || echo '$(srcdir)/'`src/util/logging.c + +src/util/parser_test-logging.obj: src/util/logging.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT src/util/parser_test-logging.obj -MD -MP -MF src/util/$(DEPDIR)/parser_test-logging.Tpo -c -o src/util/parser_test-logging.obj `if test -f 'src/util/logging.c'; then $(CYGPATH_W) 'src/util/logging.c'; else $(CYGPATH_W) '$(srcdir)/src/util/logging.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/util/$(DEPDIR)/parser_test-logging.Tpo src/util/$(DEPDIR)/parser_test-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/util/logging.c' object='src/util/parser_test-logging.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o src/util/parser_test-logging.obj `if test -f 'src/util/logging.c'; then $(CYGPATH_W) 'src/util/logging.c'; else $(CYGPATH_W) '$(srcdir)/src/util/logging.c'; fi` + +.l.c: + $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) + +.y.c: + $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) + mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + -rm -rf src/file/.libs src/file/_libs + -rm -rf src/libaacs/.libs src/libaacs/_libs + -rm -rf src/util/.libs src/util/_libs distclean-libtool: -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive +tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ @@ -475,7 +962,7 @@ $$unique; \ fi; \ fi -ctags: ctags-recursive +ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) @@ -494,7 +981,7 @@ clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive +cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ @@ -546,31 +1033,9 @@ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ @@ -702,19 +1167,26 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive -all-am: Makefile config.h -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) \ + config.h +install-binPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -728,106 +1200,132 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f src/examples/$(DEPDIR)/$(am__dirstamp) + -rm -f src/examples/$(am__dirstamp) + -rm -f src/file/$(DEPDIR)/$(am__dirstamp) + -rm -f src/file/$(am__dirstamp) + -rm -f src/libaacs/$(DEPDIR)/$(am__dirstamp) + -rm -f src/libaacs/$(am__dirstamp) + -rm -f src/util/$(DEPDIR)/$(am__dirstamp) + -rm -f src/util/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive + -rm -f src/file/keydbcfg-lexer.c + -rm -f src/file/keydbcfg-parser.c + -rm -f src/file/keydbcfg-parser.h + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstPROGRAMS mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf src/examples/$(DEPDIR) src/file/$(DEPDIR) src/libaacs/$(DEPDIR) src/util/$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: -install-data-am: +install-data-am: install-pkgconfigDATA install-pkgincludeHEADERS -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: -install-exec-am: +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf src/examples/$(DEPDIR) src/file/$(DEPDIR) src/libaacs/$(DEPDIR) src/util/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: -uninstall-am: - -.MAKE: $(am__recursive_targets) all install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-cscope clean-generic \ - clean-libtool cscope cscopelist-am ctags ctags-am dist \ - dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-pkgincludeHEADERS install-ps \ install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am + uninstall-am uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS clean-lex-yacc: - $(MAKE) -C src $@ + -rm -f $(BUILT_SOURCES) + +# do not distribute files that should be generated by lex/yacc locally +dist-hook: + (cd $(distdir) && rm -f $(BUILT_SOURCES)) # Tell versions 3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded.
View file
libaacs-0.7.1.tar.bz2/aclocal.m4 -> libaacs-0.8.0.tar.bz2/aclocal.m4
Changed
@@ -573,7 +573,8 @@ END AC_MSG_ERROR(Your 'rm' program is bad, sorry.) fi -fi) +fi +) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
View file
libaacs-0.7.1.tar.bz2/build-aux/config.guess -> libaacs-0.8.0.tar.bz2/build-aux/config.guess
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-06-10' +timestamp='2014-03-23' # 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 @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-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." @@ -149,7 +149,7 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac @@ -826,7 +826,7 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; - i*:MSYS*:*) + *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) @@ -969,10 +969,10 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + openrisc*:Linux:*:*) + echo or1k-unknown-linux-${LIBC} exit ;; - or32:Linux:*:*) + or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) @@ -1260,16 +1260,26 @@ if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if "$CC_FOR_BUILD" != 'no_compiler_found' ; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac + if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if "$CC_FOR_BUILD" != 'no_compiler_found' ; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # Avoid executing cc on OS X 10.9, as it ships with a stub + # that puts up a graphical alert prompting to install + # developer tools. Any system running Mac OS X 10.7 or + # later (Darwin 11 and later) is required to have a 64-bit + # processor. This is not true of the ARM version of Darwin + # that Apple uses in portable devices. + UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; @@ -1361,154 +1371,6 @@ exit ;; esac -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \(0-9*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if -x /usr/convex/getsysinfo -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - cat >&2 <<EOF $0: unable to guess system type
View file
libaacs-0.7.1.tar.bz2/build-aux/config.sub -> libaacs-0.8.0.tar.bz2/build-aux/config.sub
Changed
@@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. +# Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2013-08-10' +timestamp='2014-09-11' # 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 @@ -68,7 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2013 Free Software Foundation, Inc. +Copyright 1992-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." @@ -265,6 +265,7 @@ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ @@ -282,8 +283,10 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ @@ -295,11 +298,11 @@ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ + | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh1234 | sh24a | sh24aeb | sh23e | sh34eb | sheb | shbe | shle | sh1234le | sh3ele \ @@ -324,7 +327,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -381,6 +384,7 @@ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ @@ -400,8 +404,10 @@ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ @@ -413,6 +419,7 @@ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ + | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ @@ -822,6 +829,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1367,14 +1378,14 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1592,9 +1603,6 @@ mips*-*) os=-elf ;; - or1k-*) - os=-elf - ;; or32-*) os=-coff ;;
View file
libaacs-0.7.1.tar.bz2/build-aux/ltmain.sh -> libaacs-0.8.0.tar.bz2/build-aux/ltmain.sh
Changed
@@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.10ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" +VERSION="2.4.2 Debian-2.4.2-1.10ubuntu1" TIMESTAMP="" package_revision=1.3337
View file
libaacs-0.7.1.tar.bz2/configure -> libaacs-0.8.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.7.1. +# Generated by GNU Autoconf 2.69 for libaacs 0.8.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.7.1' -PACKAGE_STRING='libaacs 0.7.1' +PACKAGE_VERSION='0.8.0' +PACKAGE_STRING='libaacs 0.8.0' PACKAGE_BUGREPORT='http://www.videolan.org/developers/libaacs.html' PACKAGE_URL='' @@ -1346,7 +1346,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.7.1 to adapt to many kinds of systems. +\`configure' configures libaacs 0.8.0 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1417,7 +1417,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libaacs 0.7.1:";; + short | recursive ) echo "Configuration of libaacs 0.8.0:";; esac cat <<\_ACEOF @@ -1541,7 +1541,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libaacs configure 0.7.1 +libaacs configure 0.8.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2013,7 +2013,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.7.1, which was +It was created by libaacs $as_me 0.8.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2988,7 +2988,7 @@ # Define the identity of the package. PACKAGE='libaacs' - VERSION='0.7.1' + VERSION='0.8.0' cat >>confdefs.h <<_ACEOF @@ -3196,6 +3196,7 @@ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi + ac_config_headers="$ac_config_headers config.h" @@ -3222,6 +3223,46 @@ +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L" case "${host_os}" in @@ -13089,7 +13130,6 @@ fi -# use re-entrant version of gcrypt_error() from gpg-error # Check whether --with-gpg-error-prefix was given. @@ -13423,16 +13463,16 @@ AACS_VERSION_MAJOR=0 -AACS_VERSION_MINOR=7 +AACS_VERSION_MINOR=8 -AACS_VERSION_MICRO=1 +AACS_VERSION_MICRO=0 -LT_VERSION_INFO="4:1:4" +LT_VERSION_INFO="5:0:5" -ac_config_files="$ac_config_files Makefile src/Makefile src/libaacs.pc src/libaacs/aacs-version.h" +ac_config_files="$ac_config_files Makefile src/libaacs.pc src/libaacs/aacs-version.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13976,7 +14016,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libaacs $as_me 0.7.1, which was +This file was extended by libaacs $as_me 0.8.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14042,7 +14082,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/\\""\`\$/\\\\&/g'`" ac_cs_version="\\ -libaacs config.status 0.7.1 +libaacs config.status 0.8.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14454,7 +14494,6 @@ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/libaacs.pc") CONFIG_FILES="$CONFIG_FILES src/libaacs.pc" ;; "src/libaacs/aacs-version.h") CONFIG_FILES="$CONFIG_FILES src/libaacs/aacs-version.h" ;;
View file
libaacs-0.7.1.tar.bz2/configure.ac -> libaacs-0.8.0.tar.bz2/configure.ac
Changed
@@ -1,22 +1,22 @@ dnl library version number m4_define(aacs_major, 0) -m4_define(aacs_minor, 7) -m4_define(aacs_micro, 1) +m4_define(aacs_minor, 8) +m4_define(aacs_micro, 0) m4_define(aacs_version,aacs_major.aacs_minor.aacs_micro) -dnl library (.so) version -# +dnl shared library version (.so version) +dnl dnl update when making new release -# +dnl dnl - If there are no ABI changes, increase revision. dnl - If ABI is changed backwards-compatible way, increase current and age. Set revision to 0. dnl - If ABI is broken, increase current and set age and revision to 0. -# +dnl dnl Library file name will be libaacs.(current-age).age.revision -# -m4_define(lt_current, 4) -m4_define(lt_age, 4) -m4_define(lt_revision, 1) + +m4_define(lt_current, 5) +m4_define(lt_age, 5) +m4_define(lt_revision, 0) dnl initilization AC_INIT(libaacs, aacs_version, http://www.videolan.org/developers/libaacs.html) @@ -27,6 +27,9 @@ AC_CONFIG_HEADERS(config.h) AM_MAINTAINER_MODE +dnl Enable silent rules only when available (automake 1.11 or later). +m4_ifdef(AM_SILENT_RULES, AM_SILENT_RULES(yes)) + SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L" case "${host_os}" in @@ -137,7 +140,7 @@ fi AC_FUNC_STRERROR_R -# use re-entrant version of gcrypt_error() from gpg-error +dnl use re-entrant version of gcrypt_error() from gpg-error AC_ARG_WITH(gpg-error-prefix, AC_HELP_STRING(--with-gpg-error-prefix=PFX, @@ -196,5 +199,5 @@ dnl generate output files AC_SUBST(SET_FEATURES) -AC_CONFIG_FILES(Makefile src/Makefile src/libaacs.pc src/libaacs/aacs-version.h) +AC_CONFIG_FILES(Makefile src/libaacs.pc src/libaacs/aacs-version.h) AC_OUTPUT
View file
libaacs-0.7.1.tar.bz2/src/examples/aacs_info.c -> libaacs-0.8.0.tar.bz2/src/examples/aacs_info.c
Changed
@@ -17,12 +17,13 @@ * <http://www.gnu.org/licenses/>. */ -#include "libaacs/aacs.h" -#include "util/macro.h" /* MKINT_BE48 */ +#include <libaacs/aacs.h> #include <stdio.h> #include <stdlib.h> +#include "util/macro.h" /* MKINT_BE48 */ + static const char *_hex2str(const uint8_t *s, unsigned n) { static const char hex = "0123456789ABCDEF";
View file
libaacs-0.7.1.tar.bz2/src/examples/parser_test.c -> libaacs-0.8.0.tar.bz2/src/examples/parser_test.c
Changed
@@ -18,7 +18,7 @@ */ #include "file/keydbcfg.h" -#include "util/logging.h" +#include "util/strutl.h" #include <stdio.h> #include <stdlib.h> @@ -66,7 +66,7 @@ if (!cursor->entry.discid) break; - printf("DISCID: %s\n", print_hex(tmp, cursor->entry.discid, 20)); + printf("DISCID: %s\n", str_print_hex(tmp, cursor->entry.discid, 20)); 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); @@ -112,8 +112,8 @@ cert_list *cursor = list; while (cursor) { - printf(" Host private key: %s\n", print_hex(tmp, cursor->host_priv_key, 20)); - printf(" Host certificate: %s\n", print_hex(tmp, cursor->host_cert, 92)); + printf(" Host private key: %s\n", str_print_hex(tmp, cursor->host_priv_key, 20)); + printf(" Host certificate: %s\n", str_print_hex(tmp, cursor->host_cert, 92)); printf("\n"); cursor = cursor->next; @@ -133,7 +133,7 @@ dk_list *dkcursor = cfgfile->dkl; while (dkcursor) { - printf(" Device key: %s\n", print_hex(tmp, dkcursor->key, 16)); + printf(" Device key: %s\n", str_print_hex(tmp, dkcursor->key, 16)); printf(" Device node: %lu\n", dkcursor->node); dkcursor = dkcursor->next; @@ -146,7 +146,7 @@ pk_list *cursor = cfgfile->pkl; while (cursor) { - printf(" %s\n", print_hex(tmp, cursor->key, 16)); + printf(" %s\n", str_print_hex(tmp, cursor->key, 16)); cursor = cursor->next; }
View file
libaacs-0.7.1.tar.bz2/src/file/dirs.h -> libaacs-0.8.0.tar.bz2/src/file/dirs.h
Changed
@@ -20,19 +20,20 @@ #ifndef BLURAY_DIRS_H #define BLURAY_DIRS_H -#include <util/attributes.h> +#include "util/attributes.h" #ifdef _WIN32 -AACS_PRIVATE int win32_mkdir(const char *dir); +BD_PRIVATE int win32_mkdir(const char *dir); #endif /* * Config, cache and data dirs */ -AACS_PRIVATE const char *file_get_config_home(void); -AACS_PRIVATE const char *file_get_config_system(const char *dir); -AACS_PRIVATE const char *file_get_cache_home(void); -AACS_PRIVATE const char *file_get_data_home(void); +BD_PRIVATE const char *file_get_config_system(const char *dir); + +BD_PRIVATE char *file_get_config_home(void) BD_ATTR_MALLOC; +BD_PRIVATE char *file_get_cache_home(void) BD_ATTR_MALLOC; +BD_PRIVATE char *file_get_data_home(void) BD_ATTR_MALLOC; #endif
View file
libaacs-0.7.1.tar.bz2/src/file/dirs_darwin.c -> libaacs-0.8.0.tar.bz2/src/file/dirs_darwin.c
Changed
@@ -38,61 +38,37 @@ #define SYSTEM_CFG_DIR "/Library/Preferences" -const char *file_get_config_home(void) +char *file_get_config_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CFG_DIR); - } - - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CFG_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_data_home(void) +char *file_get_data_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_DATA_DIR); - } - - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_DATA_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_cache_home(void) +char *file_get_cache_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CACHE_DIR); - } - - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CACHE_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } const char *file_get_config_system(const char *dir)
View file
libaacs-0.7.1.tar.bz2/src/file/dirs_win32.c -> libaacs-0.8.0.tar.bz2/src/file/dirs_win32.c
Changed
@@ -42,33 +42,29 @@ return _wmkdir(wdir); } -const char *file_get_config_home(void) +char *file_get_config_home(void) { return file_get_data_home(); } -const char *file_get_data_home(void) +char *file_get_data_home(void) { - static char *appdir = NULL; wchar_t wdirMAX_PATH; - if (appdir) - return appdir; - /* Get the "Application Data" folder for the user */ if (S_OK == SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, wdir)) { int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); - appdir = malloc(len); + char *appdir = malloc(len); WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); return appdir; } - DEBUG(DBG_FILE, "Can't find user configuration directory !\n"); + BD_DEBUG(DBG_FILE, "Can't find user configuration directory !\n"); return NULL; } -const char *file_get_cache_home(void) +char *file_get_cache_home(void) { return file_get_data_home(); } @@ -92,7 +88,7 @@ WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); return appdir; } else { - DEBUG(DBG_FILE, "Can't find common configuration directory !\n"); + BD_DEBUG(DBG_FILE, "Can't find common configuration directory !\n"); return NULL; } } else {
View file
libaacs-0.7.1.tar.bz2/src/file/dirs_xdg.c -> libaacs-0.8.0.tar.bz2/src/file/dirs_xdg.c
Changed
@@ -41,76 +41,52 @@ #define SYSTEM_CFG_DIR "/etc/xdg" -const char *file_get_config_home(void) +char *file_get_config_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *xdg_home = getenv("XDG_CONFIG_HOME"); - if (xdg_home && *xdg_home) { - return dir = str_printf("%s", xdg_home); - } - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CFG_DIR); - } + const char *xdg_home = getenv("XDG_CONFIG_HOME"); + if (xdg_home && *xdg_home) { + return str_printf("%s", xdg_home); + } - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CFG_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_data_home(void) +char *file_get_data_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *xdg_home = getenv("XDG_DATA_HOME"); - if (xdg_home && *xdg_home) { - return dir = str_printf("%s", xdg_home); - } - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_DATA_DIR); - } + const char *xdg_home = getenv("XDG_DATA_HOME"); + if (xdg_home && *xdg_home) { + return str_printf("%s", xdg_home); + } - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_DATA_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } -const char *file_get_cache_home(void) +char *file_get_cache_home(void) { - static char *dir = NULL; - static int init_done = 0; - - if (!init_done) { - init_done = 1; - - const char *xdg_cache = getenv("XDG_CACHE_HOME"); - if (xdg_cache && *xdg_cache) { - return dir = str_printf("%s", xdg_cache); - } - - const char *user_home = getenv("HOME"); - if (user_home && *user_home) { - return dir = str_printf("%s/%s", user_home, USER_CACHE_DIR); - } + const char *xdg_cache = getenv("XDG_CACHE_HOME"); + if (xdg_cache && *xdg_cache) { + return str_printf("%s", xdg_cache); + } - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + const char *user_home = getenv("HOME"); + if (user_home && *user_home) { + return str_printf("%s/%s", user_home, USER_CACHE_DIR); } - return dir; + BD_DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + return NULL; } const char *file_get_config_system(const char *dir)
View file
libaacs-0.7.1.tar.bz2/src/file/file.h -> libaacs-0.8.0.tar.bz2/src/file/file.h
Changed
@@ -20,25 +20,31 @@ #ifndef FILE_H_ #define FILE_H_ -#include "filesystem.h" +#include "util/attributes.h" -#include <util/attributes.h> +#include "filesystem.h" #include <stdint.h> -//#ifdef __LINUX__ -#define DIR_SEP "/" -//#endif +#ifdef _WIN32 +# define DIR_SEP "\\" +# define DIR_SEP_CHAR '\\' +#else +# define DIR_SEP "/" +# define DIR_SEP_CHAR '/' +#endif + +/* + * file access + */ #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_eof(X) X->eof(X) #define file_read(X,Y,Z) X->read(X,Y,Z) -#define file_write(X,Y,Z) X->write(X,Y,Z) -AACS_PRIVATE extern AACS_FILE_H *(*file_open)(const char* filename, const char *mode); +BD_PRIVATE extern AACS_FILE_H *(*file_open)(const char* filename, const char *mode); #endif /* FILE_H_ */
View file
libaacs-0.7.1.tar.bz2/src/file/file_posix.c -> libaacs-0.8.0.tar.bz2/src/file/file_posix.c
Changed
@@ -38,7 +38,7 @@ if (file) { fclose((FILE *)file->internal); - DEBUG(DBG_FILE, "Closed LINUX file (%p)\n", (void*)file); + BD_DEBUG(DBG_FILE, "Closed LINUX file (%p)\n", (void*)file); X_FREE(file); } @@ -62,33 +62,21 @@ #endif } -static int file_eof_linux(AACS_FILE_H *file) -{ - return feof((FILE *)file->internal); -} - static int64_t file_read_linux(AACS_FILE_H *file, uint8_t *buf, int64_t size) { return fread(buf, 1, size, (FILE *)file->internal); } -static int64_t file_write_linux(AACS_FILE_H *file, const uint8_t *buf, int64_t size) -{ - return fwrite(buf, 1, size, (FILE *)file->internal); -} - static AACS_FILE_H *file_open_linux(const char* filename, const char *mode) { FILE *fp = NULL; - AACS_FILE_H *file = malloc(sizeof(AACS_FILE_H)); + AACS_FILE_H *file = calloc(1, sizeof(AACS_FILE_H)); - DEBUG(DBG_FILE, "Opening LINUX file %s... (%p)\n", filename, (void*)file); + 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->write = file_write_linux; file->tell = file_tell_linux; - file->eof = file_eof_linux; if ((fp = fopen(filename, mode))) { file->internal = fp; @@ -96,7 +84,7 @@ return file; } - DEBUG(DBG_FILE, "Error opening file %s ! (%p)\n", filename, (void*)file); + BD_DEBUG(DBG_FILE, "Error opening file %s ! (%p)\n", filename, (void*)file); X_FREE(file); @@ -107,7 +95,7 @@ AACS_FILE_OPEN aacs_register_file(AACS_FILE_OPEN p) { - AACS_FILE_OPEN old = file_open; - file_open = p; - return old; + AACS_FILE_OPEN old = file_open; + file_open = p; + return old; }
View file
libaacs-0.7.1.tar.bz2/src/file/filesystem.h -> libaacs-0.8.0.tar.bz2/src/file/filesystem.h
Changed
@@ -45,5 +45,28 @@ */ AACS_FILE_OPEN aacs_register_file(AACS_FILE_OPEN p); +/** + * + * Function that will be used to open a file + * + * NOTE: file name is relative to disc root directory ! + * + * @param handle application-specific handle + * @param filename file to open + * @return pointer to AACS_FILE_H, NULL if error + */ +typedef AACS_FILE_H* (*AACS_FILE_OPEN2)(void *handle, const char* filename); + +/** + * + * Register function pointer that will be used to open a file + * + * @param aacs aacs instance + * @param handle handle that will be passed to file open function + * @param p function pointer + */ +struct aacs; +void aacs_set_fopen(struct aacs *aacs, void *handle, AACS_FILE_OPEN2 p); + #endif /* AACS_FILESYSTEM_H_ */
View file
libaacs-0.7.1.tar.bz2/src/file/keydbcfg.c -> libaacs-0.8.0.tar.bz2/src/file/keydbcfg.c
Changed
@@ -33,6 +33,11 @@ #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 @@ -52,23 +57,26 @@ char *dir = str_printf("%s", path); char *end = dir; - while (*end == '/') +#ifdef _WIN32 + end += 2; /* skip drive */ +#endif + while (*end == DIR_SEP_CHAR) end++; - while ((end = strchr(end, '/'))) { + while ((end = strchr(end, DIR_SEP_CHAR))) { *end = 0; if (stat(dir, &s) != 0 || !S_ISDIR(s.st_mode)) { - DEBUG(DBG_FILE, "Creating directory %s\n", dir); + BD_DEBUG(DBG_FILE, "Creating directory %s\n", dir); if (mkdir(dir, S_IRWXU|S_IRWXG|S_IRWXO) == -1) { - DEBUG(DBG_FILE | DBG_CRIT, "Error creating directory %s\n", dir); + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error creating directory %s\n", dir); result = 0; break; } } - *end++ = '/'; + *end++ = DIR_SEP_CHAR; } X_FREE(dir); @@ -86,7 +94,7 @@ fseek(fp, 0, SEEK_SET); if (file_size < MIN_FILE_SIZE || file_size > MAX_FILE_SIZE) { - DEBUG(DBG_FILE, "Invalid file size\n"); + BD_DEBUG(DBG_FILE, "Invalid file size\n"); return NULL; } @@ -94,7 +102,7 @@ read_size = fread(data, 1, file_size, fp); if (read_size != file_size) { - DEBUG(DBG_FILE, "Error reading file\n"); + BD_DEBUG(DBG_FILE, "Error reading file\n"); X_FREE(data); return NULL; } @@ -106,13 +114,16 @@ static char *_config_file_user(const char *file_name) { - const char *cfg_dir = file_get_config_home(); + char *cfg_dir = file_get_config_home(); + char *result; if (!cfg_dir) { return NULL; } - return str_printf("%s/%s/%s", cfg_dir, CFG_DIR, file_name); + result = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s", cfg_dir, CFG_DIR, file_name); + X_FREE(cfg_dir); + return result; } static FILE *_open_cfg_file_user(const char *file_name, char **path, const char *mode) @@ -132,7 +143,7 @@ FILE *fp = fopen(cfg_file, mode); - DEBUG(DBG_FILE, fp ? "Opened %s for %s\n" : "%s not found\n", cfg_file, mode); + BD_DEBUG(DBG_FILE, fp ? "Opened %s for %s\n" : "%s not found\n", cfg_file, mode); if (fp && path) { *path = cfg_file; @@ -149,11 +160,11 @@ while (NULL != (dir = file_get_config_system(dir))) { - char *cfg_file = str_printf("%s/%s/%s", dir, CFG_DIR, file_name); + char *cfg_file = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s", dir, CFG_DIR, file_name); FILE *fp = fopen(cfg_file, "r"); if (fp) { - DEBUG(DBG_FILE, "Reading %s\n", cfg_file); + BD_DEBUG(DBG_FILE, "Reading %s\n", cfg_file); if (path) { *path = cfg_file; @@ -164,7 +175,7 @@ return fp; } - DEBUG(DBG_FILE, "%s not found\n", cfg_file); + BD_DEBUG(DBG_FILE, "%s not found\n", cfg_file); X_FREE(cfg_file); } @@ -195,14 +206,14 @@ char *str = str_get_hex_string(p, 2*16); if (str) { - DEBUG(DBG_FILE, "Found processing key %s\n", str); + 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)) { - DEBUG(DBG_FILE, "Skipping duplicate processing key %s\n", str); + BD_DEBUG(DBG_FILE, "Skipping duplicate processing key %s\n", str); X_FREE(e); } else { e->next = cf->pkl; @@ -252,17 +263,17 @@ X_FREE(data); if (!host_priv_key || !host_cert) { - DEBUG(DBG_FILE, "Invalid file\n"); + BD_DEBUG(DBG_FILE, "Invalid file\n"); } else { - DEBUG(DBG_FILE, "Found certificate: %s %s\n", host_priv_key, host_cert); + BD_DEBUG(DBG_FILE, "Found certificate: %s %s\n", host_priv_key, host_cert); cert_list *e = calloc(1, sizeof(cert_list)); hexstring_to_hex_array(e->host_priv_key, 20, host_priv_key); hexstring_to_hex_array(e->host_cert, 92, host_cert); if (_is_duplicate_cert(cf->host_cert_list, e)) { - DEBUG(DBG_FILE, "Skipping duplicate certificate entry %s %s\n", host_priv_key, host_cert); + BD_DEBUG(DBG_FILE, "Skipping duplicate certificate entry %s %s\n", host_priv_key, host_cert); X_FREE(e); } else { e->next = cf->host_cert_list; @@ -333,7 +344,8 @@ static char *_keycache_file(const char *type, const uint8_t *disc_id) { - const char *cache_dir = file_get_cache_home(); + char *cache_dir = file_get_cache_home(); + char *result; char disc_id_str41; if (!cache_dir) { @@ -342,7 +354,9 @@ hex_array_to_hexstring(disc_id_str, disc_id, 20); - return str_printf("%s/%s/%s/%s", cache_dir, CFG_DIR, type, disc_id_str); + result = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s"DIR_SEP"%s", cache_dir, CFG_DIR, type, disc_id_str); + X_FREE(cache_dir); + return result; } int keycache_save(const char *type, const uint8_t *disc_id, const uint8_t *key, unsigned int len) @@ -359,11 +373,11 @@ hex_array_to_hexstring(key_str, key, len); if (fwrite(key_str, 1, len*2, fp) == len*2) { - DEBUG(DBG_FILE, "Wrote %s to %s\n", type, file); + BD_DEBUG(DBG_FILE, "Wrote %s to %s\n", type, file); result = 1; } else { - DEBUG(DBG_FILE, "Error writing to %s\n", file); + BD_DEBUG(DBG_FILE, "Error writing to %s\n", file); } free(key_str); @@ -389,17 +403,17 @@ if (fp) { char *key_str = malloc(len*2); - DEBUG(DBG_FILE, "Reading %s\n", file); + BD_DEBUG(DBG_FILE, "Reading %s\n", file); if (fread(key_str, 1, len*2, fp) == len*2) { result = hexstring_to_hex_array(key, len, key_str); if (!result) { - DEBUG(DBG_FILE, "Error converting %s\n", file); + BD_DEBUG(DBG_FILE, "Error converting %s\n", file); } } else { - DEBUG(DBG_FILE, "Error reading from %s\n", file); + BD_DEBUG(DBG_FILE, "Error reading from %s\n", file); } free(key_str); @@ -407,7 +421,7 @@ fclose(fp); } else { - DEBUG(DBG_FILE, "%s not found\n", file); + BD_DEBUG(DBG_FILE, "%s not found\n", file); } X_FREE(file); @@ -418,13 +432,16 @@ static char *_cache_file(const char *name) { - const char *cache_dir = file_get_cache_home(); + char *cache_dir = file_get_cache_home(); + char *result; if (!cache_dir) { return NULL; } - return str_printf("%s/%s/%s", cache_dir, CFG_DIR, name); + result = str_printf("%s"DIR_SEP"%s"DIR_SEP"%s", cache_dir, CFG_DIR, name); + X_FREE(cache_dir); + return result; } int cache_save(const char *name, uint32_t version, const void *data, uint32_t len) @@ -440,11 +457,11 @@ if (fwrite(&version, 1, 4, fp) == 4 && fwrite(&len, 1, 4, fp) == 4 && fwrite(data, 1, len, fp) == len) { - DEBUG(DBG_FILE, "Wrote %d bytes to %s\n", len + 8, file); + BD_DEBUG(DBG_FILE, "Wrote %d bytes to %s\n", len + 8, file); result = 1; } else { - DEBUG(DBG_FILE, "Error writing to %s\n", file); + BD_DEBUG(DBG_FILE, "Error writing to %s\n", file); } fclose(fp); @@ -471,23 +488,23 @@ FILE *fp = fopen(file, "r"); if (fp) { - DEBUG(DBG_FILE, "Reading %s\n", file); + BD_DEBUG(DBG_FILE, "Reading %s\n", file); if (fread(version, 1, 4, fp) == 4 && (!len || fread(len, 1, 4, fp) == 4) && (!buf || fread(buf, 1, *len, fp) == *len)) { - DEBUG(DBG_FILE, "Read %d bytes from %s, version %d\n", 4 + (len ? 4 : 0) + (buf ? *len : 0), file, *version); + BD_DEBUG(DBG_FILE, "Read %d bytes from %s, version %d\n", 4 + (len ? 4 : 0) + (buf ? *len : 0), file, *version); result = 1; } else { - DEBUG(DBG_FILE, "Error reading from %s\n", file); + BD_DEBUG(DBG_FILE, "Error reading from %s\n", file); } fclose(fp); } else { - DEBUG(DBG_FILE, "%s not found\n", file); + BD_DEBUG(DBG_FILE, "%s not found\n", file); } X_FREE(file); @@ -501,7 +518,7 @@ char *file = _cache_file(name); int result = !remove(file); if (!result) { - DEBUG(DBG_FILE, "Error removing %s\n", file); + BD_DEBUG(DBG_FILE, "Error removing %s\n", file); } X_FREE(file); return result; @@ -520,7 +537,7 @@ cache_data = malloc(cache_len); if (cache_get(type, &cache_version, &cache_len, cache_data)) { - DEBUG(DBG_AACS, "Using cached %s. Version: %d\n", type, cache_version); + BD_DEBUG(DBG_AACS, "Using cached %s. Version: %d\n", type, cache_version); *len = cache_len; return cache_data; } @@ -536,7 +553,7 @@ /* cached data is older, update cache */ if (cache_version < version) { cache_save(type, version, data, *len); - DEBUG(DBG_AACS, "Updated cached %s. Version: %d\n", type, version); + BD_DEBUG(DBG_AACS, "Updated cached %s. Version: %d\n", type, version); } } @@ -552,11 +569,11 @@ if (fp) { if (fwrite(&len, 1, 4, fp) == 4 && fwrite(data, 1, len, fp) == len) { - DEBUG(DBG_FILE, "Wrote %d bytes to %s\n", len + 4, path); + BD_DEBUG(DBG_FILE, "Wrote %d bytes to %s\n", len + 4, path); result = 1; } else { - DEBUG(DBG_FILE | DBG_CRIT, "Error writing to %s\n", path); + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error writing to %s\n", path); } fclose(fp); @@ -577,16 +594,16 @@ *len = 0; if (fp) { - DEBUG(DBG_FILE, "Reading %s\n", path); + BD_DEBUG(DBG_FILE, "Reading %s\n", path); if (fread(len, 1, 4, fp) == 4 && (size <= *len) && (!buf || fread(buf, 1, *len, fp) == *len)) { - DEBUG(DBG_FILE, "Read %d bytes from %s\n", 4 + (buf ? *len : 0), path); + BD_DEBUG(DBG_FILE, "Read %d bytes from %s\n", 4 + (buf ? *len : 0), path); result = 1; } else { - DEBUG(DBG_FILE | DBG_CRIT, "Error reading from %s\n", path); + BD_DEBUG(DBG_FILE | DBG_CRIT, "Error reading from %s\n", path); } fclose(fp); @@ -611,7 +628,7 @@ } if (fp) { - DEBUG(DBG_FILE, "found config file: %s\n", cfg_file); + BD_DEBUG(DBG_FILE, "found config file: %s\n", cfg_file); fclose(fp); } @@ -707,7 +724,7 @@ config_ok = _parse_embedded(cf) || config_ok; if (!config_ok) { - DEBUG(DBG_AACS | DBG_CRIT, "No valid AACS configuration files found\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "No valid AACS configuration files found\n"); keydbcfg_config_file_close(cf); return NULL; }
View file
libaacs-0.7.1.tar.bz2/src/file/keydbcfg.h -> libaacs-0.8.0.tar.bz2/src/file/keydbcfg.h
Changed
@@ -20,7 +20,7 @@ #ifndef KEYDBCFG_H #define KEYDBCFG_H -#include <util/attributes.h> +#include "util/attributes.h" #include <stdint.h> @@ -114,26 +114,26 @@ }; /* Functions used throughout the parser */ -AACS_PRIVATE int keydbcfg_parse_config(config_file *cfgfile, const char *path); -AACS_PRIVATE config_file *keydbcfg_new_config_file(void); -AACS_PRIVATE int keydbcfg_config_file_close(config_file *cfgfile); +BD_PRIVATE int keydbcfg_parse_config(config_file *cfgfile, const char *path); +BD_PRIVATE config_file *keydbcfg_new_config_file(void); +BD_PRIVATE int keydbcfg_config_file_close(config_file *cfgfile); /* */ -AACS_PRIVATE config_file *keydbcfg_config_load(const char *configfile_path); +BD_PRIVATE config_file *keydbcfg_config_load(const char *configfile_path); -AACS_PRIVATE int keycache_save(const char *type, const uint8_t *disc_id, +BD_PRIVATE int keycache_save(const char *type, const uint8_t *disc_id, const uint8_t *key, unsigned int len); -AACS_PRIVATE int keycache_find(const char *type, const uint8_t *disc_id, +BD_PRIVATE int keycache_find(const char *type, const uint8_t *disc_id, uint8_t *key, unsigned int len); -AACS_PRIVATE int cache_get(const char *name, uint32_t *version, uint32_t *len, void *buf); /* use buf=NULL to get version and size */ -AACS_PRIVATE int cache_save(const char *name, uint32_t version, const void *data, uint32_t len); -AACS_PRIVATE int cache_remove(const char *name); +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_save(const char *name, uint32_t version, const void *data, uint32_t len); +BD_PRIVATE int cache_remove(const char *name); -AACS_PRIVATE void *cache_get_or_update(const char *type, const void *data, uint32_t *len, uint32_t version); +BD_PRIVATE void *cache_get_or_update(const char *type, const void *data, uint32_t *len, uint32_t version); -AACS_PRIVATE int config_get(const char *name, uint32_t *len, void *buf); /* use buf=NULL to get size */ -AACS_PRIVATE int config_save(const char *name, const void *data, uint32_t len); +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); #endif
View file
libaacs-0.8.0.tar.bz2/src/file/mmc_device.h
Added
@@ -0,0 +1,36 @@ +/* + * This file is part of libaacs + * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2010-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 MMC_DEVICE_H_ +#define MMC_DEVICE_H_ + +#include "util/attributes.h" + +#include <stdint.h> +#include <stddef.h> + +typedef struct mmcdev MMCDEV; + +BD_PRIVATE MMCDEV *device_open(const char *path); +BD_PRIVATE void device_close(MMCDEV **mmc); + +BD_PRIVATE int device_send_cmd(MMCDEV *dev, const uint8_t *cmd, uint8_t *buf, size_t tx, size_t rx); + +#endif /* MMC_DEVICE_H_ */
View file
libaacs-0.8.0.tar.bz2/src/file/mmc_device_darwin.c
Added
@@ -0,0 +1,432 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * This file is part of libaacs + * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2010-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 "mmc_device.h" + +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include <stdlib.h> +#include <string.h> + +#include <Carbon/Carbon.h> + +#include <IOKit/IOKitLib.h> +#include <IOKit/IOCFPlugIn.h> + +#include <DiskArbitration/DiskArbitration.h> + +/* need to undefine VERSION as one of the members of struct + SCSICmd_INQUIRY_StandardData is named VERSION (see + IOKit/scsi/SCSICmds_INQUIRY_Definitions.h) */ +#undef VERSION +#include <IOKit/scsi/SCSITaskLib.h> + +#include <IOKit/storage/IOBDMediaBSDClient.h> + +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif + +#ifdef HAVE_SYS_MOUNT_H +#include <sys/mount.h> +#endif + +#ifdef HAVE_LIBGEN_H +#include <libgen.h> +#endif + +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif + + +/* + * + */ + +struct mmcdev { + MMCDeviceInterface **mmcInterface; + SCSITaskDeviceInterface **taskInterface; + + /* device short name (ie disk1) */ + char bsd_name128; + + /* for mounting/unmounting the disc */ + DADiskRef disk; + DASessionRef session; + bool is_mounted; +}; + +int device_send_cmd(MMCDEV *mmc, const uint8_t *cmd, uint8_t *buf, size_t tx, size_t rx) +{ + SCSITaskInterface **task = NULL; + SCSI_Sense_Data sense; + SCSITaskStatus status; + SCSITaskSGElement iov; + UInt8 direction; + UInt64 sent; + int rc; + + if (NULL == mmc->taskInterface) { + return 0; + } + + do { + task = (*mmc->taskInterface)->CreateSCSITask (mmc->taskInterface); + if (NULL == task) { + BD_DEBUG(DBG_MMC, "Could not create SCSI Task\n"); + break; + } + + iov.address = (uintptr_t) buf; + iov.length = tx ? tx : rx; + + if (buf) { + direction = tx ? kSCSIDataTransfer_FromInitiatorToTarget : + kSCSIDataTransfer_FromTargetToInitiator; + } else { + direction = kSCSIDataTransfer_NoDataTransfer; + } + + rc = (*task)->SetCommandDescriptorBlock (task, cmd, 16); + if (kIOReturnSuccess != rc) { + BD_DEBUG(DBG_MMC, "Error setting SCSI command\n"); + break; + } + + rc = (*task)->SetScatterGatherEntries (task, &iov, 1, iov.length, direction); + if (kIOReturnSuccess != rc) { + BD_DEBUG(DBG_MMC, "Error setting SCSI scatter gather entries\n"); + break; + } + + rc = (*task)->SetTimeoutDuration (task, 5000000); + if (kIOReturnSuccess != rc) { + BD_DEBUG(DBG_MMC, "Error setting SCSI command timeout\n"); + break; + } + + memset (&sense, 0, sizeof (sense)); + + rc = (*task)->ExecuteTaskSync (task, &sense, &status, &sent); + + char str512; + BD_DEBUG(DBG_MMC, "Send SCSI MMC cmd %s:\n", str_print_hex(str, cmd, 16)); + if (tx) { + BD_DEBUG(DBG_MMC, " Buffer: %s ->\n", str_print_hex(str, buf, tx>255?255:tx)); + } else { + BD_DEBUG(DBG_MMC, " Buffer: %s <-\n", str_print_hex(str, buf, rx>255?255:rx)); + } + + if (kIOReturnSuccess != rc || status != 0) { + BD_DEBUG(DBG_MMC, " Send failed!\n"); + break; + } else { + BD_DEBUG(DBG_MMC, " Send succeeded! sent = %lld status = %u. response = %x\n", + (unsigned long long) sent, status, sense.VALID_RESPONSE_CODE); + } + + (*task)->Release (task); + + return 1; + } while (0); + + if (task) { + (*task)->Release (task); + } + + return 0; +} + +static int get_mounted_device_from_path (MMCDEV *mmc, const char *path) { + struct statfs stat_info; + int rc; + + rc = statfs (path, &stat_info); + if (0 != rc) { + return rc; + } + + strncpy (mmc->bsd_name, basename (stat_info.f_mntfromname), sizeof (mmc->bsd_name)); + + return 0; +} + +static void iokit_unmount_complete (DADiskRef disk, DADissenterRef dissenter, + void *context) { + (void)disk; /* suppress warning */ + + if (dissenter) { + BD_DEBUG(DBG_MMC, "Could not unmount the disc\n"); + } else { + BD_DEBUG(DBG_MMC, "Disc unmounted\n"); + ((MMCDEV *)context)->is_mounted = 0; + } +} + +static void iokit_mount_complete (DADiskRef disk, DADissenterRef dissenter, + void *context) { + (void) disk; /* suppress warning */ + (void) dissenter; /* suppress warning */ + + /* the disc mounts despite whether there is a dessenter */ + BD_DEBUG(DBG_MMC, "Disc mounted\n"); + ((MMCDEV *)context)->is_mounted = 1; +} + +static int iokit_unmount (MMCDEV *mmc) { + if (0 == mmc->is_mounted) { + return 0; /* nothing to do */ + } + + BD_DEBUG(DBG_MMC, "Unmounting disk\n"); + + mmc->session = DASessionCreate (kCFAllocatorDefault); + if (NULL == mmc->session) { + BD_DEBUG(DBG_MMC, "Could not create a disc arbitration session\n"); + return -1; + } + + mmc->disk = DADiskCreateFromBSDName (kCFAllocatorDefault, mmc->session, mmc->bsd_name); + if (NULL == mmc->disk) { + BD_DEBUG(DBG_MMC, "Could not create a disc arbitration disc for the device\n"); + CFRelease (mmc->session); + mmc->session = NULL; + return -1; + } + + DAApprovalSessionScheduleWithRunLoop (mmc->session, CFRunLoopGetCurrent (), + kCFRunLoopDefaultMode); + + DADiskUnmount (mmc->disk, kDADiskUnmountOptionForce, iokit_unmount_complete, mmc); + + CFRunLoopRunInMode (kCFRunLoopDefaultMode, 10, true); + + return mmc->is_mounted ? -1 : 0; +} + +static int iokit_mount (MMCDEV *mmc) { + if (0 == mmc->is_mounted) { + if (mmc->disk && mmc->session) { + DADiskMount (mmc->disk, NULL, kDADiskMountOptionDefault, iokit_mount_complete, mmc); + + CFRunLoopRunInMode (kCFRunLoopDefaultMode, 10, true); + + DAApprovalSessionUnscheduleFromRunLoop (mmc->session, CFRunLoopGetCurrent (), + kCFRunLoopDefaultMode); + } + + if (mmc->disk) { + CFRelease (mmc->disk); + mmc->disk = NULL; + } + + if (mmc->session) { + CFRelease (mmc->session); + mmc->session = NULL; + } + } + + return mmc->is_mounted ? 0 : -1; +} + +static int iokit_find_service_matching (MMCDEV *mmc, io_service_t *servp) { + CFMutableDictionaryRef matchingDict = IOServiceMatching("IOBDServices"); + io_iterator_t deviceIterator; + io_service_t service; + int rc; + + assert (NULL != servp); + + *servp = 0; + + if (!matchingDict) { + BD_DEBUG(DBG_MMC, "Could not create a matching dictionary for IOBDServices\n"); + return -1; + } + + /* this call consumes the reference to the matchingDict. we do not need to release it */ + rc = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &deviceIterator); + if (kIOReturnSuccess != rc) { + BD_DEBUG(DBG_MMC, "Could not create device iterator\n"); + return -1; + } + + while (0 != (service = IOIteratorNext (deviceIterator))) { + CFStringRef data; + char name128 = ""; + + data = IORegistryEntrySearchCFProperty (service, kIOServicePlane, CFSTR("BSD Name"), + kCFAllocatorDefault, kIORegistryIterateRecursively); + + if (NULL != data) { + rc = CFStringGetCString (data, name, sizeof (name), kCFStringEncodingASCII); + CFRelease (data); + if (0 == strcmp (name, mmc->bsd_name)) { + break; + } + } + + (void) IOObjectRelease (service); + } + + IOObjectRelease (deviceIterator); + + *servp = service; + + return (service) ? 0 : -1; +} + +static int iokit_find_interfaces (MMCDEV *mmc, io_service_t service) { + IOCFPlugInInterface **plugInInterface = NULL; + SInt32 score; + int rc; + + rc = IOCreatePlugInInterfaceForService (service, kIOMMCDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, &plugInInterface, + &score); + if (kIOReturnSuccess != rc || NULL == plugInInterface) { + return -1; + } + + BD_DEBUG(DBG_MMC, "Getting MMC interface\n"); + + rc = (*plugInInterface)->QueryInterface(plugInInterface, + CFUUIDGetUUIDBytes(kIOMMCDeviceInterfaceID), + (LPVOID)&mmc->mmcInterface); + /* call release instead of IODestroyPlugInInterface to avoid stopping IOBDServices */ + (*plugInInterface)->Release(plugInInterface); + if (kIOReturnSuccess != rc || NULL == mmc->mmcInterface) { + BD_DEBUG(DBG_MMC, "Could not get multimedia commands (MMC) interface\n"); + return -1; + } + + BD_DEBUG(DBG_MMC, "Have an MMC interface (%p). Getting a SCSI task interface...\n", (void*)mmc->mmcInterface); + + mmc->taskInterface = (*mmc->mmcInterface)->GetSCSITaskDeviceInterface (mmc->mmcInterface); + if (NULL == mmc->taskInterface) { + BD_DEBUG(DBG_MMC, "Could not get SCSI task device interface\n"); + return -1; + } + + return 0; +} + +static int mmc_open_iokit (const char *path, MMCDEV *mmc) { + io_service_t service; + int rc; + + mmc->mmcInterface = NULL; + mmc->taskInterface = NULL; + mmc->disk = NULL; + mmc->session = NULL; + mmc->is_mounted = true; + + /* get the bsd name associated with this mount */ + rc = get_mounted_device_from_path (mmc, path); + if (0 != rc) { + BD_DEBUG(DBG_MMC, "Could not locate mounted device associated with %s\n", path); + return rc; + } + + /* find a matching io service (IOBDServices) */ + rc = iokit_find_service_matching (mmc, &service); + if (0 != rc) { + BD_DEBUG(DBG_MMC, "Could not find matching IOBDServices mounted @ %s\n", path); + return rc; + } + + /* find mmc and scsi task interfaces */ + rc = iokit_find_interfaces (mmc, service); + + /* done with the ioservice. release it */ + (void) IOObjectRelease (service); + + if (0 != rc) { + return rc; + } + + /* unmount the disk so exclusive access can be obtained (this is required + to use the scsi task interface) */ + rc = iokit_unmount (mmc); + if (0 != rc) { + return rc; + } + + /* finally, obtain exclusive access */ + rc = (*mmc->taskInterface)->ObtainExclusiveAccess (mmc->taskInterface); + if (kIOReturnSuccess != rc) { + BD_DEBUG(DBG_MMC, "Failed to obtain exclusive access. rc = %x\n", rc); + return -1; + } + + BD_DEBUG(DBG_MMC, "MMC Open complete\n"); + + return 0; +} + +MMCDEV *device_open(const char *path) +{ + MMCDEV *dev; + int rc; + + dev = calloc(1, sizeof(MMCDEV)); + + rc = mmc_open_iokit (path, dev); + if (0 != rc) { + device_close (dev); + return NULL; + } + + return dev; +} + +void device_close(MMCDEV **pp) +{ + if (pp && *pp) { + MMCDEV *mmc = *pp; + + if (mmc->taskInterface) { + (*mmc->taskInterface)->ReleaseExclusiveAccess (mmc->taskInterface); + (*mmc->taskInterface)->Release (mmc->taskInterface); + mmc->taskInterface = NULL; + } + + if (mmc->mmcInterface) { + (*mmc->mmcInterface)->Release (mmc->mmcInterface); + mmc->mmcInterface = NULL; + } + + (void) iokit_mount (mmc); + + X_FREE(*pp); + } +}
View file
libaacs-0.8.0.tar.bz2/src/file/mmc_device_linux.c
Added
@@ -0,0 +1,203 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * This file is part of libaacs + * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2010-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 "mmc_device.h" + +#include "path.h" + +#include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" + +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/stat.h> + +#ifdef HAVE_MNTENT_H +#include <mntent.h> +#endif + +#ifdef HAVE_LINUX_CDROM_H +#include <errno.h> +#include <sys/ioctl.h> +#include <linux/cdrom.h> +#endif + + +/* + * + */ + +struct mmcdev { + int fd; +}; + +int device_send_cmd(MMCDEV *dev, const uint8_t *cmd, uint8_t *buf, size_t tx, size_t rx) +{ +#if defined(HAVE_LINUX_CDROM_H) + struct cdrom_generic_command cgc; + struct request_sense sense; + char str512; + int result; + + memset(&cgc, 0, sizeof(cgc)); + memcpy(cgc.cmd, cmd, CDROM_PACKET_SIZE); + cgc.sense = &sense; + cgc.timeout = 5000; + + if (buf) { + if (tx) { + cgc.data_direction = CGC_DATA_WRITE; + cgc.buflen = tx; + cgc.buffer = buf; + } else if (rx) { + cgc.data_direction = CGC_DATA_READ; + cgc.buflen = rx; + cgc.buffer = buf; + } + } else { + cgc.data_direction = CGC_DATA_NONE; + cgc.buflen = 0; + cgc.buffer = NULL; + } + + result = ioctl(dev->fd, CDROM_SEND_PACKET, &cgc); + + BD_DEBUG(DBG_MMC, "Send LINUX MMC cmd %s:\n", str_print_hex(str, cmd, 16)); + if (tx) { + BD_DEBUG(DBG_MMC, " Buffer: %s ->\n", str_print_hex(str, buf, tx>255?255:tx)); + } else { + BD_DEBUG(DBG_MMC, " Buffer: %s <-\n", str_print_hex(str, buf, rx>255?255:rx)); + } + + if (result >= 0) { + BD_DEBUG(DBG_MMC, " Send succeeded! %d\n", result); + return 1; + } + + BD_DEBUG(DBG_MMC, " Send failed! %d %s\n", result, strerror(errno)); +#else +#warning no MMC drive support + BD_DEBUG(DBG_MMC | DBG_CRIT, "No MMC drive support\n"); +#endif + + return 0; +} + +MMCDEV *device_open(const char *path) +{ + char resolved_pathAACS_PATH_MAX; + size_t path_len; + struct stat st; + int fd = -1; + MMCDEV *dev = NULL; + FILE *proc_mounts; + + /* resolve path */ + if (!aacs_resolve_path(path, resolved_path)) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "Failed resolving path %s\n", path); + return NULL; + } + + /* strip trailing '/'s */ + path_len = strlen(resolved_path); + while (path_len > 0 && resolved_path--path_len == '/') { + resolved_pathpath_len = '\0'; + } + + if (stat(resolved_path, &st)) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "stat(%s) failed\n", resolved_path); + 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); + fd = open(resolved_path, O_RDONLY | O_NONBLOCK); + if (fd < 0) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "Error opening block device %s\n", resolved_path); + } + } else { +#if !defined(HAVE_MNTENT_H) + BD_DEBUG(DBG_MMC | DBG_CRIT, "Only block devices supported\n"); + return NULL; +#endif + } + +#if defined(HAVE_MNTENT_H) + if (fd < 0) { + /* resolve mount point to block device */ + if ((proc_mounts = setmntent("/proc/mounts", "r"))) { + struct mntent* mount_entry; + + BD_DEBUG(DBG_MMC, "Opening LINUX MMC drive mounted to %s...\n", resolved_path); + while ((mount_entry = getmntent(proc_mounts)) != NULL) { + if (strcmp(mount_entry->mnt_dir, resolved_path) == 0) { + fd = open(mount_entry->mnt_fsname, O_RDONLY | O_NONBLOCK); + if (fd >= 0) { + BD_DEBUG(DBG_MMC, "LINUX MMC drive %s opened - fd: %d\n", + mount_entry->mnt_fsname, fd); + break; + } + + BD_DEBUG(DBG_MMC | DBG_CRIT, "Failed opening MMC drive %s mounted to %s\n", + mount_entry->mnt_fsname, resolved_path); + } + } + + endmntent(proc_mounts); + + if (fd < 0) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "No MMC drive mounted to %s\n", resolved_path); + } + + } else { + BD_DEBUG(DBG_MMC | DBG_CRIT, "Error opening /proc/mounts\n"); + } +#endif + } + + if (fd >= 0) { + dev = calloc(1, sizeof(MMCDEV)); + dev->fd = fd; + } + return dev; +} + +void device_close(MMCDEV **pp) +{ + if (pp && *pp) { + + if ((*pp)->fd != -1) { + close((*pp)->fd); + } + + X_FREE(*pp); + } +}
View file
libaacs-0.8.0.tar.bz2/src/file/mmc_device_win32.c
Added
@@ -0,0 +1,178 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * This file is part of libaacs + * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2010-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 "mmc_device.h" + +#include "util/macro.h" +#include "util/logging.h" + +#include <windows.h> +#include <winsock.h> + +#include <stdlib.h> +#include <string.h> + + +/* + * from ntddscsi.h, Windows DDK + */ + +#define SCSI_IOCTL_DATA_OUT 0 +#define SCSI_IOCTL_DATA_IN 1 +#define SCSI_IOCTL_DATA_UNSPECIFIED 2 +#define IOCTL_SCSI_PASS_THROUGH_DIRECT 0x4D014 +#define MAX_SENSE_LEN 18 + +typedef struct _SCSI_PASS_THROUGH_DIRECT { + USHORT Length; + UCHAR ScsiStatus; + UCHAR PathId; + UCHAR TargetId; + UCHAR Lun; + UCHAR CdbLength; + UCHAR SenseInfoLength; + UCHAR DataIn; + ULONG DataTransferLength; + ULONG TimeOutValue; + PVOID DataBuffer; + ULONG SenseInfoOffset; + UCHAR Cdb16; +} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT; + + +/* + * + */ + +struct mmcdev { + HANDLE fd; +}; + +int device_send_cmd(MMCDEV *dev, const uint8_t *cmd, uint8_t *buf, size_t tx, size_t rx) +{ + DWORD dwBytesReturned; + + struct { + SCSI_PASS_THROUGH_DIRECT sptd; + UCHAR SenseBufMAX_SENSE_LEN; + } sptd_sb; + + if (dev->fd == INVALID_HANDLE_VALUE) { + return 0; + } + + sptd_sb.sptd.Length = sizeof(SCSI_PASS_THROUGH_DIRECT); + sptd_sb.sptd.PathId = 0; + sptd_sb.sptd.TargetId = 0; + sptd_sb.sptd.Lun = 0; + sptd_sb.sptd.CdbLength = 12; + sptd_sb.sptd.SenseInfoLength = MAX_SENSE_LEN; + sptd_sb.sptd.TimeOutValue = 5; + sptd_sb.sptd.SenseInfoOffset = sizeof(SCSI_PASS_THROUGH_DIRECT); + + if (buf) { + if (tx) { + sptd_sb.sptd.DataIn = SCSI_IOCTL_DATA_OUT; + sptd_sb.sptd.DataTransferLength = tx; + sptd_sb.sptd.DataBuffer = buf; + } else if (rx) { + sptd_sb.sptd.DataIn = SCSI_IOCTL_DATA_IN; + sptd_sb.sptd.DataTransferLength = rx; + sptd_sb.sptd.DataBuffer = buf; + } + } else { + sptd_sb.sptd.DataIn = SCSI_IOCTL_DATA_UNSPECIFIED; + sptd_sb.sptd.DataTransferLength = 0; + sptd_sb.sptd.DataBuffer = NULL; + } + + memcpy(sptd_sb.sptd.Cdb, cmd, 16); + + ZeroMemory(sptd_sb.SenseBuf, MAX_SENSE_LEN); + + if (DeviceIoControl(dev->fd, + IOCTL_SCSI_PASS_THROUGH_DIRECT, + (void*)&sptd_sb, sizeof(sptd_sb), + (void*)&sptd_sb, sizeof(sptd_sb), + &dwBytesReturned, NULL)) { + + if (sptd_sb.sptd.ScsiStatus == 0 /* STATUS_GOOD */) { + BD_DEBUG(DBG_MMC, " Send succeeded!\n"); + return 1; + } + } + + BD_DEBUG(DBG_MMC, " Send failed!\n"); + + return 0; +} + +MMCDEV *device_open(const char *path) +{ + char drive = { path0, ':', '\\', 0 }; + char volume = {'\\', '\\', '.', '\\', path0, ':', 0}; + UINT type; + HANDLE fd; + MMCDEV *dev; + + BD_DEBUG(DBG_MMC, "Opening Windows MMC drive %s...\n", drive); + + type = GetDriveType(drive); + if (type != DRIVE_CDROM) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive %s is not CD/DVD drive\n", drive); + return NULL; + } + + fd = CreateFile(volume, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (fd == INVALID_HANDLE_VALUE) { + fd = CreateFile(volume, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (fd == INVALID_HANDLE_VALUE) { + BD_DEBUG(DBG_MMC, "Failed opening Windows MMC drive %s\n", volume); + return NULL; + } + } + + BD_DEBUG(DBG_MMC, "Windows MMC drive %s opened\n", volume); + + dev = calloc(1, sizeof(MMCDEV)); + dev->fd = fd; + return dev; +} + +void device_close(MMCDEV **pp) +{ + if (pp && *pp) { + + if ((*pp)->fd != INVALID_HANDLE_VALUE) { + CloseHandle((*pp)->fd); + } + + X_FREE(*pp); + } +}
View file
libaacs-0.7.1.tar.bz2/src/file/path.h -> libaacs-0.8.0.tar.bz2/src/file/path.h
Changed
@@ -20,12 +20,12 @@ #ifndef AACS_PATH_H #define AACS_PATH_H -#include <util/attributes.h> +#include "util/attributes.h" #ifndef AACS_PATH_MAX #define AACS_PATH_MAX 1024 #endif -AACS_PRIVATE char *aacs_resolve_path(const char *path, char *resolved_path); +BD_PRIVATE char *aacs_resolve_path(const char *path, char *resolved_path); #endif /* AACS_PATH_H */
View file
libaacs-0.7.1.tar.bz2/src/libaacs/aacs.c -> libaacs-0.8.0.tar.bz2/src/libaacs/aacs.c
Changed
@@ -22,7 +22,7 @@ #include "config.h" #endif -#include <util/attributes.h> +#include "util/attributes.h" #include "aacs-version.h" #include "aacs.h" @@ -44,7 +44,14 @@ #include <gcrypt.h> +#define SECTOR_LEN 2048 /* bus encryption block size */ +#define ALIGNED_UNIT_LEN 6144 /* aacs block size */ + + struct aacs { + void *fopen_handle; + AACS_FILE_OPEN2 fopen; + /* current disc */ char *path; int mkb_version; @@ -63,6 +70,7 @@ /* CPS unit of currently selected title */ uint16_t current_cps_unit; + uint8_t cps_unit_selected; /* title -> CPS unit mappings */ uint32_t num_titles; @@ -78,10 +86,10 @@ uint8_t device_binding_id16; }; -static const uint8_t empty_key = "\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00"; -static const uint8_t aacs_iv = "\x0b\xa0\xf8\xdd\xfe\xa6\x1f\xb3" - "\xd8\xdf\x9f\x56\x6a\x05\x0f\x78"; +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 aacs_iv16 = { 0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 0x1f, 0xb3, + 0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 0x0f, 0x78 }; static int _validate_pk(const uint8_t *pk, const uint8_t *cvalue, const uint8_t *uv, const uint8_t *vd, @@ -92,11 +100,11 @@ uint8_t dec_vd16; char str40; - DEBUG(DBG_AACS, "Validate processing key %s...\n", print_hex(str, pk, 16)); - DEBUG(DBG_AACS, " Using:\n"); - DEBUG(DBG_AACS, " UV: %s\n", print_hex(str, uv, 4)); - DEBUG(DBG_AACS, " cvalue: %s\n", print_hex(str, cvalue, 16)); - DEBUG(DBG_AACS, " Verification data: %s\n", print_hex(str, vd, 16)); + BD_DEBUG(DBG_AACS, "Validate processing key %s...\n", str_print_hex(str, pk, 16)); + BD_DEBUG(DBG_AACS, " Using:\n"); + BD_DEBUG(DBG_AACS, " UV: %s\n", str_print_hex(str, uv, 4)); + BD_DEBUG(DBG_AACS, " cvalue: %s\n", str_print_hex(str, cvalue, 16)); + BD_DEBUG(DBG_AACS, " Verification data: %s\n", str_print_hex(str, vd, 16)); gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); gcry_cipher_setkey(gcry_h, pk, 16); @@ -111,7 +119,7 @@ gcry_cipher_close(gcry_h); if (!memcmp(dec_vd, "\x01\x23\x45\x67\x89\xAB\xCD\xEF", 8)) { - DEBUG(DBG_AACS, "Processing key %s is valid!\n", print_hex(str, pk, 16)); + BD_DEBUG(DBG_AACS, "Processing key %s is valid!\n", str_print_hex(str, pk, 16)); return AACS_SUCCESS; } @@ -124,7 +132,7 @@ size_t len = 12 + 12 + 8 * entries; /* type_and_version_rec=12, rl_header=12, rl=entries*8 */ if (len + 40 > size) { - DEBUG(DBG_AACS, "revocation list size mismatch\n"); + BD_DEBUG(DBG_AACS, "revocation list size mismatch\n"); return 0; } @@ -137,7 +145,7 @@ int len = MKINT_BE24(rl_rec - 3); int entries = MKINT_BE32(rl_rec + 4); /* entries in first signature block */ if (len < 4 || !entries) { - DEBUG(DBG_AACS | DBG_CRIT, "ignoring empty %s\n", name); + BD_DEBUG(DBG_AACS | DBG_CRIT, "ignoring empty %s\n", name); return; } @@ -149,7 +157,7 @@ memcpy(data, version_rec, 12); memcpy(data + 12, rl_rec, rl_len); if (!_rl_verify_signature(data, rl_len + 12)) { - 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); } @@ -218,7 +226,7 @@ } char str40; - DEBUG(DBG_AACS, "Processing key: %s\n", print_hex(str, pk, 16)); + BD_DEBUG(DBG_AACS, "Processing key: %s\n", str_print_hex(str, pk, 16)); } static dk_list *_find_dk(dk_list *dkl, uint32_t *p_dev_key_v_mask, uint32_t uv, uint32_t u_mask) @@ -247,11 +255,11 @@ } if (!dkl) { - DEBUG(DBG_AACS | DBG_CRIT, "could not find applying device key (device 0x%x)\n", device_number); + BD_DEBUG(DBG_AACS | DBG_CRIT, "could not find applying device key (device 0x%x)\n", device_number); } else { char str128; - DEBUG(DBG_AACS, "Applying device key is #%d %s\n", key_idx, print_hex(str, dkl->key, 16)); - DEBUG(DBG_AACS, " UV: 0x%08x U mask: 0x%08x V mask: 0x%08x\n", dev_key_uv, dev_key_u_mask, dev_key_v_mask); + BD_DEBUG(DBG_AACS, "Applying device key is #%d %s\n", key_idx, str_print_hex(str, dkl->key, 16)); + BD_DEBUG(DBG_AACS, " UV: 0x%08x U mask: 0x%08x V mask: 0x%08x\n", dev_key_uv, dev_key_u_mask, dev_key_v_mask); *p_dev_key_v_mask = dev_key_v_mask; } @@ -306,7 +314,7 @@ } if (u_mask_shift & 0xc0) { - DEBUG(DBG_AACS | DBG_CRIT, "device 0x%x is revoked\n", device_number); + BD_DEBUG(DBG_AACS | DBG_CRIT, "device 0x%x is revoked\n", device_number); uvs_idx = num_uvs; } else { @@ -321,13 +329,13 @@ } if (uvs_idx >= num_uvs) { - DEBUG(DBG_AACS | DBG_CRIT, "could not find applying subset-difference for device 0x%x\n", device_number); + BD_DEBUG(DBG_AACS | DBG_CRIT, "could not find applying subset-difference for device 0x%x\n", device_number); /* try next device */ continue; } - DEBUG(DBG_AACS, "Applying subset-difference for device 0x%x is #%d:\n", device_number, uvs_idx); - DEBUG(DBG_AACS," UV: 0x%08x U mask: 0x%08x V mask: 0x%08x\n", uv, u_mask, v_mask); + BD_DEBUG(DBG_AACS, "Applying subset-difference for device 0x%x is #%d:\n", device_number, uvs_idx); + BD_DEBUG(DBG_AACS," UV: 0x%08x U mask: 0x%08x V mask: 0x%08x\n", uv, u_mask, v_mask); /* find applying device key */ @@ -354,11 +362,11 @@ mk) == AACS_SUCCESS) { - DEBUG(DBG_AACS, "Media key: %s\n", print_hex(str, mk, 16)); + BD_DEBUG(DBG_AACS, "Media key: %s\n", str_print_hex(str, mk, 16)); return AACS_SUCCESS; } - DEBUG(DBG_AACS | DBG_CRIT, "Processing key %s is invalid!\n", print_hex(str, pk, 16)); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Processing key %s is invalid!\n", str_print_hex(str, pk, 16)); /* try next device */ } @@ -366,6 +374,39 @@ return AACS_ERROR_NO_DK; } +static AACS_FILE_H *_file_open(AACS *aacs, const char *file) +{ + AACS_FILE_H *fp; + char *f_name; + + if (aacs->fopen) { + return aacs->fopen(aacs->fopen_handle, file); + } + + f_name = str_printf("%s" DIR_SEP "%s", aacs->path, file); + fp = file_open(f_name, "rb"); + X_FREE(f_name); + + return fp; +} + +static MKB *_mkb_open(AACS *aacs) +{ + AACS_FILE_H *fp; + MKB *mkb; + + fp = _file_open(aacs, "AACS" DIR_SEP "MKB_RO.inf"); + if (!fp) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Error opening MKB file (AACS/MKB_RO.inf)\n"); + return NULL; + } + + mkb = mkb_read(fp); + file_close(fp); + + return mkb; +} + static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl, dk_list *dkl) { int a, num_uvs = 0; @@ -378,9 +419,9 @@ return AACS_SUCCESS; } - DEBUG(DBG_AACS, "Calculate media key...\n"); + BD_DEBUG(DBG_AACS, "Calculate media key...\n"); - if ((mkb = mkb_open(aacs->path))) { + if ((mkb = _mkb_open(aacs))) { aacs->mkb_version = mkb_version(mkb); _update_rl(mkb); @@ -392,7 +433,7 @@ return AACS_SUCCESS; } - DEBUG(DBG_AACS, "Get UVS...\n"); + BD_DEBUG(DBG_AACS, "Get UVS...\n"); uvs = mkb_subdiff_records(mkb, &len); rec = uvs; while (rec < uvs + len) { @@ -402,11 +443,11 @@ num_uvs++; } - DEBUG(DBG_AACS, "Get cvalues...\n"); + BD_DEBUG(DBG_AACS, "Get cvalues...\n"); rec = mkb_cvalues(mkb, &len); for (; pkl; pkl = pkl->next) { - DEBUG(DBG_AACS, "Trying processing key...\n"); + BD_DEBUG(DBG_AACS, "Trying processing key...\n"); for (a = 0; a < num_uvs; a++) { if (AACS_SUCCESS == _validate_pk(pkl->key, rec + a * 16, uvs + 1 + a * 5, @@ -414,7 +455,7 @@ mkb_close(mkb); char str40; - DEBUG(DBG_AACS, "Media key: %s\n", print_hex(str, mk, 16)); + BD_DEBUG(DBG_AACS, "Media key: %s\n", str_print_hex(str, mk, 16)); memcpy(aacs->mk, mk, sizeof(aacs->mk)); return AACS_SUCCESS; } @@ -423,11 +464,10 @@ mkb_close(mkb); - DEBUG(DBG_AACS | DBG_CRIT, "Error calculating media key. Missing right processing key ?\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Error calculating media key. Missing right processing key ?\n"); return AACS_ERROR_NO_PK; } - DEBUG(DBG_AACS | DBG_CRIT, "Error opening %s/AACS/MKB_RO.inf\n", aacs->path); return AACS_ERROR_CORRUPTED_DISC; } @@ -447,19 +487,19 @@ char tmp_str2*92+1; if (!crypto_aacs_verify_host_cert(hcl->host_cert)) { - DEBUG(DBG_AACS, "Not using invalid host certificate %s.\n", - print_hex(tmp_str, hcl->host_cert, 92)); + BD_DEBUG(DBG_AACS, "Not using invalid host certificate %s.\n", + str_print_hex(tmp_str, hcl->host_cert, 92)); continue; } if (drive_cert && (drive_cert1 & 0x01) && !(hcl->host_cert1 & 0x01)) { - DEBUG(DBG_AACS, "Certificate (id 0x%s) does not support bus encryption\n", - print_hex(tmp_str, hcl->host_cert + 4, 6)); + BD_DEBUG(DBG_AACS, "Certificate (id 0x%s) does not support bus encryption\n", + str_print_hex(tmp_str, hcl->host_cert + 4, 6)); //continue; } - DEBUG(DBG_AACS, "Trying host certificate (id 0x%s)...\n", - print_hex(tmp_str, hcl->host_cert + 4, 6)); + BD_DEBUG(DBG_AACS, "Trying host certificate (id 0x%s)...\n", + str_print_hex(tmp_str, hcl->host_cert + 4, 6)); int mmc_result = mmc_read_auth(mmc, hcl->host_priv_key, hcl->host_cert, type, p1, p2); switch (mmc_result) { @@ -490,7 +530,7 @@ int error_code = _mmc_read_auth(aacs, hcl, MMC_READ_VID, aacs->vid, NULL); if (error_code != AACS_SUCCESS) { - DEBUG(DBG_AACS, "Error reading VID!\n"); + BD_DEBUG(DBG_AACS, "Error reading VID!\n"); } else { /* cache vid */ keycache_save("vid", aacs->disc_id, aacs->vid, 16); @@ -502,7 +542,7 @@ { int error_code = _mmc_read_auth(aacs, hcl, MMC_READ_DATA_KEYS, aacs->read_data_key, NULL); if (error_code != AACS_SUCCESS) { - DEBUG(DBG_AACS, "Error reading data keys!\n"); + BD_DEBUG(DBG_AACS, "Error reading data keys!\n"); } return error_code; } @@ -511,7 +551,7 @@ { int error_code = _mmc_read_auth(aacs, hcl, MMC_READ_PMSN, aacs->pmsn, NULL); if (error_code != AACS_SUCCESS) { - DEBUG(DBG_AACS, "Error reading PMSN!\n"); + BD_DEBUG(DBG_AACS, "Error reading PMSN!\n"); } return error_code; } @@ -522,13 +562,13 @@ /* Skip if retrieved from config file */ if (memcmp(vuk, empty_key, 16)) { - DEBUG(DBG_AACS, "Using VUK from config file\n"); + BD_DEBUG(DBG_AACS, "Using VUK from config file\n"); return AACS_SUCCESS; } /* get cached vuk */ if (keycache_find("vuk", aacs->disc_id, vuk, 16)) { - DEBUG(DBG_AACS, "Using cached VUK\n"); + BD_DEBUG(DBG_AACS, "Using cached VUK\n"); return AACS_SUCCESS; } @@ -558,7 +598,7 @@ } char str40; - DEBUG(DBG_AACS, "Volume unique key: %s\n", print_hex(str, vuk, 16)); + BD_DEBUG(DBG_AACS, "Volume unique key: %s\n", str_print_hex(str, vuk, 16)); /* cache vuk */ keycache_save("vuk", aacs->disc_id, vuk, 16); @@ -580,7 +620,7 @@ uint16_t first_play, top_menu; unsigned i; - DEBUG(DBG_AACS, "Assigning CPS units to titles ...\n"); + BD_DEBUG(DBG_AACS, "Assigning CPS units to titles ...\n"); X_FREE(aacs->cps_units); aacs->current_cps_unit = 0; @@ -590,8 +630,8 @@ first_play = _read_u16(fp); top_menu = _read_u16(fp); - DEBUG(DBG_AACS, "Title FP : CPS unit %d\n", first_play); - DEBUG(DBG_AACS, "Title TM : CPS unit %d\n", top_menu); + BD_DEBUG(DBG_AACS, "Title FP : CPS unit %d\n", first_play); + BD_DEBUG(DBG_AACS, "Title TM : CPS unit %d\n", top_menu); aacs->num_titles = _read_u16(fp); aacs->cps_units = calloc(sizeof(uint16_t), aacs->num_titles + 2); @@ -601,7 +641,7 @@ for (i = 2; i < aacs->num_titles + 2; i++) { _read_u16(fp); /* reserved */ aacs->cps_unitsi = _read_u16(fp); - DEBUG(DBG_AACS, "Title %02d : CPS unit %d\n", i - 1, aacs->cps_unitsi); + BD_DEBUG(DBG_AACS, "Title %02d : CPS unit %d\n", i - 1, aacs->cps_unitsi); } /* validate */ @@ -609,44 +649,12 @@ if (aacs->cps_unitsi) aacs->cps_unitsi--; /* number 1...N --> index 0...N-1 */ if (aacs->cps_unitsi >= aacs->num_uks) { - DEBUG(DBG_AACS, " *** Invalid CPS unit for title %d: %d !\n", (int) i - 1, aacs->cps_unitsi); + BD_DEBUG(DBG_AACS, " *** Invalid CPS unit for title %d: %d !\n", (int) i - 1, aacs->cps_unitsi); aacs->cps_unitsi = 0; } } } -static AACS_FILE_H *_open_unit_key_file(const char *path) -{ - AACS_FILE_H *fp; - char *f_name; - - f_name = str_printf("%s/AACS/Unit_Key_RO.inf", path); - fp = file_open(f_name, "rb"); - - if (!fp) { - DEBUG(DBG_AACS | DBG_CRIT, "Error opening unit key file %s\n", f_name); - } - - X_FREE(f_name); - return fp; -} - -static AACS_FILE_H *_open_content_certificate_file(const char *path) -{ - AACS_FILE_H *fp; - char *f_name; - - f_name = str_printf("%s/AACS/Content000.cer", path); - fp = file_open(f_name, "rb"); - - if (!fp) { - DEBUG(DBG_AACS | DBG_CRIT, "Error opening content certificate file %s\n", f_name); - } - - X_FREE(f_name); - return fp; -} - /* Function that collects keys from keydb config entry */ static void _find_config_entry(AACS *aacs, title_entry_list *ce, uint8_t *mk, uint8_t *vuk) @@ -658,8 +666,8 @@ while (ce && ce->entry.discid) { if (!memcmp(aacs->disc_id, ce->entry.discid, 20)) { - DEBUG(DBG_AACS, "Found config entry for discid %s\n", - print_hex(str, ce->entry.discid, 20)); + BD_DEBUG(DBG_AACS, "Found config entry for discid %s\n", + str_print_hex(str, ce->entry.discid, 20)); break; } @@ -672,27 +680,27 @@ if (ce->entry.mek) { hexstring_to_hex_array(mk, 16, ce->entry.mek); - DEBUG(DBG_AACS, "Found media key for %s: %s\n", - ce->entry.discid, print_hex(str, mk, 16)); + BD_DEBUG(DBG_AACS, "Found media key for %s: %s\n", + ce->entry.discid, str_print_hex(str, mk, 16)); } if (ce->entry.vid) { hexstring_to_hex_array(aacs->vid, sizeof(aacs->vid), ce->entry.vid); - DEBUG(DBG_AACS, "Found volume id for %s: %s\n", - ce->entry.discid, print_hex(str, aacs->vid, 16)); + BD_DEBUG(DBG_AACS, "Found volume id for %s: %s\n", + ce->entry.discid, str_print_hex(str, aacs->vid, 16)); } if (ce->entry.vuk) { hexstring_to_hex_array(vuk, 16, ce->entry.vuk); - DEBUG(DBG_AACS, "Found volume unique key for %s: %s\n", - ce->entry.discid, print_hex(str, vuk, 16)); + BD_DEBUG(DBG_AACS, "Found volume unique key for %s: %s\n", + ce->entry.discid, str_print_hex(str, vuk, 16)); } if (ce->entry.uk) { - DEBUG(DBG_AACS, "Acquire CPS unit keys from keydb config file...\n"); + BD_DEBUG(DBG_AACS, "Acquire CPS unit keys from keydb config file...\n"); digit_key_pair_list *ukcursor = ce->entry.uk; while (ukcursor && ukcursor->key_pair.key) { @@ -702,9 +710,9 @@ hexstring_to_hex_array(aacs->uks + (16 * (aacs->num_uks - 1)), 16, ukcursor->key_pair.key); - DEBUG(DBG_AACS, "Unit key %d from keydb entry: %s\n", + BD_DEBUG(DBG_AACS, "Unit key %d from keydb entry: %s\n", aacs->num_uks, - print_hex(str, aacs->uks + (16 * (aacs->num_uks - 1)), 16)); + str_print_hex(str, aacs->uks + (16 * (aacs->num_uks - 1)), 16)); ukcursor = ukcursor->next; } @@ -722,7 +730,7 @@ uint8_t mk16 = {0}, vuk16 = {0}; if (cf) { - DEBUG(DBG_AACS, "Searching for keydb config entry...\n"); + BD_DEBUG(DBG_AACS, "Searching for keydb config entry...\n"); _find_config_entry(aacs, cf->list, mk, vuk); /* Skip if retrieved from config file */ @@ -737,10 +745,11 @@ return error_code; } - DEBUG(DBG_AACS, "Calculate CPS unit keys...\n"); + BD_DEBUG(DBG_AACS, "Calculate CPS unit keys...\n"); - fp = _open_unit_key_file(aacs->path); + fp = _file_open(aacs, "AACS" DIR_SEP "Unit_Key_RO.inf"); if (!fp) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Error opening unit key file (AACS/Unit_Key_RO.inf)\n"); return AACS_ERROR_CORRUPTED_DISC; } @@ -755,11 +764,11 @@ X_FREE(aacs->uks); aacs->uks = calloc(aacs->num_uks, 16); - DEBUG(DBG_AACS, "%d CPS unit keys\n", aacs->num_uks); + BD_DEBUG(DBG_AACS, "%d CPS unit keys\n", aacs->num_uks); } else { aacs->num_uks = 0; - DEBUG(DBG_AACS | DBG_CRIT, "Error reading number of unit keys\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Error reading number of unit keys\n"); error_code = AACS_ERROR_CORRUPTED_DISC; } @@ -769,7 +778,7 @@ file_seek(fp, f_pos, SEEK_SET); if ((file_read(fp, buf, 16)) != 16) { - DEBUG(DBG_AACS, "Unit key %d: read error\n", i); + BD_DEBUG(DBG_AACS, "Unit key %d: read error\n", i); aacs->num_uks = i; error_code = AACS_ERROR_CORRUPTED_DISC; break; @@ -778,8 +787,8 @@ crypto_aes128d(vuk, buf, aacs->uks + 16*i); char str40; - DEBUG(DBG_AACS, "Unit key %d: %s\n", i, - print_hex(str, aacs->uks + 16*i, 16)); + BD_DEBUG(DBG_AACS, "Unit key %d: %s\n", i, + str_print_hex(str, aacs->uks + 16*i, 16)); } /* failing next is not fatal, it just slows down things */ @@ -792,11 +801,11 @@ file_close(fp); - DEBUG(DBG_AACS | DBG_CRIT, "Error reading unit keys\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Error reading unit keys\n"); return AACS_ERROR_CORRUPTED_DISC; } -static int _calc_title_hash(const char *path, uint8_t *title_hash) +static int _calc_title_hash(AACS *aacs) { AACS_FILE_H *fp = NULL; uint8_t *ukf_buf; @@ -804,8 +813,9 @@ int64_t f_size; int result = AACS_SUCCESS; - fp = _open_unit_key_file(path); + fp = _file_open(aacs, "AACS" DIR_SEP "Unit_Key_RO.inf"); if (!fp) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Error opening unit key file (AACS/Unit_Key_RO.inf)\n"); return AACS_ERROR_CORRUPTED_DISC; } @@ -816,12 +826,12 @@ ukf_buf = malloc(f_size); if ((file_read(fp, ukf_buf, f_size)) == f_size) { - crypto_aacs_title_hash(ukf_buf, f_size, title_hash); - DEBUG(DBG_AACS, "Disc ID: %s\n", print_hex(str, title_hash, 20)); + crypto_aacs_title_hash(ukf_buf, f_size, aacs->disc_id); + BD_DEBUG(DBG_AACS, "Disc ID: %s\n", str_print_hex(str, aacs->disc_id, 20)); } else { result = AACS_ERROR_CORRUPTED_DISC; - DEBUG(DBG_AACS | DBG_CRIT, "Failed to read %lu bytes from unit key file %s/AACS/Unit_Key_RO.inf", (unsigned long)f_size, path); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Failed to read %lu bytes from unit key file (AACS/Unit_Key_RO.inf)", (unsigned long)f_size); } file_close(fp); @@ -830,23 +840,23 @@ return result; } -static int _get_bus_encryption_enabled(const char *path) +static int _get_bus_encryption_enabled(AACS *aacs) { AACS_FILE_H *fp = NULL; uint8_t buf2; int bee = 0; - fp = _open_content_certificate_file(path); + fp = _file_open(aacs, "AACS" DIR_SEP "Content000.cer"); if (!fp) { - DEBUG(DBG_AACS | DBG_CRIT, "Unable to open content certificate\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Unable to open content certificate (AACS/Content000.cer)\n"); return 0; } if (file_read(fp, buf, 2) == 2) { bee = (buf1 & 0x80) >> 7; - DEBUG(DBG_AACS, "Bus Encryption Enabled flag in content certificate: %d\n", bee); + BD_DEBUG(DBG_AACS, "Bus Encryption Enabled flag in content certificate: %d\n", bee); } else { - DEBUG(DBG_AACS | DBG_CRIT, "Failed to read Bus Encryption Enabled flag from content certificate file\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Failed to read Bus Encryption Enabled flag from content certificate file\n"); } file_close(fp); @@ -865,82 +875,67 @@ if (mmc_read_drive_cert(mmc, drive_cert) == MMC_SUCCESS) { bec = drive_cert1 & 1; - DEBUG(DBG_AACS, "Bus Encryption Capable flag in drive certificate: %d\n", bec); + BD_DEBUG(DBG_AACS, "Bus Encryption Capable flag in drive certificate: %d\n", bec); } else { - DEBUG(DBG_AACS | DBG_CRIT, "Unable to read drive certificate\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Unable to read drive certificate\n"); } mmc_close(mmc); return bec; } -static int _verify_ts(uint8_t *buf, size_t size) +static int _verify_ts(uint8_t *buf) { - uint8_t *ptr; - - if (size < 192) { - return 1; - } - - for (ptr=buf; ptr < buf+192; ptr++) { - int failed = 0; - if (*ptr == 0x47) { - uint8_t *ptr2; - - for (ptr2=ptr; ptr2 < buf + size; ptr2 += 192) { - if (*ptr2 != 0x47) { - failed = 1; - break; - } - } - if (!failed) { - return 1; - } + int i; + for (i = 0; i < ALIGNED_UNIT_LEN; i += 192) { + if (BD_UNLIKELY(bufi + 4 != 0x47)) { + return 0; } - ptr++; - } - - DEBUG(DBG_AACS, "Failed to verify TS!\n"); - return 0; + /* Clear copy_permission_indicator bits */ + bufi &= ~0xc0; + } + return 1; } -#define ALIGNED_UNIT_LEN 6144 static int _decrypt_unit(AACS *aacs, uint8_t *out_buf, const uint8_t *in_buf, uint32_t curr_uk) { + /* inbuf == NULL means in-place decryption */ + gcry_cipher_hd_t gcry_h; int a; uint8_t key16; + if (BD_UNLIKELY(in_buf != NULL)) { + memcpy(out_buf, in_buf, 16); /* first 16 bytes are plain */ + } + gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); gcry_cipher_setkey(gcry_h, aacs->uks + curr_uk * 16, 16); - gcry_cipher_encrypt(gcry_h, key, 16, in_buf, 16); + gcry_cipher_encrypt(gcry_h, key, 16, out_buf, 16); /* here out_buf is plain data fron in_buf */ gcry_cipher_close(gcry_h); for (a = 0; a < 16; a++) { - keya ^= in_bufa; + keya ^= out_bufa; /* here out_buf is plain data fron in_buf */ } - memcpy(out_buf, in_buf, 16); /* first 16 bytes are plain */ - gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_CBC, 0); gcry_cipher_setkey(gcry_h, key, 16); gcry_cipher_setiv(gcry_h, aacs_iv, 16); - gcry_cipher_decrypt(gcry_h, out_buf + 16, ALIGNED_UNIT_LEN - 16, in_buf + 16, ALIGNED_UNIT_LEN - 16); + if (BD_UNLIKELY(in_buf != NULL)) { + gcry_cipher_decrypt(gcry_h, out_buf + 16, ALIGNED_UNIT_LEN - 16, in_buf + 16, ALIGNED_UNIT_LEN - 16); + } else { + gcry_cipher_decrypt(gcry_h, out_buf + 16, ALIGNED_UNIT_LEN - 16, NULL, 0); + } gcry_cipher_close(gcry_h); - if (_verify_ts(out_buf, ALIGNED_UNIT_LEN)) { + if (_verify_ts(out_buf)) { return 1; } - if (curr_uk < aacs->num_uks - 1) { - return _decrypt_unit(aacs, out_buf, in_buf, curr_uk++); - } - return 0; } -#define SECTOR_LEN 2048 static void _decrypt_bus(AACS *aacs, uint8_t *buf) { gcry_cipher_hd_t gcry_h; @@ -974,56 +969,77 @@ return NULL; } +/* aacs_open_device() wrapper for backward compability */ AACS *aacs_open2(const char *path, const char *configfile_path, int *error_code) { - DEBUG(DBG_AACS, "libaacs "AACS_VERSION_STRING" %u\n", (unsigned)sizeof(AACS)); + AACS *aacs = aacs_init(); + if (aacs) { + *error_code = aacs_open_device(aacs, path, configfile_path); + } + return aacs; +} + +AACS *aacs_init() +{ + BD_DEBUG(DBG_AACS, "libaacs "AACS_VERSION_STRING" %u\n", (unsigned)sizeof(AACS)); - DEBUG(DBG_AACS, "Initializing libgcrypt...\n"); + BD_DEBUG(DBG_AACS, "Initializing libgcrypt...\n"); if (!crypto_init()) { - DEBUG(DBG_AACS | DBG_CRIT, "Failed to initialize libgcrypt\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "Failed to initialize libgcrypt\n"); return NULL; } - AACS *aacs = calloc(1, sizeof(AACS)); + return calloc(1, sizeof(AACS)); +} + +void aacs_set_fopen(AACS *aacs, void *handle, AACS_FILE_OPEN2 p) +{ + if (aacs) { + aacs->fopen = p; + aacs->fopen_handle = handle; + } +} + +int aacs_open_device(AACS *aacs, const char *path, const char *configfile_path) +{ config_file *cf; + int error_code; aacs->path = str_printf("%s", path); - *error_code = _calc_title_hash(path, aacs->disc_id); - if (*error_code != AACS_SUCCESS) { - aacs_close(aacs); - return NULL; + error_code = _calc_title_hash(aacs); + if (error_code != AACS_SUCCESS) { + return error_code; } cf = keydbcfg_config_load(configfile_path); - DEBUG(DBG_AACS, "Starting AACS waterfall...\n"); - *error_code = _calc_uks(aacs, cf); - if (*error_code != AACS_SUCCESS) { - DEBUG(DBG_AACS, "Failed to initialize AACS!\n"); + BD_DEBUG(DBG_AACS, "Starting AACS waterfall...\n"); + error_code = _calc_uks(aacs, cf); + if (error_code != AACS_SUCCESS) { + BD_DEBUG(DBG_AACS, "Failed to initialize AACS!\n"); } - aacs->bee = _get_bus_encryption_enabled(path); + aacs->bee = _get_bus_encryption_enabled(aacs); aacs->bec = _get_bus_encryption_capable(path); - if (*error_code == AACS_SUCCESS && aacs->bee && aacs->bec) { + if (error_code == AACS_SUCCESS && aacs->bee && aacs->bec) { if (!cf) { - *error_code = AACS_ERROR_NO_CONFIG; - return aacs; + return AACS_ERROR_NO_CONFIG; } - *error_code = _read_read_data_key(aacs, cf->host_cert_list); - if (*error_code != AACS_SUCCESS) { - DEBUG(DBG_AACS | DBG_CRIT, "Unable to initialize bus encryption required by drive and disc\n"); + error_code = _read_read_data_key(aacs, cf->host_cert_list); + if (error_code != AACS_SUCCESS) { + BD_DEBUG(DBG_AACS | DBG_CRIT, "Unable to initialize bus encryption required by drive and disc\n"); } } keydbcfg_config_file_close(cf); - DEBUG(DBG_AACS, "AACS initialized!\n"); + BD_DEBUG(DBG_AACS, "AACS initialized!\n"); - return aacs; + return error_code; } void aacs_close(AACS *aacs) @@ -1040,7 +1056,7 @@ X_FREE(aacs->cps_units); X_FREE(aacs->path); - DEBUG(DBG_AACS, "AACS destroyed!\n"); + BD_DEBUG(DBG_AACS, "AACS destroyed!\n"); /* erase sensitive data */ memset(aacs, 0, sizeof(*aacs)); @@ -1050,33 +1066,42 @@ int aacs_decrypt_unit(AACS *aacs, uint8_t *buf) { - uint8_t out_bufALIGNED_UNIT_LEN; - int i; + unsigned int i; if (!(buf0 & 0xc0)) { // TP_extra_header Copy_permission_indicator == 0, unit is not encrypted return 1; } + /* handle bus encryption first */ if (aacs->bee && aacs->bec) { for (i = 0; i < ALIGNED_UNIT_LEN; i += SECTOR_LEN) { _decrypt_bus(aacs, buf + i); } } - if (_decrypt_unit(aacs, out_buf, buf, aacs->current_cps_unit)) { - memcpy(buf, out_buf, ALIGNED_UNIT_LEN); - - // Clear copy_permission_indicator bits - for (i = 0; i < 6144; i += 192) { - bufi &= ~0xc0; + /* decrypt in-place if current unit key is known */ + if (BD_LIKELY(aacs->cps_unit_selected) || BD_LIKELY(aacs->num_uks == 1)) { + if (BD_LIKELY(_decrypt_unit(aacs, buf, NULL, aacs->current_cps_unit))) { + return 1; } - return 1; - } + } else { - DEBUG(DBG_AACS, "Failed decrypting unit 6144 bytes\n"); + /* unit key is unknown (playback without menus), try each key until right key is found */ + uint8_t out_bufALIGNED_UNIT_LEN; + for (i = 0; i < aacs->num_uks; i++) { + if (_decrypt_unit(aacs, out_buf, buf, i)) { + BD_DEBUG(DBG_AACS, "autodetected current CPS unit (%d)\n", i); + aacs->current_cps_unit = i; + aacs->cps_unit_selected = 1; + memcpy(buf, out_buf, ALIGNED_UNIT_LEN); + return 1; + } + } + } + BD_DEBUG(DBG_AACS, "Failed decrypting unit 6144 bytes\n"); return 0; } @@ -1084,7 +1109,7 @@ { if (!aacs->mkb_version) { MKB *mkb; - if ((mkb = mkb_open(aacs->path))) { + if ((mkb = _mkb_open(aacs))) { aacs->mkb_version = mkb_version(mkb); mkb_close(mkb); } @@ -1108,7 +1133,7 @@ } if (!memcmp(aacs->mk, empty_key, 16)) { - DEBUG(DBG_AACS | DBG_CRIT, "aacs_get_mk() failed\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "aacs_get_mk() failed\n"); return NULL; } } @@ -1121,7 +1146,7 @@ if (!memcmp(aacs->vid, empty_key, 16)) { /* get cached vid */ if (keycache_find("vid", aacs->disc_id, aacs->vid, 16)) { - DEBUG(DBG_AACS, "Using cached VID\n"); + BD_DEBUG(DBG_AACS, "Using cached VID\n"); return aacs->vid; } @@ -1133,7 +1158,7 @@ } if (!memcmp(aacs->vid, empty_key, 16)) { - DEBUG(DBG_AACS | DBG_CRIT, "aacs_get_vid() failed\n"); + BD_DEBUG(DBG_AACS | DBG_CRIT, "aacs_get_vid() failed\n"); return NULL; } } @@ -1152,7 +1177,7 @@ } if (!memcmp(aacs->pmsn, empty_key, 16)) { - DEBUG(DBG_AACS, "aacs_get_pmsn() failed\n"); + BD_DEBUG(DBG_AACS, "aacs_get_pmsn() failed\n"); return NULL; } } @@ -1168,9 +1193,9 @@ static const char config_file_name = "device_binding_id"; uint32_t len = sizeof(aacs->device_binding_id); - DEBUG(DBG_AACS, "reading device binding id\n"); + BD_DEBUG(DBG_AACS, "reading device binding id\n"); if (!config_get(config_file_name, &len, aacs->device_binding_id) || len != sizeof(aacs->device_binding_id)) { - DEBUG(DBG_AACS, "creating device binding id\n"); + BD_DEBUG(DBG_AACS, "creating device binding id\n"); crypto_create_nonce(aacs->device_binding_id, sizeof(aacs->device_binding_id)); config_save(config_file_name, aacs->device_binding_id, sizeof(aacs->device_binding_id)); } @@ -1180,7 +1205,7 @@ const uint8_t *aacs_get_device_nonce(AACS *aacs) { - DEBUG(DBG_AACS, "creating device nonce\n"); + BD_DEBUG(DBG_AACS, "creating device nonce\n"); crypto_create_nonce(aacs->device_nonce, sizeof(aacs->device_nonce)); return aacs->device_nonce; } @@ -1212,7 +1237,7 @@ return rl; } - DEBUG(DBG_AACS | DBG_CRIT, "invalid signature in cached %s\n", type); + BD_DEBUG(DBG_AACS | DBG_CRIT, "invalid signature in cached %s\n", type); } X_FREE(data); @@ -1250,22 +1275,24 @@ } if (!aacs->cps_units) { - DEBUG(DBG_AACS|DBG_CRIT, "aacs_select_title(): CPS units not read !\n"); + BD_DEBUG(DBG_AACS|DBG_CRIT, "aacs_select_title(): CPS units not read !\n"); return; } if (title == 0xffff) { /* first play */ aacs->current_cps_unit = aacs->cps_units0; - DEBUG(DBG_AACS, "aacs_set_title(first_play): CPS unit %d\n", aacs->current_cps_unit); + aacs->cps_unit_selected = 0; + BD_DEBUG(DBG_AACS, "aacs_set_title(first_play): CPS unit %d\n", aacs->current_cps_unit); return; } if (title <= aacs->num_titles) { aacs->current_cps_unit = aacs->cps_unitstitle + 1; - DEBUG(DBG_AACS, "aacs_set_title(%d): CPS unit %d\n", title, aacs->current_cps_unit); + aacs->cps_unit_selected = 1; + BD_DEBUG(DBG_AACS, "aacs_set_title(%d): CPS unit %d\n", title, aacs->current_cps_unit); return; } - DEBUG(DBG_AACS|DBG_CRIT, "aacs_set_title(%d): invalid title !\n", title); + BD_DEBUG(DBG_AACS|DBG_CRIT, "aacs_set_title(%d): invalid title !\n", title); }
View file
libaacs-0.7.1.tar.bz2/src/libaacs/aacs.h -> libaacs-0.8.0.tar.bz2/src/libaacs/aacs.h
Changed
@@ -42,8 +42,12 @@ 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); + AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path); AACS_PUBLIC AACS *aacs_open2(const char *path, const char *keyfile_path, int *error_code); + AACS_PUBLIC void aacs_close(AACS *aacs); AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */ AACS_PUBLIC int aacs_decrypt_unit(AACS *aacs, uint8_t *buf);
View file
libaacs-0.7.1.tar.bz2/src/libaacs/crypto.c -> libaacs-0.8.0.tar.bz2/src/libaacs/crypto.c
Changed
@@ -225,10 +225,10 @@ #define LOG_GCRY_ERROR(msg, func, err) \ char errstr100 = {0}; \ gpg_strerror_r(err, errstr, sizeof(errstr)); \ - DEBUG(DBG_AACS|DBG_CRIT, "%s: %s failed. error was: %s\n", func, msg, errstr); + BD_DEBUG(DBG_AACS|DBG_CRIT, "%s: %s failed. error was: %s\n", func, msg, errstr); #else #define LOG_GCRY_ERROR(msg, func, err) \ - DEBUG(DBG_AACS|DBG_CRIT, "%s: %s failed. error was: %s\n", func, msg, gcry_strerror(err)); + BD_DEBUG(DBG_AACS|DBG_CRIT, "%s: %s failed. error was: %s\n", func, msg, gcry_strerror(err)); #endif #define GCRY_VERIFY(msg, op) \ @@ -534,7 +534,7 @@ int crypto_aacs_verify_cert(const uint8_t *cert) { if (MKINT_BE16(cert+2) != 0x5c) { - DEBUG(DBG_AACS, "Certificate length is invalid (0x%04x), expected 0x005c\n", + BD_DEBUG(DBG_AACS, "Certificate length is invalid (0x%04x), expected 0x005c\n", MKINT_BE16(cert+2)); return 0; } @@ -545,12 +545,12 @@ int crypto_aacs_verify_host_cert(const uint8_t *cert) { if (cert0 != 0x02) { - DEBUG(DBG_AACS, "Host certificate type is invalid (0x%02x), expected 0x01\n", cert0); + BD_DEBUG(DBG_AACS, "Host certificate type is invalid (0x%02x), expected 0x01\n", cert0); return 0; } if (!crypto_aacs_verify_cert(cert)) { - DEBUG(DBG_AACS, "Host certificate signature is invalid\n"); + BD_DEBUG(DBG_AACS, "Host certificate signature is invalid\n"); return 0; } @@ -560,12 +560,12 @@ int crypto_aacs_verify_drive_cert(const uint8_t *cert) { if (cert0 != 0x01) { - DEBUG(DBG_AACS, "Drive certificate type is invalid (0x%02x), expected 0x01\n", cert0); + BD_DEBUG(DBG_AACS, "Drive certificate type is invalid (0x%02x), expected 0x01\n", cert0); return 0; } if (!crypto_aacs_verify_cert(cert)) { - DEBUG(DBG_AACS, "Drive certificate signature is invalid\n"); + BD_DEBUG(DBG_AACS, "Drive certificate signature is invalid\n"); return 0; }
View file
libaacs-0.7.1.tar.bz2/src/libaacs/crypto.h -> libaacs-0.8.0.tar.bz2/src/libaacs/crypto.h
Changed
@@ -20,30 +20,30 @@ #ifndef CRYPTO_H_ #define CRYPTO_H_ -#include <util/attributes.h> +#include "util/attributes.h" #include <stdlib.h> #include <stdint.h> -AACS_PRIVATE int crypto_init(void); -AACS_PRIVATE void crypto_aes128d(const uint8_t *key, const uint8_t *data, uint8_t *dst); -AACS_PRIVATE void crypto_aesg3(const uint8_t *D, uint8_t *lsubk, uint8_t* rsubk, - uint8_t *pk); // returns left, centre, right keys -AACS_PRIVATE void crypto_aes_cmac_16(const unsigned char *data, const unsigned char *aes_key, unsigned char *cmac); - -AACS_PRIVATE void crypto_aacs_sign(const uint8_t *cert, const uint8_t *priv_key, - uint8_t *signature, - const uint8_t *nonce, const uint8_t *point); -AACS_PRIVATE void crypto_aacs_title_hash(const uint8_t *ukf, uint64_t len, uint8_t *hash); - -AACS_PRIVATE int crypto_aacs_verify(const uint8_t *cert, const uint8_t *signature, const uint8_t *data, uint32_t len); -AACS_PRIVATE int crypto_aacs_verify_aacsla(const uint8_t *signature, const uint8_t *data, uint32_t len); -AACS_PRIVATE int crypto_aacs_verify_cert(const uint8_t *cert); -AACS_PRIVATE int crypto_aacs_verify_host_cert(const uint8_t *cert); -AACS_PRIVATE int crypto_aacs_verify_drive_cert(const uint8_t *cert); - -AACS_PRIVATE void crypto_create_host_key_pair(uint8_t *key, uint8_t *key_point); -AACS_PRIVATE void crypto_create_nonce(uint8_t *buf, size_t len); -AACS_PRIVATE void crypto_create_bus_key(const uint8_t *priv_key, const uint8_t *drive_key_point, unsigned char *bus_key); +BD_PRIVATE int crypto_init(void); +BD_PRIVATE void crypto_aes128d(const uint8_t *key, const uint8_t *data, uint8_t *dst); +BD_PRIVATE void crypto_aesg3(const uint8_t *D, uint8_t *lsubk, uint8_t* rsubk, + uint8_t *pk); // returns left, centre, right keys +BD_PRIVATE void crypto_aes_cmac_16(const unsigned char *data, const unsigned char *aes_key, unsigned char *cmac); + +BD_PRIVATE void crypto_aacs_sign(const uint8_t *cert, const uint8_t *priv_key, + uint8_t *signature, + const uint8_t *nonce, const uint8_t *point); +BD_PRIVATE void crypto_aacs_title_hash(const uint8_t *ukf, uint64_t len, uint8_t *hash); + +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_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); + +BD_PRIVATE void crypto_create_host_key_pair(uint8_t *key, uint8_t *key_point); +BD_PRIVATE void crypto_create_nonce(uint8_t *buf, size_t len); +BD_PRIVATE void crypto_create_bus_key(const uint8_t *priv_key, const uint8_t *drive_key_point, unsigned char *bus_key); #endif /* CRYPTO_H_ */
View file
libaacs-0.7.1.tar.bz2/src/libaacs/mkb.c -> libaacs-0.8.0.tar.bz2/src/libaacs/mkb.c
Changed
@@ -42,7 +42,7 @@ } if (mkb->bufpos == type) { - DEBUG(DBG_MKB, "Retrieved MKB record 0x%02x (%p)\n", type, + BD_DEBUG(DBG_MKB, "Retrieved MKB record 0x%02x (%p)\n", type, (void*)(mkb->buf + pos)); return mkb->buf + pos; @@ -54,40 +54,22 @@ return NULL; } -MKB *mkb_open(const char *path) +MKB *mkb_read(AACS_FILE_H *fp) { - AACS_FILE_H *fp = NULL; - char *f_name; MKB *mkb = malloc(sizeof(MKB)); - f_name = str_printf("%s/AACS/MKB_RO.inf", path); + file_seek(fp, 0, SEEK_END); + mkb->size = file_tell(fp); + file_seek(fp, 0, SEEK_SET); - DEBUG(DBG_MKB, "Opening MKB %s...\n", f_name); - fp = file_open(f_name, "rb"); + mkb->buf = malloc(mkb->size); - X_FREE(f_name); + file_read(fp, mkb->buf, mkb->size); - if (fp) { - file_seek(fp, 0, SEEK_END); - mkb->size = file_tell(fp); - file_seek(fp, 0, SEEK_SET); + BD_DEBUG(DBG_MKB, "MKB size: %u\n", (unsigned)mkb->size); + BD_DEBUG(DBG_MKB, "MKB version: %d\n", mkb_version(mkb)); - mkb->buf = malloc(mkb->size); - - file_read(fp, mkb->buf, mkb->size); - - DEBUG(DBG_MKB, "MKB size: %u\n", (unsigned)mkb->size); - DEBUG(DBG_MKB, "MKB version: %d\n", mkb_version(mkb)); - - file_close(fp); - return mkb; - } - - DEBUG(DBG_MKB, "Error opening MKB!\n"); - - X_FREE(mkb); - - return NULL; + return mkb; } MKB *mkb_init(uint8_t *data, int len) @@ -214,7 +196,7 @@ size_t rec_len = 4 + 4 + 8 * entries + 40; if (rec_len > rl_size) { - DEBUG(DBG_MKB, "revocation list size mismatch\n"); + BD_DEBUG(DBG_MKB, "revocation list size mismatch\n"); return -1; } @@ -224,8 +206,8 @@ uint64_t id = MKINT_BE48(rl + 2); if (cert_id >= id && cert_id <= id + len) { char str16; - print_hex(str, rl + 2, 6); - DEBUG(DBG_MKB, "Certificate %s has been revoked\n", str); + str_print_hex(str, rl + 2, 6); + BD_DEBUG(DBG_MKB, "Certificate %s has been revoked\n", str); return 1; } rl += 8;
View file
libaacs-0.7.1.tar.bz2/src/libaacs/mkb.h -> libaacs-0.8.0.tar.bz2/src/libaacs/mkb.h
Changed
@@ -20,43 +20,45 @@ #ifndef MKB_H_ #define MKB_H_ -#include <util/attributes.h> +#include "util/attributes.h" #include <stdlib.h> #include <stdint.h> typedef struct mkb MKB; -AACS_PRIVATE MKB *mkb_open(const char *path); // init MKB -AACS_PRIVATE MKB *mkb_init(uint8_t *data, int len); // init MKB from data -AACS_PRIVATE void mkb_close(MKB *mkb); // free MKB +struct aacs_file_s; -AACS_PRIVATE const uint8_t *mkb_data(MKB *mkb); -AACS_PRIVATE size_t mkb_data_size(MKB *mkb); +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 void mkb_close(MKB *mkb); // free MKB + +BD_PRIVATE const uint8_t *mkb_data(MKB *mkb); +BD_PRIVATE size_t mkb_data_size(MKB *mkb); // returns type -AACS_PRIVATE uint8_t mkb_type(MKB *mkb); +BD_PRIVATE uint8_t mkb_type(MKB *mkb); // returns version -AACS_PRIVATE uint32_t mkb_version(MKB *mkb); +BD_PRIVATE uint32_t mkb_version(MKB *mkb); // returns type and version record (required to verify signatures) -AACS_PRIVATE const uint8_t *mkb_type_and_version_record(MKB *mkb); +BD_PRIVATE const uint8_t *mkb_type_and_version_record(MKB *mkb); // returns list of revoked host entries -AACS_PRIVATE const uint8_t *mkb_host_revokation_entries(MKB *mkb, size_t *len); +BD_PRIVATE const uint8_t *mkb_host_revokation_entries(MKB *mkb, size_t *len); // returns list of revoked drive entries -AACS_PRIVATE const uint8_t *mkb_drive_revokation_entries(MKB *mkb, size_t *len); +BD_PRIVATE const uint8_t *mkb_drive_revokation_entries(MKB *mkb, size_t *len); // returns subset-diff records -AACS_PRIVATE const uint8_t *mkb_subdiff_records(MKB *mkb, size_t *len); +BD_PRIVATE const uint8_t *mkb_subdiff_records(MKB *mkb, size_t *len); // returns list of subset-diff offsets -AACS_PRIVATE const uint8_t *mkb_subdiff_offsets(MKB *mkb, size_t *len); +BD_PRIVATE const uint8_t *mkb_subdiff_offsets(MKB *mkb, size_t *len); // returns list of cvalues -AACS_PRIVATE const uint8_t *mkb_cvalues(MKB *mkb, size_t *len); +BD_PRIVATE const uint8_t *mkb_cvalues(MKB *mkb, size_t *len); // media key verification data return in param (always 16 bytes) -AACS_PRIVATE const uint8_t *mkb_mk_dv(MKB *mkb); +BD_PRIVATE const uint8_t *mkb_mk_dv(MKB *mkb); // returns MKB signature -AACS_PRIVATE const uint8_t *mkb_signature(MKB *mkb, size_t *len); +BD_PRIVATE const uint8_t *mkb_signature(MKB *mkb, size_t *len); -AACS_PRIVATE int mkb_host_cert_is_revoked(MKB *mkb, const uint8_t *cert_id); -AACS_PRIVATE int mkb_drive_cert_is_revoked(MKB *mkb, const uint8_t *cert_id); +BD_PRIVATE int mkb_host_cert_is_revoked(MKB *mkb, const uint8_t *cert_id); +BD_PRIVATE int mkb_drive_cert_is_revoked(MKB *mkb, const uint8_t *cert_id); /* The Media Key block is of variable size but must be a multiple of 4 * MKB Structure:
View file
libaacs-0.7.1.tar.bz2/src/libaacs/mmc.c -> libaacs-0.8.0.tar.bz2/src/libaacs/mmc.c
Changed
@@ -24,121 +24,23 @@ #endif #include "mmc.h" + #include "crypto.h" -#include "file/path.h" -#include "util/macro.h" +#include "file/mmc_device.h" #include "util/logging.h" +#include "util/macro.h" +#include "util/strutl.h" #include <stdlib.h> -#include <errno.h> -#include <fcntl.h> -#include <unistd.h> #include <string.h> -#include <stdio.h> - -#ifdef USE_IOKIT - -#include <Carbon/Carbon.h> - -#include <IOKit/IOKitLib.h> -#include <IOKit/IOCFPlugIn.h> - -#include <DiskArbitration/DiskArbitration.h> - -/* need to undefine VERSION as one of the members of struct - SCSICmd_INQUIRY_StandardData is named VERSION (see - IOKit/scsi/SCSICmds_INQUIRY_Definitions.h) */ -#undef VERSION -#include <IOKit/scsi/SCSITaskLib.h> - -#include <IOKit/storage/IOBDMediaBSDClient.h> - -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif - -#ifdef HAVE_SYS_PARAM_H -#include <sys/param.h> -#endif - -#ifdef HAVE_SYS_MOUNT_H -#include <sys/mount.h> -#endif - -#ifdef HAVE_LIBGEN_H -#include <libgen.h> -#endif - -#endif - -#ifdef HAVE_MNTENT_H -#include <mntent.h> -#endif - -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif - -#ifdef HAVE_LINUX_CDROM_H -#include <sys/ioctl.h> -#include <linux/cdrom.h> -#endif - -#if defined(_WIN32) -#include <windows.h> -#include <winsock.h> -#endif - #ifndef DEBUG_KEYS #define DEBUG_KEYS 0 #endif -#if defined(_WIN32) -/* - * from ntddscsi.h, Windows DDK - */ -# define SCSI_IOCTL_DATA_OUT 0 -# define SCSI_IOCTL_DATA_IN 1 -# define SCSI_IOCTL_DATA_UNSPECIFIED 2 -# define IOCTL_SCSI_PASS_THROUGH_DIRECT 0x4D014 -# define MAX_SENSE_LEN 18 - -typedef struct _SCSI_PASS_THROUGH_DIRECT { - USHORT Length; - UCHAR ScsiStatus; - UCHAR PathId; - UCHAR TargetId; - UCHAR Lun; - UCHAR CdbLength; - UCHAR SenseInfoLength; - UCHAR DataIn; - ULONG DataTransferLength; - ULONG TimeOutValue; - PVOID DataBuffer; - ULONG SenseInfoOffset; - UCHAR Cdb16; -} SCSI_PASS_THROUGH_DIRECT, *PSCSI_PASS_THROUGH_DIRECT; - -#endif // defined(_WIN32) - struct mmc { -#if defined(USE_IOKIT) - MMCDeviceInterface **mmcInterface; - SCSITaskDeviceInterface **taskInterface; - - /* device short name (ie disk1) */ - char bsd_name128; - - /* for mounting/unmounting the disc */ - DADiskRef disk; - DASessionRef session; - bool is_mounted; -#elif defined(_WIN32) - HANDLE fd; -#else - int fd; -#endif + MMCDEV *dev; + uint8_t host_nonce20; uint8_t host_key20; uint8_t host_key_point40; @@ -148,191 +50,6 @@ uint8_t read_drive_cert; }; -static int _mmc_send_cmd(MMC *mmc, const uint8_t *cmd, uint8_t *buf, size_t tx, - size_t rx) -{ -#if defined(HAVE_LINUX_CDROM_H) - if (mmc->fd >= 0) { - struct cdrom_generic_command cgc; - struct request_sense sense; - - memset(&cgc, 0, sizeof(cgc)); - memcpy(cgc.cmd, cmd, CDROM_PACKET_SIZE); - cgc.sense = &sense; - cgc.timeout = 5000; - - if (buf) { - if (tx) { - cgc.data_direction = CGC_DATA_WRITE; - cgc.buflen = tx; - cgc.buffer = buf; - } else if (rx) { - cgc.data_direction = CGC_DATA_READ; - cgc.buflen = rx; - cgc.buffer = buf; - } - } else { - cgc.data_direction = CGC_DATA_NONE; - cgc.buflen = 0; - cgc.buffer = NULL; - } - - int a = ioctl(mmc->fd, CDROM_SEND_PACKET, &cgc); - - char str512; - DEBUG(DBG_MMC, "Send LINUX MMC cmd %s:\n", - print_hex(str, cmd, 16)); - if (tx) { - DEBUG(DBG_MMC, " Buffer: %s ->\n", print_hex(str, buf, tx>255?255:tx)); - } else { - DEBUG(DBG_MMC, " Buffer: %s <-\n", print_hex(str, buf, rx>255?255:rx)); - } - - if (a >= 0) { - DEBUG(DBG_MMC, " Send succeeded! %d\n", a); - return 1; - } - - DEBUG(DBG_MMC, " Send failed! %d %s\n", a, strerror(errno)); - } - -#elif defined(_WIN32) - - DWORD dwBytesReturned; - - struct { - SCSI_PASS_THROUGH_DIRECT sptd; - UCHAR SenseBufMAX_SENSE_LEN; - } sptd_sb; - - if (mmc->fd == INVALID_HANDLE_VALUE) { - return 0; - } - - sptd_sb.sptd.Length = sizeof(SCSI_PASS_THROUGH_DIRECT); - sptd_sb.sptd.PathId = 0; - sptd_sb.sptd.TargetId = 0; - sptd_sb.sptd.Lun = 0; - sptd_sb.sptd.CdbLength = 12; - sptd_sb.sptd.SenseInfoLength = MAX_SENSE_LEN; - sptd_sb.sptd.TimeOutValue = 5; - sptd_sb.sptd.SenseInfoOffset = sizeof(SCSI_PASS_THROUGH_DIRECT); - - if (buf) { - if (tx) { - sptd_sb.sptd.DataIn = SCSI_IOCTL_DATA_OUT; - sptd_sb.sptd.DataTransferLength = tx; - sptd_sb.sptd.DataBuffer = buf; - } else if (rx) { - sptd_sb.sptd.DataIn = SCSI_IOCTL_DATA_IN; - sptd_sb.sptd.DataTransferLength = rx; - sptd_sb.sptd.DataBuffer = buf; - } - } else { - sptd_sb.sptd.DataIn = SCSI_IOCTL_DATA_UNSPECIFIED; - sptd_sb.sptd.DataTransferLength = 0; - sptd_sb.sptd.DataBuffer = NULL; - } - - memcpy(sptd_sb.sptd.Cdb, cmd, 16); - - ZeroMemory(sptd_sb.SenseBuf, MAX_SENSE_LEN); - - if (DeviceIoControl(mmc->fd, - IOCTL_SCSI_PASS_THROUGH_DIRECT, - (void*)&sptd_sb, sizeof(sptd_sb), - (void*)&sptd_sb, sizeof(sptd_sb), - &dwBytesReturned, NULL)) { - - if (sptd_sb.sptd.ScsiStatus == 0 /* STATUS_GOOD */) { - DEBUG(DBG_MMC, " Send succeeded!\n"); - return 1; - } - } - - DEBUG(DBG_MMC, " Send failed!\n"); - -#elif defined(USE_IOKIT) - SCSITaskInterface **task = NULL; - SCSI_Sense_Data sense; - SCSITaskStatus status; - SCSITaskSGElement iov; - UInt8 direction; - UInt64 sent; - int rc; - - if (NULL == mmc->taskInterface) { - return 0; - } - - do { - task = (*mmc->taskInterface)->CreateSCSITask (mmc->taskInterface); - if (NULL == task) { - DEBUG(DBG_MMC, "Could not create SCSI Task\n"); - break; - } - - iov.address = (uintptr_t) buf; - iov.length = tx ? tx : rx; - - if (buf) { - direction = tx ? kSCSIDataTransfer_FromInitiatorToTarget : - kSCSIDataTransfer_FromTargetToInitiator; - } else { - direction = kSCSIDataTransfer_NoDataTransfer; - } - - rc = (*task)->SetCommandDescriptorBlock (task, cmd, 16); - if (kIOReturnSuccess != rc) { - DEBUG(DBG_MMC, "Error setting SCSI command\n"); - break; - } - - rc = (*task)->SetScatterGatherEntries (task, &iov, 1, iov.length, direction); - if (kIOReturnSuccess != rc) { - DEBUG(DBG_MMC, "Error setting SCSI scatter gather entries\n"); - break; - } - - rc = (*task)->SetTimeoutDuration (task, 5000000); - if (kIOReturnSuccess != rc) { - DEBUG(DBG_MMC, "Error setting SCSI command timeout\n"); - break; - } - - memset (&sense, 0, sizeof (sense)); - - rc = (*task)->ExecuteTaskSync (task, &sense, &status, &sent); - - char str512; - DEBUG(DBG_MMC, "Send SCSI MMC cmd %s:\n", print_hex(str, cmd, 16)); - if (tx) { - DEBUG(DBG_MMC, " Buffer: %s ->\n", print_hex(str, buf, tx>255?255:tx)); - } else { - DEBUG(DBG_MMC, " Buffer: %s <-\n", print_hex(str, buf, rx>255?255:rx)); - } - - if (kIOReturnSuccess != rc || status != 0) { - DEBUG(DBG_MMC, " Send failed!\n"); - break; - } else { - DEBUG(DBG_MMC, " Send succeeded! sent = %lld status = %u. response = %x\n", - (unsigned long long) sent, status, sense.VALID_RESPONSE_CODE); - } - - (*task)->Release (task); - - return 1; - } while (0); - - if (task) { - (*task)->Release (task); - } -#endif - - return 0; -} - /* * */ @@ -345,7 +62,7 @@ memset(cmd, 0, sizeof(cmd)); memset(buf, 0, len); - DEBUG(DBG_MMC, "MMC report key...\n"); + BD_DEBUG(DBG_MMC, "MMC report key...\n"); cmd0 = 0xa4; cmd2 = (addr >> 24) & 0xff; @@ -358,7 +75,7 @@ cmd9 = len & 0xff; cmd10 = (agid << 6) | (format & 0x3f); - return _mmc_send_cmd(mmc, cmd, buf, 0, len); + return device_send_cmd(mmc->dev, cmd, buf, 0, len); } static int _mmc_send_key(MMC *mmc, uint8_t agid, uint8_t format, uint8_t *buf, @@ -368,7 +85,7 @@ char str512; memset(cmd, 0, sizeof(cmd)); - DEBUG(DBG_MMC, "MMC send key %d %s...\n", len, print_hex(str, buf, len)); + BD_DEBUG(DBG_MMC, "MMC send key %d %s...\n", len, str_print_hex(str, buf, len)); cmd0 = 0xa3; cmd7 = 0x02; @@ -376,8 +93,8 @@ cmd9 = len & 0xff; cmd10 = (agid << 6) | (format & 0x3f); - DEBUG(DBG_MMC, "cmd: %s\n", print_hex(str, cmd, 16)); - return _mmc_send_cmd(mmc, cmd, buf, len, 0); + BD_DEBUG(DBG_MMC, "cmd: %s\n", str_print_hex(str, cmd, 16)); + return device_send_cmd(mmc->dev, cmd, buf, len, 0); } static int _mmc_report_disc_structure(MMC *mmc, uint8_t agid, uint8_t format, @@ -388,7 +105,7 @@ memset(cmd, 0, sizeof(cmd)); memset(buf, 0, len); - DEBUG(DBG_MMC, "MMC report disc structure format 0x%x layer %d address %d ...\n", format, layer, address); + BD_DEBUG(DBG_MMC, "MMC report disc structure format 0x%x layer %d address %d ...\n", format, layer, address); cmd0 = 0xad; // operation code cmd1 = 0x01; // BluRay @@ -402,7 +119,7 @@ cmd9 = len & 0xff; cmd10 = (agid << 6); - return _mmc_send_cmd(mmc, cmd, buf, 0, len); + return device_send_cmd(mmc->dev, cmd, buf, 0, len); } static int _mmc_get_configuration(MMC *mmc, uint16_t feature, uint8_t *buf, uint16_t len) @@ -411,7 +128,7 @@ memset(cmd, 0, sizeof(cmd)); memset(buf, 0, len); - DEBUG(DBG_MMC, "MMC get configuration feature 0x%x ...\n", feature); + BD_DEBUG(DBG_MMC, "MMC get configuration feature 0x%x ...\n", feature); cmd0 = 0x46; // operation code cmd1 = 0x01; // BluRay @@ -420,7 +137,7 @@ cmd7 = (len >> 8) & 0xff; cmd8 = len & 0xff; - return _mmc_send_cmd(mmc, cmd, buf, 0, len); + return device_send_cmd(mmc->dev, cmd, buf, 0, len); } /* @@ -508,23 +225,23 @@ if (_mmc_get_configuration(mmc, 0x010d, buf, 16)) { uint16_t feature = MKINT_BE16(buf+8); if (feature == 0x010d) { - DEBUG(DBG_MMC, "AACS feature descriptor:\n"); - DEBUG(DBG_MMC, " AACS version: %d\n", buf7+8); - DEBUG(DBG_MMC, " AACS active: %d\n", buf2+8 & 1); - DEBUG(DBG_MMC, " Binding Nonce generation support: %d\n", buf4+8 & 1); - DEBUG(DBG_MMC, " Binding Nonce block count: %d\n", buf5+8); - DEBUG(DBG_MMC, " Bus encryption support: %d\n", !!(buf4+8 & 2)); - DEBUG(DBG_MMC, " Read drive certificate: %d\n", !!(buf4+8 & 0x10)); - DEBUG(DBG_MMC, " AGID count: %d\n", buf6+8 & 0xf); + BD_DEBUG(DBG_MMC, "AACS feature descriptor:\n"); + BD_DEBUG(DBG_MMC, " AACS version: %d\n", buf7+8); + BD_DEBUG(DBG_MMC, " AACS active: %d\n", buf2+8 & 1); + BD_DEBUG(DBG_MMC, " Binding Nonce generation support: %d\n", buf4+8 & 1); + BD_DEBUG(DBG_MMC, " Binding Nonce block count: %d\n", buf5+8); + BD_DEBUG(DBG_MMC, " Bus encryption support: %d\n", !!(buf4+8 & 2)); + BD_DEBUG(DBG_MMC, " Read drive certificate: %d\n", !!(buf4+8 & 0x10)); + BD_DEBUG(DBG_MMC, " AGID count: %d\n", buf6+8 & 0xf); mmc->read_drive_cert = !!(buf4+8 & 0x10); return buf2+8 & 1; } - DEBUG(DBG_MMC, "incorrect feature ID %04x\n", feature); + BD_DEBUG(DBG_MMC, "incorrect feature ID %04x\n", feature); } - DEBUG(DBG_MMC, "_mmc_get_configuration() failed\n"); + BD_DEBUG(DBG_MMC, "_mmc_get_configuration() failed\n"); return 0; } @@ -540,14 +257,14 @@ int32_t len = MKINT_BE16(buf) - 2; mkb = malloc(32768 * num_packs); - DEBUG(DBG_MMC, "got mkb: pack 0/%d %d bytes\n", num_packs, len); + BD_DEBUG(DBG_MMC, "got mkb: pack 0/%d %d bytes\n", num_packs, len); memcpy(mkb, buf + 4, len); *size += len; for (pack = 1; pack < num_packs; pack++) { if (_mmc_report_disc_structure(mmc, agid, 0x83, layer, pack, buf, sizeof(buf))) { len = MKINT_BE16(buf) - 2; - DEBUG(DBG_MMC, "got mkb: pack %d/%d %d bytes\n", pack, num_packs, len); + BD_DEBUG(DBG_MMC, "got mkb: pack %d/%d %d bytes\n", pack, num_packs, len); memcpy(mkb + *size, buf + 4, len); *size += len; @@ -617,234 +334,9 @@ return 0; } -#ifdef USE_IOKIT -static int get_mounted_device_from_path (MMC *mmc, const char *path) { - struct statfs stat_info; - int rc; - - rc = statfs (path, &stat_info); - if (0 != rc) { - return rc; - } - - strncpy (mmc->bsd_name, basename (stat_info.f_mntfromname), sizeof (mmc->bsd_name)); - - return 0; -} - -static void iokit_unmount_complete (DADiskRef disk, DADissenterRef dissenter, - void *context) { - (void)disk; /* suppress warning */ - - if (dissenter) { - DEBUG(DBG_MMC, "Could not unmount the disc\n"); - } else { - DEBUG(DBG_MMC, "Disc unmounted\n"); - ((MMC *)context)->is_mounted = 0; - } -} - -static void iokit_mount_complete (DADiskRef disk, DADissenterRef dissenter, - void *context) { - (void) disk; /* suppress warning */ - (void) dissenter; /* suppress warning */ - - /* the disc mounts despite whether there is a dessenter */ - DEBUG(DBG_MMC, "Disc mounted\n"); - ((MMC *)context)->is_mounted = 1; -} - -static int iokit_unmount (MMC *mmc) { - if (0 == mmc->is_mounted) { - return 0; /* nothing to do */ - } - - DEBUG(DBG_MMC, "Unmounting disk\n"); - - mmc->session = DASessionCreate (kCFAllocatorDefault); - if (NULL == mmc->session) { - DEBUG(DBG_MMC, "Could not create a disc arbitration session\n"); - return -1; - } - - mmc->disk = DADiskCreateFromBSDName (kCFAllocatorDefault, mmc->session, mmc->bsd_name); - if (NULL == mmc->disk) { - DEBUG(DBG_MMC, "Could not create a disc arbitration disc for the device\n"); - CFRelease (mmc->session); - mmc->session = NULL; - return -1; - } - - DAApprovalSessionScheduleWithRunLoop (mmc->session, CFRunLoopGetCurrent (), - kCFRunLoopDefaultMode); - - DADiskUnmount (mmc->disk, kDADiskUnmountOptionForce, iokit_unmount_complete, mmc); - - CFRunLoopRunInMode (kCFRunLoopDefaultMode, 10, true); - - return mmc->is_mounted ? -1 : 0; -} - -static int iokit_mount (MMC *mmc) { - if (0 == mmc->is_mounted) { - if (mmc->disk && mmc->session) { - DADiskMount (mmc->disk, NULL, kDADiskMountOptionDefault, iokit_mount_complete, mmc); - - CFRunLoopRunInMode (kCFRunLoopDefaultMode, 10, true); - - DAApprovalSessionUnscheduleFromRunLoop (mmc->session, CFRunLoopGetCurrent (), - kCFRunLoopDefaultMode); - } - - if (mmc->disk) { - CFRelease (mmc->disk); - mmc->disk = NULL; - } - - if (mmc->session) { - CFRelease (mmc->session); - mmc->session = NULL; - } - } - - return mmc->is_mounted ? 0 : -1; -} - -static int iokit_find_service_matching (MMC *mmc, io_service_t *servp) { - CFMutableDictionaryRef matchingDict = IOServiceMatching("IOBDServices"); - io_iterator_t deviceIterator; - io_service_t service; - int rc; - - assert (NULL != servp); - - *servp = 0; - - if (!matchingDict) { - DEBUG(DBG_MMC, "Could not create a matching dictionary for IOBDServices\n"); - return -1; - } - - /* this call consumes the reference to the matchingDict. we do not need to release it */ - rc = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &deviceIterator); - if (kIOReturnSuccess != rc) { - DEBUG(DBG_MMC, "Could not create device iterator\n"); - return -1; - } - - while (0 != (service = IOIteratorNext (deviceIterator))) { - CFStringRef data; - char name128 = ""; - - data = IORegistryEntrySearchCFProperty (service, kIOServicePlane, CFSTR("BSD Name"), - kCFAllocatorDefault, kIORegistryIterateRecursively); - - if (NULL != data) { - rc = CFStringGetCString (data, name, sizeof (name), kCFStringEncodingASCII); - CFRelease (data); - if (0 == strcmp (name, mmc->bsd_name)) { - break; - } - } - - (void) IOObjectRelease (service); - } - - IOObjectRelease (deviceIterator); - - *servp = service; - - return (service) ? 0 : -1; -} - -static int iokit_find_interfaces (MMC *mmc, io_service_t service) { - IOCFPlugInInterface **plugInInterface = NULL; - SInt32 score; - int rc; - - rc = IOCreatePlugInInterfaceForService (service, kIOMMCDeviceUserClientTypeID, - kIOCFPlugInInterfaceID, &plugInInterface, - &score); - if (kIOReturnSuccess != rc || NULL == plugInInterface) { - return -1; - } - - DEBUG(DBG_MMC, "Getting MMC interface\n"); - - rc = (*plugInInterface)->QueryInterface(plugInInterface, - CFUUIDGetUUIDBytes(kIOMMCDeviceInterfaceID), - (LPVOID)&mmc->mmcInterface); - /* call release instead of IODestroyPlugInInterface to avoid stopping IOBDServices */ - (*plugInInterface)->Release(plugInInterface); - if (kIOReturnSuccess != rc || NULL == mmc->mmcInterface) { - DEBUG(DBG_MMC, "Could not get multimedia commands (MMC) interface\n"); - return -1; - } - - DEBUG(DBG_MMC, "Have an MMC interface (%p). Getting a SCSI task interface...\n", (void*)mmc->mmcInterface); - - mmc->taskInterface = (*mmc->mmcInterface)->GetSCSITaskDeviceInterface (mmc->mmcInterface); - if (NULL == mmc->taskInterface) { - DEBUG(DBG_MMC, "Could not get SCSI task device interface\n"); - return -1; - } - - return 0; -} - -int mmc_open_iokit (const char *path, MMC *mmc) { - io_service_t service; - int rc; - - mmc->mmcInterface = NULL; - mmc->taskInterface = NULL; - mmc->disk = NULL; - mmc->session = NULL; - mmc->is_mounted = true; - - /* get the bsd name associated with this mount */ - rc = get_mounted_device_from_path (mmc, path); - if (0 != rc) { - DEBUG(DBG_MMC, "Could not locate mounted device associated with %s\n", path); - return rc; - } - - /* find a matching io service (IOBDServices) */ - rc = iokit_find_service_matching (mmc, &service); - if (0 != rc) { - DEBUG(DBG_MMC, "Could not find matching IOBDServices mounted @ %s\n", path); - return rc; - } - - /* find mmc and scsi task interfaces */ - rc = iokit_find_interfaces (mmc, service); - - /* done with the ioservice. release it */ - (void) IOObjectRelease (service); - - if (0 != rc) { - return rc; - } - - /* unmount the disk so exclusive access can be obtained (this is required - to use the scsi task interface) */ - rc = iokit_unmount (mmc); - if (0 != rc) { - return rc; - } - - /* finally, obtain exclusive access */ - rc = (*mmc->taskInterface)->ObtainExclusiveAccess (mmc->taskInterface); - if (kIOReturnSuccess != rc) { - DEBUG(DBG_MMC, "Failed to obtain exclusive access. rc = %x\n", rc); - return -1; - } - - DEBUG(DBG_MMC, "MMC Open complete\n"); - - return 0; -} -#endif +/* + * + */ MMC *mmc_open(const char *path) { @@ -854,121 +346,35 @@ if (DEBUG_KEYS) { char strsizeof(mmc->host_nonce)*2 + 1; - DEBUG(DBG_MMC, "Created host nonce (Hn): %s\n", - print_hex(str, mmc->host_nonce, sizeof(mmc->host_nonce))); + BD_DEBUG(DBG_MMC, "Created host nonce (Hn): %s\n", + str_print_hex(str, mmc->host_nonce, sizeof(mmc->host_nonce))); } crypto_create_host_key_pair(mmc->host_key, mmc->host_key_point); if (DEBUG_KEYS) { char strsizeof(mmc->host_key_point)*2 + 1; - DEBUG(DBG_MMC, "Created host key (Hk): %s\n", - print_hex(str, mmc->host_key, sizeof(mmc->host_key))); - DEBUG(DBG_MMC, "Created host key point (Hv): %s\n", - print_hex(str, mmc->host_key_point, sizeof(mmc->host_key_point))); + BD_DEBUG(DBG_MMC, "Created host key (Hk): %s\n", + str_print_hex(str, mmc->host_key, sizeof(mmc->host_key))); + BD_DEBUG(DBG_MMC, "Created host key point (Hv): %s\n", + str_print_hex(str, mmc->host_key_point, sizeof(mmc->host_key_point))); } -#if defined(USE_IOKIT) - int rc = mmc_open_iokit (path, mmc); - if (0 != rc) { + mmc->dev = device_open(path); + if (!mmc->dev) { mmc_close (mmc); return NULL; } -#elif defined(HAVE_MNTENT_H) - - char file_path AACS_PATH_MAX; - if (!aacs_resolve_path(path, file_path)) { - DEBUG(DBG_MMC | DBG_CRIT, "Failed resolving path %s\n", path); - X_FREE(mmc); - return NULL; - } - - int path_len = strlen(file_path); - FILE *proc_mounts; - - mmc->fd = -1; - - // strip trailing '/'s - while (path_len > 0 && file_path--path_len == '/') { - file_pathpath_len = '\0'; - } - - DEBUG(DBG_MMC, "Opening LINUX MMC drive %s...\n", file_path); - - if ((proc_mounts = setmntent("/proc/mounts", "r"))) { - struct mntent* mount_entry; - - while ((mount_entry = getmntent(proc_mounts)) != NULL) { - if (strcmp(mount_entry->mnt_dir, file_path) == 0) { - mmc->fd = open(mount_entry->mnt_fsname, O_RDONLY | O_NONBLOCK); - if (mmc->fd >= 0) { - DEBUG(DBG_MMC, "LINUX MMC drive %s opened - fd: %d\n", - mount_entry->mnt_fsname, mmc->fd); - break; - } - - DEBUG(DBG_MMC, "Failed opening LINUX MMC drive %s mounted to %s\n", - mount_entry->mnt_fsname, file_path); - } - } - - endmntent(proc_mounts); - } else { - DEBUG(DBG_MMC, "Error opening /proc/mounts\n"); - } - - if (mmc->fd < 0) { - DEBUG(DBG_MMC | DBG_CRIT, "Error opening LINUX MMC drive mounted to %s\n", file_path); - X_FREE(mmc); - } - -#elif defined(_WIN32) - char drive = { path0, ':', '\\', 0 }; - char volume = {'\\', '\\', '.', '\\', path0, ':', 0}; - - DEBUG(DBG_MMC, "Opening Windows MMC drive %s...\n", drive); - - UINT type = GetDriveType(drive); - - if (type != DRIVE_CDROM) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive %s is not CD/DVD drive\n", drive); - X_FREE(mmc); - return NULL; - } - - mmc->fd = CreateFile(volume, GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (mmc->fd == INVALID_HANDLE_VALUE) { - mmc->fd = CreateFile(volume, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (mmc->fd == INVALID_HANDLE_VALUE) { - DEBUG(DBG_MMC, "Failed opening Windows MMC drive %s\n", volume); - X_FREE(mmc); - return NULL; - } - } - - DEBUG(DBG_MMC, "Windows MMC drive %s opened\n", volume); - -#else - - DEBUG(DBG_MMC | DBG_CRIT, "No MMC drive support\n"); - X_FREE(mmc); - -#endif - - if (mmc && !_mmc_check_aacs(mmc)) { - DEBUG(DBG_MMC | DBG_CRIT, "AACS not active or supported by the drive\n"); + if (!_mmc_check_aacs(mmc)) { + BD_DEBUG(DBG_MMC | DBG_CRIT, "AACS not active or supported by the drive\n"); #ifndef _WIN32 mmc_close (mmc); return NULL; #endif } - if (mmc && mmc->read_drive_cert) { + if (mmc->read_drive_cert) { mmc_read_drive_cert(mmc, mmc->drive_cert); } @@ -979,31 +385,8 @@ { if (mmc) { -#if defined(HAVE_LINUX_CDROM_H) - if (mmc->fd >= 0) { - close(mmc->fd); - } - -#elif defined(_WIN32) - if (mmc->fd != INVALID_HANDLE_VALUE) { - CloseHandle(mmc->fd); - } -#elif defined(USE_IOKIT) - if (mmc->taskInterface) { - (*mmc->taskInterface)->ReleaseExclusiveAccess (mmc->taskInterface); - (*mmc->taskInterface)->Release (mmc->taskInterface); - mmc->taskInterface = NULL; - } - - if (mmc->mmcInterface) { - (*mmc->mmcInterface)->Release (mmc->mmcInterface); - mmc->mmcInterface = NULL; - } - - (void) iokit_mount (mmc); -#endif - - DEBUG(DBG_MMC, "Closed MMC drive\n"); + device_close(&mmc->dev); + BD_DEBUG(DBG_MMC, "Closed MMC drive\n"); /* erase sensitive data */ memset(mmc, 0, sizeof(*mmc)); @@ -1035,54 +418,54 @@ memset(hks, 0, sizeof(hks)); if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Host certificate : %s\n", print_hex(str, host_cert, 92)); - DEBUG(DBG_MMC, "Host nonce : %s\n", print_hex(str, mmc->host_nonce, 20)); + BD_DEBUG(DBG_MMC, "Host certificate : %s\n", str_print_hex(str, host_cert, 92)); + BD_DEBUG(DBG_MMC, "Host nonce : %s\n", str_print_hex(str, mmc->host_nonce, 20)); } // send host cert + nonce if (!_mmc_send_host_cert(mmc, agid, mmc->host_nonce, host_cert)) { if ((mmc->drive_cert1 & 0x01) && !(host_cert1 & 0x01)) { - DEBUG(DBG_MMC | DBG_CRIT, "Certificate (id 0x%s) can not be used with bus encryption capable drive\n", - print_hex(str, host_cert + 4, 6)); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Certificate (id 0x%s) can not be used with bus encryption capable drive\n", + str_print_hex(str, host_cert + 4, 6)); } else { - DEBUG(DBG_MMC | DBG_CRIT, "Host key / Certificate has been revoked by your drive ?\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Host key / Certificate has been revoked by your drive ?\n"); } return MMC_ERROR_CERT_REVOKED; } // receive mmc cert + nonce if (!_mmc_read_drive_cert_challenge(mmc, agid, dn, mmc->drive_cert)) { - DEBUG(DBG_MMC | DBG_CRIT, + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive doesn't give its certificate\n"); return MMC_ERROR; } if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Drive certificate : %s\n", print_hex(str, mmc->drive_cert, 92)); - DEBUG(DBG_MMC, "Drive nonce : %s\n", print_hex(str, dn, 20)); + BD_DEBUG(DBG_MMC, "Drive certificate : %s\n", str_print_hex(str, mmc->drive_cert, 92)); + BD_DEBUG(DBG_MMC, "Drive nonce : %s\n", str_print_hex(str, dn, 20)); } // verify drive certificate if (!crypto_aacs_verify_drive_cert(mmc->drive_cert)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); return MMC_ERROR; } // receive mmc key if (!_mmc_read_drive_key(mmc, agid, dkp, dks)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive doesn't give its drive key\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive doesn't give its drive key\n"); return MMC_ERROR; } if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Drive key point : %s\n", print_hex(str, dkp, 40)); - DEBUG(DBG_MMC, "Drive key signature : %s\n", print_hex(str, dks, 40)); + BD_DEBUG(DBG_MMC, "Drive key point : %s\n", str_print_hex(str, dkp, 40)); + BD_DEBUG(DBG_MMC, "Drive key signature : %s\n", str_print_hex(str, dks, 40)); } // verify drive signature if (!_verify_signature(mmc->drive_cert, dks, mmc->host_nonce, dkp)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive signature is invalid\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive signature is invalid\n"); return MMC_ERROR; } @@ -1092,14 +475,14 @@ // verify own signature if (!_verify_signature(host_cert, hks, dn, mmc->host_key_point)) { - DEBUG(DBG_MMC | DBG_CRIT, "Created signature is invalid ?\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Created signature is invalid ?\n"); return MMC_ERROR; } // send signed host key and point if (!_mmc_send_host_key(mmc, agid, mmc->host_key_point, hks)) { - DEBUG(DBG_MMC | DBG_CRIT, "Error sending host signature\n"); - DEBUG(DBG_MMC, "Host key signature : %s\n", print_hex(str, hks, 40)); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Error sending host signature\n"); + BD_DEBUG(DBG_MMC, "Host key signature : %s\n", str_print_hex(str, hks, 40)); return MMC_ERROR; } @@ -1107,7 +490,7 @@ if (bus_key) { crypto_create_bus_key(mmc->host_key, dkp, bus_key); if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Bus Key : %s\n", print_hex(str, bus_key, 16)); + BD_DEBUG(DBG_MMC, "Bus Key : %s\n", str_print_hex(str, bus_key, 16)); } } @@ -1123,24 +506,24 @@ uint8_t mac16, calc_mac16; char str512; - DEBUG(DBG_MMC, "Reading VID from drive...\n"); + BD_DEBUG(DBG_MMC, "Reading VID from drive...\n"); if (_mmc_read_vid(mmc, agid, vid, mac)) { if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "VID : %s\n", print_hex(str, vid, 16)); - DEBUG(DBG_MMC, "VID MAC : %s\n", print_hex(str, mac, 16)); + BD_DEBUG(DBG_MMC, "VID : %s\n", str_print_hex(str, vid, 16)); + BD_DEBUG(DBG_MMC, "VID MAC : %s\n", str_print_hex(str, mac, 16)); } /* verify MAC */ crypto_aes_cmac_16(vid, bus_key, calc_mac); if (memcmp(calc_mac, mac, 16)) { - DEBUG(DBG_MMC | DBG_CRIT, "VID MAC is incorrect. This means this Volume ID is not correct.\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "VID MAC is incorrect. This means this Volume ID is not correct.\n"); } return MMC_SUCCESS; } - DEBUG(DBG_MMC | DBG_CRIT, "Unable to read VID from drive!\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Unable to read VID from drive!\n"); return MMC_ERROR; } @@ -1150,24 +533,24 @@ uint8_t mac16, calc_mac16; char str512; - DEBUG(DBG_MMC, "Reading PMSN from drive...\n"); + BD_DEBUG(DBG_MMC, "Reading PMSN from drive...\n"); if (_mmc_read_pmsn(mmc, agid, pmsn, mac)) { if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "PMSN : %s\n", print_hex(str, pmsn, 16)); - DEBUG(DBG_MMC, "PMSN MAC : %s\n", print_hex(str, mac, 16)); + BD_DEBUG(DBG_MMC, "PMSN : %s\n", str_print_hex(str, pmsn, 16)); + BD_DEBUG(DBG_MMC, "PMSN MAC : %s\n", str_print_hex(str, mac, 16)); } /* verify MAC */ crypto_aes_cmac_16(pmsn, bus_key, calc_mac); if (memcmp(calc_mac, mac, 16)) { - DEBUG(DBG_MMC | DBG_CRIT, "PMSN MAC is incorrect. This means this Pre-recorded Medial Serial Number is not correct.\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "PMSN MAC is incorrect. This means this Pre-recorded Medial Serial Number is not correct.\n"); } return MMC_SUCCESS; } - DEBUG(DBG_MMC | DBG_CRIT, "Unable to read PMSN from drive!\n"); + BD_DEBUG(DBG_MMC, "Unable to read PMSN from drive!\n"); return MMC_ERROR; } @@ -1178,26 +561,26 @@ uint8_t encrypted_read_data_key16, encrypted_write_data_key16; char str512; - DEBUG(DBG_MMC, "Reading data keys from drive...\n"); + BD_DEBUG(DBG_MMC, "Reading data keys from drive...\n"); if (_mmc_read_data_keys(mmc, agid, encrypted_read_data_key, encrypted_write_data_key)) { if (read_data_key) { crypto_aes128d(bus_key, encrypted_read_data_key, read_data_key); if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "READ DATA KEY : %s\n", print_hex(str, read_data_key, 16)); + BD_DEBUG(DBG_MMC, "READ DATA KEY : %s\n", str_print_hex(str, read_data_key, 16)); } } if (write_data_key) { crypto_aes128d(bus_key, encrypted_write_data_key, write_data_key); if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "WRITE DATA KEY : %s\n", print_hex(str, write_data_key, 16)); + BD_DEBUG(DBG_MMC, "WRITE DATA KEY : %s\n", str_print_hex(str, write_data_key, 16)); } } return MMC_SUCCESS; } - DEBUG(DBG_MMC | DBG_CRIT, "Unable to read data keys from drive!\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Unable to read data keys from drive!\n"); return MMC_ERROR; } @@ -1211,10 +594,10 @@ _mmc_invalidate_agids(mmc); if (!_mmc_report_agid(mmc, &agid)) { - DEBUG(DBG_MMC | DBG_CRIT, "Didn't get AGID from drive\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Didn't get AGID from drive\n"); return MMC_ERROR; } - DEBUG(DBG_MMC, "Got AGID from drive: %d\n", agid); + BD_DEBUG(DBG_MMC, "Got AGID from drive: %d\n", agid); /* * NOTE: It seems that at least some drives require a new AACS-Auth every time @@ -1238,7 +621,7 @@ error_code = _read_data_keys(mmc, agid, bus_key, p1, p2); break; default: - DEBUG(DBG_MMC | DBG_CRIT, "unknown mmc_read_auth() request %d\n", request); + BD_DEBUG(DBG_MMC | DBG_CRIT, "unknown mmc_read_auth() request %d\n", request); error_code = MMC_ERROR; break; } @@ -1262,18 +645,18 @@ } if (!mmc->read_drive_cert) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive does not support reading drive certificate\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive does not support reading drive certificate\n"); } if (!_mmc_report_key(mmc, 0, 0, 0, 0x38, buf, 116)) { if (mmc->read_drive_cert) { - DEBUG(DBG_MMC | DBG_CRIT, "Failed reading drive certificate\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Failed reading drive certificate\n"); } return MMC_ERROR; } if (!crypto_aacs_verify_drive_cert(buf + 4)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); + BD_DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); return MMC_ERROR; }
View file
libaacs-0.7.1.tar.bz2/src/libaacs/mmc.h -> libaacs-0.8.0.tar.bz2/src/libaacs/mmc.h
Changed
@@ -21,7 +21,7 @@ #ifndef MMC_H_ #define MMC_H_ -#include <util/attributes.h> +#include "util/attributes.h" #include <stdint.h> @@ -35,14 +35,14 @@ #define MMC_READ_PMSN 1 #define MMC_READ_DATA_KEYS 2 -AACS_PRIVATE MMC *mmc_open(const char *path); -AACS_PRIVATE void mmc_close(MMC *mmc); -AACS_PRIVATE int mmc_read_auth(MMC *mmc, const uint8_t *host_priv_key, const uint8_t *host_cert, +BD_PRIVATE MMC *mmc_open(const char *path); +BD_PRIVATE void mmc_close(MMC *mmc); +BD_PRIVATE int mmc_read_auth(MMC *mmc, const uint8_t *host_priv_key, const uint8_t *host_cert, int request, uint8_t *p1, uint8_t *p2); -AACS_PRIVATE int mmc_read_drive_cert(MMC *mmc, uint8_t *drive_cert); -AACS_PRIVATE const uint8_t *mmc_get_drive_cert(MMC *mmc); +BD_PRIVATE int mmc_read_drive_cert(MMC *mmc, uint8_t *drive_cert); +BD_PRIVATE const uint8_t *mmc_get_drive_cert(MMC *mmc); /* read partial MKB */ -AACS_PRIVATE uint8_t *mmc_read_mkb(MMC *mmc, int address, int *size); +BD_PRIVATE uint8_t *mmc_read_mkb(MMC *mmc, int address, int *size); #endif /* MMC_H_ */
View file
libaacs-0.7.1.tar.bz2/src/util/attributes.h -> libaacs-0.8.0.tar.bz2/src/util/attributes.h
Changed
@@ -21,38 +21,41 @@ #define LIBAACS_ATTRIBUTES_H_ #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 )) -# define AACS_ATTR_FORMAT_PRINTF(format,var) \ - __attribute__((__format__(__printf__,format,var))) -# define AACS_ATTR_MALLOC __attribute__((__malloc__)) -# define AACS_ATTR_PACKED __attribute__((packed)) +# if defined(_WIN32) +# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__gnu_printf__,format,var))) +# else +# define BD_ATTR_FORMAT_PRINTF(format,var) __attribute__((__format__(__printf__,format,var))) +# endif +# define BD_ATTR_MALLOC __attribute__((__malloc__)) +# define BD_ATTR_PACKED __attribute__((packed)) #else -# define AACS_ATTR_FORMAT_PRINTF(format,var) -# define AACS_ATTR_MALLOC -# define AACS_ATTR_PACKED +# define BD_ATTR_FORMAT_PRINTF(format,var) +# define BD_ATTR_MALLOC +# define BD_ATTR_PACKED #endif #if defined(_WIN32) # if defined(__GNUC__) # define AACS_PUBLIC __attribute__((dllexport)) -# define AACS_PRIVATE +# define BD_PRIVATE # else # define AACS_PUBLIC __declspec(dllexport) -# define AACS_PRIVATE +# define BD_PRIVATE # endif #elif defined(__GNUC__) && __GNUC__ >= 4 # define AACS_PUBLIC __attribute__((visibility("default"))) -# define AACS_PRIVATE __attribute__((visibility("hidden"))) +# define BD_PRIVATE __attribute__((visibility("hidden"))) #else # define AACS_PUBLIC -# define AACS_PRIVATE +# define BD_PRIVATE #endif #if !defined(__GNUC__) || __GNUC__ < 3 -# define AACS_LIKELY(x) (x) -# define AACS_UNLIKELY(x) (x) +# define BD_LIKELY(x) (x) +# define BD_UNLIKELY(x) (x) #else -# define AACS_LIKELY(x) __builtin_expect((x),1) -# define AACS_UNLIKELY(x) __builtin_expect((x),0) +# define BD_LIKELY(x) __builtin_expect((x),1) +# define BD_UNLIKELY(x) __builtin_expect((x),0) #endif #endif /* LIBAACS_ATTRIBUTES_H_ */
View file
libaacs-0.7.1.tar.bz2/src/util/logging.c -> libaacs-0.8.0.tar.bz2/src/util/logging.c
Changed
@@ -1,6 +1,7 @@ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2013 VideoLAN * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,35 +20,30 @@ #include "logging.h" +#include "file/file.h" + #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <string.h> -uint32_t debug_mask = (uint32_t)-1; /* set all bits to make sure aacs_debug() is called for initialization */ - -char *print_hex(char *out, const uint8_t *buf, int count) -{ - int zz; - for(zz = 0; zz < count; zz++) { - sprintf(out + (zz * 2), "%02X", bufzz); - } - - return out; -} +uint32_t debug_mask = (uint32_t)-1; /* set all bits to make sure bd_debug() is called for initialization */ -void aacs_debug(const char *file, int line, uint32_t mask, const char *format, ...) +void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...) { - static int debug_init = 0; - static FILE *logfile = NULL; + static int debug_init = 0; + static FILE *logfile = NULL; // Only call getenv() once. if (!debug_init) { debug_init = 1; logfile = stderr; - debug_mask = DBG_CRIT; char *env = NULL; + if (debug_mask == (uint32_t)-1) { + /* might be set by application with bd_set_debug_mask() */ + debug_mask = DBG_CRIT; + } if ((env = getenv("AACS_DEBUG_MASK"))) debug_mask = strtol(env, NULL, 0); else if ((env = getenv("BD_DEBUG_MASK"))) @@ -58,7 +54,7 @@ FILE *fp = fopen(env, "wb"); if (fp) { logfile = fp; - setvbuf(logfile, NULL, _IOLBF, 0); + setvbuf(logfile, NULL, _IONBF, 0); } else { fprintf(logfile, "%s:%d: Error opening log file %s\n", __FILE__, __LINE__, env); } @@ -66,13 +62,16 @@ } if (mask & debug_mask) { - char buffer512; + const char *f = strrchr(file, DIR_SEP_CHAR); + char buffer4096, *pt = buffer; va_list args; + pt += sprintf(buffer, "%s:%d: ", f ? f + 1 : file, line); + va_start(args, format); - sprintf(buffer, "libaacs: %s:%d: %s", file, line, format); - vfprintf(logfile, buffer, args); + vsnprintf(pt, sizeof(buffer) - (size_t)(intptr_t)(pt - buffer) - 1, format, args); va_end(args); + fprintf(logfile, "%s", buffer); } }
View file
libaacs-0.7.1.tar.bz2/src/util/logging.h -> libaacs-0.8.0.tar.bz2/src/util/logging.h
Changed
@@ -24,15 +24,6 @@ #include <stdint.h> -AACS_PRIVATE extern uint32_t debug_mask; - -#define DEBUG(MASK,...) \ - do { \ - if (AACS_UNLIKELY((MASK) & debug_mask)) { \ - aacs_debug(__FILE__,__LINE__,MASK,__VA_ARGS__); \ - } \ - } while (0) - enum debug_mask_enum { DBG_RESERVED = 0x0001, DBG_CONFIGFILE = 0x0002, @@ -44,15 +35,23 @@ DBG_DIR = 0x0080, //DBG_NAV = 0x0100, //DBG_BDPLUS = 0x0200, - DBG_DLX = 0x0400, + //DBG_DLX = 0x0400, DBG_CRIT = 0x0800, /* this is the default debug mask so use this if you want to display critical info */ //DBG_HDMV = 0x1000, }; typedef enum debug_mask_enum debug_mask_t; -AACS_PRIVATE char *print_hex(char *out, const uint8_t *str, int count); -AACS_PRIVATE void aacs_debug(const char *file, int line, uint32_t mask, const char *format, ...) - AACS_ATTR_FORMAT_PRINTF(4,5); +BD_PRIVATE extern uint32_t debug_mask; + +#define BD_DEBUG(MASK,...) \ + do { \ + if (BD_UNLIKELY((MASK) & debug_mask)) { \ + bd_debug(__FILE__,__LINE__,MASK,__VA_ARGS__); \ + } \ + } while (0) + +BD_PRIVATE void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...) BD_ATTR_FORMAT_PRINTF(4,5); + #endif /* LOGGING_H_ */
View file
libaacs-0.7.1.tar.bz2/src/util/macro.h -> libaacs-0.8.0.tar.bz2/src/util/macro.h
Changed
@@ -20,19 +20,14 @@ #ifndef MACRO_H_ #define MACRO_H_ -#define HEX_PRINT(X,Y) \ - { \ - int zz; \ - for(zz = 0; zz < Y; zz++) \ - fprintf(stderr, "%02X", Xzz); \ - fprintf(stderr, "\n"); \ - } +#include <stdlib.h> /* free() */ + #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_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) do { if (X) free(X); X = NULL; } while(0) +#define X_FREE(X) ( free(X), X = NULL ) #endif /* MACRO_H_ */
View file
libaacs-0.7.1.tar.bz2/src/util/strutl.c -> libaacs-0.8.0.tar.bz2/src/util/strutl.c
Changed
@@ -19,13 +19,15 @@ */ #include "strutl.h" + +#include "macro.h" #include "logging.h" -#include <string.h> #include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <ctype.h> +#include <string.h> /* Function to assigns proper hex value of character to uint8_t pointer */ @@ -105,7 +107,7 @@ break; default: - DEBUG(DBG_AACS, "Invalid hex value '%c'", c); + BD_DEBUG(DBG_AACS, "Invalid hex value '%c'", c); return 0; } @@ -151,6 +153,11 @@ return 1; } +char * str_dup(const char *str) +{ + return str ? strcpy (malloc(strlen(str) + 1), str) : NULL; +} + char *str_printf(const char *fmt, ...) { /* Guess we need no more than 100 bytes. */ @@ -210,7 +217,7 @@ /* check end */ if (isxdigit(strii)) { - //DEBUG(DBG_AACS, "Invalid hex string (too long): %s", str); + //BD_DEBUG(DBG_AACS, "Invalid hex string (too long): %s", str); return 0; } @@ -240,3 +247,13 @@ return s; } + +char *str_print_hex(char *out, const uint8_t *buf, int count) +{ + int zz; + for (zz = 0; zz < count; zz++) { + sprintf(out + (zz * 2), "%02x", bufzz); + } + + return out; +}
View file
libaacs-0.7.1.tar.bz2/src/util/strutl.h -> libaacs-0.8.0.tar.bz2/src/util/strutl.h
Changed
@@ -24,13 +24,16 @@ #include <stdint.h> -AACS_PRIVATE int hexstring_to_hex_array(uint8_t *hex_array, uint32_t size, +BD_PRIVATE int hexstring_to_hex_array(uint8_t *hex_array, uint32_t size, const char *hexstring); -AACS_PRIVATE int hex_array_to_hexstring(char *str, const uint8_t *hex_array, uint32_t size); +BD_PRIVATE int hex_array_to_hexstring(char *str, const uint8_t *hex_array, uint32_t size); -AACS_PRIVATE char *str_printf(const char *fmt, ...) AACS_ATTR_FORMAT_PRINTF(1,2) AACS_ATTR_MALLOC; +BD_PRIVATE char * str_dup(const char *str) BD_ATTR_MALLOC; +BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD_ATTR_MALLOC; -AACS_PRIVATE const char * str_next_line (const char *str); -AACS_PRIVATE char * str_get_hex_string(const char *str, int len) AACS_ATTR_MALLOC; +BD_PRIVATE const char * str_next_line (const char *str); +BD_PRIVATE char * str_get_hex_string(const char *str, int len) BD_ATTR_MALLOC; + +BD_PRIVATE char * str_print_hex(char *out, const uint8_t *str, int count); #endif // STRUTL_H_
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
.