Projects
Essentials
libaacs
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
libaacs.changes
Changed
@@ -1,4 +1,24 @@ ------------------------------------------------------------------- +Fri Apr 25 15:29:24 UTC 2014 - dnh@opensuse.org + +- update to 0.7.0 + * Add aacs_get_device_binding_id() and aacs_get_device_nonce(). + * Add aacs_get_mk(). + * Add support for bus encryption. + * Add support for device keys. + * Add support for internal keys. + * Fix reading PMSN. + * Fix reporting AACS version from AACS drive feature. + * Calculate bus key and use it to verify message authentication codes. + * Do not fail if VID is known but config file does not exist. + * Improve validating keys in KEYDB.cfg. + * Update KEYDB.cfg format (still backwards compatible): + * Host nonce and host key point are optional. + * Add device key UV values and masks. + * Build system updates. + * Drop support for compile-time PATCHED_DRIVE flag. + +------------------------------------------------------------------- Sat Mar 16 11:20:34 UTC 2013 - obs@botter.cc - update to 0.6.0
View file
libaacs.spec
Changed
@@ -19,7 +19,7 @@ Name: libaacs -Version: 0.6.0 +Version: 0.7.0 Release: 1.1 License: LGPL-2.1+ Summary: Open implentation of AACS specification
View file
libaacs-0.6.0.tar.bz2/src/examples/Makefile.am
Deleted
@@ -1,18 +0,0 @@ -SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/file - -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) - -AACS_LIB = $(top_builddir)/src/libaacs.la - -noinst_PROGRAMS=parser_test -bin_PROGRAMS=aacs_info - -parser_test_SOURCES=parser_test.c \ - $(top_builddir)/src/keydbcfg-lexer.c \ - $(top_builddir)/src/keydbcfg-parser.c - -parser_test_LDADD = $(AACS_LIB) - -aacs_info_SOURCE=libaacs_test.c -aacs_info_LDADD = $(AACS_LIB)
View file
libaacs-0.6.0.tar.bz2/src/examples/Makefile.in
Deleted
@@ -1,590 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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@ -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@ -noinst_PROGRAMS = parser_test$(EXEEXT) -bin_PROGRAMS = aacs_info$(EXEEXT) -subdir = src/examples -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -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 = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -aacs_info_SOURCES = aacs_info.c -aacs_info_OBJECTS = aacs_info.$(OBJEXT) -aacs_info_DEPENDENCIES = $(AACS_LIB) -am_parser_test_OBJECTS = parser_test.$(OBJEXT) \ - keydbcfg-lexer.$(OBJEXT) keydbcfg-parser.$(OBJEXT) -parser_test_OBJECTS = $(am_parser_test_OBJECTS) -parser_test_DEPENDENCIES = $(AACS_LIB) -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) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = aacs_info.c $(parser_test_SOURCES) -DIST_SOURCES = aacs_info.c $(parser_test_SOURCES) -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@ -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@ -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 = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -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) -I$(top_srcdir)/src -I$(top_srcdir)/src/file -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) -AACS_LIB = $(top_builddir)/src/libaacs.la -parser_test_SOURCES = parser_test.c \ - $(top_builddir)/src/keydbcfg-lexer.c \ - $(top_builddir)/src/keydbcfg-parser.c - -parser_test_LDADD = $(AACS_LIB) -aacs_info_SOURCE = libaacs_test.c -aacs_info_LDADD = $(AACS_LIB) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(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/examples/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/examples/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): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - 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 -aacs_info$(EXEEXT): $(aacs_info_OBJECTS) $(aacs_info_DEPENDENCIES) $(EXTRA_aacs_info_DEPENDENCIES) - @rm -f aacs_info$(EXEEXT) - $(LINK) $(aacs_info_OBJECTS) $(aacs_info_LDADD) $(LIBS) -parser_test$(EXEEXT): $(parser_test_OBJECTS) $(parser_test_DEPENDENCIES) $(EXTRA_parser_test_DEPENDENCIES) - @rm -f parser_test$(EXEEXT) - $(LINK) $(parser_test_OBJECTS) $(parser_test_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aacs_info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keydbcfg-lexer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keydbcfg-parser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -keydbcfg-lexer.o: $(top_builddir)/src/keydbcfg-lexer.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keydbcfg-lexer.o -MD -MP -MF $(DEPDIR)/keydbcfg-lexer.Tpo -c -o keydbcfg-lexer.o `test -f '$(top_builddir)/src/keydbcfg-lexer.c' || echo '$(srcdir)/'`$(top_builddir)/src/keydbcfg-lexer.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/keydbcfg-lexer.Tpo $(DEPDIR)/keydbcfg-lexer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/src/keydbcfg-lexer.c' object='keydbcfg-lexer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o keydbcfg-lexer.o `test -f '$(top_builddir)/src/keydbcfg-lexer.c' || echo '$(srcdir)/'`$(top_builddir)/src/keydbcfg-lexer.c - -keydbcfg-lexer.obj: $(top_builddir)/src/keydbcfg-lexer.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keydbcfg-lexer.obj -MD -MP -MF $(DEPDIR)/keydbcfg-lexer.Tpo -c -o keydbcfg-lexer.obj `if test -f '$(top_builddir)/src/keydbcfg-lexer.c'; then $(CYGPATH_W) '$(top_builddir)/src/keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/keydbcfg-lexer.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/keydbcfg-lexer.Tpo $(DEPDIR)/keydbcfg-lexer.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/src/keydbcfg-lexer.c' object='keydbcfg-lexer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o keydbcfg-lexer.obj `if test -f '$(top_builddir)/src/keydbcfg-lexer.c'; then $(CYGPATH_W) '$(top_builddir)/src/keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/keydbcfg-lexer.c'; fi` - -keydbcfg-parser.o: $(top_builddir)/src/keydbcfg-parser.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keydbcfg-parser.o -MD -MP -MF $(DEPDIR)/keydbcfg-parser.Tpo -c -o keydbcfg-parser.o `test -f '$(top_builddir)/src/keydbcfg-parser.c' || echo '$(srcdir)/'`$(top_builddir)/src/keydbcfg-parser.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/keydbcfg-parser.Tpo $(DEPDIR)/keydbcfg-parser.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/src/keydbcfg-parser.c' object='keydbcfg-parser.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o keydbcfg-parser.o `test -f '$(top_builddir)/src/keydbcfg-parser.c' || echo '$(srcdir)/'`$(top_builddir)/src/keydbcfg-parser.c - -keydbcfg-parser.obj: $(top_builddir)/src/keydbcfg-parser.c -@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT keydbcfg-parser.obj -MD -MP -MF $(DEPDIR)/keydbcfg-parser.Tpo -c -o keydbcfg-parser.obj `if test -f '$(top_builddir)/src/keydbcfg-parser.c'; then $(CYGPATH_W) '$(top_builddir)/src/keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/keydbcfg-parser.c'; fi` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/keydbcfg-parser.Tpo $(DEPDIR)/keydbcfg-parser.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(top_builddir)/src/keydbcfg-parser.c' object='keydbcfg-parser.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o keydbcfg-parser.obj `if test -f '$(top_builddir)/src/keydbcfg-parser.c'; then $(CYGPATH_W) '$(top_builddir)/src/keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/keydbcfg-parser.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files$$0 = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files$$0 = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - 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 -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files$$0 = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - 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" - -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 -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: 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: - -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) - -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-am - -clean-am: clean-binPROGRAMS clean-generic clean-libtool \ - clean-noinstPROGRAMS mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(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-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -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 ./$(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 - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool clean-noinstPROGRAMS ctags \ - 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-man install-pdf \ - install-pdf-am 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 uninstall uninstall-am uninstall-binPROGRAMS - - -# 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.6.0.tar.bz2/src/file/darwin.c
Deleted
@@ -1,95 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2012 Konstantin Pavlov - * - * 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/>. - */ - -#include "darwin.h" - -#include <CoreFoundation/CoreFoundation.h> - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "util/strutl.h" -#include "util/logging.h" - -#define USER_CFG_DIR "Library/Preferences" -#define USER_CACHE_DIR "Library/Caches" -#define SYSTEM_CFG_DIR "/Library/Preferences" - - -const char *darwin_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"); - } - - return dir; -} - -const char *darwin_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"); - } - - return dir; -} - -const char *darwin_get_config_system(const char *dir) -{ - static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0" - - if (!dirs) { - dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0); - } - - if (!dir) { - // first call - dir = dirs; - } else { - // next call - dir += strlen(dir) + 1; - if (!*dir) { - // end of list - dir = NULL; - } - } - - return dir; -}
View file
libaacs-0.6.0.tar.bz2/src/file/darwin.h
Deleted
@@ -1,29 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2012 Konstantin Pavlov - * - * 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_DARWIN_H -#define AACS_DARWIN_H - -#include <util/attributes.h> - -AACS_PRIVATE const char *darwin_get_config_home(void); -AACS_PRIVATE const char *darwin_get_config_system(const char *dir); -AACS_PRIVATE const char *darwin_get_cache_home(void); - -#endif
View file
libaacs-0.6.0.tar.bz2/src/file/win32.c
Deleted
@@ -1,89 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2011 VideoLAN - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#include "win32.h" - -#include "util/logging.h" - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include <stdio.h> -#include <string.h> - -#include <shlobj.h> -#include <w32api.h> -#include <limits.h> -#include <direct.h> - -int win32_mkdir(const char *dir) -{ - wchar_t wdirMAX_PATH; - - MultiByteToWideChar(CP_UTF8, 0, dir, -1, wdir, MAX_PATH); - return _wmkdir(wdir); -} - -const char *win32_get_config_home(void) -{ - static char appdirPATH_MAX = ""; - 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)) { - WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, PATH_MAX, NULL, NULL); - return appdir; - } - - DEBUG(DBG_FILE, "Can't find user configuration directory !\n"); - return NULL; -} - -const char *win32_get_config_system(const char *dir) -{ - static char appdirPATH_MAX = ""; - wchar_t wdirMAX_PATH; - - if (!dir) { - // first call - - if (*appdir) - return appdir; - - /* Get the "Application Data" folder for all users */ - if (S_OK == SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, - NULL, SHGFP_TYPE_CURRENT, wdir)) { - WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, PATH_MAX, NULL, NULL); - return appdir; - } else { - DEBUG(DBG_FILE, "Can't find common configuration directory !\n"); - return NULL; - } - } else { - // next call - return NULL; - } - - return dir; -}
View file
libaacs-0.6.0.tar.bz2/src/file/win32.h
Deleted
@@ -1,29 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2011 VideoLAN - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#ifndef AACS_WIN32_H -#define AACS_WIN32_H - -#include <util/attributes.h> - -AACS_PRIVATE int win32_mkdir(const char *dir); -AACS_PRIVATE const char *win32_get_config_home(void); -AACS_PRIVATE const char *win32_get_config_system(const char *dir); - -#endif
View file
libaacs-0.6.0.tar.bz2/src/file/xdg.c
Deleted
@@ -1,122 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2010 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/>. - */ - -#include "xdg.h" - -#include "util/strutl.h" -#include "util/logging.h" - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -/* - * Based on XDG Base Directory Specification - * http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html - */ - -#define USER_CFG_DIR ".config" -#define USER_CACHE_DIR ".cache" -#define SYSTEM_CFG_DIR "/etc/xdg" - - -const char *xdg_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); - } - - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); - } - - return dir; -} - -const char *xdg_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); - } - - DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); - } - - return dir; -} - -const char *xdg_get_config_system(const char *dir) -{ - static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0" - - if (!dirs) { - const char *xdg_sys = getenv("XDG_CONFIG_DIRS"); - - if (xdg_sys && *xdg_sys) { - - dirs = calloc(1, strlen(xdg_sys) + 2); - strcpy(dirs, xdg_sys); - - char *pt = dirs; - while (NULL != (pt = strchr(pt, ':'))) { - *pt++ = 0; - } - - } else { - dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0); - } - } - - if (!dir) { - // first call - dir = dirs; - } else { - // next call - dir += strlen(dir) + 1; - if (!*dir) { - // end of list - dir = NULL; - } - } - - return dir; -}
View file
libaacs-0.6.0.tar.bz2/src/file/xdg.h
Deleted
@@ -1,29 +0,0 @@ -/* - * This file is part of libaacs - * Copyright (C) 2010 npzacs - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * <http://www.gnu.org/licenses/>. - */ - -#ifndef AACS_XDG_H -#define AACS_XDG_H - -#include <util/attributes.h> - -AACS_PRIVATE const char *xdg_get_config_home(void); -AACS_PRIVATE const char *xdg_get_config_system(const char *dir); -AACS_PRIVATE const char *xdg_get_cache_home(void); - -#endif
View file
libaacs-0.6.0.tar.bz2/src/keydbcfg-lexer.c
Deleted
@@ -1,2282 +0,0 @@ -#line 2 "keydbcfg-lexer.c" - -#line 4 "keydbcfg-lexer.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include <stdio.h> -#include <string.h> -#include <errno.h> -#include <stdlib.h> - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include <inttypes.h> -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yyg->yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yyg->yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE libaacs_yyrestart(yyin ,yyscanner ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE libaacs_yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytextyyl == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via libaacs_yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stackyyg->yy_buffer_stack_top \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stackyyg->yy_buffer_stack_top - -void libaacs_yyrestart (FILE *input_file ,yyscan_t yyscanner ); -void libaacs_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE libaacs_yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void libaacs_yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void libaacs_yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void libaacs_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void libaacs_yypop_buffer_state (yyscan_t yyscanner ); - -static void libaacs_yyensure_buffer_stack (yyscan_t yyscanner ); -static void libaacs_yy_load_buffer_state (yyscan_t yyscanner ); -static void libaacs_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - -#define YY_FLUSH_BUFFER libaacs_yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) - -YY_BUFFER_STATE libaacs_yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE libaacs_yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE libaacs_yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); - -void *libaacs_yyalloc (yy_size_t ,yyscan_t yyscanner ); -void *libaacs_yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); -void libaacs_yyfree (void * ,yyscan_t yyscanner ); - -#define yy_new_buffer libaacs_yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - libaacs_yyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - libaacs_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - libaacs_yyensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - libaacs_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define libaacs_yywrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -typedef int yy_state_type; - -#define yytext_ptr yytext_r - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg ,yyscan_t yyscanner ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yyg->yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 30 -#define YY_END_OF_BUFFER 31 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept172 = - { 0, - 0, 0, 2, 2, 31, 29, 1, 27, 27, 25, - 5, 5, 28, 23, 29, 29, 29, 24, 2, 1, - 3, 2, 2, 2, 2, 2, 2, 2, 2, 5, - 0, 28, 0, 0, 26, 26, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, - 2, 2, 4, 0, 0, 26, 0, 18, 0, 0, - 15, 0, 0, 17, 0, 16, 0, 0, 20, 0, - 21, 0, 22, 0, 19, 2, 2, 2, 0, 0, - 0, 12, 0, 14, 0, 13, 2, 2, 0, 0, - 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, - - 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, - 2, 2, 0, 0, 0, 0, 0, 0, 2, 2, - 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 6, 0, 9, 0, - 0, 0, 2, 2, 2, 2, 2, 2, 7, 0, - 10, 0, 2, 2, 2, 2, 0, 0, 2, 2, - 0, 0, 2, 2, 0, 8, 2, 2, 11, 2, - 0 - } ; - -static yyconst flex_int32_t yy_ec256 = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 5, 1, 1, 6, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 1, 8, 1, - 9, 1, 1, 1, 10, 11, 12, 13, 14, 10, - 1, 15, 16, 1, 17, 1, 18, 19, 20, 21, - 1, 22, 23, 24, 25, 26, 1, 27, 28, 1, - 1, 29, 1, 1, 30, 1, 10, 11, 12, 13, - - 14, 10, 1, 15, 16, 1, 17, 1, 18, 19, - 20, 21, 1, 22, 23, 24, 25, 26, 1, 27, - 28, 1, 1, 31, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta32 = - { 0, - 1, 1, 2, 1, 1, 3, 3, 1, 1, 3, - 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, - 4 - } ; - -static yyconst flex_int16_t yy_base178 = - { 0, - 0, 30, 60, 90, 255, 256, 256, 256, 256, 256, - 13, 4, 0, 256, 240, 233, 13, 120, 0, 0, - 256, 0, 0, 15, 17, 15, 0, 238, 231, 19, - 0, 0, 224, 226, 244, 244, 0, 10, 53, 234, - 16, 25, 55, 46, 47, 48, 0, 45, 141, 29, - 219, 221, 0, 227, 218, 256, 51, 256, 52, 69, - 256, 78, 79, 256, 83, 256, 85, 86, 256, 99, - 256, 106, 256, 109, 256, 0, 225, 216, 227, 208, - 111, 256, 118, 256, 125, 256, 225, 206, 221, 145, - 220, 146, 203, 218, 217, 210, 207, 198, 213, 212, - - 205, 202, 11, 201, 194, 202, 204, 57, 197, 190, - 198, 200, 201, 194, 189, 182, 199, 184, 195, 188, - 183, 176, 193, 178, 175, 189, 199, 179, 185, 168, - 169, 183, 193, 173, 179, 162, 256, 177, 188, 169, - 186, 170, 0, 170, 179, 157, 159, 143, 256, 143, - 148, 129, 0, 123, 132, 118, 110, 100, 107, 97, - 100, 121, 94, 113, 110, 105, 104, 102, 100, 88, - 256, 167, 171, 175, 179, 182, 11 - } ; - -static yyconst flex_int16_t yy_def178 = - { 0, - 172, 172, 173, 173, 171, 171, 171, 171, 171, 171, - 171, 171, 174, 171, 171, 171, 171, 171, 175, 175, - 171, 175, 175, 175, 175, 176, 175, 175, 175, 171, - 177, 174, 171, 171, 171, 171, 18, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 175, 175, 175, 176, - 175, 175, 177, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 49, 175, 175, 171, 171, - 171, 171, 171, 171, 171, 171, 175, 175, 171, 171, - 175, 175, 171, 171, 171, 171, 171, 175, 175, 175, - - 175, 175, 171, 171, 171, 171, 171, 175, 175, 175, - 175, 175, 171, 171, 171, 171, 171, 171, 175, 175, - 175, 175, 175, 175, 171, 171, 171, 171, 171, 171, - 175, 175, 175, 175, 175, 175, 171, 171, 171, 171, - 171, 171, 175, 175, 175, 175, 175, 175, 171, 171, - 171, 171, 175, 175, 175, 175, 171, 171, 175, 175, - 171, 171, 175, 175, 171, 171, 175, 175, 171, 175, - 0, 171, 171, 171, 171, 171, 171 - } ; - -static yyconst flex_int16_t yy_nxt288 = - { 0, - 171, 7, 8, 9, 10, 11, 12, 13, 14, 30, - 30, 57, 15, 53, 16, 35, 36, 63, 30, 30, - 48, 48, 48, 48, 30, 30, 65, 113, 17, 114, - 18, 7, 8, 9, 10, 11, 12, 13, 14, 31, - 58, 49, 15, 32, 16, 32, 64, 70, 72, 74, - 48, 48, 57, 59, 59, 66, 67, 32, 17, 32, - 18, 20, 21, 22, 23, 24, 25, 26, 27, 60, - 81, 68, 28, 119, 29, 120, 71, 73, 75, 83, - 63, 58, 61, 61, 65, 69, 67, 85, 17, 170, - 18, 20, 21, 22, 23, 24, 25, 26, 27, 82, - - 70, 169, 28, 168, 29, 170, 166, 72, 84, 64, - 74, 169, 81, 66, 168, 69, 86, 167, 17, 83, - 18, 37, 166, 165, 164, 163, 85, 162, 161, 71, - 38, 160, 39, 155, 40, 41, 73, 42, 159, 75, - 43, 82, 158, 44, 45, 46, 76, 76, 84, 151, - 76, 76, 76, 76, 76, 86, 94, 99, 157, 156, - 155, 95, 100, 96, 101, 97, 102, 6, 6, 6, - 6, 19, 19, 19, 19, 32, 154, 32, 32, 47, - 145, 47, 50, 153, 50, 50, 152, 151, 150, 139, - 149, 148, 147, 146, 145, 144, 143, 142, 141, 140, - - 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, - 129, 128, 127, 126, 125, 124, 123, 122, 121, 118, - 117, 116, 115, 112, 111, 110, 109, 108, 107, 106, - 105, 104, 103, 98, 93, 92, 91, 90, 89, 88, - 87, 80, 79, 78, 77, 62, 56, 56, 55, 54, - 52, 51, 34, 33, 171, 5, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171 - } ; - -static yyconst flex_int16_t yy_chk288 = - { 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 12, - 12, 38, 1, 177, 1, 17, 17, 41, 11, 11, - 24, 24, 25, 25, 30, 30, 42, 103, 1, 103, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 11, - 38, 24, 2, 26, 2, 26, 41, 44, 45, 46, - 48, 48, 57, 59, 39, 42, 43, 50, 2, 50, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 39, - 60, 43, 3, 108, 3, 108, 44, 45, 46, 62, - 63, 57, 59, 39, 65, 43, 67, 68, 3, 170, - 3, 4, 4, 4, 4, 4, 4, 4, 4, 60, - - 70, 169, 4, 168, 4, 167, 166, 72, 62, 63, - 74, 165, 81, 65, 164, 67, 68, 163, 4, 83, - 4, 18, 162, 161, 160, 159, 85, 158, 157, 70, - 18, 156, 18, 155, 18, 18, 72, 18, 154, 74, - 18, 81, 152, 18, 18, 18, 49, 49, 83, 151, - 49, 49, 49, 49, 49, 85, 90, 92, 150, 148, - 147, 90, 92, 90, 92, 90, 92, 172, 172, 172, - 172, 173, 173, 173, 173, 174, 146, 174, 174, 175, - 145, 175, 176, 144, 176, 176, 142, 141, 140, 139, - 138, 136, 135, 134, 133, 132, 131, 130, 129, 128, - - 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, - 117, 116, 115, 114, 113, 112, 111, 110, 109, 107, - 106, 105, 104, 102, 101, 100, 99, 98, 97, 96, - 95, 94, 93, 91, 89, 88, 87, 80, 79, 78, - 77, 55, 54, 52, 51, 40, 36, 35, 34, 33, - 29, 28, 16, 15, 5, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171 - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol31 = - { 0, -0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, }; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "keydbcfg-lexer.l" -#line 2 "keydbcfg-lexer.l" -/* - * This file is part of libaacs - * Copyright (C) 2010 gates - * - * 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/>. - */ - -#include "keydbcfg-parser.h" - -#define YY_NO_UNISTD_H - -/* Disable some warnings triggered by generated scanner */ -#ifdef __GNUC__ -#pragma GCC diagnostic ignored "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC diagnostic ignored "-Wmissing-prototypes" -#pragma GCC visibility push(hidden) -#endif - -int isatty(int i) { return 0; } - -#if 0 -static char *trim_string(const char *string); -#endif -/* Options to generate reentrant lexer that's POSIX lex compatible. The - * bison-bridge option is also set since bison forces the use of a parameter - * used to get yylval. This is handy anyway and some implementations of byacc - * from some BSD distros support bison-bridge as well. - */ -#define YY_NO_INPUT 1 - -#line 621 "keydbcfg-lexer.c" - -#define INITIAL 0 -#define TITLE_STATE 1 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include <unistd.h> -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - int yy_n_chars; - int yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - }; /* end struct yyguts_t */ - -static int yy_init_globals (yyscan_t yyscanner ); - - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - -int libaacs_yylex_init (yyscan_t* scanner); - -int libaacs_yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int libaacs_yylex_destroy (yyscan_t yyscanner ); - -int libaacs_yyget_debug (yyscan_t yyscanner ); - -void libaacs_yyset_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE libaacs_yyget_extra (yyscan_t yyscanner ); - -void libaacs_yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *libaacs_yyget_in (yyscan_t yyscanner ); - -void libaacs_yyset_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *libaacs_yyget_out (yyscan_t yyscanner ); - -void libaacs_yyset_out (FILE * out_str ,yyscan_t yyscanner ); - -int libaacs_yyget_leng (yyscan_t yyscanner ); - -char *libaacs_yyget_text (yyscan_t yyscanner ); - -int libaacs_yyget_lineno (yyscan_t yyscanner ); - -void libaacs_yyset_lineno (int line_number ,yyscan_t yyscanner ); - -YYSTYPE * libaacs_yyget_lval (yyscan_t yyscanner ); - -void libaacs_yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int libaacs_yywrap (yyscan_t yyscanner ); -#else -extern int libaacs_yywrap (yyscan_t yyscanner ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); -#else -static int input (yyscan_t yyscanner ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - bufn = (char) c; \ - if ( c == '\n' ) \ - bufn++ = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int libaacs_yylex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); - -#define YY_DECL int libaacs_yylex \ - (YYSTYPE * yylval_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - -#line 88 "keydbcfg-lexer.l" - -#line 860 "keydbcfg-lexer.c" - - yylval = yylval_param; - - if ( !yyg->yy_init ) - { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - libaacs_yyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - libaacs_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - libaacs_yy_load_buffer_state(yyscanner ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yyg->yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ecYY_SC_TO_UI(*yy_cp); - if ( yy_acceptyy_current_state ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chkyy_baseyy_current_state + yy_c != yy_current_state ) - { - yy_current_state = (int) yy_defyy_current_state; - if ( yy_current_state >= 172 ) - yy_c = yy_meta(unsigned int) yy_c; - } - yy_current_state = yy_nxtyy_baseyy_current_state + (unsigned int) yy_c; - ++yy_cp; - } - while ( yy_baseyy_current_state != 256 ); - -yy_find_action: - yy_act = yy_acceptyy_current_state; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - yy_act = yy_acceptyy_current_state; - } - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eolyy_act ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytextyyl == '\n' ) - - do{ yylineno++; - yycolumn=0; - }while(0) -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 89 "keydbcfg-lexer.l" -{} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 91 "keydbcfg-lexer.l" -{ - //yylval->string = trim_string(yytext); - yylval->string = yytext; - BEGIN INITIAL; - return DISC_TITLE; - } - YY_BREAK -case 3: -/* rule 3 can match eol */ -YY_RULE_SETUP -#line 97 "keydbcfg-lexer.l" -{ - printf("Bad entry at line %u!\n", yylineno); - BEGIN INITIAL; - return BAD_ENTRY; - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 103 "keydbcfg-lexer.l" -{ - /* strip the '0x' portion of hexstring */ - yylval->string = yytext + 2; - return HEXSTRING; - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 108 "keydbcfg-lexer.l" -{ - yylval->digit = (unsigned int)atoi(yytext); - return DIGIT; - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 113 "keydbcfg-lexer.l" -{ return KEYWORD_DEVICE_KEY; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 114 "keydbcfg-lexer.l" -{ return KEYWORD_DEVICE_NODE; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 115 "keydbcfg-lexer.l" -{ return KEYWORD_HOST_PRIV_KEY; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 116 "keydbcfg-lexer.l" -{ return KEYWORD_HOST_CERT; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 117 "keydbcfg-lexer.l" -{ return KEYWORD_HOST_NONCE; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 118 "keydbcfg-lexer.l" -{ return KEYWORD_HOST_KEY_POINT; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 120 "keydbcfg-lexer.l" -{ return ENTRY_ID_DK; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 121 "keydbcfg-lexer.l" -{ return ENTRY_ID_PK; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 122 "keydbcfg-lexer.l" -{ return ENTRY_ID_HC; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 123 "keydbcfg-lexer.l" -{ return ENTRY_ID_DATE; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 124 "keydbcfg-lexer.l" -{ return ENTRY_ID_MEK; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 125 "keydbcfg-lexer.l" -{ return ENTRY_ID_VID; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 126 "keydbcfg-lexer.l" -{ return ENTRY_ID_BN; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 127 "keydbcfg-lexer.l" -{ return ENTRY_ID_VUK; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 128 "keydbcfg-lexer.l" -{ return ENTRY_ID_PAK; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 129 "keydbcfg-lexer.l" -{ return ENTRY_ID_TK; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 130 "keydbcfg-lexer.l" -{ return ENTRY_ID_UK; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 132 "keydbcfg-lexer.l" -{ BEGIN TITLE_STATE; return PUNCT_EQUALS_SIGN; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 133 "keydbcfg-lexer.l" -{ return PUNCT_VERTICAL_BAR; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 134 "keydbcfg-lexer.l" -{ return PUNCT_HYPHEN; } - YY_BREAK -case 26: -/* rule 26 can match eol */ -YY_RULE_SETUP -#line 136 "keydbcfg-lexer.l" -{} - YY_BREAK -case 27: -/* rule 27 can match eol */ -YY_RULE_SETUP -#line 137 "keydbcfg-lexer.l" -{ return NEWLINE; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 139 "keydbcfg-lexer.l" -{} - YY_BREAK -case 29: -YY_RULE_SETUP -#line 140 "keydbcfg-lexer.l" -{ return BAD_ENTRY; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 141 "keydbcfg-lexer.l" -ECHO; - YY_BREAK -#line 1126 "keydbcfg-lexer.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(TITLE_STATE): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * libaacs_yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_bufyyg->yy_n_chars ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yyg->yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_END_OF_FILE: - { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( libaacs_yywrap(yyscanner ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_bufyyg->yy_n_chars; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of libaacs_yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_bufyyg->yy_n_chars + 1 ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - libaacs_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yyg->yy_c_buf_p = &b->yy_ch_bufyy_c_buf_p_offset; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_bufnumber_to_move), - yyg->yy_n_chars, (size_t) num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if ( yyg->yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - libaacs_yyrestart(yyin ,yyscanner); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) libaacs_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_bufyyg->yy_n_chars = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_bufyyg->yy_n_chars + 1 = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf0; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_current_state = yyg->yy_start; - - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ecYY_SC_TO_UI(*yy_cp) : 1); - if ( yy_acceptyy_current_state ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chkyy_baseyy_current_state + yy_c != yy_current_state ) - { - yy_current_state = (int) yy_defyy_current_state; - if ( yy_current_state >= 172 ) - yy_c = yy_meta(unsigned int) yy_c; - } - yy_current_state = yy_nxtyy_baseyy_current_state + (unsigned int) yy_c; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) -{ - register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_acceptyy_current_state ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chkyy_baseyy_current_state + yy_c != yy_current_state ) - { - yy_current_state = (int) yy_defyy_current_state; - if ( yy_current_state >= 172 ) - yy_c = yy_meta(unsigned int) yy_c; - } - yy_current_state = yy_nxtyy_baseyy_current_state + (unsigned int) yy_c; - yy_is_jam = (yy_current_state == 171); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) -#else - static int input (yyscan_t yyscanner) -#endif - -{ - int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_bufyyg->yy_n_chars ) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; - ++yyg->yy_c_buf_p; - - switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - libaacs_yyrestart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( libaacs_yywrap(yyscanner ) ) - return EOF; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(yyscanner); -#else - return input(yyscanner); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; - - if ( c == '\n' ) - - do{ yylineno++; - yycolumn=0; - }while(0) -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * @param yyscanner The scanner object. - * @note This function does not reset the start condition to @c INITIAL . - */ - void libaacs_yyrestart (FILE * input_file , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! YY_CURRENT_BUFFER ){ - libaacs_yyensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - libaacs_yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - libaacs_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - libaacs_yy_load_buffer_state(yyscanner ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * @param yyscanner The scanner object. - */ - void libaacs_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * libaacs_yypop_buffer_state(); - * libaacs_yypush_buffer_state(new_buffer); - */ - libaacs_yyensure_buffer_stack (yyscanner); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - libaacs_yy_load_buffer_state(yyscanner ); - - /* We don't actually know whether we did this switch during - * EOF (libaacs_yywrap()) processing, but the only time this flag - * is looked at is after libaacs_yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; -} - -static void libaacs_yy_load_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - yyg->yy_hold_char = *yyg->yy_c_buf_p; -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. - */ - YY_BUFFER_STATE libaacs_yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) libaacs_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in libaacs_yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) libaacs_yyalloc(b->yy_buf_size + 2 ,yyscanner ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in libaacs_yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - libaacs_yy_init_buffer(b,file ,yyscanner); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with libaacs_yy_create_buffer() - * @param yyscanner The scanner object. - */ - void libaacs_yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - libaacs_yyfree((void *) b->yy_ch_buf ,yyscanner ); - - libaacs_yyfree((void *) b ,yyscanner ); -} - -#ifndef __cplusplus -extern int isatty (int ); -#endif /* __cplusplus */ - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a libaacs_yyrestart() or at EOF. - */ - static void libaacs_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) - -{ - int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - libaacs_yy_flush_buffer(b ,yyscanner); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then libaacs_yy_init_buffer was _probably_ - * called from libaacs_yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. - */ - void libaacs_yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf0 = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf1 = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf0; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - libaacs_yy_load_buffer_state(yyscanner ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * @param yyscanner The scanner object. - */ -void libaacs_yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) - return; - - libaacs_yyensure_buffer_stack(yyscanner); - - /* This block is copied from libaacs_yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from libaacs_yy_switch_to_buffer. */ - libaacs_yy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * @param yyscanner The scanner object. - */ -void libaacs_yypop_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - libaacs_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - libaacs_yy_load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void libaacs_yyensure_buffer_stack (yyscan_t yyscanner) -{ - int num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (!yyg->yy_buffer_stack) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)libaacs_yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in libaacs_yyensure_buffer_stack()" ); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)libaacs_yyrealloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in libaacs_yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); - yyg->yy_buffer_stack_max = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE libaacs_yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - basesize-2 != YY_END_OF_BUFFER_CHAR || - basesize-1 != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) libaacs_yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in libaacs_yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - libaacs_yy_switch_to_buffer(b ,yyscanner ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to libaacs_yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * libaacs_yy_scan_bytes() instead. - */ -YY_BUFFER_STATE libaacs_yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) -{ - - return libaacs_yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); -} - -/** Setup the input buffer state to scan the given bytes. The next call to libaacs_yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE libaacs_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) libaacs_yyalloc(n ,yyscanner ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in libaacs_yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - bufi = yybytesi; - - buf_yybytes_len = buf_yybytes_len+1 = YY_END_OF_BUFFER_CHAR; - - b = libaacs_yy_scan_buffer(buf,n ,yyscanner); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in libaacs_yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytextyyleng = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the user-defined data for this scanner. - * @param yyscanner The scanner object. - */ -YY_EXTRA_TYPE libaacs_yyget_extra (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; -} - -/** Get the current line number. - * @param yyscanner The scanner object. - */ -int libaacs_yyget_lineno (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; -} - -/** Get the current column number. - * @param yyscanner The scanner object. - */ -int libaacs_yyget_column (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; -} - -/** Get the input stream. - * @param yyscanner The scanner object. - */ -FILE *libaacs_yyget_in (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; -} - -/** Get the output stream. - * @param yyscanner The scanner object. - */ -FILE *libaacs_yyget_out (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; -} - -/** Get the length of the current token. - * @param yyscanner The scanner object. - */ -int libaacs_yyget_leng (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; -} - -/** Get the current token. - * @param yyscanner The scanner object. - */ - -char *libaacs_yyget_text (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; -} - -/** Set the user-defined data. This data is never touched by the scanner. - * @param user_defined The data to be associated with this scanner. - * @param yyscanner The scanner object. - */ -void libaacs_yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; -} - -/** Set the current line number. - * @param line_number - * @param yyscanner The scanner object. - */ -void libaacs_yyset_lineno (int line_number , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "libaacs_yyset_lineno called with no buffer" , yyscanner); - - yylineno = line_number; -} - -/** Set the current column. - * @param line_number - * @param yyscanner The scanner object. - */ -void libaacs_yyset_column (int column_no , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "libaacs_yyset_column called with no buffer" , yyscanner); - - yycolumn = column_no; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * @param yyscanner The scanner object. - * @see libaacs_yy_switch_to_buffer - */ -void libaacs_yyset_in (FILE * in_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; -} - -void libaacs_yyset_out (FILE * out_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; -} - -int libaacs_yyget_debug (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; -} - -void libaacs_yyset_debug (int bdebug , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; -} - -/* Accessor methods for yylval and yylloc */ - -YYSTYPE * libaacs_yyget_lval (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; -} - -void libaacs_yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; -} - -/* User-visible API */ - -/* libaacs_yylex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ - -int libaacs_yylex_init(yyscan_t* ptr_yy_globals) - -{ - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) libaacs_yyalloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* libaacs_yylex_init_extra has the same functionality as libaacs_yylex_init, but follows the - * convention of taking the scanner as the last argument. Note however, that - * this is a *pointer* to a scanner, as it will be allocated by this call (and - * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to libaacs_yyalloc in - * the yyextra field. - */ - -int libaacs_yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - -{ - struct yyguts_t dummy_yyguts; - - libaacs_yyset_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) libaacs_yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - libaacs_yyset_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); -} - -static int yy_init_globals (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from libaacs_yylex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * libaacs_yylex_init() - */ - return 0; -} - -/* libaacs_yylex_destroy is for both reentrant and non-reentrant scanners. */ -int libaacs_yylex_destroy (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - libaacs_yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); - YY_CURRENT_BUFFER_LVALUE = NULL; - libaacs_yypop_buffer_state(yyscanner); - } - - /* Destroy the stack itself. */ - libaacs_yyfree(yyg->yy_buffer_stack ,yyscanner); - yyg->yy_buffer_stack = NULL; - - /* Destroy the start condition stack. */ - libaacs_yyfree(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * libaacs_yylex() is called, initialization will occur. */ - yy_init_globals( yyscanner); - - /* Destroy the main struct (reentrant only). */ - libaacs_yyfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1i = s2i; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) -{ - register int n; - for ( n = 0; sn; ++n ) - ; - - return n; -} -#endif - -void *libaacs_yyalloc (yy_size_t size , yyscan_t yyscanner) -{ - return (void *) malloc( size ); -} - -void *libaacs_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void libaacs_yyfree (void * ptr , yyscan_t yyscanner) -{ - free( (char *) ptr ); /* see libaacs_yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 141 "keydbcfg-lexer.l" - - -#if 0 -/* Function used to trim leading and trailing space from a string */ -static char *trim_string(const char *string) -{ - int start = 0; - int end = strlen(string); - while (stringstart == ' ' || stringstart == '\t') - start++; - while (stringend == '\0' || stringend == ' ' || stringend == '\t') - end--; - int size = end - start + 1; - - char *new_string = (char*)malloc(size + 1); - strncpy(new_string, string + start, size); - new_stringsize = '\0'; - return new_string; -} -#endif
View file
libaacs-0.6.0.tar.bz2/src/keydbcfg-parser.c
Deleted
@@ -1,2494 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.5. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.5" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - -/* Substitute the variable and function names. */ -#define yyparse libaacs_yyparse -#define yylex libaacs_yylex -#define yyerror libaacs_yyerror -#define yylval libaacs_yylval -#define yychar libaacs_yychar -#define yydebug libaacs_yydebug -#define yynerrs libaacs_yynerrs - - -/* Copy the first part of user declarations. */ - - -/* Line 268 of yacc.c */ -#line 79 "keydbcfg-parser.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif - -/* "%code requires" blocks. */ - -/* Line 288 of yacc.c */ -#line 1 "keydbcfg-parser.y" - -#include "file/keydbcfg.h" - - - -/* Line 288 of yacc.c */ -#line 109 "keydbcfg-parser.c" - -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - HEXSTRING = 258, - DISC_TITLE = 259, - DIGIT = 260, - KEYWORD_DEVICE_KEY = 261, - KEYWORD_DEVICE_NODE = 262, - KEYWORD_HOST_PRIV_KEY = 263, - KEYWORD_HOST_CERT = 264, - KEYWORD_HOST_NONCE = 265, - KEYWORD_HOST_KEY_POINT = 266, - PUNCT_EQUALS_SIGN = 267, - PUNCT_VERTICAL_BAR = 268, - PUNCT_HYPHEN = 269, - ENTRY_ID_DK = 270, - ENTRY_ID_PK = 271, - ENTRY_ID_HC = 272, - ENTRY_ID_DATE = 273, - ENTRY_ID_MEK = 274, - ENTRY_ID_VID = 275, - ENTRY_ID_BN = 276, - ENTRY_ID_VUK = 277, - ENTRY_ID_PAK = 278, - ENTRY_ID_TK = 279, - ENTRY_ID_UK = 280, - NEWLINE = 281, - BAD_ENTRY = 282 - }; -#endif -/* Tokens. */ -#define HEXSTRING 258 -#define DISC_TITLE 259 -#define DIGIT 260 -#define KEYWORD_DEVICE_KEY 261 -#define KEYWORD_DEVICE_NODE 262 -#define KEYWORD_HOST_PRIV_KEY 263 -#define KEYWORD_HOST_CERT 264 -#define KEYWORD_HOST_NONCE 265 -#define KEYWORD_HOST_KEY_POINT 266 -#define PUNCT_EQUALS_SIGN 267 -#define PUNCT_VERTICAL_BAR 268 -#define PUNCT_HYPHEN 269 -#define ENTRY_ID_DK 270 -#define ENTRY_ID_PK 271 -#define ENTRY_ID_HC 272 -#define ENTRY_ID_DATE 273 -#define ENTRY_ID_MEK 274 -#define ENTRY_ID_VID 275 -#define ENTRY_ID_BN 276 -#define ENTRY_ID_VUK 277 -#define ENTRY_ID_PAK 278 -#define ENTRY_ID_TK 279 -#define ENTRY_ID_UK 280 -#define NEWLINE 281 -#define BAD_ENTRY 282 - - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - -/* Line 293 of yacc.c */ -#line 108 "keydbcfg-parser.y" - - char *string; - unsigned int digit; - - - -/* Line 293 of yacc.c */ -#line 187 "keydbcfg-parser.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -/* Copy the second part of user declarations. */ - - -/* Line 343 of yacc.c */ -#line 199 "keydbcfg-parser.c" -/* Unqualified %code blocks. */ - -/* Line 344 of yacc.c */ -#line 5 "keydbcfg-parser.y" - -/* - * This file is part of libaacs - * Copyright (C) 2010 gates - * - * 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/>. - */ - -#include "util/macro.h" - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -/* Disable some warnings triggered by generated parser */ -#if defined __GNUC__ -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#pragma GCC visibility push(hidden) -#endif - -/* Fix some warnings trigger by -Wundef which can't be ignored */ -#define YYENABLE_NLS 0 -#define YYLTYPE_IS_TRIVIAL 0 - -#define DIGIT_KEY_PAIR_LIST_FREE(X) do \ -{ \ - while (X) \ - { \ - digit_key_pair_list *pnext = X->next;\ - X_FREE(X->key_pair.key); \ - X_FREE(X); \ - X = pnext; \ - } \ -} while (0); - -/* enum used in certain functions to add proper title entry */ -enum -{ - ENTRY_TYPE_DISCID, - ENTRY_TYPE_TITLE, - ENTRY_TYPE_DATE, - ENTRY_TYPE_MEK, - ENTRY_TYPE_VID, - ENTRY_TYPE_BN, - ENTRY_TYPE_VUK, - ENTRY_TYPE_PAK, - ENTRY_TYPE_TK, - ENTRY_TYPE_UK -}; - -static dk_list *new_dk_list(void); -static dk_list *add_dk_list_entry(dk_list *list, char *key, char *node); -static pk_list *new_pk_list(void); -static pk_list *add_pk_list_entry(pk_list *list, char *key); -static cert_list *new_cert_list(void); -static cert_list *add_cert_list(cert_list *list, char *host_priv_key, - char *host_cert, char *host_nonce, - char *host_key_point); -static title_entry_list *new_title_entry_list(void); -static int add_entry(title_entry_list *list, int type, char *entry); -static digit_key_pair_list *new_digit_key_pair_list(void); -static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list, - int type, unsigned int digit, char *key); -static int add_date_entry(title_entry_list *list, unsigned int year, - unsigned int month, unsigned int day); -void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, - title_entry_list *celist, digit_key_pair_list *dkplist, - const char *msg); -extern int libaacs_yyget_lineno (void *scanner); - -/* uncomment the line below for debugging */ -// int yydebug = 1; - - - -/* Line 344 of yacc.c */ -#line 293 "keydbcfg-parser.c" - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)yyi = (From)yyi; \ - } \ - while (YYID (0)) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 24 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 128 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 28 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 37 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 63 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 129 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 282 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslateYYX : YYUNDEFTOK) - -/* YYTRANSLATEYYLEX -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27 -}; - -#if YYDEBUG -/* YYPRHSYYN -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint8 yyprhs = -{ - 0, 0, 3, 6, 8, 10, 11, 14, 16, 18, - 20, 22, 24, 27, 34, 40, 43, 46, 51, 55, - 66, 76, 79, 82, 85, 88, 93, 97, 100, 102, - 106, 108, 110, 113, 115, 117, 119, 121, 123, 125, - 127, 129, 131, 138, 141, 144, 147, 151, 153, 157, - 160, 163, 167, 169, 173, 176, 180, 182, 186, 189, - 193, 195, 199, 202 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs = -{ - 29, 0, -1, 30, 42, -1, 30, -1, 42, -1, - -1, 30, 31, -1, 31, -1, 32, -1, 35, -1, - 36, -1, 41, -1, 1, 26, -1, 42, 15, 33, - 13, 34, 26, -1, 15, 33, 13, 34, 26, -1, - 6, 64, -1, 7, 64, -1, 42, 16, 64, 26, - -1, 16, 64, 26, -1, 42, 17, 37, 13, 38, - 13, 39, 13, 40, 26, -1, 17, 37, 13, 38, - 13, 39, 13, 40, 26, -1, 8, 64, -1, 9, - 64, -1, 10, 64, -1, 11, 64, -1, 42, 43, - 46, 26, -1, 43, 46, 26, -1, 42, 26, -1, - 26, -1, 44, 12, 45, -1, 64, -1, 4, -1, - 46, 47, -1, 47, -1, 48, -1, 49, -1, 50, - -1, 51, -1, 54, -1, 55, -1, 58, -1, 61, - -1, 18, 5, 14, 5, 14, 5, -1, 19, 64, - -1, 20, 64, -1, 21, 52, -1, 52, 13, 53, - -1, 53, -1, 5, 14, 64, -1, 22, 64, -1, - 23, 56, -1, 56, 13, 57, -1, 57, -1, 5, - 14, 64, -1, 24, 59, -1, 59, 13, 60, -1, - 60, -1, 5, 14, 64, -1, 25, 62, -1, 62, - 13, 63, -1, 63, -1, 5, 14, 64, -1, 64, - 3, -1, 3, -1 -}; - -/* YYRLINEYYN -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline = -{ - 0, 148, 148, 149, 150, 151, 155, 156, 160, 161, - 162, 163, 164, 173, 177, 184, 189, 194, 198, 205, - 209, 216, 221, 226, 231, 236, 241, 249, 250, 254, - 262, 266, 270, 271, 275, 276, 277, 278, 279, 280, - 281, 282, 286, 293, 300, 307, 314, 315, 319, 331, - 338, 345, 346, 350, 362, 369, 370, 374, 386, 393, - 394, 398, 410, 418 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAMESYMBOL-NUM -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname = -{ - "$end", "error", "$undefined", "HEXSTRING", "DISC_TITLE", "DIGIT", - "KEYWORD_DEVICE_KEY", "KEYWORD_DEVICE_NODE", "KEYWORD_HOST_PRIV_KEY", - "KEYWORD_HOST_CERT", "KEYWORD_HOST_NONCE", "KEYWORD_HOST_KEY_POINT", - "PUNCT_EQUALS_SIGN", "PUNCT_VERTICAL_BAR", "PUNCT_HYPHEN", "ENTRY_ID_DK", - "ENTRY_ID_PK", "ENTRY_ID_HC", "ENTRY_ID_DATE", "ENTRY_ID_MEK", - "ENTRY_ID_VID", "ENTRY_ID_BN", "ENTRY_ID_VUK", "ENTRY_ID_PAK", - "ENTRY_ID_TK", "ENTRY_ID_UK", "NEWLINE", "BAD_ENTRY", "$accept", - "config_file", "config_entry_list", "config_entry", "dk_entry", - "device_key", "device_node", "pk_entry", "host_cert_entry", - "host_priv_key", "host_cert", "host_nonce", "host_key_point", - "title_entry", "newline_list", "disc_info", "discid", "disc_title", - "entry_list", "entry", "date_entry", "mek_entry", "vid_entry", - "bn_entry", "bn_data_list", "bn_data", "vuk_entry", "pak_entry", - "pak_data_list", "pak_data", "tk_entry", "tk_data_list", "tk_data", - "uk_entry", "uk_data_list", "uk_data", "hexstring_list", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUMYYLEX-NUM -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282 -}; -# endif - -/* YYR1YYN -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1 = -{ - 0, 28, 29, 29, 29, 29, 30, 30, 31, 31, - 31, 31, 31, 32, 32, 33, 34, 35, 35, 36, - 36, 37, 38, 39, 40, 41, 41, 42, 42, 43, - 44, 45, 46, 46, 47, 47, 47, 47, 47, 47, - 47, 47, 48, 49, 50, 51, 52, 52, 53, 54, - 55, 56, 56, 57, 58, 59, 59, 60, 61, 62, - 62, 63, 64, 64 -}; - -/* YYR2YYN -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2 = -{ - 0, 2, 2, 1, 1, 0, 2, 1, 1, 1, - 1, 1, 2, 6, 5, 2, 2, 4, 3, 10, - 9, 2, 2, 2, 2, 4, 3, 2, 1, 3, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 6, 2, 2, 2, 3, 1, 3, 2, - 2, 3, 1, 3, 2, 3, 1, 3, 2, 3, - 1, 3, 2, 1 -}; - -/* YYDEFACTSTATE-NAME -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact = -{ - 0, 0, 63, 0, 0, 0, 28, 0, 0, 7, - 8, 9, 10, 11, 4, 0, 0, 30, 12, 0, - 0, 0, 0, 0, 1, 6, 2, 0, 0, 0, - 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 0, 62, 15, 0, 18, 21, 0, 0, 0, 0, - 0, 0, 43, 44, 0, 45, 47, 49, 0, 50, - 52, 0, 54, 56, 0, 58, 60, 26, 32, 31, - 29, 0, 0, 0, 0, 0, 17, 0, 25, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 16, 14, - 22, 0, 0, 0, 0, 48, 46, 53, 51, 57, - 55, 61, 59, 0, 0, 13, 0, 0, 23, 0, - 0, 42, 0, 0, 0, 24, 20, 0, 19 -}; - -/* YYDEFGOTONTERM-NUM. */ -static const yytype_int8 yydefgoto = -{ - -1, 7, 8, 9, 10, 20, 82, 11, 12, 23, - 84, 114, 123, 13, 14, 15, 16, 80, 40, 41, - 42, 43, 44, 45, 65, 66, 46, 47, 69, 70, - 48, 72, 73, 49, 75, 76, 17 -}; - -/* YYPACTSTATE-NUM -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -38 -static const yytype_int8 yypact = -{ - 5, -25, -38, 1, -1, 26, -38, 17, 10, -38, - -38, -38, -38, -38, 25, 75, -3, 16, -38, -1, - 20, 9, -1, 30, -38, -38, 25, 1, -1, 26, - -38, 75, 33, -1, -1, 39, -1, 40, 41, 42, - 34, -38, -38, -38, -38, -38, -38, -38, -38, -38, - 35, -38, 16, 63, -38, 16, 62, 36, 11, 37, - 43, 58, 16, 16, 59, 61, -38, 16, 64, 67, - -38, 68, 70, -38, 71, 74, -38, -38, -38, -38, - -38, -1, 22, -1, 76, 63, -38, 62, -38, 79, - -1, 39, -1, 40, -1, 41, -1, 42, 16, -38, - 16, 65, 50, 78, 87, 16, -38, 16, -38, 16, - -38, 16, -38, -1, 89, -38, 65, 98, 16, 93, - 92, -38, -1, 55, 93, 16, -38, 80, -38 -}; - -/* YYPGOTONTERM-NUM. */ -static const yytype_int8 yypgoto = -{ - -38, -38, -38, 99, -38, 81, 27, -38, -38, 82, - 23, -2, -11, -38, 107, -10, -38, -38, 85, -37, - -38, -38, -38, -38, -38, 28, -38, -38, -38, 24, - -38, -38, 29, -38, -38, 31, -4 -}; - -/* YYTABLEYYPACTSTATE-NUM. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -6 -static const yytype_int16 yytable = -{ - 21, 18, 2, 78, 31, -5, 1, 19, 2, 50, - -3, 1, 51, 2, 51, 52, 31, 24, 55, 51, - 3, 4, 5, 78, 58, 3, 4, 5, 2, 62, - 63, 6, 67, 53, 22, 54, 6, 86, 61, 79, - 27, 28, 29, 56, 64, 68, 71, 74, 99, 85, - 87, 30, 32, 33, 34, 35, 36, 37, 38, 39, - 77, 32, 33, 34, 35, 36, 37, 38, 39, 88, - 81, 83, 89, 90, 91, 113, 115, 98, 92, 100, - 93, 126, 94, 95, 104, 96, 105, 97, 107, 101, - 109, 116, 111, 32, 33, 34, 35, 36, 37, 38, - 39, 117, 119, 121, 122, 124, 128, 25, 57, 118, - 103, 59, 102, 127, 120, 26, 60, 108, 125, 106, - 0, 0, 0, 0, 110, 0, 0, 0, 112 -}; - -#define yypact_value_is_default(yystate) \ - ((yystate) == (-38)) - -#define yytable_value_is_error(yytable_value) \ - YYID (0) - -static const yytype_int8 yycheck = -{ - 4, 26, 3, 40, 14, 0, 1, 6, 3, 12, - 0, 1, 3, 3, 3, 19, 26, 0, 22, 3, - 15, 16, 17, 60, 28, 15, 16, 17, 3, 33, - 34, 26, 36, 13, 8, 26, 26, 26, 5, 4, - 15, 16, 17, 13, 5, 5, 5, 5, 26, 13, - 13, 26, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 7, 9, 14, 14, 13, 10, 26, 81, 14, 83, - 13, 26, 14, 13, 5, 14, 90, 13, 92, 13, - 94, 13, 96, 18, 19, 20, 21, 22, 23, 24, - 25, 14, 13, 5, 11, 13, 26, 8, 27, 113, - 87, 29, 85, 124, 116, 8, 31, 93, 122, 91, - -1, -1, -1, -1, 95, -1, -1, -1, 97 -}; - -/* YYSTOSSTATE-NUM -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos = -{ - 0, 1, 3, 15, 16, 17, 26, 29, 30, 31, - 32, 35, 36, 41, 42, 43, 44, 64, 26, 6, - 33, 64, 8, 37, 0, 31, 42, 15, 16, 17, - 26, 43, 18, 19, 20, 21, 22, 23, 24, 25, - 46, 47, 48, 49, 50, 51, 54, 55, 58, 61, - 12, 3, 64, 13, 26, 64, 13, 33, 64, 37, - 46, 5, 64, 64, 5, 52, 53, 64, 5, 56, - 57, 5, 59, 60, 5, 62, 63, 26, 47, 4, - 45, 7, 34, 9, 38, 13, 26, 13, 26, 14, - 14, 13, 14, 13, 14, 13, 14, 13, 64, 26, - 64, 13, 34, 38, 5, 64, 53, 64, 57, 64, - 60, 64, 63, 10, 39, 26, 13, 14, 64, 13, - 39, 5, 11, 40, 13, 64, 26, 40, 26 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (scanner, dklist, pklist, clist, celist, dkplist, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS1 to RHSN. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS0 (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)K) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* This macro is provided for backward compatibility. */ - -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, scanner) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, scanner, dklist, pklist, clist, celist, dkplist); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - void *scanner; - dk_list *dklist; - pk_list *pklist; - cert_list *clist; - title_entry_list *celist; - digit_key_pair_list *dkplist; -#endif -{ - if (!yyvaluep) - return; - YYUSE (scanner); - YYUSE (dklist); - YYUSE (pklist); - YYUSE (clist); - YYUSE (celist); - YYUSE (dkplist); -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknumyytype, *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - void *scanner; - dk_list *dklist; - pk_list *pklist; - cert_list *clist; - title_entry_list *celist; - digit_key_pair_list *dkplist; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytnameyytype); - else - YYFPRINTF (yyoutput, "nterm %s (", yytnameyytype); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist) -#else -static void -yy_reduce_print (yyvsp, yyrule, scanner, dklist, pklist, clist, celist, dkplist) - YYSTYPE *yyvsp; - int yyrule; - void *scanner; - dk_list *dklist; - pk_list *pklist; - cert_list *clist; - title_entry_list *celist; - digit_key_pair_list *dkplist; -#endif -{ - int yynrhs = yyr2yyrule; - int yyi; - unsigned long int yylno = yyrlineyyrule; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhsyyprhsyyrule + yyi, - &(yyvsp(yyi + 1) - (yynrhs)) - , scanner, dklist, pklist, clist, celist, dkplist); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, scanner, dklist, pklist, clist, celist, dkplist); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystryylen; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyresyyn = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyresyyn = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (0, yytnameyytoken); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = 0; - /* Arguments of yyformat. */ - char const *yyargYYERROR_VERBOSE_ARGS_MAXIMUM; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> - for details. YYERROR is fine as it does not invoke this - function. - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact*yyssp; - yyargyycount++ = yytnameyytoken; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheckyyx + yyn == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytableyyx + yyn)) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyargyycount++ = yytnameyyx; - yysize1 = yysize + yytnamerr (0, yytnameyyx); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat1 == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyargyyi++); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, scanner, dklist, pklist, clist, celist, dkplist) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - void *scanner; - dk_list *dklist; - pk_list *pklist; - cert_list *clist; - title_entry_list *celist; - digit_key_pair_list *dkplist; -#endif -{ - YYUSE (yyvaluep); - YYUSE (scanner); - YYUSE (dklist); - YYUSE (pklist); - YYUSE (clist); - YYUSE (celist); - YYUSE (dkplist); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, title_entry_list *celist, digit_key_pair_list *dkplist) -#else -int -yyparse (scanner, dklist, pklist, clist, celist, dkplist) - void *scanner; - dk_list *dklist; - pk_list *pklist; - cert_list *clist; - title_entry_list *celist; - digit_key_pair_list *dkplist; -#endif -#endif -{ -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssaYYINITDEPTH; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsaYYINITDEPTH; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf128; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypactyystate; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheckyyn != yytoken) - goto yydefault; - yyn = yytableyyn; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefactyystate; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2yyn; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp1-yylen; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 12: - -/* Line 1806 of yacc.c */ -#line 165 "keydbcfg-parser.y" - { - fprintf(stderr, "bad entry at or around line %d\n", - libaacs_yyget_lineno(scanner) - 1); - yyerrok; - } - break; - - case 13: - -/* Line 1806 of yacc.c */ -#line 174 "keydbcfg-parser.y" - { - dklist = add_dk_list_entry(dklist, (yyvsp(3) - (6).string), (yyvsp(5) - (6).string)); - } - break; - - case 14: - -/* Line 1806 of yacc.c */ -#line 178 "keydbcfg-parser.y" - { - dklist = add_dk_list_entry(dklist, (yyvsp(2) - (5).string), (yyvsp(4) - (5).string)); - } - break; - - case 15: - -/* Line 1806 of yacc.c */ -#line 185 "keydbcfg-parser.y" - { (yyval.string) = (yyvsp(2) - (2).string); } - break; - - case 16: - -/* Line 1806 of yacc.c */ -#line 190 "keydbcfg-parser.y" - { (yyval.string) = (yyvsp(2) - (2).string); } - break; - - case 17: - -/* Line 1806 of yacc.c */ -#line 195 "keydbcfg-parser.y" - { - pklist = add_pk_list_entry(pklist, (yyvsp(3) - (4).string)); - } - break; - - case 18: - -/* Line 1806 of yacc.c */ -#line 199 "keydbcfg-parser.y" - { - pklist = add_pk_list_entry(pklist, (yyvsp(2) - (3).string)); - } - break; - - case 19: - -/* Line 1806 of yacc.c */ -#line 206 "keydbcfg-parser.y" - { - clist = add_cert_list(clist, (yyvsp(3) - (10).string), (yyvsp(5) - (10).string), (yyvsp(7) - (10).string), (yyvsp(9) - (10).string)); - } - break; - - case 20: - -/* Line 1806 of yacc.c */ -#line 210 "keydbcfg-parser.y" - { - clist = add_cert_list(clist, (yyvsp(2) - (9).string), (yyvsp(4) - (9).string), (yyvsp(6) - (9).string), (yyvsp(8) - (9).string)); - } - break; - - case 21: - -/* Line 1806 of yacc.c */ -#line 217 "keydbcfg-parser.y" - { (yyval.string) = (yyvsp(2) - (2).string); } - break; - - case 22: - -/* Line 1806 of yacc.c */ -#line 222 "keydbcfg-parser.y" - { (yyval.string) = (yyvsp(2) - (2).string); } - break; - - case 23: - -/* Line 1806 of yacc.c */ -#line 227 "keydbcfg-parser.y" - { (yyval.string) = (yyvsp(2) - (2).string); } - break; - - case 24: - -/* Line 1806 of yacc.c */ -#line 232 "keydbcfg-parser.y" - { (yyval.string) = (yyvsp(2) - (2).string); } - break; - - case 25: - -/* Line 1806 of yacc.c */ -#line 237 "keydbcfg-parser.y" - { - celist->next = new_title_entry_list(); - celist = celist->next; - } - break; - - case 26: - -/* Line 1806 of yacc.c */ -#line 242 "keydbcfg-parser.y" - { - celist->next = new_title_entry_list(); - celist = celist->next; - } - break; - - case 29: - -/* Line 1806 of yacc.c */ -#line 255 "keydbcfg-parser.y" - { - add_entry(celist, ENTRY_TYPE_DISCID, (yyvsp(1) - (3).string)); - add_entry(celist, ENTRY_TYPE_TITLE, (yyvsp(3) - (3).string)); - } - break; - - case 42: - -/* Line 1806 of yacc.c */ -#line 287 "keydbcfg-parser.y" - { - add_date_entry(celist, (yyvsp(2) - (6).digit), (yyvsp(4) - (6).digit), (yyvsp(6) - (6).digit)); - } - break; - - case 43: - -/* Line 1806 of yacc.c */ -#line 294 "keydbcfg-parser.y" - { - add_entry(celist, ENTRY_TYPE_MEK, (yyvsp(2) - (2).string)); - } - break; - - case 44: - -/* Line 1806 of yacc.c */ -#line 301 "keydbcfg-parser.y" - { - add_entry(celist, ENTRY_TYPE_VID, (yyvsp(2) - (2).string)); - } - break; - - case 45: - -/* Line 1806 of yacc.c */ -#line 308 "keydbcfg-parser.y" - { - dkplist = NULL; - } - break; - - case 48: - -/* Line 1806 of yacc.c */ -#line 320 "keydbcfg-parser.y" - { - if (!dkplist) - { - dkplist = new_digit_key_pair_list(); - celist->entry.bn = dkplist; - } - dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_BN, (yyvsp(1) - (3).digit), (yyvsp(3) - (3).string)); - } - break; - - case 49: - -/* Line 1806 of yacc.c */ -#line 332 "keydbcfg-parser.y" - { - add_entry(celist, ENTRY_TYPE_VUK, (yyvsp(2) - (2).string)); - } - break; - - case 50: - -/* Line 1806 of yacc.c */ -#line 339 "keydbcfg-parser.y" - { - dkplist = NULL; - } - break; - - case 53: - -/* Line 1806 of yacc.c */ -#line 351 "keydbcfg-parser.y" - { - if (!dkplist) - { - dkplist = new_digit_key_pair_list(); - celist->entry.pak = dkplist; - } - dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_PAK, (yyvsp(1) - (3).digit), (yyvsp(3) - (3).string)); - } - break; - - case 54: - -/* Line 1806 of yacc.c */ -#line 363 "keydbcfg-parser.y" - { - dkplist = NULL; - } - break; - - case 57: - -/* Line 1806 of yacc.c */ -#line 375 "keydbcfg-parser.y" - { - if (!dkplist) - { - dkplist = new_digit_key_pair_list(); - celist->entry.tk = dkplist; - } - dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_TK, (yyvsp(1) - (3).digit), (yyvsp(3) - (3).string)); - } - break; - - case 58: - -/* Line 1806 of yacc.c */ -#line 387 "keydbcfg-parser.y" - { - dkplist = NULL; - } - break; - - case 61: - -/* Line 1806 of yacc.c */ -#line 399 "keydbcfg-parser.y" - { - if (!dkplist) - { - dkplist = new_digit_key_pair_list(); - celist->entry.uk = dkplist; - } - dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_UK, (yyvsp(1) - (3).digit), (yyvsp(3) - (3).string)); - } - break; - - case 62: - -/* Line 1806 of yacc.c */ -#line 411 "keydbcfg-parser.y" - { - char *str = (char*)malloc(strlen((yyvsp(1) - (2).string)) + strlen((yyvsp(2) - (2).string)) + 1); - strcpy(str, (yyvsp(1) - (2).string)); - strcat(str, (yyvsp(2) - (2).string)); - (yyval.string) = str; - X_FREE((yyvsp(1) - (2).string)); - } - break; - - case 63: - -/* Line 1806 of yacc.c */ -#line 419 "keydbcfg-parser.y" - { - char *str = (char*)malloc(strlen((yyvsp(1) - (1).string)) + 1); - strcpy(str, (yyvsp(1) - (1).string)); - (yyval.string) = str; - } - break; - - - -/* Line 1806 of yacc.c */ -#line 1959 "keydbcfg-parser.c" - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1yyn, &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1yyn; - - yystate = yypgotoyyn - YYNTOKENS + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheckyystate == *yyssp) - yystate = yytableyystate; - else - yystate = yydefgotoyyn - YYNTOKENS; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (scanner, dklist, pklist, clist, celist, dkplist, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (scanner, dklist, pklist, clist, celist, dkplist, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, scanner, dklist, pklist, clist, celist, dkplist); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypactyystate; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheckyyn == YYTERROR) - { - yyn = yytableyyn; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystosyystate, yyvsp, scanner, dklist, pklist, clist, celist, dkplist); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystosyyn, yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (scanner, dklist, pklist, clist, celist, dkplist, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, scanner, dklist, pklist, clist, celist, dkplist); - } - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos*yyssp, yyvsp, scanner, dklist, pklist, clist, celist, dkplist); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - -/* Line 2067 of yacc.c */ -#line 425 "keydbcfg-parser.y" - -/* Function to parse a config file */ -int keydbcfg_parse_config(config_file *cfgfile, const char *path) -{ - if (!cfgfile || !path) - return 0; - - FILE * fp = fopen(path, "r"); - if (!fp) - return 0; - - dk_list *head_dklist = new_dk_list(); - pk_list *head_pklist = new_pk_list(); - cert_list *head_clist = new_cert_list(); - title_entry_list *head_celist = new_title_entry_list(); - digit_key_pair_list *dkplist = NULL; - - void *scanner; - libaacs_yylex_init(&scanner); - libaacs_yyset_in(fp, scanner); - int retval = yyparse(scanner, head_dklist, head_pklist, head_clist, - head_celist, dkplist); - libaacs_yylex_destroy(scanner); - - cfgfile->dkl = head_dklist; - cfgfile->pkl = head_pklist; - cfgfile->host_cert_list = head_clist; - cfgfile->list = head_celist; - - fclose(fp); - - if (retval) - return 0; - - return 1; -} - -/* Function that returns pointer to new config file object */ -config_file *keydbcfg_new_config_file(void) -{ - config_file *cfgfile = (config_file *)malloc(sizeof(*cfgfile)); - memset(cfgfile, 0, sizeof(*cfgfile)); - return cfgfile; -} - -/* Function that closes and frees a config file object */ -int keydbcfg_config_file_close(config_file *cfgfile) -{ - /* free pk list */ - while (cfgfile->pkl) - { - pk_list *next = cfgfile->pkl->next; - X_FREE(cfgfile->pkl->key); - X_FREE(cfgfile->pkl); - cfgfile->pkl = next; - } - - /* free dk list */ - while (cfgfile->dkl) - { - dk_list *next = cfgfile->dkl->next; - X_FREE(cfgfile->dkl->key); - X_FREE(cfgfile->dkl); - cfgfile->dkl = next; - } - - /* free host cert list */ - while (cfgfile->host_cert_list) - { - cert_list *next = cfgfile->host_cert_list->next; - X_FREE(cfgfile->host_cert_list->host_priv_key); - X_FREE(cfgfile->host_cert_list->host_cert); - X_FREE(cfgfile->host_cert_list->host_nonce); - X_FREE(cfgfile->host_cert_list->host_key_point); - X_FREE(cfgfile->host_cert_list); - cfgfile->host_cert_list = next; - } - - /* free title entries */ - while (cfgfile->list) - { - title_entry_list *next = cfgfile->list->next; - X_FREE(cfgfile->list->entry.discid); - X_FREE(cfgfile->list->entry.title); - X_FREE(cfgfile->list->entry.mek); - X_FREE(cfgfile->list->entry.vid); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.bn); - X_FREE(cfgfile->list->entry.vuk); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.pak); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.tk); - DIGIT_KEY_PAIR_LIST_FREE(cfgfile->list->entry.uk); - X_FREE(cfgfile->list); - cfgfile->list = next; - } - - /* free the config file object */ - X_FREE(cfgfile); - - return 1; -} - -/* Function to return new dk_list object */ -static dk_list *new_dk_list(void) -{ - dk_list *dkl = (dk_list *)malloc(sizeof(*dkl)); - memset(dkl, 0, sizeof(*dkl)); - return dkl; -} - -/* Function to add dk to config file */ -static dk_list *add_dk_list_entry(dk_list *list, char *key, char *node) -{ - if (!list) - { - printf("Error: No dk list passed as parameter.\n"); - return NULL; - } - - list->key = key; - list->node = strtoul(node, NULL, 16); - list->next = new_dk_list(); - - X_FREE(node); - - return list->next; -} - -/* Function to return new pk_list object */ -static pk_list *new_pk_list(void) -{ - pk_list *pkl = (pk_list *)malloc(sizeof(*pkl)); - memset(pkl, 0, sizeof(*pkl)); - return pkl; -} - -/* Function to add pk to config file */ -static pk_list *add_pk_list_entry(pk_list *list, char *key) -{ - if (!list) - { - printf("Error: No pk list passed as parameter.\n"); - return NULL; - } - - list->key = key; - list->next = new_pk_list(); - - return list->next; -} - -/* Function to create new certificate list */ -static cert_list *new_cert_list(void) -{ - cert_list *list = (cert_list *)malloc(sizeof(*list)); - if (!list) - { - printf("Error allocating memory for new certificate list!\n"); - return NULL; - } - - memset(list, 0, sizeof(*list)); - - return list; -} - -/* Function to add certificate list entry into config file object */ -static cert_list *add_cert_list(cert_list *list, char *host_priv_key, - char *host_cert, char *host_nonce, - char *host_key_point) -{ - if (!list) - { - printf("Error: no certificate list object passed as parameter.\n"); - return NULL; - } - - list->host_priv_key = host_priv_key; - list->host_cert = host_cert; - list->host_nonce = host_nonce; - list->host_key_point = host_key_point; - - list->next = new_cert_list(); - - return list->next; -} - -/* Function that returns pointer to new title entry list */ -title_entry_list *new_title_entry_list(void) -{ - title_entry_list *list = (title_entry_list *)malloc(sizeof(*list)); - if (!list) - { - printf("Error allocating memory for new title entry list!\n"); - return NULL; - } - - memset(list, 0, sizeof(*list)); - - return list; -} - -/* Function to add standard string entries to a config entry */ -static int add_entry(title_entry_list *list, int type, char *entry) -{ - if (!list) - { - printf("Error: No title list passed as parameter.\n"); - return 0; - } - - switch (type) - { - case ENTRY_TYPE_DISCID: - X_FREE(list->entry.discid); - list->entry.discid = entry; - break; - - case ENTRY_TYPE_TITLE: - X_FREE(list->entry.title); - list->entry.title = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.title, entry); - break; - - case ENTRY_TYPE_MEK: - X_FREE(list->entry.mek); - list->entry.mek = entry; - break; - - case ENTRY_TYPE_VID: - X_FREE(list->entry.vid); - list->entry.vid = entry; - break; - - case ENTRY_TYPE_VUK: - X_FREE(list->entry.vuk); - list->entry.vuk = entry; - break; - - default: - X_FREE(entry); - printf("WARNING: entry type passed in unknown\n"); - return 0; - } - - return 1; -} - -/* Function that returns pointer to new digit key pair list */ -static digit_key_pair_list *new_digit_key_pair_list(void) -{ - digit_key_pair_list *list = (digit_key_pair_list *)malloc(sizeof(*list)); - if (!list) - { - printf("Error allocating memory for new digit key pair entry list!\n"); - return NULL; - } - - memset(list, 0, sizeof(*list)); - - return list; -} - -/* Function used to add a digit/key pair to a list of digit key pair entries */ -static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list, - int type, unsigned int digit, char *key) -{ - if (!list) - { - printf("Error: No digit key pair list passed as parameter.\n"); - return NULL; - } - - list->key_pair.digit = digit; - list->key_pair.key = key; - - list->next = new_digit_key_pair_list(); - - return list->next; -} - -/* Function to add a date entry */ -static int add_date_entry(title_entry_list *list, unsigned int year, - unsigned int month, unsigned int day) -{ - if (!list) - { - printf("Error: No title list passed as parameter.\n"); - return 0; - } - - list->entry.date.year = year; - list->entry.date.month = month; - list->entry.date.day = day; - - return 1; -} - -/* Our definition of yyerror */ -void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, - title_entry_list *celist, digit_key_pair_list *dkplist, - const char *msg) -{ - fprintf(stderr, "%s: line %d\n", msg, libaacs_yyget_lineno(scanner)); -} -
View file
libaacs-0.6.0.tar.bz2/ChangeLog -> libaacs-0.7.0.tar.bz2/ChangeLog
Changed
@@ -1,3 +1,20 @@ +2013-12-18: Version 0.7.0 + - Add aacs_get_device_binding_id() and aacs_get_device_nonce(). + - Add aacs_get_mk(). + - Add support for bus encryption. + - Add support for device keys. + - Add support for internal keys. + - Fix reading PMSN. + - Fix reporting AACS version from AACS drive feature. + - Calculate bus key and use it to verify message authentication codes. + - Do not fail if VID is known but config file does not exist. + - Improve validating keys in KEYDB.cfg. + - Update KEYDB.cfg format (still backwards compatible): + * Host nonce and host key point are optional. + * Add device key UV values and masks. + - Build system updates. + - Drop support for compile-time PATCHED_DRIVE flag. + 2013-03-04: Version 0.6.0 - Added reading of PMSN (Pre-recorded Media Serial Number) - Fix resource leak
View file
libaacs-0.6.0.tar.bz2/KEYDB.cfg -> libaacs-0.7.0.tar.bz2/KEYDB.cfg
Changed
@@ -38,14 +38,17 @@ ; ; Device Key entry ; ---------------- -; | DK | DEVICE_KEY <HEXSTRING> | DEVICE_NODE <HEXSTRING> +; | DK | DEVICE_KEY <HEXSTRING> \ +; | DEVICE_NODE <HEXSTRING> \ +; | KEY_UV <HEXSTRING> \ +; | KEY_U_MASK_SHIFT <HEXSTRING> ; ; The device key entry begins with the entry ID "| DK |". Within a device key -; entry are two hexadecimal strings. The first hexadecimal string is preceded by +; entry are four hexadecimal strings. The first hexadecimal string is preceded by ; the keyword "DEVICE_KEY" and is the hexadecimal string representing the device ; key. The second hexadecimal string is preceded by the keyword "DEVICE_NODE" ; and is the hexadecimal string representing the device node number. Each of -; two entries is delimited by a vertical bar '|'. Each device key entry must end +; four entries is delimited by a vertical bar '|'. Each device key entry must end ; with a newline. ; ; Note that each of these entries must end with at least one new line, as @@ -62,15 +65,12 @@ ; Host Certificate entry ; ---------------------- ; | HC | HOST_PRIV_KEY <HEXSTRING> \ -; | HOST_CERT <HEXSTRING> \ -; | HOST_NONCE <HEXSTRING> \ -; | HOST_KEY_POINT <HEXSTRING> +; | HOST_CERT <HEXSTRING> ; ; A Host Certificate entry begins with the entry ID "| HC |". Each host -; certificate entry must contain 4 hexadecimal strings preceded by a keyword that identifies the type of entry +; certificate entry must contain 2 hexadecimal strings preceded by a keyword that identifies the type of entry ; that the hexadecimal string corresponds to. The first hexstring is the host -; private key, the second is the host certificate, the third is the host nonce, -; and the fourth is the host key point. Each of these 4 entry types for a host +; private key, the second is the host certificate. Each of these entry types for a host ; certificate entry must be delimited by vertical bar '|'. A host certificate ; entry must end with a newline. ; @@ -156,7 +156,9 @@ ; foo's device key | DK | DEVICE_KEY 0x00000000000000000000000000000000 \ - | DEVICE_NODE 0x0 + | DEVICE_NODE 0x0 \ + | KEY_UV 0x00000000 \ + | KEY_U_MASK 0x00 ; bar's device key | DK | DEVICE_KEY 0x00000000000000000000000000000000 \
View file
libaacs-0.6.0.tar.bz2/Makefile.am -> libaacs-0.7.0.tar.bz2/Makefile.am
Changed
@@ -1,4 +1,4 @@ -SUBDIRS=src src/examples +SUBDIRS=src ACLOCAL_AMFLAGS=-I m4
View file
libaacs-0.6.0.tar.bz2/Makefile.in -> libaacs-0.7.0.tar.bz2/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -15,6 +15,23 @@ @SET_MAKE@ VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\\ \ *) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -64,6 +81,11 @@ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive +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=) \ @@ -140,6 +162,9 @@ 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@ @@ -244,7 +269,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src src/examples +SUBDIRS = src ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap COPYING KEYDB.cfg README.txt ChangeLog all: config.h @@ -481,13 +506,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || 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; \ @@ -572,7 +594,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir)
View file
libaacs-0.6.0.tar.bz2/aclocal.m4 -> libaacs-0.7.0.tar.bz2/aclocal.m4
Changed
@@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -14,8 +14,8 @@ m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl -m4_if(m4_defn(AC_AUTOCONF_VERSION), 2.68,, -m4_warning(this file was generated for autoconf 2.68. +m4_if(m4_defn(AC_AUTOCONF_VERSION), 2.69,, +m4_warning(this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.)) @@ -38,7 +38,7 @@ am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if($1, 1.11.3, , +m4_if($1, 1.11.6, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -54,7 +54,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN(AM_SET_CURRENT_AUTOMAKE_VERSION, -AM_AUTOMAKE_VERSION(1.11.3)dnl +AM_AUTOMAKE_VERSION(1.11.6)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION)))
View file
libaacs-0.6.0.tar.bz2/build-aux/config.sub -> libaacs-0.7.0.tar.bz2/build-aux/config.sub
Changed
@@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2012-04-18' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -225,6 +225,12 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -1537,6 +1543,9 @@ c4x-* | tic4x-*) os=-coff ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;;
View file
libaacs-0.6.0.tar.bz2/build-aux/depcomp -> libaacs-0.7.0.tar.bz2/build-aux/depcomp
Changed
@@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) @@ -40,8 +40,8 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +57,12 @@ ;; esac +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -102,6 +108,12 @@ depmode=msvc7 fi +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -156,15 +168,14 @@ ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^^:*: / /' \ -e 's/^'$alpha':\/^:*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. @@ -203,18 +214,15 @@ # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ + tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else @@ -226,10 +234,17 @@ rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/^/*$|/|'` @@ -259,12 +274,11 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. + # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. + # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.a-z*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the . - sed -e 's,^.*\.a-z*: *,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.a-z*:'"$tab"' *,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile @@ -275,23 +289,26 @@ ;; icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h - # which is wrong. We want: + # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... - + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : @@ -300,15 +317,21 @@ exit $stat fi rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^^:*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^^:*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^ $tab $tab*/ /" -e "s,^^:*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/ '"$tab"' '"$tab"'*/ /g + s/^ *// + s/ *\\*$// + s/^^:*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; @@ -344,7 +367,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.a-z*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// @@ -359,9 +382,9 @@ tru64) # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. + # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/^/*$|/|'` test "x$dir" = "x$object" && dir= @@ -407,8 +430,7 @@ done if test -f "$tmpdepfile"; then sed -e "s,^.*\.a-z*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the . - sed -e 's,^.*\.a-z*: *,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + sed -e 's,^.*\.a-z*:'"$tab"' *,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi @@ -443,11 +465,11 @@ p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" @@ -478,7 +500,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,15 +520,14 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^ *^: ^:^:*\: *:'"$object"'\: :' > "$tmpdepfile" + sed 's:^'"$tab"' *^:'"$tab"' ^:^:*\:'"$tab"' *:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ + tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -562,8 +583,7 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" @@ -583,7 +603,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -652,8 +672,8 @@ sed -n '/^#line 0-90-9* "\(^"*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;;
View file
libaacs-0.6.0.tar.bz2/build-aux/ltmain.sh -> libaacs-0.7.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-1ubuntu1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1ubuntu1" +VERSION="2.4.2 Debian-2.4.2-1.2ubuntu1" TIMESTAMP="" package_revision=1.3337
View file
libaacs-0.6.0.tar.bz2/config.h.in -> libaacs-0.7.0.tar.bz2/config.h.in
Changed
@@ -20,7 +20,7 @@ /* Define to 1 if you have the <libgen.h> header file. */ #undef HAVE_LIBGEN_H -/* Define to 1 if you have the `gpg-error' library (-lgpg-error). */ +/* Define to 1 if you have the gpg-error library */ #undef HAVE_LIBGPG_ERROR /* Define to 1 if you have the <limits.h> header file. */ @@ -44,9 +44,6 @@ /* Define to 1 if you have the <pthread.h> header file. */ #undef HAVE_PTHREAD_H -/* realpath */ -#undef HAVE_REALPATH - /* Define to 1 if you have the <stdarg.h> header file. */ #undef HAVE_STDARG_H @@ -144,6 +141,11 @@ `char'. */ #undef YYTEXT_POINTER +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS
View file
libaacs-0.6.0.tar.bz2/configure -> libaacs-0.7.0.tar.bz2/configure
Changed
@@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libaacs 0.6.0. +# Generated by GNU Autoconf 2.69 for libaacs 0.7.0. # # Report bugs to <http://www.videolan.org/developers/libaacs.html>. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -222,21 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -339,6 +367,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -460,6 +496,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $0, causing all sort of problems # (the dirname of $0 is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -494,16 +534,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -515,28 +555,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???sx*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%^_$as_cr_alnum%_%g'" @@ -570,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libaacs' PACKAGE_TARNAME='libaacs' -PACKAGE_VERSION='0.6.0' -PACKAGE_STRING='libaacs 0.6.0' +PACKAGE_VERSION='0.7.0' +PACKAGE_STRING='libaacs 0.7.0' PACKAGE_BUGREPORT='http://www.videolan.org/developers/libaacs.html' PACKAGE_URL='' @@ -620,6 +640,9 @@ AACS_VERSION_MICRO AACS_VERSION_MINOR AACS_VERSION_MAJOR +GPG_ERROR_LIBS +GPG_ERROR_CFLAGS +GPG_ERROR_CONFIG LIBGCRYPT_LIBS LIBGCRYPT_CFLAGS LIBGCRYPT_CONFIG @@ -765,6 +788,7 @@ enable_libtool_lock enable_largefile with_libgcrypt_prefix +with_gpg_error_prefix ' ac_precious_vars='build_alias host_alias @@ -1232,8 +1256,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1319,7 +1341,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.6.0 to adapt to many kinds of systems. +\`configure' configures libaacs 0.7.0 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1390,7 +1412,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libaacs 0.6.0:";; + short | recursive ) echo "Configuration of libaacs 0.7.0:";; esac cat <<\_ACEOF @@ -1424,6 +1446,8 @@ (or the compiler's sysroot if not specified). --with-libgcrypt-prefix=PFX prefix where libgcrypt is installed (optional) + --with-gpg-error-prefix=PFX + prefix where gpg-error is installed (optional) Some influential environment variables: CC C compiler command @@ -1507,10 +1531,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libaacs configure 0.6.0 -generated by GNU Autoconf 2.68 +libaacs configure 0.7.0 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1586,7 +1610,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1979,8 +2003,8 @@ 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.6.0, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by libaacs $as_me 0.7.0, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2507,7 +2531,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2676,7 +2700,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2716,7 +2740,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2767,7 +2791,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2820,7 +2844,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2906,7 +2930,7 @@ # Define the identity of the package. PACKAGE='libaacs' - VERSION='0.6.0' + VERSION='0.7.0' cat >>confdefs.h <<_ACEOF @@ -3074,7 +3098,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3114,7 +3138,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3167,7 +3191,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3208,7 +3232,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3266,7 +3290,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3310,7 +3334,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3756,8 +3780,7 @@ /* end confdefs.h. */ #include <stdarg.h> #include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -4149,7 +4172,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -4225,7 +4248,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4291,7 +4314,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4358,7 +4381,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -4614,7 +4637,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4658,7 +4681,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4847,7 +4870,8 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -5082,7 +5106,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5122,7 +5146,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5248,10 +5272,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -5290,7 +5310,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -5428,7 +5448,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5468,7 +5488,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5572,7 +5592,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5616,7 +5636,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5741,7 +5761,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5781,7 +5801,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5840,7 +5860,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5880,7 +5900,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6388,7 +6408,14 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -6529,7 +6556,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6569,7 +6596,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6649,7 +6676,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6689,7 +6716,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6741,7 +6768,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6781,7 +6808,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6833,7 +6860,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6873,7 +6900,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6925,7 +6952,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6965,7 +6992,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7017,7 +7044,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7057,7 +7084,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -8217,7 +8244,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -10387,17 +10414,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -10514,7 +10530,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -11581,7 +11597,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11621,7 +11637,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11673,7 +11689,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11713,7 +11729,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11765,7 +11781,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11805,7 +11821,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11875,7 +11891,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11907,7 +11923,8 @@ b { REJECT; } c { yymore (); } d { yyless (1); } -e { yyless (input () != 0); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ + yyless ((input () != 0)); } f { unput (yytext0); } . { BEGIN INITIAL; } %% @@ -12036,7 +12053,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12533,6 +12550,8 @@ esac rm -rf conftest* fi + + fi @@ -12544,14 +12563,6 @@ fi -ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" -if test "x$ac_cv_func_realpath" = xyes; then : - -$as_echo "#define HAVE_REALPATH 1" >>confdefs.h - -fi - - if test "${SYS}" != "mingw32"; then : @@ -12663,7 +12674,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12786,54 +12797,77 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gpg_strerror_r in -lgpg-error" >&5 -$as_echo_n "checking for gpg_strerror_r in -lgpg-error... " >&6; } -if ${ac_cv_lib_gpg_error_gpg_strerror_r+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgpg-error $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gpg_strerror_r (); -int -main () -{ -return gpg_strerror_r (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gpg_error_gpg_strerror_r=yes +# use re-entrant version of gcrypt_error() from gpg-error + + +# Check whether --with-gpg-error-prefix was given. +if test "${with_gpg_error_prefix+set}" = set; then : + withval=$with_gpg_error_prefix; gpg_error_config_prefix="$withval" else - ac_cv_lib_gpg_error_gpg_strerror_r=no + gpg_error_config_prefix="" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + +if test x$gpg_error_config_prefix != x ; then + if test x${GPG_ERROR_CONFIG+set} != xset ; then + GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gpg_error_gpg_strerror_r" >&5 -$as_echo "$ac_cv_lib_gpg_error_gpg_strerror_r" >&6; } -if test "x$ac_cv_lib_gpg_error_gpg_strerror_r" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGPG_ERROR 1 -_ACEOF - LIBS="-lgpg-error $LIBS" +# Extract the first word of "gpg-error-config", so it can be a program name with args. +set dummy gpg-error-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GPG_ERROR_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GPG_ERROR_CONFIG in + \\/* | ?:\\/*) + ac_cv_path_GPG_ERROR_CONFIG="$GPG_ERROR_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GPG_ERROR_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + test -z "$ac_cv_path_GPG_ERROR_CONFIG" && ac_cv_path_GPG_ERROR_CONFIG="no" + ;; +esac fi +GPG_ERROR_CONFIG=$ac_cv_path_GPG_ERROR_CONFIG +if test -n "$GPG_ERROR_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPG_ERROR_CONFIG" >&5 +$as_echo "$GPG_ERROR_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +if test x"$GPG_ERROR_CONFIG" = xno; then + as_fn_error $? "gpg-error not found on system" "$LINENO" 5 +else + GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags` + GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs` +$as_echo "#define HAVE_LIBGPG_ERROR 1" >>confdefs.h + +fi + + for flag in -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wshadow; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 @@ -12957,7 +12991,7 @@ cc_cv_werror=-Werror else - if { as_var=`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + if ${cc_cv_cflags__errwarn__all+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CFLAGS="$CFLAGS" @@ -12967,9 +13001,9 @@ int main() { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - eval "`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh`='yes'" + eval "cc_cv_cflags__errwarn__all='yes'" else - eval "`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh`='no'" + eval "cc_cv_cflags__errwarn__all='no'" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -12978,7 +13012,7 @@ fi - if eval test x$`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh` = xyes; then : + if eval test x$cc_cv_cflags__errwarn__all = xyes; then : cc_cv_werror=-errwarn=%all fi @@ -13098,16 +13132,16 @@ AACS_VERSION_MAJOR=0 -AACS_VERSION_MINOR=6 +AACS_VERSION_MINOR=7 AACS_VERSION_MICRO=0 -LT_VERSION_INFO="3:0:3" +LT_VERSION_INFO="4:0:4" -ac_config_files="$ac_config_files Makefile src/Makefile src/examples/Makefile src/libaacs.pc src/libaacs/aacs-version.h" +ac_config_files="$ac_config_files Makefile src/Makefile src/libaacs.pc src/libaacs/aacs-version.h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13544,16 +13578,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -13613,28 +13647,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???sx*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%^_$as_cr_alnum%_%g'" @@ -13655,8 +13677,8 @@ # 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.6.0, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by libaacs $as_me 0.7.0, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -13721,11 +13743,11 @@ 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.6.0 -configured by $0, generated by GNU Autoconf 2.68, +libaacs config.status 0.7.0 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -13816,7 +13838,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -14134,7 +14156,6 @@ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/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.6.0.tar.bz2/configure.ac -> libaacs-0.7.0.tar.bz2/configure.ac
Changed
@@ -1,6 +1,6 @@ dnl library version number m4_define(aacs_major, 0) -m4_define(aacs_minor, 6) +m4_define(aacs_minor, 7) m4_define(aacs_micro, 0) m4_define(aacs_version,aacs_major.aacs_minor.aacs_micro) @@ -14,8 +14,8 @@ # dnl Library file name will be libaacs.(current-age).age.revision # -m4_define(lt_current, 3) -m4_define(lt_age, 3) +m4_define(lt_current, 4) +m4_define(lt_age, 4) m4_define(lt_revision, 0) dnl initilization @@ -104,8 +104,6 @@ dnl required functions AC_CHECK_FUNC(snprintf,, AC_MSG_ERROR($function_not_found)) -AC_CHECK_FUNC(realpath,AC_DEFINE(HAVE_REALPATH,1,realpath)) - dnl required libraries dnl pthread check (not on win32) @@ -138,8 +136,29 @@ AC_SUBST(LIBGCRYPT_LIBS) fi AC_FUNC_STRERROR_R -AC_CHECK_LIB(gpg-error, gpg_strerror_r) +# use re-entrant version of gcrypt_error() from gpg-error + +AC_ARG_WITH(gpg-error-prefix, + AC_HELP_STRING(--with-gpg-error-prefix=PFX, + prefix where gpg-error is installed (optional)), + gpg_error_config_prefix="$withval", gpg_error_config_prefix="") +if test x$gpg_error_config_prefix != x ; then + if test x${GPG_ERROR_CONFIG+set} != xset ; then + GPG_ERROR_CONFIG=$gpg_error_config_prefix/bin/gpg-error-config + fi +fi + +AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) +if test x"$GPG_ERROR_CONFIG" = xno; then + AC_MSG_ERROR(gpg-error not found on system) +else + GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags` + GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs` + AC_SUBST(GPG_ERROR_CFLAGS) + AC_SUBST(GPG_ERROR_LIBS) + AC_DEFINE(HAVE_LIBGPG_ERROR, 1, Define to 1 if you have the gpg-error library) +fi CC_CHECK_CFLAGS_APPEND(-Wall -Wdisabled-optimization -Wpointer-arith dnl -Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef dnl @@ -177,5 +196,5 @@ dnl generate output files AC_SUBST(SET_FEATURES) -AC_CONFIG_FILES(Makefile src/Makefile src/examples/Makefile src/libaacs.pc src/libaacs/aacs-version.h) +AC_CONFIG_FILES(Makefile src/Makefile src/libaacs.pc src/libaacs/aacs-version.h) AC_OUTPUT
View file
libaacs-0.6.0.tar.bz2/m4/libtool.m4 -> libaacs-0.7.0.tar.bz2/m4/libtool.m4
Changed
@@ -1324,7 +1324,14 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -1688,7 +1695,8 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -2512,17 +2520,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2639,7 +2636,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -3255,10 +3252,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3297,7 +3290,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -4049,7 +4042,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4348,7 +4341,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -6241,9 +6234,6 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6405,7 +6395,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler
View file
libaacs-0.6.0.tar.bz2/src/Makefile.am -> libaacs-0.7.0.tar.bz2/src/Makefile.am
Changed
@@ -1,7 +1,7 @@ SET_FEATURES = @SET_FEATURES@ SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibaacs -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) $(GPG_ERROR_CFLAGS) AM_YFLAGS = -d -p libaacs_yy lib_LTLIBRARIES = libaacs.la @@ -14,13 +14,16 @@ 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 \ @@ -33,17 +36,15 @@ if HAVE_DARWIN libaacs_la_SOURCES+= \ - file/darwin.c \ - file/darwin.h + file/dirs_darwin.c else if HAVE_WIN32 libaacs_la_SOURCES+= \ - file/win32.c \ - file/win32.h + file/dirs_win32.c else libaacs_la_SOURCES+= \ - file/xdg.c \ - file/xdg.h + file/dirs_xdg.c \ + file/path.c endif endif @@ -53,7 +54,7 @@ libaacs/aacs-version.h libaacs_la_LDFLAGS= -no-undefined -version-info $(LT_VERSION_INFO) -libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) +libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libaacs.pc @@ -67,3 +68,21 @@ # 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.6.0.tar.bz2/src/Makefile.in -> libaacs-0.7.0.tar.bz2/src/Makefile.in
Changed
@@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -17,7 +17,25 @@ + VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\\ \ *) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -38,17 +56,17 @@ host_triplet = @host@ target_triplet = @target@ @HAVE_DARWIN_TRUE@am__append_1 = \ -@HAVE_DARWIN_TRUE@ file/darwin.c \ -@HAVE_DARWIN_TRUE@ file/darwin.h +@HAVE_DARWIN_TRUE@ file/dirs_darwin.c @HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__append_2 = \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/win32.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@ file/win32.h +@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/xdg.c \ -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/xdg.h +@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 = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libaacs.pc.in keydbcfg-lexer.c \ @@ -91,22 +109,24 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(pkgincludedir)" +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = -libaacs_la_DEPENDENCIES = $(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/file.h file/filesystem.h \ - file/file_posix.c file/keydbcfg.c file/keydbcfg.h \ - file/keydbcfg-parser.y file/keydbcfg-lexer.l util/attributes.h \ + 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/darwin.c file/darwin.h file/win32.c \ - file/win32.h file/xdg.c file/xdg.h -@HAVE_DARWIN_TRUE@am__objects_1 = darwin.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = win32.lo -@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = xdg.lo + util/strutl.h file/dirs_darwin.c file/dirs_win32.c \ + file/dirs_xdg.c file/path.c +@HAVE_DARWIN_TRUE@am__objects_1 = dirs_darwin.lo +@HAVE_DARWIN_FALSE@@HAVE_WIN32_TRUE@am__objects_2 = dirs_win32.lo +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@am__objects_3 = dirs_xdg.lo \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ path.lo am_libaacs_la_OBJECTS = aacs.lo mmc.lo crypto.lo mkb.lo file_posix.lo \ keydbcfg.lo keydbcfg-parser.lo keydbcfg-lexer.lo logging.lo \ strutl.lo $(am__objects_1) $(am__objects_2) $(am__objects_3) @@ -114,6 +134,22 @@ libaacs_la_LINK = $(LIBTOOL) --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 = aacs_info-aacs_info.$(OBJEXT) +aacs_info_OBJECTS = $(am_aacs_info_OBJECTS) +aacs_info_DEPENDENCIES = libaacs.la +aacs_info_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(aacs_info_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +am_parser_test_OBJECTS = parser_test-parser_test.$(OBJEXT) \ + parser_test-keydbcfg-parser.$(OBJEXT) \ + parser_test-keydbcfg-lexer.$(OBJEXT) \ + parser_test-strutl.$(OBJEXT) parser_test-logging.$(OBJEXT) +parser_test_OBJECTS = $(am_parser_test_OBJECTS) +parser_test_LDADD = $(LDADD) +parser_test_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(parser_test_CFLAGS) \ + $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles @@ -136,9 +172,16 @@ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) -SOURCES = $(libaacs_la_SOURCES) $(EXTRA_libaacs_la_SOURCES) +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) + $(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) ETAGS = etags @@ -172,6 +215,9 @@ 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@ @@ -277,16 +323,17 @@ 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) +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/file.h file/filesystem.h file/file_posix.c \ - file/keydbcfg.c file/keydbcfg.h file/keydbcfg-parser.y \ - file/keydbcfg-lexer.l 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) + 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 @@ -296,11 +343,21 @@ libaacs/aacs-version.h libaacs_la_LDFLAGS = -no-undefined -version-info $(LT_VERSION_INFO) -libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) +libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libaacs.pc BUILT_SOURCES = keydbcfg-parser.h keydbcfg-parser.c 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 @@ -340,7 +397,6 @@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -348,6 +404,8 @@ 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)"; \ } @@ -374,6 +432,67 @@ @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) keydbcfg-parser.c; else :; fi libaacs.la: $(libaacs_la_OBJECTS) $(libaacs_la_DEPENDENCIES) $(EXTRA_libaacs_la_DEPENDENCIES) $(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 +aacs_info$(EXEEXT): $(aacs_info_OBJECTS) $(aacs_info_DEPENDENCIES) $(EXTRA_aacs_info_DEPENDENCIES) + @rm -f aacs_info$(EXEEXT) + $(aacs_info_LINK) $(aacs_info_OBJECTS) $(aacs_info_LDADD) $(LIBS) +parser_test$(EXEEXT): $(parser_test_OBJECTS) $(parser_test_DEPENDENCIES) $(EXTRA_parser_test_DEPENDENCIES) + @rm -f parser_test$(EXEEXT) + $(parser_test_LINK) $(parser_test_OBJECTS) $(parser_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -382,8 +501,11 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aacs.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aacs_info-aacs_info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darwin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirs_darwin.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirs_win32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirs_xdg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_posix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keydbcfg-lexer.Plo@am__quote@ @@ -392,9 +514,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmc.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test-keydbcfg-lexer.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test-keydbcfg-parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test-logging.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test-parser_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser_test-strutl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutl.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdg.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -473,26 +599,33 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o strutl.lo `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c -darwin.lo: file/darwin.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT darwin.lo -MD -MP -MF $(DEPDIR)/darwin.Tpo -c -o darwin.lo `test -f 'file/darwin.c' || echo '$(srcdir)/'`file/darwin.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/darwin.Tpo $(DEPDIR)/darwin.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/darwin.c' object='darwin.lo' libtool=yes @AMDEPBACKSLASH@ +dirs_darwin.lo: file/dirs_darwin.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dirs_darwin.lo -MD -MP -MF $(DEPDIR)/dirs_darwin.Tpo -c -o dirs_darwin.lo `test -f 'file/dirs_darwin.c' || echo '$(srcdir)/'`file/dirs_darwin.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dirs_darwin.Tpo $(DEPDIR)/dirs_darwin.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dirs_darwin.c' object='dirs_darwin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o darwin.lo `test -f 'file/darwin.c' || echo '$(srcdir)/'`file/darwin.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dirs_darwin.lo `test -f 'file/dirs_darwin.c' || echo '$(srcdir)/'`file/dirs_darwin.c -win32.lo: file/win32.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT win32.lo -MD -MP -MF $(DEPDIR)/win32.Tpo -c -o win32.lo `test -f 'file/win32.c' || echo '$(srcdir)/'`file/win32.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/win32.Tpo $(DEPDIR)/win32.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/win32.c' object='win32.lo' libtool=yes @AMDEPBACKSLASH@ +dirs_win32.lo: file/dirs_win32.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dirs_win32.lo -MD -MP -MF $(DEPDIR)/dirs_win32.Tpo -c -o dirs_win32.lo `test -f 'file/dirs_win32.c' || echo '$(srcdir)/'`file/dirs_win32.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dirs_win32.Tpo $(DEPDIR)/dirs_win32.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dirs_win32.c' object='dirs_win32.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o win32.lo `test -f 'file/win32.c' || echo '$(srcdir)/'`file/win32.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dirs_win32.lo `test -f 'file/dirs_win32.c' || echo '$(srcdir)/'`file/dirs_win32.c -xdg.lo: file/xdg.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT xdg.lo -MD -MP -MF $(DEPDIR)/xdg.Tpo -c -o xdg.lo `test -f 'file/xdg.c' || echo '$(srcdir)/'`file/xdg.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/xdg.Tpo $(DEPDIR)/xdg.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/xdg.c' object='xdg.lo' libtool=yes @AMDEPBACKSLASH@ +dirs_xdg.lo: file/dirs_xdg.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dirs_xdg.lo -MD -MP -MF $(DEPDIR)/dirs_xdg.Tpo -c -o dirs_xdg.lo `test -f 'file/dirs_xdg.c' || echo '$(srcdir)/'`file/dirs_xdg.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dirs_xdg.Tpo $(DEPDIR)/dirs_xdg.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/dirs_xdg.c' object='dirs_xdg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o xdg.lo `test -f 'file/xdg.c' || echo '$(srcdir)/'`file/xdg.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dirs_xdg.lo `test -f 'file/dirs_xdg.c' || echo '$(srcdir)/'`file/dirs_xdg.c + +path.lo: file/path.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT path.lo -MD -MP -MF $(DEPDIR)/path.Tpo -c -o path.lo `test -f 'file/path.c' || echo '$(srcdir)/'`file/path.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/path.Tpo $(DEPDIR)/path.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='file/path.c' object='path.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o path.lo `test -f 'file/path.c' || echo '$(srcdir)/'`file/path.c ec.lo: libaacs/ec.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ec.lo -MD -MP -MF $(DEPDIR)/ec.Tpo -c -o ec.lo `test -f 'libaacs/ec.c' || echo '$(srcdir)/'`libaacs/ec.c @@ -501,6 +634,90 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ec.lo `test -f 'libaacs/ec.c' || echo '$(srcdir)/'`libaacs/ec.c +aacs_info-aacs_info.o: examples/aacs_info.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -MT aacs_info-aacs_info.o -MD -MP -MF $(DEPDIR)/aacs_info-aacs_info.Tpo -c -o aacs_info-aacs_info.o `test -f 'examples/aacs_info.c' || echo '$(srcdir)/'`examples/aacs_info.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/aacs_info-aacs_info.Tpo $(DEPDIR)/aacs_info-aacs_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/aacs_info.c' object='aacs_info-aacs_info.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -c -o aacs_info-aacs_info.o `test -f 'examples/aacs_info.c' || echo '$(srcdir)/'`examples/aacs_info.c + +aacs_info-aacs_info.obj: examples/aacs_info.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -MT aacs_info-aacs_info.obj -MD -MP -MF $(DEPDIR)/aacs_info-aacs_info.Tpo -c -o 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__mv) $(DEPDIR)/aacs_info-aacs_info.Tpo $(DEPDIR)/aacs_info-aacs_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/aacs_info.c' object='aacs_info-aacs_info.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aacs_info_CFLAGS) $(CFLAGS) -c -o 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` + +parser_test-parser_test.o: examples/parser_test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-parser_test.o -MD -MP -MF $(DEPDIR)/parser_test-parser_test.Tpo -c -o parser_test-parser_test.o `test -f 'examples/parser_test.c' || echo '$(srcdir)/'`examples/parser_test.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-parser_test.Tpo $(DEPDIR)/parser_test-parser_test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/parser_test.c' object='parser_test-parser_test.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-parser_test.o `test -f 'examples/parser_test.c' || echo '$(srcdir)/'`examples/parser_test.c + +parser_test-parser_test.obj: examples/parser_test.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-parser_test.obj -MD -MP -MF $(DEPDIR)/parser_test-parser_test.Tpo -c -o 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__mv) $(DEPDIR)/parser_test-parser_test.Tpo $(DEPDIR)/parser_test-parser_test.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='examples/parser_test.c' object='parser_test-parser_test.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o 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` + +parser_test-keydbcfg-parser.o: keydbcfg-parser.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-keydbcfg-parser.o -MD -MP -MF $(DEPDIR)/parser_test-keydbcfg-parser.Tpo -c -o parser_test-keydbcfg-parser.o `test -f 'keydbcfg-parser.c' || echo '$(srcdir)/'`keydbcfg-parser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-keydbcfg-parser.Tpo $(DEPDIR)/parser_test-keydbcfg-parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keydbcfg-parser.c' object='parser_test-keydbcfg-parser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-keydbcfg-parser.o `test -f 'keydbcfg-parser.c' || echo '$(srcdir)/'`keydbcfg-parser.c + +parser_test-keydbcfg-parser.obj: keydbcfg-parser.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-keydbcfg-parser.obj -MD -MP -MF $(DEPDIR)/parser_test-keydbcfg-parser.Tpo -c -o parser_test-keydbcfg-parser.obj `if test -f 'keydbcfg-parser.c'; then $(CYGPATH_W) 'keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/keydbcfg-parser.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-keydbcfg-parser.Tpo $(DEPDIR)/parser_test-keydbcfg-parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keydbcfg-parser.c' object='parser_test-keydbcfg-parser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-keydbcfg-parser.obj `if test -f 'keydbcfg-parser.c'; then $(CYGPATH_W) 'keydbcfg-parser.c'; else $(CYGPATH_W) '$(srcdir)/keydbcfg-parser.c'; fi` + +parser_test-keydbcfg-lexer.o: keydbcfg-lexer.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-keydbcfg-lexer.o -MD -MP -MF $(DEPDIR)/parser_test-keydbcfg-lexer.Tpo -c -o parser_test-keydbcfg-lexer.o `test -f 'keydbcfg-lexer.c' || echo '$(srcdir)/'`keydbcfg-lexer.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-keydbcfg-lexer.Tpo $(DEPDIR)/parser_test-keydbcfg-lexer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keydbcfg-lexer.c' object='parser_test-keydbcfg-lexer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-keydbcfg-lexer.o `test -f 'keydbcfg-lexer.c' || echo '$(srcdir)/'`keydbcfg-lexer.c + +parser_test-keydbcfg-lexer.obj: keydbcfg-lexer.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-keydbcfg-lexer.obj -MD -MP -MF $(DEPDIR)/parser_test-keydbcfg-lexer.Tpo -c -o parser_test-keydbcfg-lexer.obj `if test -f 'keydbcfg-lexer.c'; then $(CYGPATH_W) 'keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/keydbcfg-lexer.c'; fi` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-keydbcfg-lexer.Tpo $(DEPDIR)/parser_test-keydbcfg-lexer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='keydbcfg-lexer.c' object='parser_test-keydbcfg-lexer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-keydbcfg-lexer.obj `if test -f 'keydbcfg-lexer.c'; then $(CYGPATH_W) 'keydbcfg-lexer.c'; else $(CYGPATH_W) '$(srcdir)/keydbcfg-lexer.c'; fi` + +parser_test-strutl.o: util/strutl.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-strutl.o -MD -MP -MF $(DEPDIR)/parser_test-strutl.Tpo -c -o parser_test-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-strutl.Tpo $(DEPDIR)/parser_test-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/strutl.c' object='parser_test-strutl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-strutl.o `test -f 'util/strutl.c' || echo '$(srcdir)/'`util/strutl.c + +parser_test-strutl.obj: util/strutl.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-strutl.obj -MD -MP -MF $(DEPDIR)/parser_test-strutl.Tpo -c -o 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__mv) $(DEPDIR)/parser_test-strutl.Tpo $(DEPDIR)/parser_test-strutl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/strutl.c' object='parser_test-strutl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-strutl.obj `if test -f 'util/strutl.c'; then $(CYGPATH_W) 'util/strutl.c'; else $(CYGPATH_W) '$(srcdir)/util/strutl.c'; fi` + +parser_test-logging.o: util/logging.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-logging.o -MD -MP -MF $(DEPDIR)/parser_test-logging.Tpo -c -o parser_test-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/parser_test-logging.Tpo $(DEPDIR)/parser_test-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='parser_test-logging.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o parser_test-logging.o `test -f 'util/logging.c' || echo '$(srcdir)/'`util/logging.c + +parser_test-logging.obj: util/logging.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -MT parser_test-logging.obj -MD -MP -MF $(DEPDIR)/parser_test-logging.Tpo -c -o 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__mv) $(DEPDIR)/parser_test-logging.Tpo $(DEPDIR)/parser_test-logging.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util/logging.c' object='parser_test-logging.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parser_test_CFLAGS) $(CFLAGS) -c -o 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__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) @@ -524,8 +741,11 @@ -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @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"; \ @@ -542,8 +762,11 @@ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" @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"; \ @@ -647,9 +870,11 @@ check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am -all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) +all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) +install-binPROGRAMS: install-libLTLIBRARIES + installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -690,8 +915,8 @@ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ + clean-libtool clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -717,7 +942,7 @@ install-dvi-am: -install-exec-am: install-libLTLIBRARIES +install-exec-am: install-binPROGRAMS install-libLTLIBRARIES install-html: install-html-am @@ -757,25 +982,27 @@ ps-am: -uninstall-am: uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ - uninstall-pkgincludeHEADERS +uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \ + uninstall-pkgconfigDATA uninstall-pkgincludeHEADERS .MAKE: all check install install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags dist-hook distclean \ +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libLTLIBRARIES clean-libtool \ + clean-noinstPROGRAMS ctags 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-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 uninstall \ - uninstall-am uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + 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 uninstall uninstall-am uninstall-binPROGRAMS \ + uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ uninstall-pkgincludeHEADERS
View file
libaacs-0.6.0.tar.bz2/src/examples/aacs_info.c -> libaacs-0.7.0.tar.bz2/src/examples/aacs_info.c
Changed
@@ -17,8 +17,8 @@ * <http://www.gnu.org/licenses/>. */ -#include "../libaacs/aacs.h" -#include "../util/macro.h" /* MKINT_BE48 */ +#include "libaacs/aacs.h" +#include "util/macro.h" /* MKINT_BE48 */ #include <stdio.h> #include <stdlib.h> @@ -110,9 +110,17 @@ const uint8_t *vid = aacs_get_vid(aacs); const uint8_t *id = aacs_get_disc_id(aacs); + const uint8_t *pmsn = aacs_get_pmsn(aacs); + const int bec = aacs_get_bus_encryption(aacs); + const uint8_t *binding_id = aacs_get_device_binding_id(aacs); printf("Disc ID: %s\n", id ? _hex2str(id, 20) : "???"); printf("VID : %s\n", vid ? _hex2str(vid, 16) : "???"); printf("MKBv : %d\n", aacs_get_mkb_version(aacs)); + printf("PMSN : %s\n", pmsn ? _hex2str(pmsn, 16) : "???"); + printf("Bus encryption:\n"); + printf(" Device support: %s\n", (bec & AACS_BUS_ENCRYPTION_CAPABLE) ? "yes" : "no"); + printf(" Enabled in media: %s\n", (bec & AACS_BUS_ENCRYPTION_ENABLED) ? "yes" : "no"); + printf("Device binding ID: %s\n", binding_id ? _hex2str(binding_id, 16) : "???"); aacs_close(aacs); @@ -123,11 +131,11 @@ rl = aacs_get_hrl(&num_entries, &mkb_version); _dump_rl("Host", rl, num_entries, mkb_version); - X_FREE(rl); + aacs_free_rl(&rl); rl = aacs_get_drl(&num_entries, &mkb_version); _dump_rl("Drive", rl, num_entries, mkb_version); - X_FREE(rl); + aacs_free_rl(&rl); return EXIT_SUCCESS; }
View file
libaacs-0.6.0.tar.bz2/src/examples/parser_test.c -> libaacs-0.7.0.tar.bz2/src/examples/parser_test.c
Changed
@@ -18,6 +18,7 @@ */ #include "file/keydbcfg.h" +#include "util/logging.h" #include <stdio.h> #include <stdlib.h> @@ -51,6 +52,8 @@ /* Function that prints all entries parsed from a config file */ static int print_title_entries(title_entry_list *list) { + char tmp256; + if (!list) { printf("Error: No title list passed as parameter.\n"); @@ -63,7 +66,7 @@ if (!cursor->entry.discid) break; - printf("DISCID: %s\n", cursor->entry.discid); + printf("DISCID: %s\n", 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); @@ -103,23 +106,14 @@ /* Function to print certificate list from config file */ static int print_cert_list(cert_list *list) { - if (!list) - { - printf("Error: no certificate list object passed in as parameter\n"); - return 0; - } + char tmp256; printf("Available certificates:\n"); cert_list *cursor = list; while (cursor) { - if (!cursor->host_priv_key) - break; - - printf(" Host private key: %s\n", cursor->host_priv_key); - printf(" Host certificate: %s\n", cursor->host_cert); - printf(" Host nonce: %s\n", cursor->host_nonce); - printf(" Host key point: %s\n", cursor->host_key_point); + 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("\n"); cursor = cursor->next; @@ -133,14 +127,13 @@ /* Function to print config file */ static int print_config_file(config_file *cfgfile) { + char tmp256; + printf("Available device keys:\n"); dk_list *dkcursor = cfgfile->dkl; while (dkcursor) { - if (!dkcursor->key) - break; - - printf(" Device key: %s\n", dkcursor->key); + printf(" Device key: %s\n", print_hex(tmp, dkcursor->key, 16)); printf(" Device node: %lu\n", dkcursor->node); dkcursor = dkcursor->next; @@ -153,10 +146,7 @@ pk_list *cursor = cfgfile->pkl; while (cursor) { - if (!cursor->key) - break; - - printf(" %s\n", cursor->key); + printf(" %s\n", print_hex(tmp, cursor->key, 16)); cursor = cursor->next; }
View file
libaacs-0.7.0.tar.bz2/src/file/dirs.h
Added
@@ -0,0 +1,38 @@ +/* + * This file is part of libbluray + * Copyright (C) 2011-2013 VideoLAN + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef BLURAY_DIRS_H +#define BLURAY_DIRS_H + +#include <util/attributes.h> + +#ifdef _WIN32 +AACS_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); + +#endif
View file
libaacs-0.7.0.tar.bz2/src/file/dirs_darwin.c
Added
@@ -0,0 +1,119 @@ +/* + * This file is part of libbluray + * Copyright (C) 2012 Konstantin Pavlov + * + * 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/>. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "dirs.h" + +#include <CoreFoundation/CoreFoundation.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "util/strutl.h" +#include "util/logging.h" + +#define USER_CFG_DIR "Library/Preferences" +#define USER_CACHE_DIR "Library/Caches" +#define USER_DATA_DIR "Library" +#define SYSTEM_CFG_DIR "/Library/Preferences" + + +const 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"); + } + + return dir; +} + +const 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"); + } + + return dir; +} + +const 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"); + } + + return dir; +} + +const char *file_get_config_system(const char *dir) +{ + static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0" + + if (!dirs) { + dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0); + } + + if (!dir) { + // first call + dir = dirs; + } else { + // next call + dir += strlen(dir) + 1; + if (!*dir) { + // end of list + dir = NULL; + } + } + + return dir; +}
View file
libaacs-0.7.0.tar.bz2/src/file/dirs_win32.c
Added
@@ -0,0 +1,104 @@ +/* + * This file is part of libbluray + * Copyright (C) 2011 VideoLAN + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "dirs.h" + +#include "util/logging.h" + +#include <stdio.h> +#include <string.h> + +#include <shlobj.h> +#include <windows.h> +#include <limits.h> +#include <direct.h> + + +int win32_mkdir(const char *dir) +{ + wchar_t wdirMAX_PATH; + + MultiByteToWideChar(CP_UTF8, 0, dir, -1, wdir, MAX_PATH); + return _wmkdir(wdir); +} + +const char *file_get_config_home(void) +{ + return file_get_data_home(); +} + +const 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); + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + return appdir; + } + + DEBUG(DBG_FILE, "Can't find user configuration directory !\n"); + return NULL; +} + +const char *file_get_cache_home(void) +{ + return file_get_data_home(); +} + +const char *file_get_config_system(const char *dir) +{ + static char *appdir = NULL; + wchar_t wdirMAX_PATH; + + if (!dir) { + // first call + + if (appdir) + return appdir; + + /* Get the "Application Data" folder for all users */ + if (S_OK == SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA | CSIDL_FLAG_CREATE, + NULL, SHGFP_TYPE_CURRENT, wdir)) { + int len = WideCharToMultiByte (CP_UTF8, 0, wdir, -1, NULL, 0, NULL, NULL); + appdir = malloc(len); + WideCharToMultiByte (CP_UTF8, 0, wdir, -1, appdir, len, NULL, NULL); + return appdir; + } else { + DEBUG(DBG_FILE, "Can't find common configuration directory !\n"); + return NULL; + } + } else { + // next call + return NULL; + } + + return dir; +}
View file
libaacs-0.7.0.tar.bz2/src/file/dirs_xdg.c
Added
@@ -0,0 +1,151 @@ +/* + * This file is part of libbluray + * Copyright (C) 2013 Petri Hintukainen <phintuka@users.sourceforge.net> + * + * 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/>. + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "dirs.h" + +#include "util/strutl.h" +#include "util/logging.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +/* + * Based on XDG Base Directory Specification + * http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html + */ + +#define USER_CFG_DIR ".config" +#define USER_CACHE_DIR ".cache" +#define USER_DATA_DIR ".local/share" +#define SYSTEM_CFG_DIR "/etc/xdg" + + +const 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); + } + + DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + } + + return dir; +} + +const 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); + } + + DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + } + + return dir; +} + +const 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); + } + + DEBUG(DBG_FILE, "Can't find user home directory ($HOME) !\n"); + } + + return dir; +} + +const char *file_get_config_system(const char *dir) +{ + static char *dirs = NULL; // "dir1\0dir2\0...\0dirN\0\0" + + if (!dirs) { + const char *xdg_sys = getenv("XDG_CONFIG_DIRS"); + + if (xdg_sys && *xdg_sys) { + + dirs = calloc(1, strlen(xdg_sys) + 2); + strcpy(dirs, xdg_sys); + + char *pt = dirs; + while (NULL != (pt = strchr(pt, ':'))) { + *pt++ = 0; + } + + } else { + dirs = str_printf("%s%c%c", SYSTEM_CFG_DIR, 0, 0); + } + } + + if (!dir) { + // first call + dir = dirs; + } else { + // next call + dir += strlen(dir) + 1; + if (!*dir) { + // end of list + dir = NULL; + } + } + + return dir; +}
View file
libaacs-0.7.0.tar.bz2/src/file/keydb.h
Added
@@ -0,0 +1,26 @@ + +/* encrypted keys */ + +static const uint32_t internal_device_number = 0; + +static const uint8_t internal_dk_list21 = { + { + }, +}; + +static const uint8_t internal_pk_list16 = { + { + }, +}; + +static const uint8_t internal_hc_list112 = { + { + }, +}; + +/* customize this function to "hide" the keys in the binary */ + +static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size) +{ + memcpy(out, in, size); +}
View file
libaacs-0.6.0.tar.bz2/src/file/keydbcfg-lexer.l -> libaacs-0.7.0.tar.bz2/src/file/keydbcfg-lexer.l
Changed
@@ -59,6 +59,8 @@ KEYWORD_DEVICE_KEY (DdEeVvIiCcEe_KkEeYy) KEYWORD_DEVICE_NODE (DdEeVvIiCcEe_NnOoDdEe) +KEYWORD_KEY_UV (KkEeYy_UuVv) +KEYWORD_KEY_U_MASK_SHIFT (KkEeYy_Uu_MmAaSsKk_SsHhIiFfTt) KEYWORD_HOST_PRIV_KEY (HhOoSsTt_PpRrIiVv_KkEeYy \t+) KEYWORD_HOST_CERT (HhOoSsTt_CcEeRrTt \t+) KEYWORD_HOST_NONCE (HhOoSsTt_NnOoNnCcEe \t+) @@ -112,6 +114,8 @@ {KEYWORD_DEVICE_KEY} { return KEYWORD_DEVICE_KEY; } {KEYWORD_DEVICE_NODE} { return KEYWORD_DEVICE_NODE; } +{KEYWORD_KEY_UV} { return KEYWORD_KEY_UV; } +{KEYWORD_KEY_U_MASK_SHIFT} { return KEYWORD_KEY_U_MASK_SHIFT; } {KEYWORD_HOST_PRIV_KEY} { return KEYWORD_HOST_PRIV_KEY; } {KEYWORD_HOST_CERT} { return KEYWORD_HOST_CERT; } {KEYWORD_HOST_NONCE} { return KEYWORD_HOST_NONCE; }
View file
libaacs-0.6.0.tar.bz2/src/file/keydbcfg-parser.y -> libaacs-0.7.0.tar.bz2/src/file/keydbcfg-parser.y
Changed
@@ -66,13 +66,13 @@ }; static dk_list *new_dk_list(void); -static dk_list *add_dk_list_entry(dk_list *list, char *key, char *node); static pk_list *new_pk_list(void); -static pk_list *add_pk_list_entry(pk_list *list, char *key); static cert_list *new_cert_list(void); -static cert_list *add_cert_list(cert_list *list, char *host_priv_key, - char *host_cert, char *host_nonce, - char *host_key_point); + +static void add_dk_entry(config_file *cf, char *key, char *node, char *uv, char *u_mask_shift); +static void add_pk_entry(config_file *cf, char *key); +static void add_cert_entry(config_file *cf, char *host_priv_key, char *host_cert); + static title_entry_list *new_title_entry_list(void); static int add_entry(title_entry_list *list, int type, char *entry); static digit_key_pair_list *new_digit_key_pair_list(void); @@ -80,7 +80,7 @@ int type, unsigned int digit, char *key); static int add_date_entry(title_entry_list *list, unsigned int year, unsigned int month, unsigned int day); -void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, +void yyerror (void *scanner, config_file *cf, title_entry_list *celist, digit_key_pair_list *dkplist, const char *msg); extern int libaacs_yyget_lineno (void *scanner); @@ -98,9 +98,7 @@ %yacc %lex-param{void *scanner} %parse-param{void *scanner} -%parse-param{dk_list *dklist} -%parse-param{pk_list *pklist} -%parse-param{cert_list *clist} +%parse-param{config_file *cf} %parse-param{title_entry_list *celist} %parse-param{digit_key_pair_list *dkplist} @@ -116,6 +114,8 @@ %token KEYWORD_DEVICE_KEY %token KEYWORD_DEVICE_NODE +%token KEYWORD_KEY_UV +%token KEYWORD_KEY_U_MASK_SHIFT %token KEYWORD_HOST_PRIV_KEY %token KEYWORD_HOST_CERT %token KEYWORD_HOST_NONCE @@ -142,7 +142,7 @@ %type <string> discid disc_title %type <string> host_priv_key host_cert host_nonce host_key_point hexstring_list -%type <string> device_key device_node +%type <string> device_key device_node key_uv key_u_mask_shift %% config_file : config_entry_list newline_list @@ -170,13 +170,21 @@ ; dk_entry - : newline_list ENTRY_ID_DK device_key PUNCT_VERTICAL_BAR device_node NEWLINE + : newline_list ENTRY_ID_DK device_key PUNCT_VERTICAL_BAR device_node PUNCT_VERTICAL_BAR key_uv PUNCT_VERTICAL_BAR key_u_mask_shift NEWLINE + { + add_dk_entry(cf, $3, $5, $7, $9); + } + | newline_list ENTRY_ID_DK device_key PUNCT_VERTICAL_BAR device_node NEWLINE + { + add_dk_entry(cf, $3, $5, NULL, NULL); + } + | ENTRY_ID_DK device_key PUNCT_VERTICAL_BAR device_node PUNCT_VERTICAL_BAR key_uv PUNCT_VERTICAL_BAR key_u_mask_shift NEWLINE { - dklist = add_dk_list_entry(dklist, $3, $5); + add_dk_entry(cf, $2, $4, $6, $8); } | ENTRY_ID_DK device_key PUNCT_VERTICAL_BAR device_node NEWLINE { - dklist = add_dk_list_entry(dklist, $2, $4); + add_dk_entry(cf, $2, $4, NULL, NULL); } ; @@ -190,25 +198,49 @@ { $$ = $2; } ; +key_uv + : KEYWORD_KEY_UV hexstring_list + { $$ = $2; } + ; + +key_u_mask_shift + : KEYWORD_KEY_U_MASK_SHIFT hexstring_list + { $$ = $2; } + ; + pk_entry : newline_list ENTRY_ID_PK hexstring_list NEWLINE { - pklist = add_pk_list_entry(pklist, $3); + add_pk_entry(cf, $3); } | ENTRY_ID_PK hexstring_list NEWLINE { - pklist = add_pk_list_entry(pklist, $2); + add_pk_entry(cf, $2); } ; host_cert_entry : newline_list ENTRY_ID_HC host_priv_key PUNCT_VERTICAL_BAR host_cert PUNCT_VERTICAL_BAR host_nonce PUNCT_VERTICAL_BAR host_key_point NEWLINE { - clist = add_cert_list(clist, $3, $5, $7, $9); + /* host_nonce and host_key_point are ignored, keep this for backward compatibility */ + X_FREE($7); + X_FREE($9); + add_cert_entry(cf, $3, $5); } | ENTRY_ID_HC host_priv_key PUNCT_VERTICAL_BAR host_cert PUNCT_VERTICAL_BAR host_nonce PUNCT_VERTICAL_BAR host_key_point NEWLINE { - clist = add_cert_list(clist, $2, $4, $6, $8); + /* host_nonce and host_key_point are ignored, keep this for backward compatibility */ + X_FREE($6); + X_FREE($8); + add_cert_entry(cf, $2, $4); + } + | newline_list ENTRY_ID_HC host_priv_key PUNCT_VERTICAL_BAR host_cert NEWLINE + { + add_cert_entry(cf, $3, $5); + } + | ENTRY_ID_HC host_priv_key PUNCT_VERTICAL_BAR host_cert NEWLINE + { + add_cert_entry(cf, $2, $4); } ; @@ -234,15 +266,7 @@ title_entry : newline_list disc_info entry_list NEWLINE - { - celist->next = new_title_entry_list(); - celist = celist->next; - } | disc_info entry_list NEWLINE - { - celist->next = new_title_entry_list(); - celist = celist->next; - } ; newline_list @@ -253,6 +277,12 @@ disc_info : discid PUNCT_EQUALS_SIGN disc_title { + if (!cf->list) { + celist = cf->list = new_title_entry_list(); + } else { + celist->next = new_title_entry_list(); + celist = celist->next; + } add_entry(celist, ENTRY_TYPE_DISCID, $1); add_entry(celist, ENTRY_TYPE_TITLE, $3); } @@ -433,24 +463,12 @@ if (!fp) return 0; - dk_list *head_dklist = new_dk_list(); - pk_list *head_pklist = new_pk_list(); - cert_list *head_clist = new_cert_list(); - title_entry_list *head_celist = new_title_entry_list(); - digit_key_pair_list *dkplist = NULL; - void *scanner; libaacs_yylex_init(&scanner); libaacs_yyset_in(fp, scanner); - int retval = yyparse(scanner, head_dklist, head_pklist, head_clist, - head_celist, dkplist); + int retval = yyparse(scanner, cfgfile, NULL, NULL); libaacs_yylex_destroy(scanner); - cfgfile->dkl = head_dklist; - cfgfile->pkl = head_pklist; - cfgfile->host_cert_list = head_clist; - cfgfile->list = head_celist; - fclose(fp); if (retval) @@ -470,11 +488,14 @@ /* Function that closes and frees a config file object */ int keydbcfg_config_file_close(config_file *cfgfile) { + if (!cfgfile) { + return 0; + } + /* free pk list */ while (cfgfile->pkl) { pk_list *next = cfgfile->pkl->next; - X_FREE(cfgfile->pkl->key); X_FREE(cfgfile->pkl); cfgfile->pkl = next; } @@ -483,7 +504,6 @@ while (cfgfile->dkl) { dk_list *next = cfgfile->dkl->next; - X_FREE(cfgfile->dkl->key); X_FREE(cfgfile->dkl); cfgfile->dkl = next; } @@ -492,10 +512,6 @@ while (cfgfile->host_cert_list) { cert_list *next = cfgfile->host_cert_list->next; - X_FREE(cfgfile->host_cert_list->host_priv_key); - X_FREE(cfgfile->host_cert_list->host_cert); - X_FREE(cfgfile->host_cert_list->host_nonce); - X_FREE(cfgfile->host_cert_list->host_key_point); X_FREE(cfgfile->host_cert_list); cfgfile->host_cert_list = next; } @@ -504,7 +520,6 @@ while (cfgfile->list) { title_entry_list *next = cfgfile->list->next; - X_FREE(cfgfile->list->entry.discid); X_FREE(cfgfile->list->entry.title); X_FREE(cfgfile->list->entry.mek); X_FREE(cfgfile->list->entry.vid); @@ -532,21 +547,36 @@ } /* Function to add dk to config file */ -static dk_list *add_dk_list_entry(dk_list *list, char *key, char *node) +static void add_dk_entry(config_file *cf, char *key, char *node, char *uv, char *u_mask_shift) { - if (!list) - { - printf("Error: No dk list passed as parameter.\n"); - return NULL; + if (strlen(key) != 32) { + fprintf(stderr, "ignoring bad DK entry %s\n", key); + X_FREE(key); + return; } - list->key = key; - list->node = strtoul(node, NULL, 16); - list->next = new_dk_list(); + dk_list *entry = cf->dkl; + if (!entry) { + entry = cf->dkl = new_dk_list(); + } else { + for (; entry->next; entry = entry->next); + entry->next = new_dk_list(); + entry = entry->next; + } + hexstring_to_hex_array(entry->key, 16, key); + X_FREE(key); + entry->node = strtoul(node, NULL, 16); X_FREE(node); - return list->next; + if (uv) { + entry->uv = strtoul(uv, NULL, 16); + X_FREE(uv); + } + if (u_mask_shift) { + entry->u_mask_shift = strtoul(u_mask_shift, NULL, 16); + X_FREE(u_mask_shift); + } } /* Function to return new pk_list object */ @@ -558,18 +588,25 @@ } /* Function to add pk to config file */ -static pk_list *add_pk_list_entry(pk_list *list, char *key) +static void add_pk_entry(config_file *cf, char *key) { - if (!list) - { - printf("Error: No pk list passed as parameter.\n"); - return NULL; + if (strlen(key) != 32) { + fprintf(stderr, "ignoring bad PK entry %s\n", key); + X_FREE(key); + return; } - list->key = key; - list->next = new_pk_list(); + pk_list *entry = cf->pkl; + if (!entry) { + entry = cf->pkl = new_pk_list(); + } else { + for (; entry->next; entry = entry->next); + entry->next = new_pk_list(); + entry = entry->next; + } - return list->next; + hexstring_to_hex_array(entry->key, 16, key); + X_FREE(key); } /* Function to create new certificate list */ @@ -588,24 +625,34 @@ } /* Function to add certificate list entry into config file object */ -static cert_list *add_cert_list(cert_list *list, char *host_priv_key, - char *host_cert, char *host_nonce, - char *host_key_point) +static void add_cert_entry(config_file *cf, char *host_priv_key, char *host_cert) { - if (!list) - { - printf("Error: no certificate list object passed as parameter.\n"); - return NULL; + if (strlen(host_priv_key) != 40) { + fprintf(stderr, "ignoring bad private key entry %s\n", host_priv_key); + X_FREE(host_priv_key); + X_FREE(host_cert); + return; + } + if (strlen(host_cert) != 184) { + fprintf(stderr, "ignoring bad certificate entry %s\n", host_cert); + X_FREE(host_priv_key); + X_FREE(host_cert); + return; } - list->host_priv_key = host_priv_key; - list->host_cert = host_cert; - list->host_nonce = host_nonce; - list->host_key_point = host_key_point; - - list->next = new_cert_list(); + cert_list *entry = cf->host_cert_list; + if (!entry) { + entry = cf->host_cert_list = new_cert_list(); + } else { + for (; entry->next; entry = entry->next); + entry->next = new_cert_list(); + entry = entry->next; + } - return list->next; + hexstring_to_hex_array(entry->host_priv_key, 20, host_priv_key); + X_FREE(host_priv_key); + hexstring_to_hex_array(entry->host_cert, 92, host_cert); + X_FREE(host_cert); } /* Function that returns pointer to new title entry list */ @@ -623,6 +670,13 @@ return list; } +#define CHECK_KEY_LENGTH(name, len) \ + if (strlen(entry) != len) { \ + fprintf(stderr, "Ignoring bad "name" entry %s\n", entry); \ + X_FREE(entry); \ + break; \ + } + /* Function to add standard string entries to a config entry */ static int add_entry(title_entry_list *list, int type, char *entry) { @@ -635,8 +689,9 @@ switch (type) { case ENTRY_TYPE_DISCID: - X_FREE(list->entry.discid); - list->entry.discid = entry; + CHECK_KEY_LENGTH("discid", 40) + hexstring_to_hex_array(list->entry.discid, 20, entry); + X_FREE(entry); break; case ENTRY_TYPE_TITLE: @@ -646,16 +701,19 @@ break; case ENTRY_TYPE_MEK: + CHECK_KEY_LENGTH("mek", 32) X_FREE(list->entry.mek); list->entry.mek = entry; break; case ENTRY_TYPE_VID: + CHECK_KEY_LENGTH("vid", 32) X_FREE(list->entry.vid); list->entry.vid = entry; break; case ENTRY_TYPE_VUK: + CHECK_KEY_LENGTH("vuk", 32) X_FREE(list->entry.vuk); list->entry.vuk = entry; break; @@ -720,7 +778,7 @@ } /* Our definition of yyerror */ -void yyerror (void *scanner, dk_list *dklist, pk_list *pklist, cert_list *clist, +void yyerror (void *scanner, config_file *cf, title_entry_list *celist, digit_key_pair_list *dkplist, const char *msg) {
View file
libaacs-0.6.0.tar.bz2/src/file/keydbcfg.c -> libaacs-0.7.0.tar.bz2/src/file/keydbcfg.c
Changed
@@ -1,6 +1,6 @@ /* * This file is part of libaacs - * Copyright (C) 2010 npzacs + * Copyright (C) 2010-2013 npzacs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,22 +19,7 @@ #include "keydbcfg.h" -#if defined(__APPLE__) -# include "darwin.h" -# define get_config_home darwin_get_config_home -# define get_cache_home darwin_get_cache_home -# define get_config_system darwin_get_config_system -#elif defined(_WIN32) -# include "win32.h" -# define get_config_home win32_get_config_home -# define get_cache_home win32_get_config_home -# define get_config_system win32_get_config_system -#else -# include "xdg.h" -# define get_config_home xdg_get_config_home -# define get_cache_home xdg_get_cache_home -# define get_config_system xdg_get_config_system -#endif +#include "dirs.h" #include "util/strutl.h" #include "util/logging.h" @@ -60,6 +45,36 @@ #define MIN_FILE_SIZE 20 #define MAX_FILE_SIZE 65535 +static int _mkpath(const char *path) +{ + struct stat s; + int result = 1; + char *dir = str_printf("%s", path); + char *end = dir; + + while (*end == '/') + end++; + + while ((end = strchr(end, '/'))) { + *end = 0; + + if (stat(dir, &s) != 0 || !S_ISDIR(s.st_mode)) { + 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); + result = 0; + break; + } + } + + *end++ = '/'; + } + + X_FREE(dir); + + return result; +} static char *_load_file(FILE *fp) { @@ -89,18 +104,35 @@ return data; } -static FILE *_open_cfg_file_user(const char *file_name, char **path) +static char *_config_file_user(const char *file_name) { - const char *cfg_dir = get_config_home(); + const char *cfg_dir = file_get_config_home(); if (!cfg_dir) { return NULL; } - char *cfg_file = str_printf("%s/%s/%s", cfg_dir, CFG_DIR, file_name); - FILE *fp = fopen(cfg_file, "r"); + return str_printf("%s/%s/%s", cfg_dir, CFG_DIR, file_name); +} + +static FILE *_open_cfg_file_user(const char *file_name, char **path, const char *mode) +{ + char *cfg_file = _config_file_user(file_name); + + if (!cfg_file) { + return NULL; + } + + if (*mode == 'w') { + if (!_mkpath(cfg_file)) { + X_FREE(cfg_file); + return NULL; + } + } - DEBUG(DBG_FILE, fp ? "Reading %s\n" : "%s not found\n", cfg_file); + FILE *fp = fopen(cfg_file, mode); + + DEBUG(DBG_FILE, fp ? "Opened %s for %s\n" : "%s not found\n", cfg_file, mode); if (fp && path) { *path = cfg_file; @@ -115,7 +147,7 @@ { const char *dir = NULL; - while (NULL != (dir = get_config_system(dir))) { + while (NULL != (dir = file_get_config_system(dir))) { char *cfg_file = str_printf("%s/%s/%s", dir, CFG_DIR, file_name); @@ -139,13 +171,11 @@ return NULL; } -static int _is_duplicate_pk(pk_list *list, const char *e) +static int _is_duplicate_pk(pk_list *list, const uint8_t *e) { while (list) { - if (list->key) { - if (!memcmp(list->key, e, 2*16)) { - return 1; - } + if (!memcmp(list->key, e, 16)) { + return 1; } list = list->next; } @@ -164,22 +194,24 @@ while (*p) { char *str = str_get_hex_string(p, 2*16); - if (str && _is_duplicate_pk(cf->pkl, str)) { - DEBUG(DBG_FILE, "Skipping duplicate processing key %s\n", str); - X_FREE(str); - - } else if (str) { + if (str) { DEBUG(DBG_FILE, "Found processing key %s\n", str); pk_list *e = calloc(1, sizeof(pk_list)); - e->key = str; - e->next = cf->pkl; + hexstring_to_hex_array(e->key, 16, str); - cf->pkl = e; + if (_is_duplicate_pk(cf->pkl, e->key)) { + DEBUG(DBG_FILE, "Skipping duplicate processing key %s\n", str); + X_FREE(e); + } else { + e->next = cf->pkl; + cf->pkl = e; + } result++; } + X_FREE(str); p = str_next_line(p); } @@ -193,13 +225,10 @@ static int _is_duplicate_cert(cert_list *list, cert_list *e) { while (list) { - if (list->host_priv_key && list->host_cert) { + if (!memcmp(list->host_priv_key, e->host_priv_key, 20) && + !memcmp(list->host_cert, e->host_cert, 92)) { - if (!memcmp(list->host_priv_key, e->host_priv_key, 2*20) && - !memcmp(list->host_cert, e->host_cert, 2*92)) { - - return 1; - } + return 1; } list = list->next; } @@ -207,13 +236,6 @@ return 0; } -static void _free_cert_entry(cert_list *e) -{ - X_FREE(e->host_priv_key); - X_FREE(e->host_cert); - X_FREE(e); -} - static int _parse_cert_file(config_file *cf, FILE *fp) { char *data = _load_file(fp); @@ -221,40 +243,59 @@ if (data) { const char *p = data; - cert_list *e = calloc(1, sizeof(cert_list)); - e->host_priv_key = str_get_hex_string(p, 2*20); + char *host_cert, *host_priv_key; + host_priv_key = str_get_hex_string(p, 2*20); p = str_next_line(p); - e->host_cert = str_get_hex_string(p, 2*92); + host_cert = str_get_hex_string(p, 2*92); X_FREE(data); - if (!e->host_priv_key || !e->host_cert) { + if (!host_priv_key || !host_cert) { DEBUG(DBG_FILE, "Invalid file\n"); - _free_cert_entry(e); - - } else if (_is_duplicate_cert(cf->host_cert_list, e)) { - DEBUG(DBG_FILE, "Skipping duplicate certificate entry %s %s\n", e->host_priv_key, e->host_cert); - _free_cert_entry(e); } else { - DEBUG(DBG_FILE, "Found certificate: %s %s\n", e->host_priv_key, e->host_cert); - e->next = cf->host_cert_list; - cf->host_cert_list = e; - result = 1; + 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); + X_FREE(e); + } else { + e->next = cf->host_cert_list; + cf->host_cert_list = e; + result = 1; + } } + X_FREE(host_priv_key); + X_FREE(host_cert); } return result; } +static int _is_duplicate_dk(dk_list *list, dk_list *e) +{ + while (list) { + if (!memcmp(list, e, sizeof(*e))) { + return 1; + } + list = list->next; + } + + return 0; +} + static int _load_pk_file(config_file *cf) { static const char pk_file_name = PK_FILE_NAME; FILE *fp; int result = 0; - fp = _open_cfg_file_user(pk_file_name, NULL); + fp = _open_cfg_file_user(pk_file_name, NULL, "r"); if (fp) { result += _parse_pk_file(cf, fp); fclose(fp); @@ -275,7 +316,7 @@ FILE *fp; int result = 0; - fp = _open_cfg_file_user(cert_file_name, NULL); + fp = _open_cfg_file_user(cert_file_name, NULL, "r"); if (fp) { result += _parse_cert_file(cf, fp); fclose(fp); @@ -290,40 +331,9 @@ return result; } -static int _mkpath(const char *path) -{ - struct stat s; - int result = 1; - char *dir = str_printf("%s", path); - char *end = dir; - - while (*end == '/') - end++; - - while ((end = strchr(end, '/'))) { - *end = 0; - - if (stat(dir, &s) != 0 || !S_ISDIR(s.st_mode)) { - DEBUG(DBG_FILE, "Creating directory %s\n", dir); - - if (mkdir(dir, S_IRWXU|S_IRWXG|S_IRWXO) == -1) { - DEBUG(DBG_FILE, "Error creating directory %s\n", dir); - result = 0; - break; - } - } - - *end++ = '/'; - } - - X_FREE(dir); - - return result; -} - static char *_keycache_file(const char *type, const uint8_t *disc_id) { - const char *cache_dir = get_cache_home(); + const char *cache_dir = file_get_cache_home(); char disc_id_str41; if (!cache_dir) { @@ -408,7 +418,7 @@ static char *_cache_file(const char *name) { - const char *cache_dir = get_cache_home(); + const char *cache_dir = file_get_cache_home(); if (!cache_dir) { return NULL; @@ -489,7 +499,7 @@ int cache_remove(const char *name) { char *file = _cache_file(name); - int result = !remove(name); + int result = !remove(file); if (!result) { DEBUG(DBG_FILE, "Error removing %s\n", file); } @@ -533,6 +543,61 @@ return cache_data; } +int config_save(const char *name, const void *data, uint32_t len) +{ + char *path = NULL; + FILE *fp = _open_cfg_file_user(name, &path, "w"); + int result = 0; + + 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); + result = 1; + + } else { + DEBUG(DBG_FILE | DBG_CRIT, "Error writing to %s\n", path); + } + + fclose(fp); + } + + X_FREE(path); + + return result; +} + +int config_get(const char *name, uint32_t *len, void *buf) +{ + char *path = NULL; + FILE *fp = _open_cfg_file_user(name, &path, "r"); + int result = 0; + uint32_t size = *len; + + *len = 0; + + if (fp) { + 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); + result = 1; + + } else { + DEBUG(DBG_FILE | DBG_CRIT, "Error reading from %s\n", path); + } + + fclose(fp); + } + + X_FREE(path); + + return result; +} + + static char *_find_config_file(void) { static const char cfg_file_name = CFG_FILE_NAME; @@ -540,7 +605,7 @@ char *cfg_file = NULL; FILE *fp = NULL; - fp = _open_cfg_file_user(cfg_file_name, &cfg_file); + fp = _open_cfg_file_user(cfg_file_name, &cfg_file, "r"); if (!fp) { fp = _open_cfg_file_system(cfg_file_name, &cfg_file); } @@ -553,6 +618,66 @@ return cfg_file; } +#include "keydb.h" + +static int _parse_embedded(config_file *cf) +{ + int result = 0, jj; + unsigned ii; + + /* reverse order to maintain key positions (items are added to list head) */ + for (jj = sizeof(internal_dk_list) / sizeof(internal_dk_list0) - 1; jj >= 0; --jj) { + dk_list *e = calloc(1, sizeof(dk_list)); + + decrypt_key(e->key, internal_dk_listjj, 16); + e->node = internal_device_number; + e->uv = MKINT_BE32(internal_dk_listjj + 16); + e->u_mask_shift = internal_dk_listjj20; + + if (!e->uv || _is_duplicate_dk(cf->dkl, e)) { + X_FREE(e); + + } else { + e->next = cf->dkl; + cf->dkl = e; + result++; + } + } + + for (ii = 0; ii < sizeof(internal_pk_list) / sizeof(internal_pk_list0); ii++) { + pk_list *e = calloc(1, sizeof(pk_list)); + + decrypt_key(e->key, internal_pk_listii, 16); + + if (_is_duplicate_pk(cf->pkl, e->key)) { + X_FREE(e); + + } else { + e->next = cf->pkl; + cf->pkl = e; + result++; + } + } + + for (ii = 0; ii < sizeof(internal_hc_list) / sizeof(internal_hc_list0); ii++) { + cert_list *e = calloc(1, sizeof(cert_list)); + + decrypt_key(e->host_priv_key, internal_hc_listii, 20); + decrypt_key(e->host_cert, internal_hc_listii + 20, 92); + + if (_is_duplicate_cert(cf->host_cert_list, e)) { + X_FREE(e); + + } else { + e->next = cf->host_cert_list; + cf->host_cert_list = e; + result++; + } + } + + return result; +} + config_file *keydbcfg_config_load(const char *configfile_path) { int config_ok = 0; @@ -578,6 +703,9 @@ config_ok = _load_pk_file(cf) || config_ok; config_ok = _load_cert_file(cf) || config_ok; + /* embedded keys */ + config_ok = _parse_embedded(cf) || config_ok; + if (!config_ok) { DEBUG(DBG_AACS | DBG_CRIT, "No valid AACS configuration files found\n"); keydbcfg_config_file_close(cf);
View file
libaacs-0.6.0.tar.bz2/src/file/keydbcfg.h -> libaacs-0.7.0.tar.bz2/src/file/keydbcfg.h
Changed
@@ -53,16 +53,20 @@ typedef struct dk_entry dk_list; struct dk_entry { - char *key; + uint8_t key16; unsigned long node; dk_list *next; + + /* optional, can be calculated */ + uint32_t uv; + uint8_t u_mask_shift; }; /* pk entry */ typedef struct pk_entry pk_list; struct pk_entry { - char *key; + uint8_t key16; pk_list *next; }; @@ -70,10 +74,8 @@ typedef struct cert_entry cert_list; struct cert_entry { - char *host_priv_key; - char *host_cert; - char *host_nonce; - char *host_key_point; + uint8_t host_priv_key20; + uint8_t host_cert92; cert_list *next; }; @@ -81,7 +83,7 @@ typedef struct title_entry_t title_entry; struct title_entry_t { - char *discid; + uint8_t discid20; char *title; date_entry date; char *mek; @@ -131,4 +133,7 @@ AACS_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); + #endif
View file
libaacs-0.7.0.tar.bz2/src/file/path.c
Added
@@ -0,0 +1,142 @@ +/* + * This file is part of libaacs + * 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 + * 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/>. + */ + +#include "path.h" + +#include <unistd.h> +#include <string.h> +#include <errno.h> + +#define MAX_LINKS 32 + +char *aacs_resolve_path(const char *path, char *resolved_path) +{ + char tmp_pathAACS_PATH_MAX; + char linkAACS_PATH_MAX; + char *new_path = resolved_path; + char *path_end = tmp_path + AACS_PATH_MAX - 1; + int readlinks = 0; + int n; + + if (!path || !*path || strlen(path) >= AACS_PATH_MAX - 2) { + return NULL; + } + + /* shadow original path with a copy */ + strcpy(tmp_path, path); + path = tmp_path; + + /* handle relative path */ + if (*path != '/') { + if (!getcwd(new_path, AACS_PATH_MAX - 1)) { + return NULL; + } + new_path += strlen(new_path); + if (new_path-1 != '/') { + *new_path++ = '/'; + } + } else { + *new_path++ = '/'; + path++; + } + + + while (*path) { + /* "/" */ + if (*path == '/') { + path++; + continue; + } + /* "." */ + if (path0 == '.' && (!path1 || path1 == '/')) { + path++; + continue; + } + /* ".." */ + if (path0 == '.' && path1 == '.' && (!path2 || path2 == '/')) { + path += 2; + /* not at root ? -> back up one level */ + if (new_path != resolved_path + 1) { + while ((--new_path)-1 != '/'); + } + continue; + } + + /* copy next component */ + while (*path && *path != '/') { + if (path >= path_end) { + return NULL; + } + *new_path++ = *path++; + } + + /* avoid symlink loops */ + if (readlinks++ > MAX_LINKS) { + return NULL; + } + + /* resolve symlink */ + + *new_path = 0; + n = readlink(resolved_path, link, AACS_PATH_MAX - 1); + + if (n < 0) { + if (errno != EINVAL) { + return NULL; + } + /* file exists but isn't a symlink. */ + + } else if (n >= AACS_PATH_MAX - 1) { + return NULL; + + } else { + linkn = 0; + if (*link == '/') { + new_path = resolved_path; + } else { + while (*(--new_path) != '/'); + } + + if (path + n >= path_end) { + return NULL; + } + + /* update what's left */ + strcat(link, path); + strcpy(tmp_path, link); + path = tmp_path; + } + + if (*path) { + *new_path++ = '/'; + } + } + + *new_path = 0; + return resolved_path; +} + +#ifdef TEST_AACS_RESOLVE_PATH +#include <stdio.h> +void main(int argc, char *argv) { + char pathAACS_PATH_MAX; + printf("%s -> %s\n", argv0, aacs_resolve_path(argv0, path)); + printf("%s -> %s\n", argv1, aacs_resolve_path(argv1, path)); +} +#endif
View file
libaacs-0.7.0.tar.bz2/src/file/path.h
Added
@@ -0,0 +1,31 @@ +/* + * This file is part of libaacs + * 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 + * 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_PATH_H +#define AACS_PATH_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); + +#endif /* AACS_PATH_H */
View file
libaacs-0.6.0.tar.bz2/src/libaacs/aacs-version.h -> libaacs-0.7.0.tar.bz2/src/libaacs/aacs-version.h
Changed
@@ -26,10 +26,10 @@ ((micro) * 1)) #define AACS_VERSION_MAJOR 0 -#define AACS_VERSION_MINOR 6 +#define AACS_VERSION_MINOR 7 #define AACS_VERSION_MICRO 0 -#define AACS_VERSION_STRING "0.6.0" +#define AACS_VERSION_STRING "0.7.0" #define AACS_VERSION \ AACS_VERSION_CODE(AACS_VERSION_MAJOR, AACS_VERSION_MINOR, AACS_VERSION_MICRO)
View file
libaacs-0.6.0.tar.bz2/src/libaacs/aacs.c -> libaacs-0.7.0.tar.bz2/src/libaacs/aacs.c
Changed
@@ -1,7 +1,7 @@ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n - * Copyright (C) 2009-2010 npzacs + * Copyright (C) 2009-2013 npzacs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -54,6 +54,8 @@ uint8_t vid16; /* PMSN is cached for BD-J */ uint8_t pmsn16; + /* Media key is cached for BD+ */ + uint8_t mk16; /* unit key for each CPS unit */ uint32_t num_uks; @@ -65,10 +67,21 @@ /* title -> CPS unit mappings */ uint32_t num_titles; uint16_t *cps_units; /* 0 = first play ; 1 = top menu ; 2 = title 1 ... */ + + /* bus encryption */ + int bee; /* bus encryption enabled flag in content certificate */ + int bec; /* bus encryption capable flag in drive certificate */ + uint8_t read_data_key16; + + /* AACS Online (BD-J) */ + uint8_t device_nonce16; + 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 int _validate_pk(const uint8_t *pk, const uint8_t *cvalue, const uint8_t *uv, const uint8_t *vd, @@ -118,38 +131,245 @@ return crypto_aacs_verify_aacsla(rl + len, rl, len); } -static void _update_drl(MKB *mkb) +static void _save_rl(const char *name, uint32_t version, const uint8_t *version_rec, + const uint8_t *rl_rec, size_t rl_len) +{ + 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); + return; + } + + if (rl_rec && version_rec) { + rl_rec -= 4; + rl_len += 4; + + uint8_t *data = malloc(12 + rl_len); + 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); + } else { + cache_save(name, version, data, rl_len + 12); + } + X_FREE(data); + } +} + +static void _update_rl(MKB *mkb) { uint32_t version = mkb_version(mkb); uint32_t cache_version; + size_t rl_len; if (!cache_get("drl", &cache_version, NULL, NULL) || cache_version < version) { - size_t drl_len; - const uint8_t *drl_rec = mkb_drive_revokation_entries(mkb, &drl_len); - const uint8_t *v_rec = mkb_type_and_version_record(mkb); - - if (drl_rec && v_rec) { - drl_rec -= 4; - drl_len += 4; - - uint8_t *data = malloc(12 + drl_len); - memcpy(data, v_rec, 12); - memcpy(data + 12, drl_rec, drl_len); - if (!_rl_verify_signature(data, drl_len + 12)) { - DEBUG(DBG_AACS | DBG_CRIT, "invalid drive revocation list signature, not using it\n"); + const uint8_t *version_rec = mkb_type_and_version_record(mkb); + const uint8_t *drl_rec = mkb_drive_revokation_entries(mkb, &rl_len); + if (drl_rec && rl_len > 8) { + _save_rl("drl", version, version_rec, drl_rec, rl_len); + } + } + if (!cache_get("hrl", &cache_version, NULL, NULL) || cache_version < version) { + const uint8_t *version_rec = mkb_type_and_version_record(mkb); + const uint8_t *hrl_rec = mkb_host_revokation_entries(mkb, &rl_len); + if (hrl_rec && rl_len > 8) { + _save_rl("hrl", version, version_rec, hrl_rec, rl_len); + } + } +} + +static uint32_t _calc_v_mask(uint32_t uv) +{ + uint32_t v_mask = 0xffffffff; + + while (!(uv & ~v_mask)) { + v_mask <<= 1; + } + + return v_mask; +} + +static void _calc_pk(const uint8_t *dk, uint8_t *pk, uint32_t uv, uint32_t v_mask, uint32_t dev_key_v_mask) +{ + unsigned char left_child16, right_child16; + + crypto_aesg3(dk, left_child, right_child, pk); + + while (dev_key_v_mask != v_mask) { + + int i; + for (i = 31; i >= 0; i--) { + if (!(dev_key_v_mask & (1ul << i))) { + break; + } + } + + uint8_t curr_key16; + if (!(uv & (1ul << i))) { + memcpy(curr_key, left_child, 16); + } else { + memcpy(curr_key, right_child, 16); + } + + crypto_aesg3(curr_key, left_child, right_child, pk); + + dev_key_v_mask = ((int) dev_key_v_mask) >> 1; + } + + char str40; + DEBUG(DBG_AACS, "Processing key: %s\n", 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) +{ + uint32_t device_number = dkl->node; + uint32_t dev_key_uv, dev_key_u_mask, dev_key_v_mask; + unsigned key_idx = 0; + + for (; dkl; dkl = dkl->next) { + if (device_number != dkl->node) { + /* wrong device */ + continue; + } + if (!dkl->uv) { + continue; + } + key_idx++; + dev_key_uv = dkl->uv; + dev_key_u_mask = 0xffffffff << dkl->u_mask_shift; + dev_key_v_mask = _calc_v_mask(dev_key_uv); + + if ((u_mask == dev_key_u_mask) && + ((uv & dev_key_v_mask) == (dev_key_uv & dev_key_v_mask))) { + break; + } + } + + if (!dkl) { + 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); + *p_dev_key_v_mask = dev_key_v_mask; + } + + return dkl; +} + +static int _calc_pk_mk(MKB *mkb, dk_list *dkl, uint8_t *mk) +{ + /* calculate processing key and media key using device keys */ + + const uint8_t *uvs, *cvalues; + unsigned num_uvs; + size_t len; + char str128; + + /* get mkb data */ + + uvs = mkb_subdiff_records(mkb, &len); + cvalues = mkb_cvalues(mkb, &len); + num_uvs = len / 5; + + if (num_uvs < 1) { + return AACS_ERROR_CORRUPTED_DISC; + } + + /* loop over all known devices */ + + dk_list *dk_num; + uint32_t device_number = (uint32_t)-1; + + for (dk_num = dkl; dk_num; dk_num = dk_num->next) { + + /* find next device */ + + if (device_number == dk_num->node) { + continue; + } + device_number = dk_num->node; + + /* find applying subset difference */ + + unsigned uvs_idx; + uint32_t u_mask, v_mask, uv; + + for (uvs_idx = 0; uvs_idx < num_uvs; uvs_idx++) { + const uint8_t *p_uv = uvs + 1 + 5 * uvs_idx; + uint8_t u_mask_shift = p_uv-1; + + uv = MKINT_BE32(p_uv); + if (!uv) { + continue; + } + + if (u_mask_shift & 0xc0) { + DEBUG(DBG_AACS | DBG_CRIT, "device 0x%x is revoked\n", device_number); + uvs_idx = num_uvs; + } else { - cache_save("drl", version, data, drl_len + 12); + + u_mask = 0xffffffff << u_mask_shift; + v_mask = _calc_v_mask(uv); + + if (((device_number & u_mask) == (uv & u_mask)) && ((device_number & v_mask) != (uv & v_mask))) { + break; + } } - X_FREE(data); } + + if (uvs_idx >= num_uvs) { + 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); + + /* find applying device key */ + + uint32_t dev_key_v_mask = 0; + dk_list *dk; + + dk = _find_dk(dk_num, &dev_key_v_mask, uv, u_mask); + if (!dk) { + /* try next device */ + continue; + } + + /* calculate processing key */ + + uint8_t pk16; + _calc_pk(dk->key, pk, uv, v_mask, dev_key_v_mask); + + /* calculate and verify media key */ + + if ( _validate_pk(pk, + cvalues + uvs_idx * 16, + uvs + 1 + uvs_idx * 5, + mkb_mk_dv(mkb), + mk) + == AACS_SUCCESS) { + + DEBUG(DBG_AACS, "Media key: %s\n", print_hex(str, mk, 16)); + return AACS_SUCCESS; + } + + DEBUG(DBG_AACS | DBG_CRIT, "Processing key %s is invalid!\n", print_hex(str, pk, 16)); + + /* try next device */ } + + return AACS_ERROR_NO_DK; } -static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl) +static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl, dk_list *dkl) { int a, num_uvs = 0; size_t len; - uint8_t *buf = NULL; MKB *mkb = NULL; const uint8_t *rec, *uvs; @@ -161,9 +381,18 @@ DEBUG(DBG_AACS, "Calculate media key...\n"); if ((mkb = mkb_open(aacs->path))) { - DEBUG(DBG_AACS, "Get UVS...\n"); - _update_drl(mkb); + aacs->mkb_version = mkb_version(mkb); + _update_rl(mkb); + + /* try device keys first */ + if (dkl && _calc_pk_mk(mkb, dkl, mk) == AACS_SUCCESS) { + memcpy(aacs->mk, mk, sizeof(aacs->mk)); + mkb_close(mkb); + return AACS_SUCCESS; + } + + DEBUG(DBG_AACS, "Get UVS...\n"); uvs = mkb_subdiff_records(mkb, &len); rec = uvs; while (rec < uvs + len) { @@ -176,26 +405,23 @@ DEBUG(DBG_AACS, "Get cvalues...\n"); rec = mkb_cvalues(mkb, &len); - for (; pkl && pkl->key; pkl = pkl->next) { - uint8_t pk16; - hexstring_to_hex_array(pk, sizeof(pk), pkl->key); + for (; pkl; pkl = pkl->next) { DEBUG(DBG_AACS, "Trying processing key...\n"); for (a = 0; a < num_uvs; a++) { - if (AACS_SUCCESS == _validate_pk(pk, rec + a * 16, uvs + 1 + a * 5, + if (AACS_SUCCESS == _validate_pk(pkl->key, rec + a * 16, uvs + 1 + a * 5, mkb_mk_dv(mkb), mk)) { mkb_close(mkb); - X_FREE(buf); char str40; DEBUG(DBG_AACS, "Media key: %s\n", print_hex(str, mk, 16)); + memcpy(aacs->mk, mk, sizeof(aacs->mk)); return AACS_SUCCESS; } } } mkb_close(mkb); - X_FREE(buf); DEBUG(DBG_AACS | DBG_CRIT, "Error calculating media key. Missing right processing key ?\n"); return AACS_ERROR_NO_PK; @@ -231,7 +457,7 @@ data = cache_get_or_update("hrl", mkb_data(mkb), &size, mkb_version(mkb)); if (!_rl_verify_signature(data, size)) { - DEBUG(DBG_AACS | DBG_CRIT, "invalid cached revocation list signature, replacing it\n"); + DEBUG(DBG_AACS | DBG_CRIT, "invalid cached host revocation list signature, replacing it\n"); cache_save("hrl", mkb_version(mkb), mkb_data(mkb), mkb_data_size(mkb)); X_FREE(data); } else { @@ -245,10 +471,10 @@ uint32_t size; data = cache_get_or_update("hrl", NULL, &size, 0); if (data && size > 0) { - if (!_rl_verify_signature(data, size)) { + if (_rl_verify_signature(data, size)) { mkb = mkb_init(data, size); } else { - DEBUG(DBG_AACS | DBG_CRIT, "invalid cached revocation list signature, deleting cache\n"); + DEBUG(DBG_AACS | DBG_CRIT, "invalid cached host revocation list signature, deleting cache\n"); cache_remove("hrl"); } } @@ -262,13 +488,8 @@ return mkb; } -static int _read_vid(AACS *aacs, cert_list *hcl) +static int _mmc_read_auth(AACS *aacs, cert_list *hcl, int type, uint8_t *p1, uint8_t *p2) { - /* Use VID given in config file if available */ - if (memcmp(aacs->vid, empty_key, 16)) { - return AACS_SUCCESS; - } - MMC* mmc = NULL; if (!(mmc = mmc_open(aacs->path))) { return AACS_ERROR_MMC_OPEN; @@ -277,31 +498,35 @@ int error_code = AACS_ERROR_NO_CERT; MKB *hrl_mkb = _get_hrl_mkb(mmc); + const uint8_t *drive_cert = mmc_get_drive_cert(mmc); - for (;hcl && hcl->host_priv_key && hcl->host_cert; hcl = hcl->next) { + for (; hcl ; hcl = hcl->next) { char tmp_str2*92+1; - uint8_t priv_key20, cert92; - hexstring_to_hex_array(priv_key, sizeof(priv_key), hcl->host_priv_key); - hexstring_to_hex_array(cert, sizeof(cert), hcl->host_cert); - if (!crypto_aacs_verify_host_cert(cert)) { + if (!crypto_aacs_verify_host_cert(hcl->host_cert)) { DEBUG(DBG_AACS, "Not using invalid host certificate %s.\n", - print_hex(tmp_str, cert, 92)); + print_hex(tmp_str, hcl->host_cert, 92)); continue; } - if (mkb_host_cert_is_revoked(hrl_mkb, cert + 4)) { + if (mkb_host_cert_is_revoked(hrl_mkb, hcl->host_cert + 4) > 0) { DEBUG(DBG_AACS | DBG_CRIT, "Host certificate %s has been revoked.\n", - print_hex(tmp_str, cert + 4, 6)); + print_hex(tmp_str, hcl->host_cert + 4, 6)); error_code = AACS_ERROR_CERT_REVOKED; //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)); + //continue; + } + DEBUG(DBG_AACS, "Trying host certificate (id 0x%s)...\n", - print_hex(tmp_str, cert + 4, 6)); + print_hex(tmp_str, hcl->host_cert + 4, 6)); - int mmc_result = mmc_read_vid(mmc, priv_key, cert, aacs->vid, aacs->pmsn); + int mmc_result = mmc_read_auth(mmc, hcl->host_priv_key, hcl->host_cert, type, p1, p2); switch (mmc_result) { case MMC_SUCCESS: mkb_close(hrl_mkb); @@ -320,12 +545,45 @@ mkb_close(hrl_mkb); mmc_close(mmc); - DEBUG(DBG_AACS, "Error reading VID!\n"); return error_code; } -static int _calc_vuk(AACS *aacs, uint8_t *mk, uint8_t *vuk, - pk_list *pkl, cert_list *host_cert_list) +static int _read_vid(AACS *aacs, cert_list *hcl) +{ + /* Use VID given in config file if available */ + if (memcmp(aacs->vid, empty_key, 16)) { + return AACS_SUCCESS; + } + + 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"); + } else { + /* cache vid */ + keycache_save("vid", aacs->disc_id, aacs->vid, 16); + } + return error_code; +} + +static int _read_read_data_key(AACS *aacs, cert_list *hcl) +{ + 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"); + } + return error_code; +} + +static int _read_pmsn(AACS *aacs, cert_list *hcl) +{ + 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"); + } + return error_code; +} + +static int _calc_vuk(AACS *aacs, uint8_t *mk, uint8_t *vuk, config_file *cf) { int error_code; @@ -341,26 +599,27 @@ return AACS_SUCCESS; } + if (!cf) { + return AACS_ERROR_NO_CONFIG; + } + /* make sure we have media key */ - error_code = _calc_mk(aacs, mk, pkl); + error_code = _calc_mk(aacs, mk, cf->pkl, cf->dkl); if (error_code != AACS_SUCCESS) { return error_code; } /* acquire VID */ - error_code = _read_vid(aacs, host_cert_list); + error_code = _read_vid(aacs, cf->host_cert_list); if (error_code != AACS_SUCCESS) { return error_code; } - int a; - gcry_cipher_hd_t gcry_h; + /* calculate VUK */ - gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); - gcry_cipher_setkey(gcry_h, mk, 16); - gcry_cipher_decrypt(gcry_h, vuk, 16, aacs->vid, 16); - gcry_cipher_close(gcry_h); + crypto_aes128d(mk, aacs->vid, vuk); + int a; for (a = 0; a < 16; a++) { vuka ^= aacs->vida; } @@ -439,23 +698,35 @@ 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) { - uint8_t discid20; char str48; aacs->uks = NULL; aacs->num_uks = 0; while (ce && ce->entry.discid) { - memset(discid, 0, sizeof(discid)); - hexstring_to_hex_array(discid, sizeof(discid), - ce->entry.discid); - if (!memcmp(aacs->disc_id, discid, 20)) { + if (!memcmp(aacs->disc_id, ce->entry.discid, 20)) { DEBUG(DBG_AACS, "Found config entry for discid %s\n", - ce->entry.discid); + print_hex(str, ce->entry.discid, 20)); break; } @@ -507,7 +778,7 @@ } } -static int _calc_uks(AACS *aacs, const char *configfile_path) +static int _calc_uks(AACS *aacs, config_file *cf) { AACS_FILE_H *fp = NULL; uint8_t buf16; @@ -515,26 +786,20 @@ unsigned int i; int error_code; - config_file *cf = NULL; uint8_t mk16 = {0}, vuk16 = {0}; - cf = keydbcfg_config_load(configfile_path); - if (!cf) { - return AACS_ERROR_NO_CONFIG; - } - - DEBUG(DBG_AACS, "Searching for keydb config entry...\n"); - _find_config_entry(aacs, cf->list, mk, vuk); + if (cf) { + DEBUG(DBG_AACS, "Searching for keydb config entry...\n"); + _find_config_entry(aacs, cf->list, mk, vuk); - /* Skip if retrieved from config file */ - if (aacs->uks) { - keydbcfg_config_file_close(cf); - return AACS_SUCCESS; + /* Skip if retrieved from config file */ + if (aacs->uks) { + return AACS_SUCCESS; + } } /* Make sure we have VUK */ - error_code = _calc_vuk(aacs, mk, vuk, cf->pkl, cf->host_cert_list); - keydbcfg_config_file_close(cf); + error_code = _calc_vuk(aacs, mk, vuk, cf); if (error_code != AACS_SUCCESS) { return error_code; } @@ -577,12 +842,7 @@ break; } - gcry_cipher_hd_t gcry_h; - gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, - GCRY_CIPHER_MODE_ECB, 0); - gcry_cipher_setkey(gcry_h, vuk, 16); - gcry_cipher_decrypt(gcry_h, aacs->uks + 16*i, 16, buf, 16); - gcry_cipher_close(gcry_h); + crypto_aes128d(vuk, buf, aacs->uks + 16*i); char str40; DEBUG(DBG_AACS, "Unit key %d: %s\n", i, @@ -628,7 +888,7 @@ } else { result = AACS_ERROR_CORRUPTED_DISC; - DEBUG(DBG_AACS | DBG_CRIT, "Failed to read %"PRIu64" bytes from unit key file %s/AACS/Unit_Key_RO.inf", f_size, path); + 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); } file_close(fp); @@ -637,6 +897,50 @@ return result; } +static int _get_bus_encryption_enabled(const char *path) +{ + AACS_FILE_H *fp = NULL; + uint8_t buf2; + int bee = 0; + + fp = _open_content_certificate_file(path); + if (!fp) { + DEBUG(DBG_AACS | DBG_CRIT, "Unable to open content certificate\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); + } else { + DEBUG(DBG_AACS | DBG_CRIT, "Failed to read Bus Encryption Enabled flag from content certificate file\n"); + } + + file_close(fp); + return bee; +} + +static int _get_bus_encryption_capable(const char *path) +{ + MMC* mmc = NULL; + uint8_t drive_cert92; + int bec = 0; + + if (!(mmc = mmc_open(path))) { + return 0; + } + + 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); + } else { + 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) { uint8_t *ptr; @@ -673,8 +977,7 @@ { gcry_cipher_hd_t gcry_h; int a; - uint8_t key16, iv = "\x0b\xa0\xf8\xdd\xfe\xa6\x1f\xb3" - "\xd8\xdf\x9f\x56\x6a\x05\x0f\x78"; + uint8_t key16; gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); gcry_cipher_setkey(gcry_h, aacs->uks + curr_uk * 16, 16); @@ -689,7 +992,7 @@ 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, iv, 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); gcry_cipher_close(gcry_h); @@ -704,6 +1007,18 @@ return 0; } +#define SECTOR_LEN 2048 +static void _decrypt_bus(AACS *aacs, uint8_t *buf) +{ + gcry_cipher_hd_t gcry_h; + + gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_CBC, 0); + gcry_cipher_setkey(gcry_h, aacs->read_data_key, 16); + gcry_cipher_setiv(gcry_h, aacs_iv, 16); + gcry_cipher_decrypt(gcry_h, buf + 16, SECTOR_LEN - 16, NULL, 0); + gcry_cipher_close(gcry_h); +} + void aacs_get_version(int *major, int *minor, int *micro) { *major = AACS_VERSION_MAJOR; @@ -718,7 +1033,7 @@ AACS *aacs; aacs = aacs_open2(path, configfile_path, &error_code); - if (error_code == AACS_SUCCESS) { + if (!aacs || error_code == AACS_SUCCESS) { return aacs; } @@ -728,7 +1043,7 @@ AACS *aacs_open2(const char *path, const char *configfile_path, int *error_code) { - DEBUG(DBG_AACS, "libaacs "AACS_VERSION_STRING" %zd\n", sizeof(AACS)); + DEBUG(DBG_AACS, "libaacs "AACS_VERSION_STRING" %u\n", (unsigned)sizeof(AACS)); DEBUG(DBG_AACS, "Initializing libgcrypt...\n"); if (!crypto_init()) { @@ -737,6 +1052,7 @@ } AACS *aacs = calloc(1, sizeof(AACS)); + config_file *cf; aacs->path = str_printf("%s", path); @@ -746,15 +1062,34 @@ return NULL; } - DEBUG(DBG_AACS, "Starting AACS waterfall...\n"); - *error_code = _calc_uks(aacs, configfile_path); + cf = keydbcfg_config_load(configfile_path); - if (*error_code == AACS_SUCCESS) { - DEBUG(DBG_AACS, "AACS initialized!\n"); - } else { + 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"); } + aacs->bee = _get_bus_encryption_enabled(path); + aacs->bec = _get_bus_encryption_capable(path); + + if (*error_code == AACS_SUCCESS && aacs->bee && aacs->bec) { + + if (!cf) { + *error_code = AACS_ERROR_NO_CONFIG; + return aacs; + } + + *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"); + } + } + + keydbcfg_config_file_close(cf); + + DEBUG(DBG_AACS, "AACS initialized!\n"); + return aacs; } @@ -763,29 +1098,43 @@ if (!aacs) return; + /* erase sensitive data */ + if (aacs->uks) { + memset(aacs->uks, 0, 16 * aacs->num_uks); + } + X_FREE(aacs->uks); X_FREE(aacs->cps_units); X_FREE(aacs->path); DEBUG(DBG_AACS, "AACS destroyed!\n"); + /* erase sensitive data */ + memset(aacs, 0, sizeof(*aacs)); + X_FREE(aacs); } int aacs_decrypt_unit(AACS *aacs, uint8_t *buf) { uint8_t out_bufALIGNED_UNIT_LEN; + int i; if (!(buf0 & 0xc0)) { // TP_extra_header Copy_permission_indicator == 0, unit is not encrypted return 1; } + 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 - int i; for (i = 0; i < 6144; i += 192) { bufi &= ~0xc0; } @@ -815,32 +1164,94 @@ return aacs->disc_id; } +const uint8_t *aacs_get_mk(AACS *aacs) +{ + if (!memcmp(aacs->mk, empty_key, 16)) { + config_file *cf = keydbcfg_config_load(NULL); + if (cf) { + _calc_mk(aacs, aacs->mk, cf->pkl, cf->dkl); + + keydbcfg_config_file_close(cf); + } + + if (!memcmp(aacs->mk, empty_key, 16)) { + DEBUG(DBG_AACS | DBG_CRIT, "aacs_get_mk() failed\n"); + return NULL; + } + } + + return aacs->mk; +} + const uint8_t *aacs_get_vid(AACS *aacs) { 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"); + return aacs->vid; + } + config_file *cf = keydbcfg_config_load(NULL); if (cf) { _read_vid(aacs, cf->host_cert_list); keydbcfg_config_file_close(cf); } + + if (!memcmp(aacs->vid, empty_key, 16)) { + DEBUG(DBG_AACS | DBG_CRIT, "aacs_get_vid() failed\n"); + return NULL; + } } + return aacs->vid; } const uint8_t *aacs_get_pmsn(AACS *aacs) { - if (!memcmp(aacs->vid, empty_key, 16)) { + if (!memcmp(aacs->pmsn, empty_key, 16)) { config_file *cf = keydbcfg_config_load(NULL); if (cf) { - _read_vid(aacs, cf->host_cert_list); + _read_pmsn(aacs, cf->host_cert_list); keydbcfg_config_file_close(cf); } + + if (!memcmp(aacs->pmsn, empty_key, 16)) { + DEBUG(DBG_AACS, "aacs_get_pmsn() failed\n"); + return NULL; + } } + return aacs->pmsn; } +const uint8_t *aacs_get_device_binding_id(AACS *aacs) +{ + /* Device binding ID is used to encrypt online content. + * It needs to be cached so that downloaded content can be played later. + */ + 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"); + 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"); + 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)); + } + + return aacs->device_binding_id; +} + +const uint8_t *aacs_get_device_nonce(AACS *aacs) +{ + DEBUG(DBG_AACS, "creating device nonce\n"); + crypto_create_nonce(aacs->device_nonce, sizeof(aacs->device_nonce)); + return aacs->device_nonce; +} + static AACS_RL_ENTRY *_get_rl(const char *type, int *num_records, int *mkbv) { uint32_t len, version; @@ -887,6 +1298,18 @@ return _get_rl("drl", num_records, mkbv); } +void aacs_free_rl(AACS_RL_ENTRY **rl) +{ + X_FREE(*rl); +} + +uint32_t aacs_get_bus_encryption(AACS *aacs) +{ + return (aacs->bee * AACS_BUS_ENCRYPTION_ENABLED) | + (aacs->bec * AACS_BUS_ENCRYPTION_CAPABLE); +} + + void aacs_select_title(AACS *aacs, uint32_t title) { if (!aacs) {
View file
libaacs-0.6.0.tar.bz2/src/libaacs/aacs.h -> libaacs-0.7.0.tar.bz2/src/libaacs/aacs.h
Changed
@@ -1,6 +1,7 @@ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n + * Copyright (C) 2009-2013 npzacz * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,6 +36,7 @@ #define AACS_ERROR_CERT_REVOKED -5 /* certificate has been revoked */ #define AACS_ERROR_MMC_OPEN -6 /* MMC open failed (no MMC drive ?) */ #define AACS_ERROR_MMC_FAILURE -7 /* MMC failed */ +#define AACS_ERROR_NO_DK -8 /* no matching device key */ typedef struct aacs AACS; @@ -51,6 +53,11 @@ AACS_PUBLIC const uint8_t *aacs_get_disc_id(AACS *aacs); AACS_PUBLIC const uint8_t *aacs_get_vid(AACS *aacs); /* may fail even if disc can be decrypted */ AACS_PUBLIC const uint8_t *aacs_get_pmsn(AACS *aacs); /* may fail even if disc can be decrypted */ +AACS_PUBLIC const uint8_t *aacs_get_mk(AACS *aacs); /* may fail even if disc can be decrypted */ + +/* AACS Online */ +AACS_PUBLIC const uint8_t *aacs_get_device_binding_id(AACS *aacs); +AACS_PUBLIC const uint8_t *aacs_get_device_nonce(AACS *aacs); /* revocation lists */ typedef struct { @@ -60,5 +67,13 @@ AACS_PUBLIC AACS_RL_ENTRY *aacs_get_hrl(int *num_entries, int *mkb_version); AACS_PUBLIC AACS_RL_ENTRY *aacs_get_drl(int *num_entries, int *mkb_version); +AACS_PUBLIC void aacs_free_rl(AACS_RL_ENTRY **rl); + +/* bus encryption info */ + +#define AACS_BUS_ENCRYPTION_ENABLED 0x01 /* Bus encryption enabled in the media */ +#define AACS_BUS_ENCRYPTION_CAPABLE 0x02 /* Bus encryption capable drive */ + +AACS_PUBLIC uint32_t aacs_get_bus_encryption(AACS *); #endif /* AACS_H_ */
View file
libaacs-0.6.0.tar.bz2/src/libaacs/crypto.c -> libaacs-0.7.0.tar.bz2/src/libaacs/crypto.c
Changed
@@ -1,7 +1,7 @@ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n - * Copyright (C) 2010 npzacs + * Copyright (C) 2010-2013 npzacs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -103,15 +103,11 @@ static void _aesg3(const uint8_t *src_key, uint8_t *dst_key, uint8_t inc) { int a; - gcry_cipher_hd_t gcry_h; uint8_t seed16 = { 0x7B, 0x10, 0x3C, 0x5D, 0xCB, 0x08, 0xC4, 0xE5, 0x1A, 0x27, 0xB0, 0x17, 0x99, 0x05, 0x3B, 0xD9 }; seed15 += inc; - gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); - gcry_cipher_setkey(gcry_h, src_key, 16); - gcry_cipher_decrypt (gcry_h, dst_key, 16, seed, 16); - gcry_cipher_close(gcry_h); + crypto_aes128d(src_key, seed, dst_key); for (a = 0; a < 16; a++) { dst_keya ^= seeda; @@ -136,6 +132,16 @@ return crypto_init_check; } +void crypto_aes128d(const uint8_t *key, const uint8_t *data, uint8_t *dst) +{ + gcry_cipher_hd_t gcry_h; + + gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); + gcry_cipher_setkey(gcry_h, key, 16); + gcry_cipher_decrypt(gcry_h, dst, 16, data, 16); + gcry_cipher_close(gcry_h); +} + void crypto_aesg3(const uint8_t *D, uint8_t *lsubk, uint8_t* rsubk, uint8_t *pk) { if (lsubk) { @@ -151,6 +157,67 @@ } } +/* + * AES CMAC + */ + +static void _shl_128(unsigned char *dst, const unsigned char *src) +{ + uint8_t overflow = 0; + int i; + + for (i = 15; i >= 0; i--) { + dsti = (srci << 1) | overflow; + overflow = srci >> 7; + } +} + +static void _cmac_key(const unsigned char *aes_key, unsigned char *k1, unsigned char *k2) +{ + uint8_t key16 = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + gcry_cipher_hd_t gcry_h; + + gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); + gcry_cipher_setkey(gcry_h, aes_key, 16); + gcry_cipher_encrypt (gcry_h, key, 16, NULL, 0); + gcry_cipher_close(gcry_h); + + _shl_128(k1, key); + if (key0 & 0x80) { + k115 ^= 0x87; + } + + _shl_128(k2, k1); + if (k10 & 0x80) { + k215 ^= 0x87; + } +} + +void crypto_aes_cmac_16(const unsigned char *data, const unsigned char *aes_key, unsigned char *cmac) +{ + gcry_cipher_hd_t gcry_h; + uint8_t k116, k216; + unsigned ii; + + /* + * Somplified version of AES CMAC. Spports only 16-byte input data. + */ + + /* generate CMAC keys */ + _cmac_key(aes_key, k1, k2); + + memcpy(cmac, data, 16); + for (ii = 0; ii < 16; ii++) { + cmacii ^= k1ii; + } + + gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); + gcry_cipher_setkey(gcry_h, aes_key, 16); + gcry_cipher_encrypt (gcry_h, cmac, 16, 0, 16); + gcry_cipher_close(gcry_h); +} + + #if defined(HAVE_STRERROR_R) && defined(HAVE_LIBGPG_ERROR) #define LOG_GCRY_ERROR(msg, func, err) \ char errstr100 = {0}; \ @@ -503,6 +570,59 @@ gcry_create_nonce(buf, len); } +void crypto_create_bus_key(const uint8_t *priv_key, const uint8_t *drive_key_point, unsigned char *bus_key) +{ + /* init AACS curve */ + + elliptic_curve_t ec; + _aacs_curve_init(&ec); + + /* init ec context */ + + mpi_ec_t ctx = _gcry_mpi_ec_init (ec.p, ec.a); + + /* parse input data */ + + gcry_mpi_t mpi_priv_key = NULL; + gcry_mpi_scan (&mpi_priv_key, GCRYMPI_FMT_USG, priv_key, 20, NULL); + + mpi_point_t Q; + point_init (&Q); + gcry_mpi_scan (&Q.x, GCRYMPI_FMT_USG, drive_key_point, 20, NULL); + gcry_mpi_scan (&Q.y, GCRYMPI_FMT_USG, drive_key_point + 20, 20, NULL); + Q.z = mpi_alloc_set_ui(1); + + /* calculate bus key point: multiply drive key point with private key */ + + mpi_point_t bus_key_point; + point_init (&bus_key_point); + _gcry_mpi_ec_mul_point (&bus_key_point, mpi_priv_key, &Q, ctx); + + /* bus key is lowest 128 bits of bus_key_point x-coordinate */ + + /* get affine coordinates (Hv) */ + gcry_mpi_t q_x = mpi_new(0); + gcry_mpi_t q_y = mpi_new(0); + _gcry_mpi_ec_get_affine (q_x, q_y, &bus_key_point, ctx); + + /* convert to binary */ + uint8_t q_x_bin100; + size_t n = 0; + gcry_mpi_print (GCRYMPI_FMT_USG, q_x_bin, sizeof(q_x_bin), &n, q_x); + + memcpy(bus_key, q_x_bin + n - 16, 16); + + /* cleanup */ + + _gcry_mpi_ec_free (ctx); + _curve_free(&ec); + mpi_free(mpi_priv_key); + point_free(&Q); + point_free(&bus_key_point); + mpi_free(q_x); + mpi_free(q_y); +} + void crypto_create_host_key_pair(uint8_t *host_key, uint8_t *host_key_point) { /*
View file
libaacs-0.6.0.tar.bz2/src/libaacs/crypto.h -> libaacs-0.7.0.tar.bz2/src/libaacs/crypto.h
Changed
@@ -26,8 +26,11 @@ #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); @@ -41,5 +44,6 @@ 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); #endif /* CRYPTO_H_ */
View file
libaacs-0.6.0.tar.bz2/src/libaacs/mkb.c -> libaacs-0.7.0.tar.bz2/src/libaacs/mkb.c
Changed
@@ -76,7 +76,7 @@ file_read(fp, mkb->buf, mkb->size); - DEBUG(DBG_MKB, "MKB size: %zd\n", 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); @@ -85,6 +85,8 @@ DEBUG(DBG_MKB, "Error opening MKB!\n"); + X_FREE(mkb); + return NULL; } @@ -221,7 +223,9 @@ uint16_t len = MKINT_BE16(rl); uint64_t id = MKINT_BE48(rl + 2); if (cert_id >= id && cert_id <= id + len) { - DEBUG(DBG_MKB, "Certificate %12llx has been revoked\n", (unsigned long long)cert_id); + char str16; + print_hex(str, rl + 2, 6); + DEBUG(DBG_MKB, "Certificate %s has been revoked\n", str); return 1; } rl += 8;
View file
libaacs-0.6.0.tar.bz2/src/libaacs/mmc.c -> libaacs-0.7.0.tar.bz2/src/libaacs/mmc.c
Changed
@@ -2,7 +2,7 @@ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n - * Copyright (C) 2010 npzacs + * Copyright (C) 2010-2013 npzacs * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include "mmc.h" #include "crypto.h" +#include "file/path.h" #include "util/macro.h" #include "util/logging.h" @@ -89,11 +90,6 @@ #include <winsock.h> #endif -/* define in CFLAGS to skip drive certificate checks */ -#ifndef PATCHED_DRIVE -#define PATCHED_DRIVE 0 -#endif - #ifndef DEBUG_KEYS #define DEBUG_KEYS 0 #endif @@ -146,6 +142,10 @@ uint8_t host_nonce20; uint8_t host_key20; uint8_t host_key_point40; + + uint8_t drive_cert92; + + uint8_t read_drive_cert; }; static int _mmc_send_cmd(MMC *mmc, const uint8_t *cmd, uint8_t *buf, size_t tx, @@ -388,6 +388,8 @@ 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); + cmd0 = 0xad; // operation code cmd1 = 0x01; // BluRay cmd2 = (address >> 24) & 0xff; @@ -409,6 +411,8 @@ memset(cmd, 0, sizeof(cmd)); memset(buf, 0, len); + DEBUG(DBG_MMC, "MMC get configuration feature 0x%x ...\n", feature); + cmd0 = 0x46; // operation code cmd1 = 0x01; // BluRay cmd2 = (feature >> 8) & 0xff; @@ -467,8 +471,8 @@ return _mmc_send_key(mmc, agid, 0x01, buf, 116); } -static int _mmc_read_drive_cert(MMC *mmc, uint8_t agid, uint8_t *drive_nonce, - uint8_t *drive_cert) +static int _mmc_read_drive_cert_challenge(MMC *mmc, uint8_t agid, uint8_t *drive_nonce, + uint8_t *drive_cert) { uint8_t buf116; memset(buf, 0, sizeof(buf)); @@ -505,13 +509,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", buf5+8); + 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, " 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); + mmc->read_drive_cert = !!(buf4+8 & 0x10); + return buf2+8 & 1; } DEBUG(DBG_MMC, "incorrect feature ID %04x\n", feature); @@ -597,6 +604,19 @@ return 0; } +static int _mmc_read_data_keys(MMC *mmc, uint8_t agid, uint8_t *read_data_key, uint8_t *write_data_key) +{ + uint8_t buf36; + + if (_mmc_report_disc_structure(mmc, agid, 0x84, 0, 0, buf, 36)) { + memcpy(read_data_key, buf + 4, 16); + memcpy(write_data_key, buf + 20, 16); + return 1; + } + + return 0; +} + #ifdef USE_IOKIT static int get_mounted_device_from_path (MMC *mmc, const char *path) { struct statfs stat_info; @@ -857,18 +877,12 @@ #elif defined(HAVE_MNTENT_H) -#ifdef HAVE_REALPATH - char *file_path = malloc(PATH_MAX); - if (!file_path || !realpath(path, file_path)) { + 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); - X_FREE(file_path); return NULL; } -#else - char *file_path = (char*)malloc(strlen(path) + 1); - strcpy(file_path, path); -#endif int path_len = strlen(file_path); FILE *proc_mounts; @@ -909,8 +923,6 @@ X_FREE(mmc); } - X_FREE(file_path); - #elif defined(_WIN32) char drive = { path0, ':', '\\', 0 }; char volume = {'\\', '\\', '.', '\\', path0, ':', 0}; @@ -948,13 +960,17 @@ #endif -#ifndef _WIN32 if (mmc && !_mmc_check_aacs(mmc)) { 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) { + mmc_read_drive_cert(mmc, mmc->drive_cert); + } return mmc; } @@ -989,10 +1005,17 @@ DEBUG(DBG_MMC, "Closed MMC drive\n"); + /* erase sensitive data */ + memset(mmc, 0, sizeof(*mmc)); + X_FREE(mmc); } } +/* + * + */ + static int _verify_signature(const uint8_t *cert, const uint8_t *signature, const uint8_t *nonce, const uint8_t *point) { @@ -1004,119 +1027,270 @@ return crypto_aacs_verify(cert, signature, data, 60); } -int mmc_read_vid(MMC *mmc, const uint8_t *host_priv_key, const uint8_t *host_cert, uint8_t *vid, uint8_t *pmsn) +static int _mmc_aacs_auth(MMC *mmc, uint8_t agid, const uint8_t *host_priv_key, const uint8_t *host_cert, uint8_t *bus_key) { - uint8_t agid = 0, hks40, dn20, dc92, dkp40, dks40, mac16; + uint8_t hks40, dn20, dkp40, dks40; char str512; - int error_code = MMC_ERROR; memset(hks, 0, sizeof(hks)); - DEBUG(DBG_MMC, "Reading VID from drive...\n"); + 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)); + } - _mmc_invalidate_agids(mmc); + // send host cert + nonce + if (!_mmc_send_host_cert(mmc, agid, mmc->host_nonce, host_cert)) { - if (!_mmc_report_agid(mmc, &agid)) { - DEBUG(DBG_MMC | DBG_CRIT, "Didn't get AGID from drive\n"); + 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)); + } else { + 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, + "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)); + } + + // verify drive certificate + if (!crypto_aacs_verify_drive_cert(mmc->drive_cert)) { + 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"); + 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)); + } + + // verify drive signature + if (!_verify_signature(mmc->drive_cert, dks, mmc->host_nonce, dkp)) { + DEBUG(DBG_MMC | DBG_CRIT, "Drive signature is invalid\n"); + return MMC_ERROR; + } + + // sign + crypto_aacs_sign(host_cert, host_priv_key, hks, dn, + mmc->host_key_point); + + // verify own signature + if (!_verify_signature(host_cert, hks, dn, mmc->host_key_point)) { + DEBUG(DBG_MMC | DBG_CRIT, "Created signature is invalid ?\n"); return MMC_ERROR; } - DEBUG(DBG_MMC, "Got AGID from drive: %d\n", agid); - if (!PATCHED_DRIVE) do { + // 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)); + return MMC_ERROR; + } + // calculate bus key + if (bus_key) { + crypto_create_bus_key(mmc->host_key, dkp, bus_key); 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)); + DEBUG(DBG_MMC, "Bus Key : %s\n", print_hex(str, bus_key, 16)); } + } - // send host cert + nonce - if (!_mmc_send_host_cert(mmc, agid, mmc->host_nonce, host_cert)) { - DEBUG(DBG_MMC | DBG_CRIT, "Host key / Certificate has been revoked by your drive ?\n"); - error_code = MMC_ERROR_CERT_REVOKED; - break; - } + return MMC_SUCCESS; +} - // receive mmc cert + nonce - if (!_mmc_read_drive_cert(mmc, agid, dn, dc)) { - DEBUG(DBG_MMC | DBG_CRIT, - "Drive doesn't give its certificate\n"); - break; - } +/* + * + */ + +static int _read_vid(MMC *mmc, uint8_t agid, const uint8_t *bus_key, uint8_t *vid) +{ + uint8_t mac16, calc_mac16; + char str512; + + DEBUG(DBG_MMC, "Reading VID from drive...\n"); + if (_mmc_read_vid(mmc, agid, vid, mac)) { if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Drive certificate : %s\n", print_hex(str, dc, 92)); - DEBUG(DBG_MMC, "Drive nonce : %s\n", print_hex(str, dn, 20)); + DEBUG(DBG_MMC, "VID : %s\n", print_hex(str, vid, 16)); + DEBUG(DBG_MMC, "VID MAC : %s\n", print_hex(str, mac, 16)); } - // verify drive certificate - if (!crypto_aacs_verify_drive_cert(dc)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); - break; + /* 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"); } - // 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"); - break; - } + return MMC_SUCCESS; + } + + DEBUG(DBG_MMC | DBG_CRIT, "Unable to read VID from drive!\n"); + + return MMC_ERROR; +} + +static int _read_pmsn(MMC *mmc, uint8_t agid, const uint8_t *bus_key, uint8_t *pmsn) +{ + uint8_t mac16, calc_mac16; + char str512; + + DEBUG(DBG_MMC, "Reading PMSN from drive...\n"); + if (_mmc_read_pmsn(mmc, agid, pmsn, mac)) { 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)); + DEBUG(DBG_MMC, "PMSN : %s\n", print_hex(str, pmsn, 16)); + DEBUG(DBG_MMC, "PMSN MAC : %s\n", print_hex(str, mac, 16)); } - // verify drive signature - if (!_verify_signature(dc, dks, mmc->host_nonce, dkp)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive signature is invalid\n"); - break; + /* 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"); } - // sign - crypto_aacs_sign(host_cert, host_priv_key, hks, dn, - mmc->host_key_point); + return MMC_SUCCESS; + } - // verify own signature - if (!_verify_signature(host_cert, hks, dn, mmc->host_key_point)) { - DEBUG(DBG_MMC | DBG_CRIT, "Created signature is invalid ?\n"); - break; - } + DEBUG(DBG_MMC | DBG_CRIT, "Unable to read PMSN from drive!\n"); - // 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)); - break; - } + return MMC_ERROR; +} - } while (0); +static int _read_data_keys(MMC *mmc, uint8_t agid, const uint8_t *bus_key, + uint8_t *read_data_key, uint8_t *write_data_key) +{ + uint8_t encrypted_read_data_key16, encrypted_write_data_key16; + char str512; - if (_mmc_read_vid(mmc, agid, vid, mac)) { - DEBUG(DBG_MMC, "VID: %s\n", print_hex(str, vid, 16)); - DEBUG(DBG_MMC, "MAC: %s\n", print_hex(str, mac, 16)); - /* TODO: verify MAC */ - - /* read pmsn */ - if (_mmc_read_pmsn(mmc, agid, pmsn, mac)) { - DEBUG(DBG_MMC, "PMSN: %s\n", print_hex(str, pmsn, 16)); - DEBUG(DBG_MMC, "MAC: %s\n", print_hex(str, mac, 16)); - /* TODO: verify MAC */ - } else { - memset(pmsn, 0, 16); - DEBUG(DBG_MMC | DBG_CRIT, "Unable to read PMSN from drive!\n"); - } + DEBUG(DBG_MMC, "Reading data keys from drive...\n"); - _mmc_invalidate_agid(mmc, agid); + 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)); + } + } + 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)); + } + } return MMC_SUCCESS; } - DEBUG(DBG_MMC | DBG_CRIT, "Unable to read VID from drive!\n"); + DEBUG(DBG_MMC | DBG_CRIT, "Unable to read data keys from drive!\n"); + + return MMC_ERROR; +} + +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) +{ + uint8_t agid = 0, bus_key16; + int error_code; + + _mmc_invalidate_agids(mmc); + + if (!_mmc_report_agid(mmc, &agid)) { + 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); + + /* + * NOTE: It seems that at least some drives require a new AACS-Auth every time + * keys are being read + */ + + error_code = _mmc_aacs_auth(mmc, agid, host_priv_key, host_cert, bus_key); + if (error_code) { + _mmc_invalidate_agid(mmc, agid); + return error_code; + } + + switch (request) { + case MMC_READ_VID: + error_code = _read_vid(mmc, agid, bus_key, p1); + break; + case MMC_READ_PMSN: + error_code = _read_pmsn(mmc, agid, bus_key, p1); + break; + case MMC_READ_DATA_KEYS: + 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); + error_code = MMC_ERROR; + break; + } _mmc_invalidate_agid(mmc, agid); return error_code; } +/* + * + */ + +int mmc_read_drive_cert(MMC *mmc, uint8_t *drive_cert) +{ + uint8_t buf116; + + if (mmc->drive_cert0 == 0x01) { + memcpy(drive_cert, mmc->drive_cert, 92); + return MMC_SUCCESS; + } + + if (!mmc->read_drive_cert) { + 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"); + } + return MMC_ERROR; + } + + if (!crypto_aacs_verify_drive_cert(buf + 4)) { + DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); + return MMC_ERROR; + } + + memcpy(mmc->drive_cert, buf + 4, 92); + memcpy(drive_cert, buf + 4, 92); + + return MMC_SUCCESS; +} + +const uint8_t *mmc_get_drive_cert(MMC *mmc) +{ + if (mmc->drive_cert0 == 0x01) { + return mmc->drive_cert; + } + return NULL; +} + uint8_t *mmc_read_mkb(MMC *mmc, int address, int *size) { uint8_t agid = 0;
View file
libaacs-0.6.0.tar.bz2/src/libaacs/mmc.h -> libaacs-0.7.0.tar.bz2/src/libaacs/mmc.h
Changed
@@ -31,10 +31,16 @@ #define MMC_ERROR -1 /* MMC failed */ #define MMC_ERROR_CERT_REVOKED -2 /* revoked certificate */ +#define MMC_READ_VID 0 +#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_vid(MMC *mmc, const uint8_t *host_priv_key, const uint8_t *host_cert, - uint8_t *vid, uint8_t *pmsn); +AACS_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); /* read partial MKB */ AACS_PRIVATE uint8_t *mmc_read_mkb(MMC *mmc, int address, int *size);
View file
libaacs-0.6.0.tar.bz2/src/util/attributes.h -> libaacs-0.7.0.tar.bz2/src/util/attributes.h
Changed
@@ -17,8 +17,8 @@ * <http://www.gnu.org/licenses/>. */ -#ifndef LIBBLURAY_ATTRIBUTES_H_ -#define LIBBLURAY_ATTRIBUTES_H_ +#ifndef LIBAACS_ATTRIBUTES_H_ +#define LIBAACS_ATTRIBUTES_H_ #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 )) # define AACS_ATTR_FORMAT_PRINTF(format,var) \ @@ -47,4 +47,12 @@ # define AACS_PRIVATE #endif -#endif /* LIBBLURAY_ATTRIBUTES_H_ */ +#if !defined(__GNUC__) || __GNUC__ < 3 +# define AACS_LIKELY(x) (x) +# define AACS_UNLIKELY(x) (x) +#else +# define AACS_LIKELY(x) __builtin_expect((x),1) +# define AACS_UNLIKELY(x) __builtin_expect((x),0) +#endif + +#endif /* LIBAACS_ATTRIBUTES_H_ */
View file
libaacs-0.6.0.tar.bz2/src/util/logging.c -> libaacs-0.7.0.tar.bz2/src/util/logging.c
Changed
@@ -24,7 +24,7 @@ #include <stdarg.h> #include <string.h> -static debug_mask_t debug_mask = DBG_CRIT; +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) { @@ -45,6 +45,7 @@ if (!debug_init) { debug_init = 1; logfile = stderr; + debug_mask = DBG_CRIT; char *env = NULL; if ((env = getenv("AACS_DEBUG_MASK")))
View file
libaacs-0.6.0.tar.bz2/src/util/logging.h -> libaacs-0.7.0.tar.bz2/src/util/logging.h
Changed
@@ -24,7 +24,14 @@ #include <stdint.h> -#define DEBUG(MASK,...) aacs_debug(__FILE__,__LINE__,MASK,##__VA_ARGS__) +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,
View file
libaacs-0.6.0.tar.bz2/src/util/strutl.c -> libaacs-0.7.0.tar.bz2/src/util/strutl.c
Changed
@@ -208,6 +208,12 @@ } } + /* check end */ + if (isxdigit(strii)) { + //DEBUG(DBG_AACS, "Invalid hex string (too long): %s", str); + return 0; + } + return 1; }
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
.