Projects
Essentials
libaacs
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
libaacs.changes
Changed
@@ -1,4 +1,36 @@ ------------------------------------------------------------------- +Sat Mar 16 11:20:34 UTC 2013 - obs@botter.cc + +- update to 0.6.0 + * Added reading of PMSN (Pre-recorded Media Serial Number) + * Fix resource leak + * Use proper paths to search for keydb and friends on Darwin. + * Build fixes and improvements + +- 0.5.0 + * Support for Mac OS X using IOKit + * Fix AACS detection failure in some Win32 systems + +- 0.4.0 + * Added aacs_open2() and error codes + * Renamed libaacs_test to aacs_info + * Added aacs_get_mkb_version() + * Fixed memory leaks + * Fixed buffer overflow + * Added revocation list caching + * Check host certificates against latest seen revocation list + +- 0.3.1 + * Added configure option for libgcrypt prefix + * Fixed building Win32 DLL + * Fixed segfault when mount point path can't be resolved + * Do not export internal symbols from generated parser/lexer + * Do not distribute generated parser files + * Check for libgpg-error. Link against it when needed. + * Distribute README.txt + * Added ChangeLog + +------------------------------------------------------------------- Sat Dec 3 22:54:44 UTC 2011 - pascal.bleser@opensuse.org - update to 0.3.0 (first proper release)
View file
libaacs.spec
Changed
@@ -19,13 +19,14 @@ Name: libaacs -Version: 0.3.0 +Version: 0.6.0 Release: 1.1 License: LGPL-2.1+ Summary: Open implentation of AACS specification Url: http://www.videolan.org/developers/libaacs.html Group: System/Libraries Source: ftp://ftp.videolan.org/pub/videolan/libaacs/%{version}/libaacs-%{version}.tar.bz2 +Patch0: libaacs-0.6.0-bison-2.3-compatibility.patch BuildRequires: bison BuildRequires: flex BuildRequires: libgcrypt-devel @@ -56,6 +57,9 @@ %prep %setup -q +%if 0%{?suse_version} < 1140 +%patch0 -p1 +%endif %build ./bootstrap @@ -76,6 +80,7 @@ %files -n libaacs0 %defattr(-, root, root) %doc COPYING +%{_bindir}/aacs_info %{_libdir}/libaacs.so.0 %{_libdir}/libaacs.so.0.*
View file
libaacs-0.6.0-bison-2.3-compatibility.patch
Added
@@ -0,0 +1,24 @@ +diff -Naur libaacs-0.6.0.orig/src/file/keydbcfg-parser.y libaacs-0.6.0/src/file/keydbcfg-parser.y +--- libaacs-0.6.0.orig/src/file/keydbcfg-parser.y 2013-03-04 14:10:01.000000000 +0100 ++++ libaacs-0.6.0/src/file/keydbcfg-parser.y 2013-03-16 13:46:58.074135067 +0100 +@@ -1,8 +1,8 @@ +-%code requires { ++%{ + #include "file/keydbcfg.h" +-} ++%} + +-%code { ++%{ + /* + * This file is part of libaacs + * Copyright (C) 2010 gates +@@ -87,7 +87,7 @@ + + /* uncomment the line below for debugging */ + // int yydebug = 1; +-} ++%} + /* Options set to generate a reentrant parser that is POSIX yacc compatible + * The basic 'scanner' parameters are set. Also, another parameter is set + * to pass in a title entry list struct used to hold all title entries.
View file
libaacs-0.3.0.tar.bz2/src/examples/libaacs_test.c
Deleted
@@ -1,64 +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 "libaacs/aacs.h" - -#include <stdio.h> -#include <stdlib.h> - -static const char *_hex2str(const uint8_t *s, unsigned n) -{ - static const char hex = "0123456789ABCDEF"; - static char *str = NULL; - - unsigned ii; - - str = realloc(str, n*2 + 1); - for (ii = 0; ii < n; ii++) { - str2*ii = hex sii >> 4; - str2*ii + 1 = hex sii & 0x07; - } - strii = 0; - - return str; -} - -int main (int argc, char **argv) -{ - if (argc < 2) { - fprintf(stderr, "Usage: %s <path-to-disc-root> <path-to-config-file>\n", argv0); - exit(EXIT_FAILURE); - } - - AACS *aacs = aacs_open(argv1, argc > 2 ? argv2 : NULL); - - if (!aacs) { - fprintf(stderr, "libaacs open failed.\n"); - exit(EXIT_FAILURE); - } - - printf("libaacs open succeed.\n"); - - const uint8_t *vid = aacs_get_vid(aacs); - printf("VID: %s\n", vid ? _hex2str(vid, 20) : "???"); - - aacs_close(aacs); - - return EXIT_SUCCESS; -}
View file
libaacs-0.3.0.tar.bz2/src/keydbcfg-parser.h
Deleted
@@ -1,119 +0,0 @@ -/* A Bison parser, made by GNU Bison 2.5. */ - -/* Bison interface 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. */ - - -/* 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 2068 of yacc.c */ -#line 106 "keydbcfg-parser.y" - - char *string; - unsigned int digit; - - - -/* Line 2068 of yacc.c */ -#line 111 "keydbcfg-parser.h" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -
View file
libaacs-0.6.0.tar.bz2/ChangeLog
Added
@@ -0,0 +1,31 @@ +2013-03-04: Version 0.6.0 + - Added reading of PMSN (Pre-recorded Media Serial Number) + - Fix resource leak + - Use proper paths to search for keydb and friends on Darwin. + - Build fixes and improvements + +2012-08-17: Version 0.5.0 + - Support for Mac OS X using IOKit + - Fix AACS detection failure in some Win32 systems + +2012-05-07: Version 0.4.0 + - Added aacs_open2() and error codes + - Renamed libaacs_test to aacs_info + - Added aacs_get_mkb_version() + - Fixed memory leaks + - Fixed buffer overflow + - Added revocation list caching + - Check host certificates against latest seen revocation list + +2012-03-21: Version 0.3.1 + - Added configure option for libgcrypt prefix + - Fixed building Win32 DLL + - Fixed segfault when mount point path can't be resolved + - Do not export internal symbols from generated parser/lexer + - Do not distribute generated parser files + - Check for libgpg-error. Link against it when needed. + - Distribute README.txt + - Added ChangeLog + +2011-11-30: Version 0.3.0 + - First release
View file
libaacs-0.3.0.tar.bz2/Makefile.am -> libaacs-0.6.0.tar.bz2/Makefile.am
Changed
@@ -1,12 +1,8 @@ -SUBDIRS=src +SUBDIRS=src src/examples ACLOCAL_AMFLAGS=-I m4 -EXTRA_DIST=bootstrap COPYING KEYDB.cfg - -AUTOMAKE_OPTIONS = \ - dist-bzip2 \ - no-dist-gzip +EXTRA_DIST=bootstrap COPYING KEYDB.cfg README.txt ChangeLog clean-lex-yacc: $(MAKE) -C src $@
View file
libaacs-0.3.0.tar.bz2/Makefile.in -> libaacs-0.6.0.tar.bz2/Makefile.in
Changed
@@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# 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 Free Software Foundation, -# Inc. +# 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. @@ -38,15 +38,15 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure \ - $(top_srcdir)/src/libaacs/aacs-version.h.in COPYING \ + $(top_srcdir)/src/libaacs/aacs-version.h.in COPYING ChangeLog \ build-aux/config.guess build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/ltmain.sh build-aux/missing \ build-aux/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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__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) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -76,9 +76,11 @@ distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\(^/*\)/.*$$,\1,'; \ @@ -107,6 +109,8 @@ GZIP_ENV = --best DIST_ARCHIVES = $(distdir).tar.bz2 distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print AACS_VERSION_MAJOR = @AACS_VERSION_MAJOR@ AACS_VERSION_MICRO = @AACS_VERSION_MICRO@ @@ -114,6 +118,7 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -176,10 +181,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ -SET_DEBUG_OPTS = @SET_DEBUG_OPTS@ +SET_FEATURES = @SET_FEATURES@ SET_MAKE = @SET_MAKE@ -SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@ -SET_WARNINGS = @SET_WARNINGS@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ @@ -241,18 +244,14 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src +SUBDIRS = src src/examples ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = bootstrap COPYING KEYDB.cfg -AUTOMAKE_OPTIONS = \ - dist-bzip2 \ - no-dist-gzip - +EXTRA_DIST = bootstrap COPYING KEYDB.cfg README.txt ChangeLog all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: -am--refresh: +am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ @@ -288,10 +287,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi + @if test ! -f $@; then rm -f stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -521,7 +518,11 @@ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir @@ -529,7 +530,7 @@ $(am__remove_distdir) dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir @@ -546,7 +547,7 @@ $(am__remove_distdir) dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then @@ -560,6 +561,8 @@ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ @@ -579,6 +582,7 @@ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -607,8 +611,16 @@ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ - && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ @@ -639,10 +651,15 @@ installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -730,8 +747,8 @@ .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-generic distclean-hdr \ + dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \ + dist-zip distcheck distclean distclean-generic distclean-hdr \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \
View file
libaacs-0.6.0.tar.bz2/README.txt
Added
@@ -0,0 +1,30 @@ +Disclaimer +---------- + +This library is written for the purpose of playing Blu-ray movies. It is +intended for software that want to support Blu-ray playback (such as VLC and +MPlayer). We, the authors of this library, do not condone nor endorse piracy. + +This library is simply a tool for playback of Blu-ray movies. Like any tool, the +use of this tool can also be abused. There are already numerous laws in +different countries and juridictions all over the world that protect copyrighted +material, such as Blu-ray movies. With that said, it would have been +inappropriate for us to distribute this library with terms such as "you cannot +use this library for piracy". Instead, we present to everyone this disclaimer. + +As a reminder, here is also the disclaimer found at the beginning of any movie +in relation to copyrights. + +ATTENTION + +International agreement and national laws protect copyrighted motion pictures, +videotapes, and sound recordings. + +UNAUTHORIZED REPRODUCTION, EXHIBITION OR DISTRIBUTION OF COPYRIGHTED MOTION +PICTURES CAN RESULT IN SEVERE CRIMINAL AND CIVIL PENALTIES UNDER THE LAWS OF +YOUR COUNTRY. + +The International Criminal Police Organization - INTERPOL, has expressed its +concern about motion picture and sound recording piracy to all of its member +national police forces. (Resolution adopted at INTERPOL General Assembly, +Stockholm, Sweden, September 8, 1977.)
View file
libaacs-0.3.0.tar.bz2/aclocal.m4 -> libaacs-0.6.0.tar.bz2/aclocal.m4
Changed
@@ -1,7 +1,8 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- +# generated automatically by aclocal 1.11.3 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,12 +20,15 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.)) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been @@ -34,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.1, , +m4_if($1, 1.11.3, , AC_FATAL(Do not call $0, use AM_INIT_AUTOMAKE($1).))dnl ) @@ -50,19 +54,21 @@ # 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.1)dnl +AM_AUTOMAKE_VERSION(1.11.3)dnl m4_ifndef(AC_AUTOCONF_VERSION, m4_copy(m4_PACKAGE_VERSION, AC_AUTOCONF_VERSION))dnl _AM_AUTOCONF_VERSION(m4_defn(AC_AUTOCONF_VERSION))) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # For projects using AC_CONFIG_AUX_DIR(foo), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -144,14 +150,14 @@ Usually this means the macro was only invoked conditionally.) fi)) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 10 +# serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, @@ -191,6 +197,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -255,7 +262,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -320,10 +327,13 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi AM_CONDITIONAL(AMDEP, test "x$enable_dependency_tracking" != xno) AC_SUBST(AMDEPBACKSLASH)dnl _AM_SUBST_NOTMAKE(AMDEPBACKSLASH)dnl +AC_SUBST(am__nodep)dnl +_AM_SUBST_NOTMAKE(am__nodep)dnl ) # Generate code to set up dependency tracking. -*- Autoconf -*- @@ -406,18 +416,6 @@ AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir") ) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 8 - -# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. -AU_DEFUN(AM_CONFIG_HEADER, AC_CONFIG_HEADERS($@)) - # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, @@ -557,12 +555,15 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME("$_am_arg")`/stamp-h$_am_stamp_count) -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -623,8 +624,8 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, +# 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -644,7 +645,7 @@ disable, m4_define(am_maintainer_other, enable), m4_define(am_maintainer_other, enable) m4_warn(syntax, unexpected argument to AM@&t@_MAINTAINER_MODE: $1)) -AC_MSG_CHECKING(whether to am_maintainer_other maintainer-specific portions of Makefiles) +AC_MSG_CHECKING(whether to enable maintainer-specific portions of Makefiles) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE(maintainer-mode, --am_maintainer_other-maintainer-mode am_maintainer_other make rules and dependencies not useful @@ -755,12 +756,15 @@ fi ) -# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. @@ -783,13 +787,14 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 +# serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- @@ -797,13 +802,13 @@ _AM_OPTION_m4_bpatsubst($1, ^a-zA-Z0-9_, _)) # _AM_SET_OPTION(NAME) -# ------------------------------ +# -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN(_AM_SET_OPTION, m4_define(_AM_MANGLE_OPTION($1), 1)) # _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- +# ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN(_AM_SET_OPTIONS, m4_foreach_w(_AM_Option, $1, _AM_SET_OPTION(_AM_Option))) @@ -879,12 +884,14 @@ fi AC_MSG_RESULT(yes)) -# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. +# serial 1 + # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't @@ -907,13 +914,13 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST(INSTALL_STRIP_PROGRAM)) -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 +# serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- @@ -922,13 +929,13 @@ AC_DEFUN(_AM_SUBST_NOTMAKE) # AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- +# -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN(AM_SUBST_NOTMAKE, _AM_SUBST_NOTMAKE($@)) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -950,10 +957,11 @@ # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN(_AM_PROG_TAR, -# Always define AMTAR for backward compatibility. -AM_MISSING_PROG(AMTAR, tar) +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST(AMTAR, '$${TAR-tar}') m4_if($1, v7, - am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -', + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -', m4_case($1, ustar,, pax,, m4_fatal(Unknown tar format)) AC_MSG_CHECKING(how to create a $1 tar archive) @@ -1022,6 +1030,7 @@ AC_SUBST(am__untar) ) # _AM_PROG_TAR +m4_include(m4/attributes.m4) m4_include(m4/libtool.m4) m4_include(m4/ltoptions.m4) m4_include(m4/ltsugar.m4)
View file
libaacs-0.3.0.tar.bz2/build-aux/config.guess -> libaacs-0.6.0.tar.bz2/build-aux/config.guess
Changed
@@ -2,9 +2,9 @@ # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-05-11' +timestamp='2012-02-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -17,9 +17,7 @@ # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -57,8 +55,8 @@ Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -145,7 +143,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward @@ -792,13 +790,12 @@ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) - case ${UNAME_MACHINE} in - pc98) - echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; *) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; esac exit ;; i*:CYGWIN*:*) @@ -807,6 +804,9 @@ *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 @@ -861,6 +861,13 @@ i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; @@ -895,13 +902,16 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) - echo cris-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -943,7 +953,7 @@ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu @@ -978,13 +988,13 @@ echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-tilera-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -1315,6 +1325,9 @@ i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2
View file
libaacs-0.3.0.tar.bz2/build-aux/config.sub -> libaacs-0.6.0.tar.bz2/build-aux/config.sub
Changed
@@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# 2011, 2012 Free Software Foundation, Inc. -timestamp='2011-03-23' +timestamp='2012-02-10' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -21,9 +21,7 @@ # 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, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program; if not, see <http://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -76,8 +74,8 @@ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -132,6 +130,10 @@ os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'` ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'`-unknown + ;; *) basic_machine=`echo $1 | sed 's/-^-*$//'` if $basic_machine != $1 @@ -247,17 +249,22 @@ # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ + | aarch64 | aarch64_be \ | alpha | alphaev4-8 | alphaev56 | alphaev678 | alphapca567 \ | alpha64 | alpha64ev4-8 | alpha64ev56 | alpha64ev678 | alpha64pca567 \ | am33_2.0 \ | arc | arm | armble | armelb | armv2345 | armv345lb | avr | avr32 \ + | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ + | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.01 | hppa2.0 | hppa2.0nw | hppa64 \ + | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ @@ -291,7 +298,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ - | rx \ + | rl78 | rx \ | score \ | sh | sh1234 | sh24a | sh24aeb | sh23e | sh34eb | sheb | shbe | shle | sh1234le | sh3ele \ | sh64 | sh64le \ @@ -300,7 +307,7 @@ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ - | v850 | v850e \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) @@ -315,8 +322,7 @@ c6x) basic_machine=tic6x-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; @@ -329,7 +335,10 @@ strongarm | thumb | xscale) basic_machine=arm-unknown ;; - + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; xscaleeb) basic_machine=armeb-unknown ;; @@ -352,11 +361,13 @@ # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ + | aarch64-* | aarch64_be-* \ | alpha-* | alphaev4-8-* | alphaev56-* | alphaev678-* \ | alpha64-* | alpha64ev4-8-* | alpha64ev56-* | alpha64ev678-* \ | alphapca567-* | alpha64pca567-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | be32-* | be64-* \ | bfin-* | bs2000-* \ | c123* | c30-* | cjt90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ @@ -365,8 +376,10 @@ | f3001-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.01-* | hppa2.0-* | hppa2.0nw-* | hppa64-* \ + | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m6800123460-* | m68360-* | m683?2-* | m68k-* \ @@ -400,7 +413,7 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ - | romp-* | rs6000-* | rx-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh1234-* | sh24a-* | sh24aeb-* | sh23e-* | sh34eb-* | sheb-* | shbe-* \ | shle-* | sh1234le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -408,10 +421,11 @@ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile-* | tilegx-* \ + | tile*-* \ | tron-* \ | ubicom32-* \ - | v850-* | v850e-* | vax-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -711,7 +725,6 @@ i370-ibm* | ibm*) basic_machine=i370-ibm ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 @@ -808,10 +821,18 @@ ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; + msys) + basic_machine=i386-pc + os=-msys + ;; mvs) basic_machine=i370-ibm os=-mvs ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; ncr3000) basic_machine=i486-ncr os=-sysv4 @@ -1120,13 +1141,8 @@ basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) - basic_machine=tilegx-unknown - os=-linux-gnu - ;; tile*) - basic_machine=tile-unknown + basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) @@ -1336,7 +1352,7 @@ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1548,9 +1564,6 @@ ;; m68000-sun) os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 ;; m68*-cisco) os=-aout
View file
libaacs-0.3.0.tar.bz2/build-aux/depcomp -> libaacs-0.6.0.tar.bz2/build-aux/depcomp
Changed
@@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-12-04.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 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 @@ -44,7 +44,7 @@ object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to <bug-automake@gnu.org>. @@ -90,10 +90,18 @@ # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -158,10 +166,12 @@ ' < "$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. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## 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" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -405,6 +415,52 @@ rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/ \1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/ / + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # 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 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -503,7 +559,9 @@ touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" + # 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 ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation
View file
libaacs-0.3.0.tar.bz2/build-aux/install-sh -> libaacs-0.6.0.tar.bz2/build-aux/install-sh
Changed
@@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | =\(\)!) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | =\(\)!) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | =\(\)!) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ case $dstdir in /*) prefix='/';; - -*) prefix='./';; + -=\(\)!*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then
View file
libaacs-0.3.0.tar.bz2/build-aux/ltmain.sh -> libaacs-0.6.0.tar.bz2/build-aux/ltmain.sh
Changed
@@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1" +VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337
View file
libaacs-0.3.0.tar.bz2/build-aux/missing -> libaacs-0.6.0.tar.bz2/build-aux/missing
Changed
@@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.ch', if possible, from existing .ch Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg.
View file
libaacs-0.3.0.tar.bz2/build-aux/ylwrap -> libaacs-0.6.0.tar.bz2/build-aux/ylwrap
Changed
@@ -1,10 +1,10 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-08-25.18; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, -# 2007, 2009 Free Software Foundation, Inc. +# 2007, 2009, 2010, 2011 Free Software Foundation, Inc. # # Written by Tom Tromey <tromey@cygnus.com>. # @@ -99,7 +99,11 @@ # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ -trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 +do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' +trap "ret=129; $do_exit" 1 +trap "ret=130; $do_exit" 2 +trap "ret=141; $do_exit" 13 +trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname @@ -133,19 +137,19 @@ # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then - from="y_tab.c" + from="y_tab.c" else - if test $from = "y.tab.h"; then - from="y_tab.h" - fi + if test $from = "y.tab.h"; then + from="y_tab.h" + fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in - \\/* | ?:\\/*) target="$2";; - *) target="../$2";; + \\/* | ?:\\/*) target="$2";; + *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't @@ -155,8 +159,8 @@ # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then - realtarget="$target" - target="tmp-`echo $target | sed s/.*\\///g`" + realtarget="$target" + target="tmp-`echo $target | sed s/.*\\///g`" fi # Edit out `#line' or `#' directives. # @@ -180,10 +184,10 @@ # Check whether header files must be updated. if test $first = no; then - if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then - echo "$2" is unchanged - rm -f "$target" - else + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else echo updating "$2" mv -f "$target" "$realtarget" fi
View file
libaacs-0.3.0.tar.bz2/config.h.in -> libaacs-0.6.0.tar.bz2/config.h.in
Changed
@@ -20,8 +20,11 @@ /* Define to 1 if you have the <libgen.h> header file. */ #undef HAVE_LIBGEN_H -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD +/* Define to 1 if you have the `gpg-error' library (-lgpg-error). */ +#undef HAVE_LIBGPG_ERROR + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H /* Define to 1 if you have the <linux/cdrom.h> header file. */ #undef HAVE_LINUX_CDROM_H @@ -69,10 +72,16 @@ */ #undef HAVE_SYS_DIR_H +/* Define to 1 if you have the <sys/mount.h> header file. */ +#undef HAVE_SYS_MOUNT_H + /* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + /* Define to 1 if you have the <sys/select.h> header file. */ #undef HAVE_SYS_SELECT_H @@ -125,6 +134,9 @@ /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P +/* Use IOKit for MMC access */ +#undef USE_IOKIT + /* Version number of package */ #undef VERSION
View file
libaacs-0.3.0.tar.bz2/configure -> libaacs-0.6.0.tar.bz2/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libaacs 0.3.0. +# Generated by GNU Autoconf 2.68 for libaacs 0.6.0. # # Report bugs to <http://www.videolan.org/developers/libaacs.html>. # @@ -570,8 +570,8 @@ # Identity of this package. PACKAGE_NAME='libaacs' PACKAGE_TARNAME='libaacs' -PACKAGE_VERSION='0.3.0' -PACKAGE_STRING='libaacs 0.3.0' +PACKAGE_VERSION='0.6.0' +PACKAGE_STRING='libaacs 0.6.0' PACKAGE_BUGREPORT='http://www.videolan.org/developers/libaacs.html' PACKAGE_URL='' @@ -615,9 +615,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -SET_DEBUG_OPTS -SET_OPTIMIZATIONS -SET_WARNINGS +SET_FEATURES LT_VERSION_INFO AACS_VERSION_MICRO AACS_VERSION_MINOR @@ -630,6 +628,7 @@ LEXLIB LEX_OUTPUT_ROOT LEX +AS CPP OTOOL64 OTOOL @@ -655,6 +654,7 @@ am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE +am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE @@ -668,6 +668,8 @@ LDFLAGS CFLAGS CC +HAVE_DARWIN_FALSE +HAVE_DARWIN_TRUE HAVE_WIN32_FALSE HAVE_WIN32_TRUE MAINT @@ -753,7 +755,6 @@ enable_werror enable_extra_warnings enable_optimizations -enable_debug enable_dependency_tracking enable_shared enable_static @@ -763,6 +764,7 @@ with_sysroot enable_libtool_lock enable_largefile +with_libgcrypt_prefix ' ac_precious_vars='build_alias host_alias @@ -1317,7 +1319,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.3.0 to adapt to many kinds of systems. +\`configure' configures libaacs 0.6.0 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1388,7 +1390,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libaacs 0.3.0:";; + short | recursive ) echo "Configuration of libaacs 0.6.0:";; esac cat <<\_ACEOF @@ -1398,10 +1400,11 @@ --enable-FEATURE=ARG include FEATURE ARG=yes --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer - --enable-werror set warnings as errors via -Werror (default is no) - --enable-extra-warnings set extra warnings (default is yes) - --enable-optimizations enable optimizations (default is yes) - --enable-debug enable debugging information (default is yes) + --enable-werror set warnings as errors via -Werror + default=disabled + --disable-extra-warnings + set extra warnings default=enabled + --disable-optimizations disable optimizations default=enabled --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-shared=PKGS build shared libraries default=yes @@ -1419,6 +1422,8 @@ --with-gnu-ld assume the C compiler uses GNU ld default=no --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-libgcrypt-prefix=PFX + prefix where libgcrypt is installed (optional) Some influential environment variables: CC C compiler command @@ -1502,7 +1507,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libaacs configure 0.3.0 +libaacs configure 0.6.0 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1974,7 +1979,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libaacs $as_me 0.3.0, which was +It was created by libaacs $as_me 0.6.0, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2901,7 +2906,7 @@ # Define the identity of the package. PACKAGE='libaacs' - VERSION='0.3.0' + VERSION='0.6.0' cat >>confdefs.h <<_ACEOF @@ -2931,11 +2936,11 @@ # We need awk for the "check" target. The system "awk" is bad on # some platforms. -# Always define AMTAR for backward compatibility. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2967,6 +2972,8 @@ +SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L" + case "${host_os}" in "") SYS=unknown @@ -2987,6 +2994,14 @@ ;; esac ;; + *darwin*) + SYS=darwin + +$as_echo "#define USE_IOKIT 1" >>confdefs.h + + LDFLAGS="${LDFLAGS} -lobjc -Wl,-framework,IOKit,-framework,Cocoa,-framework,DiskArbitration" + SET_FEATURES="${SET_FEATURES} -D_DARWIN_C_SOURCE" + ;; *) SYS="${host_os}" ;; @@ -3000,45 +3015,43 @@ HAVE_WIN32_FALSE= fi + if test "${SYS}" = "darwin"; then + HAVE_DARWIN_TRUE= + HAVE_DARWIN_FALSE='#' +else + HAVE_DARWIN_TRUE='#' + HAVE_DARWIN_FALSE= +fi + -# messages library_not_found="Could not find required library!" function_not_found="Could not find required function!" -# configure options # Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; use_werror=$enableval -else - use_werror=no + enableval=$enable_werror; fi # Check whether --enable-extra-warnings was given. if test "${enable_extra_warnings+set}" = set; then : - enableval=$enable_extra_warnings; use_extra_warnings=$enableval -else - use_extra_warnings=yes + enableval=$enable_extra_warnings; fi # Check whether --enable-optimizations was given. if test "${enable_optimizations+set}" = set; then : - enableval=$enable_optimizations; use_optimizations=$enableval -else - use_optimizations=yes + enableval=$enable_optimizations; fi -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; use_debug=$enableval +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 else - use_debug=yes + lt_cv_deplibs_check_method=pass_all fi -# required programs ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3880,6 +3893,7 @@ if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' + am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= @@ -3904,6 +3918,7 @@ # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. + rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. @@ -3963,7 +3978,7 @@ break fi ;; - msvisualcpp | msvcmsys) + msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. @@ -11545,6 +11560,303 @@ # Only expand once: +enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. +set dummy ${ac_tool_prefix}as; 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_prog_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # Let the user override the test. +else +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AS=$ac_cv_prog_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AS"; then + ac_ct_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; 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_prog_ac_ct_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AS"; then + ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. +else +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AS=$ac_cv_prog_ac_ct_AS +if test -n "$ac_ct_AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +$as_echo "$ac_ct_AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AS" = x; then + AS="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AS=$ac_ct_AS + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; 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_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; 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_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; 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_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; 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_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + ;; +esac + +test -z "$AS" && AS=as + + + + + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -11750,7 +12062,6 @@ test -n "$YACC" || YACC="yacc" -# required types { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : @@ -11785,7 +12096,6 @@ -# required headers for ac_header in stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -11812,7 +12122,7 @@ done -for ac_header in sys/time.h time.h sys/select.h +for ac_header in sys/time.h time.h sys/select.h limits.h sys/param.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -11825,8 +12135,19 @@ done +for ac_header in sys/mount.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/mount.h" "ac_cv_header_sys_mount_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mount_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_MOUNT_H 1 +_ACEOF + +fi + +done + -# required structures ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` @@ -12016,7 +12337,6 @@ -# required system services # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; @@ -12216,7 +12536,6 @@ fi -# required functions ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : @@ -12233,8 +12552,9 @@ fi -# pthread check (not on win32) -if test "${SYS}" != "mingw32" ; then + +if test "${SYS}" != "mingw32"; then : + for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" @@ -12243,17 +12563,18 @@ #define HAVE_PTHREAD_H 1 _ACEOF +else + as_fn_error $? "pthread required" "$LINENO" 5 fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_mutex_init in -lpthread" >&5 -$as_echo_n "checking for pthread_mutex_init in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_mutex_init+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 +$as_echo_n "checking for library containing pthread_create... " >&6; } +if ${ac_cv_search_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" + ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12263,40 +12584,67 @@ #ifdef __cplusplus extern "C" #endif -char pthread_mutex_init (); +char pthread_create (); int main () { -return pthread_mutex_init (); +return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_mutex_init=yes -else - ac_cv_lib_pthread_pthread_mutex_init=no +for ac_lib in '' pthread; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_pthread_create=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + conftest$ac_exeext + if ${ac_cv_search_pthread_create+:} false; then : + break +fi +done +if ${ac_cv_search_pthread_create+:} false; then : + +else + ac_cv_search_pthread_create=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5 +$as_echo "$ac_cv_search_pthread_create" >&6; } +ac_res=$ac_cv_search_pthread_create +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + as_fn_error $? "pthread required" "$LINENO" 5 +fi + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_mutex_init" >&6; } -if test "x$ac_cv_lib_pthread_pthread_mutex_init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 -_ACEOF - LIBS="-lpthread $LIBS" + +# Check whether --with-libgcrypt-prefix was given. +if test "${with_libgcrypt_prefix+set}" = set; then : + withval=$with_libgcrypt_prefix; libgcrypt_config_prefix="$withval" else - as_fn_error $? "$library_not_found" "$LINENO" 5 + libgcrypt_config_prefix="" fi +if test x$libgcrypt_config_prefix != x ; then + if test x${LIBGCRYPT_CONFIG+set} != xset ; then + LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config + fi fi -# gcrypt check # Extract the first word of "libgcrypt-config", so it can be a program name with args. set dummy libgcrypt-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -12438,86 +12786,324 @@ 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. */ -# function testing for supported compiler options -check_cc_options() +/* 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 () { - local tmpfile=$(mktemp XXXXXXXXXX) - local tmpcfile="$tmpfile.c" - mv $tmpfile $tmpcfile - local retval=1 - printf "Checking if compiler supports $@... " - if $CC -c $@ $tmpcfile -o /dev/null >/dev/null 2>&1; then - local retval=0 - fi - rm $tmpcfile - if $retval = "0" ; then - echo "yes" - else - echo "no" - fi - return $retval -} - -# set default warnings if supported -check_cc_options -Wall && \ - SET_WARNINGS="$SET_WARNINGS -Wall" -check_cc_options -Wdisabled-optimization && \ - SET_WARNINGS="$SET_WARNINGS -Wdisabled-optimization" -check_cc_options -Wpointer-arith && \ - SET_WARNINGS="$SET_WARNINGS -Wpointer-arith" -check_cc_options -Wredundant-decls && \ - SET_WARNINGS="$SET_WARNINGS -Wredundant-decls" -check_cc_options -Wcast-qual && \ - SET_WARNINGS="$SET_WARNINGS -Wcast-qual" -check_cc_options -Wwrite-strings && \ - SET_WARNINGS="$SET_WARNINGS -Wwrite-strings" -check_cc_options -Wtype-limits && \ - SET_WARNINGS="$SET_WARNINGS -Wtype-limits" -check_cc_options -Wundef && \ - SET_WARNINGS="$SET_WARNINGS -Wundef" - -# use -Werror -if $use_werror = "yes" ; then - check_cc_options -Werror && \ - SET_WARNINGS="$SET_WARNINGS -Werror" -fi - -# use extra warnings -if $use_extra_warnings = "yes" ; then - check_cc_options -Wextra && \ - SET_WARNINGS="$SET_WARNINGS -Wextra" - check_cc_options -Winline && \ - SET_WARNINGS="$SET_WARNINGS -Winline" -fi - -# use optimizations -if $use_optimizations = "yes" ; then - check_cc_options -O3 && \ - SET_OPTIMIZATIONS="$SET_OPTIMIZATIONS -O3" - check_cc_options -fomit-frame-pointer && \ - SET_OPTIMIZATIONS="$SET_OPTIMIZATIONS -fomit-frame-pointer" -fi - -# use debug -if $use_debug = "yes" ; then - check_cc_options -g && \ - SET_DEBUG_OPTS="$SET_DEBUG_OPTS -g" +return gpg_strerror_r (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_gpg_error_gpg_strerror_r=yes +else + ac_cv_lib_gpg_error_gpg_strerror_r=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +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 -# export library version number -AACS_VERSION_MAJOR=0 + LIBS="-lgpg-error $LIBS" + +fi -AACS_VERSION_MINOR=3 -AACS_VERSION_MICRO=0 -# export library (.so) version -LT_VERSION_INFO="1:0:1" + 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 +$as_echo_n "checking if $CC supports $flag flag... " >&6; } +if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else -# generate output files + if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" +else + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + +fi + + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + +fi + +fi +eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + CFLAGS="$CFLAGS $flag"; +fi + + done + + + + for flag in -Werror=implicit-function-declaration -Werror-implicit-function-declaration; do + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 +$as_echo_n "checking if $CC supports $flag flag... " >&6; } +if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + + if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" +else + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + +fi + + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + +fi + +fi +eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + CFLAGS="$CFLAGS $flag"; break; +fi + + done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC way to treat warnings as errors" >&5 +$as_echo_n "checking for $CC way to treat warnings as errors... " >&6; } +if ${cc_cv_werror+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if ${cc_cv_cflags__Werror+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "cc_cv_cflags__Werror='yes'" +else + eval "cc_cv_cflags__Werror='no'" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + +fi + + + if eval test x$cc_cv_cflags__Werror = xyes; then : + cc_cv_werror=-Werror +else + + if { as_var=`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -errwarn=%all" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +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'" +else + eval "`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh`='no'" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + +fi + + + if eval test x$`$as_echo "cc_cv_cflags_-errwarn=%all" | $as_tr_sh` = xyes; then : + cc_cv_werror=-errwarn=%all +fi + +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_cv_werror" >&5 +$as_echo "$cc_cv_werror" >&6; } + +if test "x$enable_werror" = "xyes"; then : + + CFLAGS="${CFLAGS} $cc_cv_werror" + +fi + +if test "x$enable_extra_warnings" != "xno"; then : + + + for flag in -Wextra -Winline; do + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 +$as_echo_n "checking if $CC supports $flag flag... " >&6; } +if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + + if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" +else + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + +fi + + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + +fi + +fi +eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + CFLAGS="$CFLAGS $flag"; +fi + + done + + +fi + +if test "x$enable_optimizations" != "xno"; then : + + + for flag in -O3 -fomit-frame-pointer; do + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports $flag flag" >&5 +$as_echo_n "checking if $CC supports $flag flag... " >&6; } +if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + + if { as_var=`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`; eval \${$as_var+:} false; }; then : + $as_echo_n "(cached) " >&6 +else + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $flag" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main() { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='yes'" +else + eval "`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh`='no'" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + +fi + + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + +fi + +fi +eval ac_res=\$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + + if eval test x$`$as_echo "cc_cv_cflags_$flag" | $as_tr_sh` = xyes; then : + CFLAGS="$CFLAGS $flag"; +fi + + done + + +fi + + +AACS_VERSION_MAJOR=0 + +AACS_VERSION_MINOR=6 + +AACS_VERSION_MICRO=0 + + +LT_VERSION_INFO="3:0:3" @@ -12648,6 +13234,10 @@ as_fn_error $? "conditional \"HAVE_WIN32\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_DARWIN_TRUE}" && test -z "${HAVE_DARWIN_FALSE}"; then + as_fn_error $? "conditional \"HAVE_DARWIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13065,7 +13655,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libaacs $as_me 0.3.0, which was +This file was extended by libaacs $as_me 0.6.0, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13131,7 +13721,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/\\""\`\$/\\\\&/g'`" ac_cs_version="\\ -libaacs config.status 0.3.0 +libaacs config.status 0.6.0 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -13390,6 +13980,7 @@ enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' @@ -13468,7 +14059,8 @@ install_override_mode \ finish_eval \ old_striplib \ -striplib; do +striplib \ +AS; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *\\\\\\\`\\"\\\$*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" @@ -14540,6 +15132,9 @@ old_striplib=$lt_old_striplib striplib=$lt_striplib +# Assembler program. +AS=$lt_AS + # The linker used to build libraries. LD=$lt_LD
View file
libaacs-0.3.0.tar.bz2/configure.ac -> libaacs-0.6.0.tar.bz2/configure.ac
Changed
@@ -1,32 +1,34 @@ -# library version number +dnl library version number m4_define(aacs_major, 0) -m4_define(aacs_minor, 3) +m4_define(aacs_minor, 6) m4_define(aacs_micro, 0) m4_define(aacs_version,aacs_major.aacs_minor.aacs_micro) -# library (.so) version +dnl library (.so) version # -# update when making new release +dnl update when making new release # -# - If there are no ABI changes, increase revision. -# - If ABI is changed backwards-compatible way, increase current and age. Set revision to 0. -# - If ABI is broken, increase current and set age and revision to 0. +dnl - If there are no ABI changes, increase revision. +dnl - If ABI is changed backwards-compatible way, increase current and age. Set revision to 0. +dnl - If ABI is broken, increase current and set age and revision to 0. # -# Library file name will be libaacs.(current-age).age.revision +dnl Library file name will be libaacs.(current-age).age.revision # -m4_define(lt_current, 1) -m4_define(lt_age, 1) +m4_define(lt_current, 3) +m4_define(lt_age, 3) m4_define(lt_revision, 0) -# initilization +dnl initilization AC_INIT(libaacs, aacs_version, http://www.videolan.org/developers/libaacs.html) AC_CONFIG_AUX_DIR(build-aux) AC_CONFIG_MACRO_DIR(m4) AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(foreign) -AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(foreign dist-bzip2 no-dist-gzip) +AC_CONFIG_HEADERS(config.h) AM_MAINTAINER_MODE +SET_FEATURES="-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L" + case "${host_os}" in "") SYS=unknown @@ -43,75 +45,89 @@ ;; esac ;; + *darwin*) + SYS=darwin + AC_DEFINE(USE_IOKIT, 1, Use IOKit for MMC access) + LDFLAGS="${LDFLAGS} -lobjc -Wl,-framework,IOKit,-framework,Cocoa,-framework,DiskArbitration" + SET_FEATURES="${SET_FEATURES} -D_DARWIN_C_SOURCE" + ;; *) SYS="${host_os}" ;; esac AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32") +AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin") -# messages +dnl messages library_not_found="Could not find required library!" function_not_found="Could not find required function!" -# configure options +dnl configure options AC_ARG_ENABLE(werror, - AS_HELP_STRING(--enable-werror, - set warnings as errors via -Werror (default is no)), - use_werror=$enableval, - use_werror=no) + AS_HELP_STRING(--enable-werror, set warnings as errors via -Werror @<:@default=disabled@:>@)) AC_ARG_ENABLE(extra-warnings, - AS_HELP_STRING(--enable-extra-warnings, - set extra warnings (default is yes)), - use_extra_warnings=$enableval, - use_extra_warnings=yes) + AS_HELP_STRING(--disable-extra-warnings, set extra warnings @<:@default=enabled@:>@)) AC_ARG_ENABLE(optimizations, - AS_HELP_STRING(--enable-optimizations, - enable optimizations (default is yes)), - use_optimizations=$enableval, - use_optimizations=yes) - -AC_ARG_ENABLE(debug, - AS_HELP_STRING(--enable-debug, - enable debugging information (default is yes)), - use_debug=$enableval, - use_debug=yes) - -# required programs + AS_HELP_STRING(--disable-optimizations, disable optimizations @<:@default=enabled@:>@)) + +dnl override platform specific check for dependent libraries +dnl otherwise libtool linking of shared libraries will +dnl fail on anything other than pass_all. +AC_CACHE_VAL(lt_cv_deplibs_check_method, + lt_cv_deplibs_check_method=pass_all) + +dnl required programs AC_PROG_CC AC_PROG_LIBTOOL +AC_LIBTOOL_WIN32_DLL AM_PROG_LEX AC_PROG_YACC -# required types +dnl required types AC_TYPE_SIGNAL -# required headers +dnl required headers AC_CHECK_HEADERS(stdarg.h sys/types.h dirent.h errno.h libgen.h malloc.h) AC_CHECK_HEADERS(stdlib.h mntent.h linux/cdrom.h inttypes.h) -AC_CHECK_HEADERS(sys/time.h time.h sys/select.h) +AC_CHECK_HEADERS(sys/time.h time.h sys/select.h limits.h sys/param.h) +AC_CHECK_HEADERS(sys/mount.h) -# required structures +dnl required structures AC_STRUCT_DIRENT_D_TYPE -# required system services +dnl required system services AC_SYS_LARGEFILE -# required functions +dnl required functions AC_CHECK_FUNC(snprintf,, AC_MSG_ERROR($function_not_found)) AC_CHECK_FUNC(realpath,AC_DEFINE(HAVE_REALPATH,1,realpath)) -# pthread check (not on win32) -if test "${SYS}" != "mingw32" ; then - AC_CHECK_HEADERS(pthread.h) - AC_CHECK_LIB(pthread, pthread_mutex_init,, - AC_MSG_ERROR($library_not_found)) +dnl required libraries + +dnl pthread check (not on win32) +AS_IF(test "${SYS}" != "mingw32", + AC_CHECK_HEADERS(pthread.h, , + AC_MSG_ERROR(pthread required)) + AC_SEARCH_LIBS(pthread_create, pthread, , + AC_MSG_ERROR(pthread required)) +) + +dnl gcrypt check + +AC_ARG_WITH(libgcrypt-prefix, + AC_HELP_STRING(--with-libgcrypt-prefix=PFX, + prefix where libgcrypt is installed (optional)), + libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="") +if test x$libgcrypt_config_prefix != x ; then + if test x${LIBGCRYPT_CONFIG+set} != xset ; then + LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config + fi fi -# gcrypt check AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) if test x"$LIBGCRYPT_CONFIG" = xno; then AC_MSG_ERROR(libgcrypt not found on system) @@ -122,74 +138,32 @@ AC_SUBST(LIBGCRYPT_LIBS) fi AC_FUNC_STRERROR_R +AC_CHECK_LIB(gpg-error, gpg_strerror_r) -# function testing for supported compiler options -check_cc_options() -{ - local tmpfile=$(mktemp XXXXXXXXXX) - local tmpcfile="$tmpfile.c" - mv $tmpfile $tmpcfile - local retval=1 - printf "Checking if compiler supports $@... " - if $CC -c $@ $tmpcfile -o /dev/null >/dev/null 2>&1; then - local retval=0 - fi - rm $tmpcfile - if $retval = "0" ; then - echo "yes" - else - echo "no" - fi - return $retval -} - -# set default warnings if supported -check_cc_options -Wall && \ - SET_WARNINGS="$SET_WARNINGS -Wall" -check_cc_options -Wdisabled-optimization && \ - SET_WARNINGS="$SET_WARNINGS -Wdisabled-optimization" -check_cc_options -Wpointer-arith && \ - SET_WARNINGS="$SET_WARNINGS -Wpointer-arith" -check_cc_options -Wredundant-decls && \ - SET_WARNINGS="$SET_WARNINGS -Wredundant-decls" -check_cc_options -Wcast-qual && \ - SET_WARNINGS="$SET_WARNINGS -Wcast-qual" -check_cc_options -Wwrite-strings && \ - SET_WARNINGS="$SET_WARNINGS -Wwrite-strings" -check_cc_options -Wtype-limits && \ - SET_WARNINGS="$SET_WARNINGS -Wtype-limits" -check_cc_options -Wundef && \ - SET_WARNINGS="$SET_WARNINGS -Wundef" - -# use -Werror -if $use_werror = "yes" ; then - check_cc_options -Werror && \ - SET_WARNINGS="$SET_WARNINGS -Werror" -fi -# use extra warnings -if $use_extra_warnings = "yes" ; then - check_cc_options -Wextra && \ - SET_WARNINGS="$SET_WARNINGS -Wextra" - check_cc_options -Winline && \ - SET_WARNINGS="$SET_WARNINGS -Winline" -fi +CC_CHECK_CFLAGS_APPEND(-Wall -Wdisabled-optimization -Wpointer-arith dnl +-Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef dnl +-Wmissing-prototypes -Wshadow) -# use optimizations -if $use_optimizations = "yes" ; then - check_cc_options -O3 && \ - SET_OPTIMIZATIONS="$SET_OPTIMIZATIONS -O3" - check_cc_options -fomit-frame-pointer && \ - SET_OPTIMIZATIONS="$SET_OPTIMIZATIONS -fomit-frame-pointer" -fi +CC_CHECK_CFLAGS_APPEND(-Werror=implicit-function-declaration dnl + -Werror-implicit-function-declaration, + break;) + +CC_CHECK_WERROR +AS_IF(test "x$enable_werror" = "xyes", + CFLAGS="${CFLAGS} $cc_cv_werror" +) + +AS_IF(test "x$enable_extra_warnings" != "xno", + CC_CHECK_CFLAGS_APPEND(-Wextra -Winline) +) + +AS_IF(test "x$enable_optimizations" != "xno", + CC_CHECK_CFLAGS_APPEND(-O3 -fomit-frame-pointer) +) -# use debug -if $use_debug = "yes" ; then - check_cc_options -g && \ - SET_DEBUG_OPTS="$SET_DEBUG_OPTS -g" -fi -# export library version number +dnl export library version number AACS_VERSION_MAJOR=aacs_major() AC_SUBST(AACS_VERSION_MAJOR) AACS_VERSION_MINOR=aacs_minor() @@ -197,13 +171,11 @@ AACS_VERSION_MICRO=aacs_micro() AC_SUBST(AACS_VERSION_MICRO) -# export library (.so) version +dnl export library (.so) version LT_VERSION_INFO="lt_current:lt_revision:lt_age" AC_SUBST(LT_VERSION_INFO) -# generate output files -AC_SUBST(SET_WARNINGS) -AC_SUBST(SET_OPTIMIZATIONS) -AC_SUBST(SET_DEBUG_OPTS) +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_OUTPUT
View file
libaacs-0.6.0.tar.bz2/m4/attributes.m4
Added
@@ -0,0 +1,296 @@ +dnl Macros to check the presence of generic (non-typed) symbols. +dnl Copyright (c) 2006-2007 Diego Pettenò <flameeyes@gmail.com> +dnl Copyright (c) 2006-2007 xine project +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2, or (at your option) +dnl any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +dnl 02110-1301, USA. +dnl +dnl As a special exception, the copyright owners of the +dnl macro gives unlimited permission to copy, distribute and modify the +dnl configure scripts that are the output of Autoconf when processing the +dnl Macro. You need not follow the terms of the GNU General Public +dnl License when using or distributing such scripts, even though portions +dnl of the text of the Macro appear in them. The GNU General Public +dnl License (GPL) does govern all other use of the material that +dnl constitutes the Autoconf Macro. +dnl +dnl This special exception to the GPL applies to versions of the +dnl Autoconf Macro released by this project. When you make and +dnl distribute a modified version of the Autoconf Macro, you may extend +dnl this special exception to the GPL to apply to your modified version as +dnl well. + +dnl Check if the flag is supported by compiler +dnl CC_CHECK_CFLAGS_SILENT(FLAG, ACTION-IF-FOUND,ACTION-IF-NOT-FOUND) + +AC_DEFUN(CC_CHECK_CFLAGS_SILENT, + AC_CACHE_VAL(AS_TR_SH(cc_cv_cflags_$1), + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $1" + AC_LINK_IFELSE(AC_LANG_SOURCE(int main() { return 0; }), + eval "AS_TR_SH(cc_cv_cflags_$1)='yes'", + eval "AS_TR_SH(cc_cv_cflags_$1)='no'") + CFLAGS="$ac_save_CFLAGS" + ) + + AS_IF(eval test x$AS_TR_SH(cc_cv_cflags_$1) = xyes, + $2, $3) +) + +dnl Check if the flag is supported by compiler (cacheable) +dnl CC_CHECK_CFLAGS(FLAG, ACTION-IF-FOUND,ACTION-IF-NOT-FOUND) + +AC_DEFUN(CC_CHECK_CFLAGS, + AC_CACHE_CHECK(if $CC supports $1 flag, + AS_TR_SH(cc_cv_cflags_$1), + CC_CHECK_CFLAGS_SILENT($1) dnl Don't execute actions here! + ) + + AS_IF(eval test x$AS_TR_SH(cc_cv_cflags_$1) = xyes, + $2, $3) +) + +dnl CC_CHECK_CFLAG_APPEND(FLAG, action-if-found, action-if-not-found) +dnl Check for CFLAG and appends them to CFLAGS if supported +AC_DEFUN(CC_CHECK_CFLAG_APPEND, + AC_CACHE_CHECK(if $CC supports $1 flag, + AS_TR_SH(cc_cv_cflags_$1), + CC_CHECK_CFLAGS_SILENT($1) dnl Don't execute actions here! + ) + + AS_IF(eval test x$AS_TR_SH(cc_cv_cflags_$1) = xyes, + CFLAGS="$CFLAGS $1"; $2, $3) +) + +dnl CC_CHECK_CFLAGS_APPEND(FLAG1 FLAG2, action-if-found, action-if-not) +AC_DEFUN(CC_CHECK_CFLAGS_APPEND, + for flag in $1; do + CC_CHECK_CFLAG_APPEND($flag, $2, $3) + done +) + +dnl Check if the flag is supported by linker (cacheable) +dnl CC_CHECK_LDFLAGS(FLAG, ACTION-IF-FOUND,ACTION-IF-NOT-FOUND) + +AC_DEFUN(CC_CHECK_LDFLAGS, + AC_CACHE_CHECK(if $CC supports $1 flag, + AS_TR_SH(cc_cv_ldflags_$1), + ac_save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $1" + AC_LINK_IFELSE(AC_LANG_SOURCE(int main() { return 1; }), + eval "AS_TR_SH(cc_cv_ldflags_$1)='yes'", + eval "AS_TR_SH(cc_cv_ldflags_$1)=") + LDFLAGS="$ac_save_LDFLAGS" + ) + + AS_IF(eval test x$AS_TR_SH(cc_cv_ldflags_$1) = xyes, + $2, $3) +) + +dnl Check for a -Werror flag or equivalent. -Werror is the GCC +dnl and ICC flag that tells the compiler to treat all the warnings +dnl as fatal. We usually need this option to make sure that some +dnl constructs (like attributes) are not simply ignored. +dnl +dnl Other compilers don't support -Werror per se, but they support +dnl an equivalent flag: +dnl - Sun Studio compiler supports -errwarn=%all +AC_DEFUN(CC_CHECK_WERROR, + AC_CACHE_CHECK( + for $CC way to treat warnings as errors, + cc_cv_werror, + CC_CHECK_CFLAGS_SILENT(-Werror, cc_cv_werror=-Werror, + CC_CHECK_CFLAGS_SILENT(-errwarn=%all, cc_cv_werror=-errwarn=%all)) + ) +) + +AC_DEFUN(CC_CHECK_ATTRIBUTE, + AC_REQUIRE(CC_CHECK_WERROR) + AC_CACHE_CHECK(if $CC supports __attribute__(( ifelse($2, , $1, $2) )), + AS_TR_SH(cc_cv_attribute_$1), + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + AC_COMPILE_IFELSE(AC_LANG_SOURCE($3), + eval "AS_TR_SH(cc_cv_attribute_$1)='yes'", + eval "AS_TR_SH(cc_cv_attribute_$1)='no'") + CFLAGS="$ac_save_CFLAGS" + ) + + AS_IF(eval test x$AS_TR_SH(cc_cv_attribute_$1) = xyes, + AC_DEFINE( + AS_TR_CPP(SUPPORT_ATTRIBUTE_$1), 1, + Define this if the compiler supports __attribute__(( ifelse($2, , $1, $2) )) + ) + $4, + $5) +) + +AC_DEFUN(CC_ATTRIBUTE_CONSTRUCTOR, + CC_CHECK_ATTRIBUTE( + constructor,, + extern void foo(); + void __attribute__((constructor)) ctor() { foo(); }, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_DESTRUCTOR, + CC_CHECK_ATTRIBUTE( + destructor,, + extern void foo(); + void __attribute__((destructor)) dtor() { foo(); }, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_FORMAT, + CC_CHECK_ATTRIBUTE( + format, format(printf, n, n), + void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_FORMAT_ARG, + CC_CHECK_ATTRIBUTE( + format_arg, format_arg(printf), + char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_VISIBILITY, + CC_CHECK_ATTRIBUTE( + visibility_$1, visibility("$1"), + void __attribute__((visibility("$1"))) $1_function() { }, + $2, $3) +) + +AC_DEFUN(CC_ATTRIBUTE_NONNULL, + CC_CHECK_ATTRIBUTE( + nonnull, nonnull(), + void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_UNUSED, + CC_CHECK_ATTRIBUTE( + unused, , + void some_function(void *foo, __attribute__((unused)) void *bar);, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_SENTINEL, + CC_CHECK_ATTRIBUTE( + sentinel, , + void some_function(void *foo, ...) __attribute__((sentinel));, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_DEPRECATED, + CC_CHECK_ATTRIBUTE( + deprecated, , + void some_function(void *foo, ...) __attribute__((deprecated));, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_ALIAS, + CC_CHECK_ATTRIBUTE( + alias, weak, alias, + void other_function(void *foo) { } + void some_function(void *foo) __attribute__((weak, alias("other_function")));, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_MALLOC, + CC_CHECK_ATTRIBUTE( + malloc, , + void * __attribute__((malloc)) my_alloc(int n);, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_PACKED, + CC_CHECK_ATTRIBUTE( + packed, , + struct astructure { char a; int b; long c; void *d; } __attribute__((packed)); + char assert@<:@(sizeof(struct astructure) == (sizeof(char)+sizeof(int)+sizeof(long)+sizeof(void*)))-1@:>@;, + $1, $2) +) + +AC_DEFUN(CC_ATTRIBUTE_CONST, + CC_CHECK_ATTRIBUTE( + const, , + int __attribute__((const)) twopow(int n) { return 1 << n; } , + $1, $2) +) + +AC_DEFUN(CC_FLAG_VISIBILITY, + AC_REQUIRE(CC_CHECK_WERROR) + AC_CACHE_CHECK(if $CC supports -fvisibility=hidden, + cc_cv_flag_visibility, + cc_flag_visibility_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + CC_CHECK_CFLAGS_SILENT(-fvisibility=hidden, + cc_cv_flag_visibility='yes', + cc_cv_flag_visibility='no') + CFLAGS="$cc_flag_visibility_save_CFLAGS") + + AS_IF(test "x$cc_cv_flag_visibility" = "xyes", + AC_DEFINE(SUPPORT_FLAG_VISIBILITY, 1, + Define this if the compiler supports the -fvisibility flag) + $1, + $2) +) + +AC_DEFUN(CC_FUNC_EXPECT, + AC_REQUIRE(CC_CHECK_WERROR) + AC_CACHE_CHECK(if compiler has __builtin_expect function, + cc_cv_func_expect, + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + AC_COMPILE_IFELSE( + int some_function() { + int a = 3; + return (int)__builtin_expect(a, 3); + }, + cc_cv_func_expect=yes, + cc_cv_func_expect=no) + CFLAGS="$ac_save_CFLAGS" + ) + + AS_IF(test "x$cc_cv_func_expect" = "xyes", + AC_DEFINE(SUPPORT__BUILTIN_EXPECT, 1, + Define this if the compiler supports __builtin_expect() function) + $1, + $2) +) + +AC_DEFUN(CC_ATTRIBUTE_ALIGNED, + AC_REQUIRE(CC_CHECK_WERROR) + AC_CACHE_CHECK(highest __attribute__ ((aligned ())) supported, + cc_cv_attribute_aligned, + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + for cc_attribute_align_try in 64 32 16 8 4 2; do + AC_COMPILE_IFELSE( + int main() { + static char c __attribute__ ((aligned($cc_attribute_align_try))) = 0; + return c; + }, cc_cv_attribute_aligned=$cc_attribute_align_try; break) + done + CFLAGS="$ac_save_CFLAGS" + ) + + if test "x$cc_cv_attribute_aligned" != "x"; then + AC_DEFINE_UNQUOTED(ATTRIBUTE_ALIGNED_MAX, $cc_cv_attribute_aligned, + Define the highest alignment supported) + fi +)
View file
libaacs-0.3.0.tar.bz2/src/Makefile.am -> libaacs-0.6.0.tar.bz2/src/Makefile.am
Changed
@@ -1,20 +1,12 @@ -LIB_VERSION_INFO="@LT_VERSION_INFO@" +SET_FEATURES = @SET_FEATURES@ +SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibaacs -SUBDIRS= . examples - -SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_WARNINGS = @SET_WARNINGS@ -SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@ -SET_DEBUG_OPTS = @SET_DEBUG_OPTS@ -SET_INCLUDES = -I$(top_srcdir) -Ifile - -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_WARNINGS) $(SET_OPTIMIZATIONS) \ - $(SET_DEBUG_OPTS) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) AM_YFLAGS = -d -p libaacs_yy -CFLAGS=$(shell test -z "$$CFLAGS" || echo "$$CFLAGS") lib_LTLIBRARIES = libaacs.la -libaacs_la_SOURCES=libaacs/aacs.h \ +libaacs_la_SOURCES=\ + libaacs/aacs.h \ libaacs/mmc.h \ libaacs/mkb.h \ libaacs/aacs.c \ @@ -36,8 +28,14 @@ util/strutl.c \ util/strutl.h -EXTRA_libaacs_la_SOURCES=libaacs/ec.c +EXTRA_libaacs_la_SOURCES=\ + libaacs/ec.c +if HAVE_DARWIN +libaacs_la_SOURCES+= \ + file/darwin.c \ + file/darwin.h +else if HAVE_WIN32 libaacs_la_SOURCES+= \ file/win32.c \ @@ -47,14 +45,25 @@ file/xdg.c \ file/xdg.h endif +endif -libaacs_ladir= $(includedir)/libaacs -libaacs_la_HEADERS= libaacs/aacs.h file/filesystem.h libaacs/aacs-version.h -libaacs_la_LDFLAGS= $(LIBGCRYPT_LIBS) -version-info $(LIB_VERSION_INFO) +pkginclude_HEADERS = \ + libaacs/aacs.h \ + file/filesystem.h \ + libaacs/aacs-version.h + +libaacs_la_LDFLAGS= -no-undefined -version-info $(LT_VERSION_INFO) +libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libaacs.pc BUILT_SOURCES = keydbcfg-parser.h keydbcfg-parser.c keydbcfg-lexer.c +CLEANFILES = $(BUILT_SOURCES) + clean-lex-yacc: -rm -f $(BUILT_SOURCES) + +# do not distribute files that should be generated by lex/yacc locally +dist-hook: + (cd $(distdir) && rm -f $(BUILT_SOURCES))
View file
libaacs-0.3.0.tar.bz2/src/Makefile.in -> libaacs-0.6.0.tar.bz2/src/Makefile.in
Changed
@@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# 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 Free Software Foundation, -# Inc. +# 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. @@ -37,23 +37,27 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@HAVE_WIN32_TRUE@am__append_1 = \ -@HAVE_WIN32_TRUE@ file/win32.c \ -@HAVE_WIN32_TRUE@ file/win32.h +@HAVE_DARWIN_TRUE@am__append_1 = \ +@HAVE_DARWIN_TRUE@ file/darwin.c \ +@HAVE_DARWIN_TRUE@ file/darwin.h -@HAVE_WIN32_FALSE@am__append_2 = \ -@HAVE_WIN32_FALSE@ file/xdg.c \ -@HAVE_WIN32_FALSE@ file/xdg.h +@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_FALSE@am__append_3 = \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/xdg.c \ +@HAVE_DARWIN_FALSE@@HAVE_WIN32_FALSE@ file/xdg.h subdir = src -DIST_COMMON = $(libaacs_la_HEADERS) $(srcdir)/Makefile.am \ +DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/libaacs.pc.in keydbcfg-lexer.c \ keydbcfg-parser.c keydbcfg-parser.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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__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 @@ -81,22 +85,31 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(libaacs_ladir)" + "$(DESTDIR)$(pkgincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) -libaacs_la_LIBADD = +am__DEPENDENCIES_1 = +libaacs_la_DEPENDENCIES = $(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 \ util/macro.h util/logging.c util/logging.h util/strutl.c \ - util/strutl.h file/win32.c file/win32.h file/xdg.c file/xdg.h -@HAVE_WIN32_TRUE@am__objects_1 = win32.lo -@HAVE_WIN32_FALSE@am__objects_2 = xdg.lo + 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 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) + strutl.lo $(am__objects_1) $(am__objects_2) $(am__objects_3) libaacs_la_OBJECTS = $(am_libaacs_la_OBJECTS) libaacs_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -115,73 +128,36 @@ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || -LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) +LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) + --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) YLWRAP = $(top_srcdir)/build-aux/ylwrap @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || -YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS) + --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) SOURCES = $(libaacs_la_SOURCES) $(EXTRA_libaacs_la_SOURCES) DIST_SOURCES = $(am__libaacs_la_SOURCES_DIST) \ $(EXTRA_libaacs_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive DATA = $(pkgconfig_DATA) -HEADERS = $(libaacs_la_HEADERS) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir +HEADERS = $(pkginclude_HEADERS) ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\(^/*\)/.*$$,\1,'; \ - sed_rest='s,^^/*/*,,'; \ - sed_last='s,^.*/\(^/*\)$$,\1,'; \ - sed_butlast='s,/*^/*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" 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 = $(shell test -z "$$CFLAGS" || echo "$$CFLAGS") +CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -237,10 +213,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ -SET_DEBUG_OPTS = @SET_DEBUG_OPTS@ +SET_FEATURES = @SET_FEATURES@ SET_MAKE = @SET_MAKE@ -SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@ -SET_WARNINGS = @SET_WARNINGS@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ @@ -302,13 +276,8 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -LIB_VERSION_INFO = "@LT_VERSION_INFO@" -SUBDIRS = . examples -SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_INCLUDES = -I$(top_srcdir) -Ifile -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_WARNINGS) $(SET_OPTIMIZATIONS) \ - $(SET_DEBUG_OPTS) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) - +SET_INCLUDES = -I$(top_srcdir) -Ifile -Ilibaacs +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) $(LIBGCRYPT_CFLAGS) AM_YFLAGS = -d -p libaacs_yy lib_LTLIBRARIES = libaacs.la libaacs_la_SOURCES = libaacs/aacs.h libaacs/mmc.h libaacs/mkb.h \ @@ -317,16 +286,23 @@ 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) -EXTRA_libaacs_la_SOURCES = libaacs/ec.c -libaacs_ladir = $(includedir)/libaacs -libaacs_la_HEADERS = libaacs/aacs.h file/filesystem.h libaacs/aacs-version.h -libaacs_la_LDFLAGS = $(LIBGCRYPT_LIBS) -version-info $(LIB_VERSION_INFO) + $(am__append_1) $(am__append_2) $(am__append_3) +EXTRA_libaacs_la_SOURCES = \ + libaacs/ec.c + +pkginclude_HEADERS = \ + libaacs/aacs.h \ + file/filesystem.h \ + libaacs/aacs-version.h + +libaacs_la_LDFLAGS = -no-undefined -version-info $(LT_VERSION_INFO) +libaacs_la_LIBADD = $(LIBGCRYPT_LIBS) pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libaacs.pc BUILT_SOURCES = keydbcfg-parser.h keydbcfg-parser.c keydbcfg-lexer.c +CLEANFILES = $(BUILT_SOURCES) all: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) all-recursive + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y @@ -394,11 +370,9 @@ rm -f "$${dir}/so_locations"; \ done keydbcfg-parser.h: keydbcfg-parser.c - @if test ! -f $@; then \ - rm -f keydbcfg-parser.c; \ - $(MAKE) $(AM_MAKEFLAGS) keydbcfg-parser.c; \ - else :; fi -libaacs.la: $(libaacs_la_OBJECTS) $(libaacs_la_DEPENDENCIES) + @if test ! -f $@; then rm -f keydbcfg-parser.c; else :; fi + @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) mostlyclean-compile: @@ -409,6 +383,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aacs.Plo@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)/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@ @@ -498,6 +473,13 @@ @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@ +@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 + 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 @@ -525,7 +507,7 @@ keydbcfg-lexer.c: file/keydbcfg-lexer.l \ $(am__skiplex) \ - $(SHELL) $(YLWRAP) `test -f 'file/keydbcfg-lexer.l' || echo '$(srcdir)/'`file/keydbcfg-lexer.l $(LEX_OUTPUT_ROOT).c keydbcfg-lexer.c -- $(LEX) $(LFLAGS) $(AM_LFLAGS) + $(SHELL) $(YLWRAP) `test -f 'file/keydbcfg-lexer.l' || echo '$(srcdir)/'`file/keydbcfg-lexer.l $(LEX_OUTPUT_ROOT).c keydbcfg-lexer.c -- $(LEX) $(AM_LFLAGS) $(LFLAGS) .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) @@ -533,7 +515,7 @@ keydbcfg-parser.c: file/keydbcfg-parser.y \ $(am__skipyacc) \ - $(SHELL) $(YLWRAP) `test -f 'file/keydbcfg-parser.y' || echo '$(srcdir)/'`file/keydbcfg-parser.y y.tab.c keydbcfg-parser.c y.tab.h keydbcfg-parser.h y.output keydbcfg-parser.output -- $(YACC) $(YFLAGS) $(AM_YFLAGS) + $(SHELL) $(YLWRAP) `test -f 'file/keydbcfg-parser.y' || echo '$(srcdir)/'`file/keydbcfg-parser.y y.tab.c keydbcfg-parser.c y.tab.h keydbcfg-parser.h y.output keydbcfg-parser.output -- $(YACC) $(AM_YFLAGS) $(YFLAGS) mostlyclean-libtool: -rm -f *.lo @@ -557,99 +539,25 @@ @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(pkgconfigdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(pkgconfigdir)" && rm -f $$files -install-libaacs_laHEADERS: $(libaacs_la_HEADERS) + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) - test -z "$(libaacs_ladir)" || $(MKDIR_P) "$(DESTDIR)$(libaacs_ladir)" - @list='$(libaacs_la_HEADERS)'; test -n "$(libaacs_ladir)" || list=; \ + test -z "$(pkgincludedir)" || $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libaacs_ladir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(libaacs_ladir)" || exit $$?; \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done -uninstall-libaacs_laHEADERS: +uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) - @list='$(libaacs_la_HEADERS)'; test -n "$(libaacs_ladir)" || list=; \ + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(libaacs_ladir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(libaacs_ladir)" && rm -f $$files - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --!k*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --!k*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -661,23 +569,10 @@ mkid -fID $$unique tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -696,7 +591,7 @@ fi; \ fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -746,61 +641,41 @@ || exit 1; \ fi; \ 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 \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook check-am: all-am check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(libaacs_ladir)"; do \ +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -813,104 +688,104 @@ -rm -f keydbcfg-parser.c -rm -f keydbcfg-parser.h -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-recursive +clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: -install-data-am: install-libaacs_laHEADERS install-pkgconfigDATA +install-data-am: install-pkgconfigDATA install-pkgincludeHEADERS -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: -uninstall-am: uninstall-libLTLIBRARIES uninstall-libaacs_laHEADERS \ - uninstall-pkgconfigDATA - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - ctags-recursive install install-am install-strip \ - tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ - 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-libaacs_laHEADERS install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ +uninstall-am: 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 \ + 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 tags-recursive \ - uninstall uninstall-am uninstall-libLTLIBRARIES \ - uninstall-libaacs_laHEADERS uninstall-pkgconfigDATA + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-libLTLIBRARIES uninstall-pkgconfigDATA \ + uninstall-pkgincludeHEADERS clean-lex-yacc: -rm -f $(BUILT_SOURCES) +# do not distribute files that should be generated by lex/yacc locally +dist-hook: + (cd $(distdir) && rm -f $(BUILT_SOURCES)) + # Tell versions 3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
View file
libaacs-0.3.0.tar.bz2/src/examples/Makefile.am -> libaacs-0.6.0.tar.bz2/src/examples/Makefile.am
Changed
@@ -1,21 +1,18 @@ SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT -SET_WARNINGS = @SET_WARNINGS@ -SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@ -SET_DEBUG_OPTS = @SET_DEBUG_OPTS@ SET_INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/file -AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_WARNINGS) $(SET_OPTIMIZATIONS) \ - $(SET_DEBUG_OPTS) $(SET_INCLUDES) -CFLAGS=$(shell test -z "$$CFLAGS" || echo "$$CFLAGS") +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) AACS_LIB = $(top_builddir)/src/libaacs.la -PARSER_TEST_DEPENDENCIES=$(top_srcdir)/src/keydbcfg-lexer.c $(top_srcdir)/src/keydbcfg-parser.c +noinst_PROGRAMS=parser_test +bin_PROGRAMS=aacs_info -noinst_PROGRAMS=parser_test libaacs_test +parser_test_SOURCES=parser_test.c \ + $(top_builddir)/src/keydbcfg-lexer.c \ + $(top_builddir)/src/keydbcfg-parser.c -parser_test_SOURCE=parser_test.c -parser_test_LDADD = $(AACS_LIB) $(PARSER_TEST_DEPENDENCIES) +parser_test_LDADD = $(AACS_LIB) -libaacs_test_SOURCE=libaacs_test.c -libaacs_test_LDADD = $(AACS_LIB) +aacs_info_SOURCE=libaacs_test.c +aacs_info_LDADD = $(AACS_LIB)
View file
libaacs-0.3.0.tar.bz2/src/examples/Makefile.in -> libaacs-0.6.0.tar.bz2/src/examples/Makefile.in
Changed
@@ -1,9 +1,9 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# 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 Free Software Foundation, -# Inc. +# 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. @@ -35,27 +35,30 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -noinst_PROGRAMS = parser_test$(EXEEXT) libaacs_test$(EXEEXT) +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/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__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 = -PROGRAMS = $(noinst_PROGRAMS) -libaacs_test_SOURCES = libaacs_test.c -libaacs_test_OBJECTS = libaacs_test.$(OBJEXT) -libaacs_test_DEPENDENCIES = $(AACS_LIB) -parser_test_SOURCES = parser_test.c -parser_test_OBJECTS = parser_test.$(OBJEXT) -parser_test_DEPENDENCIES = $(AACS_LIB) $(PARSER_TEST_DEPENDENCIES) +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 @@ -69,8 +72,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = libaacs_test.c parser_test.c -DIST_SOURCES = libaacs_test.c parser_test.c +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) @@ -80,13 +83,14 @@ ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ +AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CFLAGS = $(shell test -z "$$CFLAGS" || echo "$$CFLAGS") +CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ @@ -142,10 +146,8 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ -SET_DEBUG_OPTS = @SET_DEBUG_OPTS@ +SET_FEATURES = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112L -D_REENTRANT SET_MAKE = @SET_MAKE@ -SET_OPTIMIZATIONS = @SET_OPTIMIZATIONS@ -SET_WARNINGS = @SET_WARNINGS@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ @@ -207,17 +209,16 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -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_WARNINGS) $(SET_OPTIMIZATIONS) \ - $(SET_DEBUG_OPTS) $(SET_INCLUDES) - +AM_CFLAGS = -std=c99 $(SET_FEATURES) $(SET_INCLUDES) AACS_LIB = $(top_builddir)/src/libaacs.la -PARSER_TEST_DEPENDENCIES = $(top_srcdir)/src/keydbcfg-lexer.c $(top_srcdir)/src/keydbcfg-parser.c -parser_test_SOURCE = parser_test.c -parser_test_LDADD = $(AACS_LIB) $(PARSER_TEST_DEPENDENCIES) -libaacs_test_SOURCE = libaacs_test.c -libaacs_test_LDADD = $(AACS_LIB) +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: @@ -252,6 +253,49 @@ $(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; \ @@ -261,10 +305,10 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -libaacs_test$(EXEEXT): $(libaacs_test_OBJECTS) $(libaacs_test_DEPENDENCIES) - @rm -f libaacs_test$(EXEEXT) - $(LINK) $(libaacs_test_OBJECTS) $(libaacs_test_LDADD) $(LIBS) -parser_test$(EXEEXT): $(parser_test_OBJECTS) $(parser_test_DEPENDENCIES) +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) @@ -274,7 +318,9 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libaacs_test.Po@am__quote@ +@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: @@ -298,6 +344,34 @@ @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 @@ -390,6 +464,9 @@ 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 @@ -400,10 +477,15 @@ installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + 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: @@ -417,8 +499,8 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -444,7 +526,7 @@ install-dvi-am: -install-exec-am: +install-exec-am: install-binPROGRAMS install-html: install-html-am @@ -484,22 +566,23 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean 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-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 +.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.
View file
libaacs-0.6.0.tar.bz2/src/examples/aacs_info.c
Added
@@ -0,0 +1,133 @@ +/* + * 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 "../libaacs/aacs.h" +#include "../util/macro.h" /* MKINT_BE48 */ + +#include <stdio.h> +#include <stdlib.h> + +static const char *_hex2str(const uint8_t *s, unsigned n) +{ + static const char hex = "0123456789ABCDEF"; + static char *str = NULL; + + unsigned ii; + + str = realloc(str, n*2 + 1); + for (ii = 0; ii < n; ii++) { + str2*ii = hex sii >> 4; + str2*ii + 1 = hex sii & 0x0f; + } + str2*ii = 0; + + return str; +} + +static const char *_error_str(int error_code) +{ + switch (error_code) { + case AACS_SUCCESS: + return "No errors"; + case AACS_ERROR_CORRUPTED_DISC: + return "Corrupted BluRay disc"; + case AACS_ERROR_NO_CONFIG: + return "Missing configuration file(s)"; + case AACS_ERROR_NO_PK: + return "No matching processing key in configuration file(s)"; + case AACS_ERROR_NO_CERT: + return "No valid certificates in configuration file(s)"; + case AACS_ERROR_CERT_REVOKED: + return "All available certificates have been revoked"; + case AACS_ERROR_MMC_OPEN: + return "MMC open failed"; + case AACS_ERROR_MMC_FAILURE: + return "MMC authentication failed"; + } + return "Unknown error"; +} + +static void _dump_rl(const char *type, AACS_RL_ENTRY *rl, int num_entries, int mkb_version) +{ + int ii; + + printf("%s Revocation List (MKB version %d):\n", type, mkb_version); + + if (num_entries < 1 || !rl) { + printf(" (empty)\n"); + return; + } + + for (ii = 0; ii < num_entries; ii++) { + unsigned long long id = MKINT_BE48(rlii.id); + + if (rlii.range) { + printf(" %012llx - %012llx\n", id, id + rlii.range); + } else { + printf(" %012llx\n", id); + } + } +} + +int main (int argc, char **argv) +{ + int major, minor, micro, error_code = AACS_SUCCESS; + + if (argc < 2) { + fprintf(stderr, "Usage: aacs_info <path-to-disc-root> <path-to-config-file>\n"); + exit(EXIT_FAILURE); + } + + aacs_get_version(&major, &minor, µ); + printf("Opening %s using libaacs %d.%d.%d ...\n", argv1, major, minor, micro); + + AACS *aacs = aacs_open2(argv1, argc > 2 ? argv2 : NULL, &error_code); + if (error_code) { + fprintf(stderr, "libaacs open failed: %s\n", _error_str(error_code)); + } else { + printf("libaacs open succeed.\n"); + } + + if (!aacs) { + exit(EXIT_FAILURE); + } + + const uint8_t *vid = aacs_get_vid(aacs); + const uint8_t *id = aacs_get_disc_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)); + + aacs_close(aacs); + + /* dump revocation lists */ + + AACS_RL_ENTRY *rl; + int num_entries, mkb_version; + + rl = aacs_get_hrl(&num_entries, &mkb_version); + _dump_rl("Host", rl, num_entries, mkb_version); + X_FREE(rl); + + rl = aacs_get_drl(&num_entries, &mkb_version); + _dump_rl("Drive", rl, num_entries, mkb_version); + X_FREE(rl); + + return EXIT_SUCCESS; +}
View file
libaacs-0.6.0.tar.bz2/src/file/darwin.c
Added
@@ -0,0 +1,95 @@ +/* + * 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
Added
@@ -0,0 +1,29 @@ +/* + * 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.3.0.tar.bz2/src/file/file_posix.c -> libaacs-0.6.0.tar.bz2/src/file/file_posix.c
Changed
@@ -38,7 +38,7 @@ if (file) { fclose((FILE *)file->internal); - DEBUG(DBG_FILE, "Closed LINUX file (%p)\n", file); + DEBUG(DBG_FILE, "Closed LINUX file (%p)\n", (void*)file); X_FREE(file); } @@ -82,7 +82,7 @@ FILE *fp = NULL; AACS_FILE_H *file = malloc(sizeof(AACS_FILE_H)); - DEBUG(DBG_FILE, "Opening LINUX file %s... (%p)\n", filename, file); + DEBUG(DBG_FILE, "Opening LINUX file %s... (%p)\n", filename, (void*)file); file->close = file_close_linux; file->seek = file_seek_linux; file->read = file_read_linux; @@ -96,7 +96,7 @@ return file; } - DEBUG(DBG_FILE, "Error opening file %s ! (%p)\n", filename, file); + DEBUG(DBG_FILE, "Error opening file %s ! (%p)\n", filename, (void*)file); X_FREE(file);
View file
libaacs-0.3.0.tar.bz2/src/file/keydbcfg-lexer.l -> libaacs-0.6.0.tar.bz2/src/file/keydbcfg-lexer.l
Changed
@@ -20,13 +20,21 @@ #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 @@ -81,7 +89,8 @@ {WHITESPACE} {} <TITLE_STATE>{DISC_TITLE} { - yylval->string = trim_string(yytext); + //yylval->string = trim_string(yytext); + yylval->string = yytext; BEGIN INITIAL; return DISC_TITLE; } @@ -130,6 +139,7 @@ {COMMENT} {} {BAD_ENTRY} { return BAD_ENTRY; } %% +#if 0 /* Function used to trim leading and trailing space from a string */ static char *trim_string(const char *string) { @@ -146,3 +156,4 @@ new_stringsize = '\0'; return new_string; } +#endif \ No newline at end of file
View file
libaacs-0.3.0.tar.bz2/src/file/keydbcfg-parser.y -> libaacs-0.6.0.tar.bz2/src/file/keydbcfg-parser.y
Changed
@@ -1,4 +1,8 @@ -%{ +%code requires { +#include "file/keydbcfg.h" +} + +%code { /* * This file is part of libaacs * Copyright (C) 2010 gates @@ -18,7 +22,6 @@ * <http://www.gnu.org/licenses/>. */ -#include "file/keydbcfg.h" #include "util/macro.h" #include <stdio.h> @@ -27,9 +30,9 @@ /* Disable some warnings triggered by generated parser */ #if defined __GNUC__ -#pragma GCC diagnostic ignored "-Wredundant-decls" #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 */ @@ -40,10 +43,10 @@ { \ while (X) \ { \ - digit_key_pair_list *next = X->next; \ + digit_key_pair_list *pnext = X->next;\ X_FREE(X->key_pair.key); \ X_FREE(X); \ - X = next; \ + X = pnext; \ } \ } while (0); @@ -62,20 +65,19 @@ ENTRY_TYPE_UK }; -static dk_list *new_dk_list(); -static dk_list *add_dk_list_entry(dk_list *list, const char *key, - const char *node); -static pk_list *new_pk_list(); -static pk_list *add_pk_list_entry(pk_list *list, const char *key); -static cert_list *new_cert_list(); -static cert_list *add_cert_list(cert_list *list, const char *host_priv_key, - const char *host_cert, const char *host_nonce, - const char *host_key_point); -static title_entry_list *new_title_entry_list(); -static int add_entry(title_entry_list *list, int type, const char *entry); -static digit_key_pair_list *new_digit_key_pair_list(); +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, const char *key); + 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, @@ -85,7 +87,7 @@ /* uncomment the line below for debugging */ // int yydebug = 1; -%} +} /* Options set to generate a reentrant parser that is POSIX yacc compatible * The basic 'scanner' parameters are set. Also, another parameter is set * to pass in a title entry list struct used to hold all title entries. @@ -318,7 +320,7 @@ { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*dkplist)); + dkplist = new_digit_key_pair_list(); celist->entry.bn = dkplist; } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_BN, $1, $3); @@ -349,7 +351,7 @@ { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*dkplist)); + dkplist = new_digit_key_pair_list(); celist->entry.pak = dkplist; } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_PAK, $1, $3); @@ -373,7 +375,7 @@ { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*dkplist)); + dkplist = new_digit_key_pair_list(); celist->entry.tk = dkplist; } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_TK, $1, $3); @@ -397,7 +399,7 @@ { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*dkplist)); + dkplist = new_digit_key_pair_list(); celist->entry.uk = dkplist; } dkplist = add_digit_key_pair_entry(dkplist, ENTRY_TYPE_UK, $1, $3); @@ -449,6 +451,8 @@ cfgfile->host_cert_list = head_clist; cfgfile->list = head_celist; + fclose(fp); + if (retval) return 0; @@ -456,11 +460,10 @@ } /* Function that returns pointer to new config file object */ -config_file *keydbcfg_new_config_file() +config_file *keydbcfg_new_config_file(void) { config_file *cfgfile = (config_file *)malloc(sizeof(*cfgfile)); - cfgfile->pkl = NULL; - cfgfile->list = NULL; + memset(cfgfile, 0, sizeof(*cfgfile)); return cfgfile; } @@ -476,6 +479,15 @@ 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) { @@ -512,17 +524,15 @@ } /* Function to return new dk_list object */ -static dk_list *new_dk_list() +static dk_list *new_dk_list(void) { dk_list *dkl = (dk_list *)malloc(sizeof(*dkl)); - dkl->key = NULL; - dkl->next = NULL; + memset(dkl, 0, sizeof(*dkl)); return dkl; } /* Function to add dk to config file */ -static dk_list *add_dk_list_entry(dk_list *list, const char *key, - const char *node) +static dk_list *add_dk_list_entry(dk_list *list, char *key, char *node) { if (!list) { @@ -530,26 +540,25 @@ return NULL; } - list->key = (char*)malloc(strlen(key) + 1); - strcpy(list->key, key); + 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() +static pk_list *new_pk_list(void) { pk_list *pkl = (pk_list *)malloc(sizeof(*pkl)); - pkl->key = NULL; - pkl->next = NULL; + memset(pkl, 0, sizeof(*pkl)); return pkl; } /* Function to add pk to config file */ -static pk_list *add_pk_list_entry(pk_list *list, const char *key) +static pk_list *add_pk_list_entry(pk_list *list, char *key) { if (!list) { @@ -557,16 +566,14 @@ return NULL; } - list->key = (char*)malloc(strlen(key) + 1); - strcpy(list->key, key); - + list->key = key; list->next = new_pk_list(); return list->next; } /* Function to create new certificate list */ -static cert_list *new_cert_list() +static cert_list *new_cert_list(void) { cert_list *list = (cert_list *)malloc(sizeof(*list)); if (!list) @@ -575,19 +582,15 @@ return NULL; } - list->host_priv_key = NULL; - list->host_cert = NULL; - list->host_nonce = NULL; - list->host_key_point = NULL; - list->next = 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, const char *host_priv_key, - const char *host_cert, const char *host_nonce, - const char *host_key_point) +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) { @@ -595,14 +598,10 @@ return NULL; } - list->host_priv_key = (char*)malloc(strlen(host_priv_key) + 1); - strcpy(list->host_priv_key, host_priv_key); - list->host_cert = (char*)malloc(strlen(host_cert) + 1); - strcpy(list->host_cert, host_cert); - list->host_nonce = (char*)malloc(strlen(host_nonce) + 1); - strcpy(list->host_nonce, host_nonce); - list->host_key_point = (char*)malloc(strlen(host_key_point) + 1); - strcpy(list->host_key_point, host_key_point); + 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(); @@ -610,7 +609,7 @@ } /* Function that returns pointer to new title entry list */ -title_entry_list *new_title_entry_list() +title_entry_list *new_title_entry_list(void) { title_entry_list *list = (title_entry_list *)malloc(sizeof(*list)); if (!list) @@ -619,25 +618,13 @@ return NULL; } - list->entry.discid = NULL; - list->entry.title = NULL; - list->entry.date.year = 0; - list->entry.date.month = 0; - list->entry.date.day = 0; - list->entry.mek = NULL; - list->entry.vid = NULL; - list->entry.bn = NULL; - list->entry.vuk = NULL; - list->entry.pak = NULL; - list->entry.tk = NULL; - list->entry.uk = NULL; - list->next = 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, const char *entry) +static int add_entry(title_entry_list *list, int type, char *entry) { if (!list) { @@ -648,31 +635,33 @@ switch (type) { case ENTRY_TYPE_DISCID: - list->entry.discid = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.discid, entry); + 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: - list->entry.mek = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.mek, entry); + X_FREE(list->entry.mek); + list->entry.mek = entry; break; case ENTRY_TYPE_VID: - list->entry.vid = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.vid, entry); + X_FREE(list->entry.vid); + list->entry.vid = entry; break; case ENTRY_TYPE_VUK: - list->entry.vuk = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.vuk, entry); + X_FREE(list->entry.vuk); + list->entry.vuk = entry; break; default: + X_FREE(entry); printf("WARNING: entry type passed in unknown\n"); return 0; } @@ -681,7 +670,7 @@ } /* Function that returns pointer to new digit key pair list */ -static digit_key_pair_list *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) @@ -690,16 +679,14 @@ return NULL; } - list->key_pair.digit = 0; - list->key_pair.key = NULL; - list->next = 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, const char *key) + int type, unsigned int digit, char *key) { if (!list) { @@ -708,8 +695,7 @@ } list->key_pair.digit = digit; - list->key_pair.key = (char*)malloc(strlen(key) + 1); - strcpy(list->key_pair.key, key); + list->key_pair.key = key; list->next = new_digit_key_pair_list();
View file
libaacs-0.3.0.tar.bz2/src/file/keydbcfg.c -> libaacs-0.6.0.tar.bz2/src/file/keydbcfg.c
Changed
@@ -19,16 +19,21 @@ #include "keydbcfg.h" -#ifndef _WIN32 -# 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 -#else +#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 "util/strutl.h" @@ -38,7 +43,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> - #include <sys/types.h> #include <sys/stat.h> @@ -244,7 +248,7 @@ return result; } -int keydbcfg_load_pk_file(config_file *cf) +static int _load_pk_file(config_file *cf) { static const char pk_file_name = PK_FILE_NAME; FILE *fp; @@ -265,7 +269,7 @@ return result; } -int keydbcfg_load_cert_file(config_file *cf) +static int _load_cert_file(config_file *cf) { static const char cert_file_name = CERT_FILE_NAME; FILE *fp; @@ -317,7 +321,7 @@ return result; } -char *_keycache_file(const char *type, const uint8_t *disc_id) +static char *_keycache_file(const char *type, const uint8_t *disc_id) { const char *cache_dir = get_cache_home(); char disc_id_str41; @@ -402,7 +406,134 @@ return result; } -char *keydbcfg_find_config_file(void) +static char *_cache_file(const char *name) +{ + const char *cache_dir = get_cache_home(); + + if (!cache_dir) { + return NULL; + } + + return str_printf("%s/%s/%s", cache_dir, CFG_DIR, name); +} + +int cache_save(const char *name, uint32_t version, const void *data, uint32_t len) +{ + int result = 0; + char *file = _cache_file(name); + + if (file) { + if (_mkpath(file)) { + FILE *fp = fopen(file, "w"); + + if (fp) { + if (fwrite(&version, 1, 4, fp) == 4 && + fwrite(&len, 1, 4, fp) == 4 && + fwrite(data, 1, len, fp) == len) { + DEBUG(DBG_FILE, "Wrote %d bytes to %s\n", len + 8, file); + result = 1; + + } else { + DEBUG(DBG_FILE, "Error writing to %s\n", file); + } + + fclose(fp); + } + } + + X_FREE(file); + } + + return result; +} + +int cache_get(const char *name, uint32_t *version, uint32_t *len, void *buf) +{ + int result = 0; + char *file = _cache_file(name); + + *version = 0; + if (len) { + *len = 0; + } + + if (file) { + FILE *fp = fopen(file, "r"); + + if (fp) { + DEBUG(DBG_FILE, "Reading %s\n", file); + + if (fread(version, 1, 4, fp) == 4 && + (!len || fread(len, 1, 4, fp) == 4) && + (!buf || fread(buf, 1, *len, fp) == *len)) { + + DEBUG(DBG_FILE, "Read %d bytes from %s, version %d\n", 4 + (len ? 4 : 0) + (buf ? *len : 0), file, *version); + result = 1; + + } else { + DEBUG(DBG_FILE, "Error reading from %s\n", file); + } + + fclose(fp); + + } else { + DEBUG(DBG_FILE, "%s not found\n", file); + } + + X_FREE(file); + } + + return result; +} + +int cache_remove(const char *name) +{ + char *file = _cache_file(name); + int result = !remove(name); + if (!result) { + DEBUG(DBG_FILE, "Error removing %s\n", file); + } + X_FREE(file); + return result; +} + +void *cache_get_or_update(const char *type, const void *data, uint32_t *len, uint32_t version) +{ + uint32_t cache_len, cache_version; + uint8_t *cache_data = NULL; + + /* get cache version */ + cache_get(type, &cache_version, &cache_len, NULL); + + /* if cached data is later, use it */ + if (cache_len && cache_version > version) { + cache_data = malloc(cache_len); + + if (cache_get(type, &cache_version, &cache_len, cache_data)) { + DEBUG(DBG_AACS, "Using cached %s. Version: %d\n", type, cache_version); + *len = cache_len; + return cache_data; + } + + /* read failed, fall back to older version */ + X_FREE(cache_data); + } + + if (data) { + cache_data = malloc(*len); + memcpy(cache_data, data, *len); + + /* cached data is older, update cache */ + if (cache_version < version) { + cache_save(type, version, data, *len); + DEBUG(DBG_AACS, "Updated cached %s. Version: %d\n", type, version); + } + } + + return cache_data; +} + +static char *_find_config_file(void) { static const char cfg_file_name = CFG_FILE_NAME; @@ -422,3 +553,37 @@ return cfg_file; } +config_file *keydbcfg_config_load(const char *configfile_path) +{ + int config_ok = 0; + + config_file *cf = keydbcfg_new_config_file(); + + /* try to load KEYDB.cfg */ + + if (configfile_path) { + config_ok = keydbcfg_parse_config(cf, configfile_path); + + } else { + /* If no configfile path given, check for config files in user's home or + * under /etc. + */ + char *cfgfile = _find_config_file(); + config_ok = keydbcfg_parse_config(cf, cfgfile); + X_FREE(cfgfile); + } + + /* Try to load simple (aacskeys) config files */ + + config_ok = _load_pk_file(cf) || config_ok; + config_ok = _load_cert_file(cf) || config_ok; + + if (!config_ok) { + DEBUG(DBG_AACS | DBG_CRIT, "No valid AACS configuration files found\n"); + keydbcfg_config_file_close(cf); + return NULL; + } + + return cf; +} +
View file
libaacs-0.3.0.tar.bz2/src/file/keydbcfg.h -> libaacs-0.6.0.tar.bz2/src/file/keydbcfg.h
Changed
@@ -113,18 +113,22 @@ /* Functions used throughout the parser */ AACS_PRIVATE int keydbcfg_parse_config(config_file *cfgfile, const char *path); -AACS_PRIVATE config_file *keydbcfg_new_config_file(); +AACS_PRIVATE config_file *keydbcfg_new_config_file(void); AACS_PRIVATE int keydbcfg_config_file_close(config_file *cfgfile); /* */ -AACS_PRIVATE char *keydbcfg_find_config_file(void); -AACS_PRIVATE int keydbcfg_load_cert_file(config_file *cf); -AACS_PRIVATE int keydbcfg_load_pk_file(config_file *cf); +AACS_PRIVATE config_file *keydbcfg_config_load(const char *configfile_path); AACS_PRIVATE int keycache_save(const char *type, const uint8_t *disc_id, const uint8_t *key, unsigned int len); AACS_PRIVATE int keycache_find(const char *type, const uint8_t *disc_id, uint8_t *key, unsigned int len); +AACS_PRIVATE int cache_get(const char *name, uint32_t *version, uint32_t *len, void *buf); /* use buf=NULL to get version and size */ +AACS_PRIVATE int cache_save(const char *name, uint32_t version, const void *data, uint32_t len); +AACS_PRIVATE int cache_remove(const char *name); + +AACS_PRIVATE void *cache_get_or_update(const char *type, const void *data, uint32_t *len, uint32_t version); + #endif
View file
libaacs-0.3.0.tar.bz2/src/keydbcfg-lexer.c -> libaacs-0.6.0.tar.bz2/src/keydbcfg-lexer.c
Changed
@@ -595,13 +595,21 @@ #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 @@ -609,7 +617,7 @@ */ #define YY_NO_INPUT 1 -#line 613 "keydbcfg-lexer.c" +#line 621 "keydbcfg-lexer.c" #define INITIAL 0 #define TITLE_STATE 1 @@ -846,9 +854,9 @@ register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 80 "keydbcfg-lexer.l" +#line 88 "keydbcfg-lexer.l" -#line 852 "keydbcfg-lexer.c" +#line 860 "keydbcfg-lexer.c" yylval = yylval_param; @@ -947,14 +955,15 @@ case 1: YY_RULE_SETUP -#line 81 "keydbcfg-lexer.l" +#line 89 "keydbcfg-lexer.l" {} YY_BREAK case 2: YY_RULE_SETUP -#line 83 "keydbcfg-lexer.l" +#line 91 "keydbcfg-lexer.l" { - yylval->string = trim_string(yytext); + //yylval->string = trim_string(yytext); + yylval->string = yytext; BEGIN INITIAL; return DISC_TITLE; } @@ -962,7 +971,7 @@ case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 88 "keydbcfg-lexer.l" +#line 97 "keydbcfg-lexer.l" { printf("Bad entry at line %u!\n", yylineno); BEGIN INITIAL; @@ -971,7 +980,7 @@ YY_BREAK case 4: YY_RULE_SETUP -#line 94 "keydbcfg-lexer.l" +#line 103 "keydbcfg-lexer.l" { /* strip the '0x' portion of hexstring */ yylval->string = yytext + 2; @@ -980,7 +989,7 @@ YY_BREAK case 5: YY_RULE_SETUP -#line 99 "keydbcfg-lexer.l" +#line 108 "keydbcfg-lexer.l" { yylval->digit = (unsigned int)atoi(yytext); return DIGIT; @@ -988,132 +997,132 @@ YY_BREAK case 6: YY_RULE_SETUP -#line 104 "keydbcfg-lexer.l" +#line 113 "keydbcfg-lexer.l" { return KEYWORD_DEVICE_KEY; } YY_BREAK case 7: YY_RULE_SETUP -#line 105 "keydbcfg-lexer.l" +#line 114 "keydbcfg-lexer.l" { return KEYWORD_DEVICE_NODE; } YY_BREAK case 8: YY_RULE_SETUP -#line 106 "keydbcfg-lexer.l" +#line 115 "keydbcfg-lexer.l" { return KEYWORD_HOST_PRIV_KEY; } YY_BREAK case 9: YY_RULE_SETUP -#line 107 "keydbcfg-lexer.l" +#line 116 "keydbcfg-lexer.l" { return KEYWORD_HOST_CERT; } YY_BREAK case 10: YY_RULE_SETUP -#line 108 "keydbcfg-lexer.l" +#line 117 "keydbcfg-lexer.l" { return KEYWORD_HOST_NONCE; } YY_BREAK case 11: YY_RULE_SETUP -#line 109 "keydbcfg-lexer.l" +#line 118 "keydbcfg-lexer.l" { return KEYWORD_HOST_KEY_POINT; } YY_BREAK case 12: YY_RULE_SETUP -#line 111 "keydbcfg-lexer.l" +#line 120 "keydbcfg-lexer.l" { return ENTRY_ID_DK; } YY_BREAK case 13: YY_RULE_SETUP -#line 112 "keydbcfg-lexer.l" +#line 121 "keydbcfg-lexer.l" { return ENTRY_ID_PK; } YY_BREAK case 14: YY_RULE_SETUP -#line 113 "keydbcfg-lexer.l" +#line 122 "keydbcfg-lexer.l" { return ENTRY_ID_HC; } YY_BREAK case 15: YY_RULE_SETUP -#line 114 "keydbcfg-lexer.l" +#line 123 "keydbcfg-lexer.l" { return ENTRY_ID_DATE; } YY_BREAK case 16: YY_RULE_SETUP -#line 115 "keydbcfg-lexer.l" +#line 124 "keydbcfg-lexer.l" { return ENTRY_ID_MEK; } YY_BREAK case 17: YY_RULE_SETUP -#line 116 "keydbcfg-lexer.l" +#line 125 "keydbcfg-lexer.l" { return ENTRY_ID_VID; } YY_BREAK case 18: YY_RULE_SETUP -#line 117 "keydbcfg-lexer.l" +#line 126 "keydbcfg-lexer.l" { return ENTRY_ID_BN; } YY_BREAK case 19: YY_RULE_SETUP -#line 118 "keydbcfg-lexer.l" +#line 127 "keydbcfg-lexer.l" { return ENTRY_ID_VUK; } YY_BREAK case 20: YY_RULE_SETUP -#line 119 "keydbcfg-lexer.l" +#line 128 "keydbcfg-lexer.l" { return ENTRY_ID_PAK; } YY_BREAK case 21: YY_RULE_SETUP -#line 120 "keydbcfg-lexer.l" +#line 129 "keydbcfg-lexer.l" { return ENTRY_ID_TK; } YY_BREAK case 22: YY_RULE_SETUP -#line 121 "keydbcfg-lexer.l" +#line 130 "keydbcfg-lexer.l" { return ENTRY_ID_UK; } YY_BREAK case 23: YY_RULE_SETUP -#line 123 "keydbcfg-lexer.l" +#line 132 "keydbcfg-lexer.l" { BEGIN TITLE_STATE; return PUNCT_EQUALS_SIGN; } YY_BREAK case 24: YY_RULE_SETUP -#line 124 "keydbcfg-lexer.l" +#line 133 "keydbcfg-lexer.l" { return PUNCT_VERTICAL_BAR; } YY_BREAK case 25: YY_RULE_SETUP -#line 125 "keydbcfg-lexer.l" +#line 134 "keydbcfg-lexer.l" { return PUNCT_HYPHEN; } YY_BREAK case 26: /* rule 26 can match eol */ YY_RULE_SETUP -#line 127 "keydbcfg-lexer.l" +#line 136 "keydbcfg-lexer.l" {} YY_BREAK case 27: /* rule 27 can match eol */ YY_RULE_SETUP -#line 128 "keydbcfg-lexer.l" +#line 137 "keydbcfg-lexer.l" { return NEWLINE; } YY_BREAK case 28: YY_RULE_SETUP -#line 130 "keydbcfg-lexer.l" +#line 139 "keydbcfg-lexer.l" {} YY_BREAK case 29: YY_RULE_SETUP -#line 131 "keydbcfg-lexer.l" +#line 140 "keydbcfg-lexer.l" { return BAD_ENTRY; } YY_BREAK case 30: YY_RULE_SETUP -#line 132 "keydbcfg-lexer.l" +#line 141 "keydbcfg-lexer.l" ECHO; YY_BREAK -#line 1117 "keydbcfg-lexer.c" +#line 1126 "keydbcfg-lexer.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(TITLE_STATE): yyterminate(); @@ -2250,9 +2259,10 @@ #define YYTABLES_NAME "yytables" -#line 132 "keydbcfg-lexer.l" +#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) { @@ -2269,4 +2279,4 @@ new_stringsize = '\0'; return new_string; } - +#endif
View file
libaacs-0.3.0.tar.bz2/src/keydbcfg-parser.c -> libaacs-0.6.0.tar.bz2/src/keydbcfg-parser.c
Changed
@@ -73,99 +73,9 @@ /* Copy the first part of user declarations. */ -/* Line 268 of yacc.c */ -#line 1 "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 "file/keydbcfg.h" -#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 "-Wredundant-decls" -#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#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 *next = X->next; \ - X_FREE(X->key_pair.key); \ - X_FREE(X); \ - X = next; \ - } \ -} 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(); -static dk_list *add_dk_list_entry(dk_list *list, const char *key, - const char *node); -static pk_list *new_pk_list(); -static pk_list *add_pk_list_entry(pk_list *list, const char *key); -static cert_list *new_cert_list(); -static cert_list *add_cert_list(cert_list *list, const char *host_priv_key, - const char *host_cert, const char *host_nonce, - const char *host_key_point); -static title_entry_list *new_title_entry_list(); -static int add_entry(title_entry_list *list, int type, const char *entry); -static digit_key_pair_list *new_digit_key_pair_list(); -static digit_key_pair_list *add_digit_key_pair_entry(digit_key_pair_list *list, - int type, unsigned int digit, const 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 268 of yacc.c */ -#line 169 "keydbcfg-parser.c" +#line 79 "keydbcfg-parser.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -185,6 +95,17 @@ # 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 @@ -254,7 +175,7 @@ { /* Line 293 of yacc.c */ -#line 106 "keydbcfg-parser.y" +#line 108 "keydbcfg-parser.y" char *string; unsigned int digit; @@ -262,7 +183,7 @@ /* Line 293 of yacc.c */ -#line 266 "keydbcfg-parser.c" +#line 187 "keydbcfg-parser.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -274,7 +195,101 @@ /* Line 343 of yacc.c */ -#line 278 "keydbcfg-parser.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 @@ -588,13 +603,13 @@ /* YYRLINEYYN -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline = { - 0, 146, 146, 147, 148, 149, 153, 154, 158, 159, - 160, 161, 162, 171, 175, 182, 187, 192, 196, 203, - 207, 214, 219, 224, 229, 234, 239, 247, 248, 252, - 260, 264, 268, 269, 273, 274, 275, 276, 277, 278, - 279, 280, 284, 291, 298, 305, 312, 313, 317, 329, - 336, 343, 344, 348, 360, 367, 368, 372, 384, 391, - 392, 396, 408, 416 + 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 @@ -1651,7 +1666,7 @@ case 12: /* Line 1806 of yacc.c */ -#line 163 "keydbcfg-parser.y" +#line 165 "keydbcfg-parser.y" { fprintf(stderr, "bad entry at or around line %d\n", libaacs_yyget_lineno(scanner) - 1); @@ -1662,7 +1677,7 @@ case 13: /* Line 1806 of yacc.c */ -#line 172 "keydbcfg-parser.y" +#line 174 "keydbcfg-parser.y" { dklist = add_dk_list_entry(dklist, (yyvsp(3) - (6).string), (yyvsp(5) - (6).string)); } @@ -1671,7 +1686,7 @@ case 14: /* Line 1806 of yacc.c */ -#line 176 "keydbcfg-parser.y" +#line 178 "keydbcfg-parser.y" { dklist = add_dk_list_entry(dklist, (yyvsp(2) - (5).string), (yyvsp(4) - (5).string)); } @@ -1680,21 +1695,21 @@ case 15: /* Line 1806 of yacc.c */ -#line 183 "keydbcfg-parser.y" +#line 185 "keydbcfg-parser.y" { (yyval.string) = (yyvsp(2) - (2).string); } break; case 16: /* Line 1806 of yacc.c */ -#line 188 "keydbcfg-parser.y" +#line 190 "keydbcfg-parser.y" { (yyval.string) = (yyvsp(2) - (2).string); } break; case 17: /* Line 1806 of yacc.c */ -#line 193 "keydbcfg-parser.y" +#line 195 "keydbcfg-parser.y" { pklist = add_pk_list_entry(pklist, (yyvsp(3) - (4).string)); } @@ -1703,7 +1718,7 @@ case 18: /* Line 1806 of yacc.c */ -#line 197 "keydbcfg-parser.y" +#line 199 "keydbcfg-parser.y" { pklist = add_pk_list_entry(pklist, (yyvsp(2) - (3).string)); } @@ -1712,7 +1727,7 @@ case 19: /* Line 1806 of yacc.c */ -#line 204 "keydbcfg-parser.y" +#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)); } @@ -1721,7 +1736,7 @@ case 20: /* Line 1806 of yacc.c */ -#line 208 "keydbcfg-parser.y" +#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)); } @@ -1730,35 +1745,35 @@ case 21: /* Line 1806 of yacc.c */ -#line 215 "keydbcfg-parser.y" +#line 217 "keydbcfg-parser.y" { (yyval.string) = (yyvsp(2) - (2).string); } break; case 22: /* Line 1806 of yacc.c */ -#line 220 "keydbcfg-parser.y" +#line 222 "keydbcfg-parser.y" { (yyval.string) = (yyvsp(2) - (2).string); } break; case 23: /* Line 1806 of yacc.c */ -#line 225 "keydbcfg-parser.y" +#line 227 "keydbcfg-parser.y" { (yyval.string) = (yyvsp(2) - (2).string); } break; case 24: /* Line 1806 of yacc.c */ -#line 230 "keydbcfg-parser.y" +#line 232 "keydbcfg-parser.y" { (yyval.string) = (yyvsp(2) - (2).string); } break; case 25: /* Line 1806 of yacc.c */ -#line 235 "keydbcfg-parser.y" +#line 237 "keydbcfg-parser.y" { celist->next = new_title_entry_list(); celist = celist->next; @@ -1768,7 +1783,7 @@ case 26: /* Line 1806 of yacc.c */ -#line 240 "keydbcfg-parser.y" +#line 242 "keydbcfg-parser.y" { celist->next = new_title_entry_list(); celist = celist->next; @@ -1778,7 +1793,7 @@ case 29: /* Line 1806 of yacc.c */ -#line 253 "keydbcfg-parser.y" +#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)); @@ -1788,7 +1803,7 @@ case 42: /* Line 1806 of yacc.c */ -#line 285 "keydbcfg-parser.y" +#line 287 "keydbcfg-parser.y" { add_date_entry(celist, (yyvsp(2) - (6).digit), (yyvsp(4) - (6).digit), (yyvsp(6) - (6).digit)); } @@ -1797,7 +1812,7 @@ case 43: /* Line 1806 of yacc.c */ -#line 292 "keydbcfg-parser.y" +#line 294 "keydbcfg-parser.y" { add_entry(celist, ENTRY_TYPE_MEK, (yyvsp(2) - (2).string)); } @@ -1806,7 +1821,7 @@ case 44: /* Line 1806 of yacc.c */ -#line 299 "keydbcfg-parser.y" +#line 301 "keydbcfg-parser.y" { add_entry(celist, ENTRY_TYPE_VID, (yyvsp(2) - (2).string)); } @@ -1815,7 +1830,7 @@ case 45: /* Line 1806 of yacc.c */ -#line 306 "keydbcfg-parser.y" +#line 308 "keydbcfg-parser.y" { dkplist = NULL; } @@ -1824,11 +1839,11 @@ case 48: /* Line 1806 of yacc.c */ -#line 318 "keydbcfg-parser.y" +#line 320 "keydbcfg-parser.y" { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*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)); @@ -1838,7 +1853,7 @@ case 49: /* Line 1806 of yacc.c */ -#line 330 "keydbcfg-parser.y" +#line 332 "keydbcfg-parser.y" { add_entry(celist, ENTRY_TYPE_VUK, (yyvsp(2) - (2).string)); } @@ -1847,7 +1862,7 @@ case 50: /* Line 1806 of yacc.c */ -#line 337 "keydbcfg-parser.y" +#line 339 "keydbcfg-parser.y" { dkplist = NULL; } @@ -1856,11 +1871,11 @@ case 53: /* Line 1806 of yacc.c */ -#line 349 "keydbcfg-parser.y" +#line 351 "keydbcfg-parser.y" { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*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)); @@ -1870,7 +1885,7 @@ case 54: /* Line 1806 of yacc.c */ -#line 361 "keydbcfg-parser.y" +#line 363 "keydbcfg-parser.y" { dkplist = NULL; } @@ -1879,11 +1894,11 @@ case 57: /* Line 1806 of yacc.c */ -#line 373 "keydbcfg-parser.y" +#line 375 "keydbcfg-parser.y" { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*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)); @@ -1893,7 +1908,7 @@ case 58: /* Line 1806 of yacc.c */ -#line 385 "keydbcfg-parser.y" +#line 387 "keydbcfg-parser.y" { dkplist = NULL; } @@ -1902,11 +1917,11 @@ case 61: /* Line 1806 of yacc.c */ -#line 397 "keydbcfg-parser.y" +#line 399 "keydbcfg-parser.y" { if (!dkplist) { - dkplist = (digit_key_pair_list *)malloc(sizeof(*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)); @@ -1916,7 +1931,7 @@ case 62: /* Line 1806 of yacc.c */ -#line 409 "keydbcfg-parser.y" +#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)); @@ -1929,7 +1944,7 @@ case 63: /* Line 1806 of yacc.c */ -#line 417 "keydbcfg-parser.y" +#line 419 "keydbcfg-parser.y" { char *str = (char*)malloc(strlen((yyvsp(1) - (1).string)) + 1); strcpy(str, (yyvsp(1) - (1).string)); @@ -1940,7 +1955,7 @@ /* Line 1806 of yacc.c */ -#line 1944 "keydbcfg-parser.c" +#line 1959 "keydbcfg-parser.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2171,7 +2186,7 @@ /* Line 2067 of yacc.c */ -#line 423 "keydbcfg-parser.y" +#line 425 "keydbcfg-parser.y" /* Function to parse a config file */ int keydbcfg_parse_config(config_file *cfgfile, const char *path) @@ -2201,6 +2216,8 @@ cfgfile->host_cert_list = head_clist; cfgfile->list = head_celist; + fclose(fp); + if (retval) return 0; @@ -2208,11 +2225,10 @@ } /* Function that returns pointer to new config file object */ -config_file *keydbcfg_new_config_file() +config_file *keydbcfg_new_config_file(void) { config_file *cfgfile = (config_file *)malloc(sizeof(*cfgfile)); - cfgfile->pkl = NULL; - cfgfile->list = NULL; + memset(cfgfile, 0, sizeof(*cfgfile)); return cfgfile; } @@ -2228,6 +2244,15 @@ 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) { @@ -2264,17 +2289,15 @@ } /* Function to return new dk_list object */ -static dk_list *new_dk_list() +static dk_list *new_dk_list(void) { dk_list *dkl = (dk_list *)malloc(sizeof(*dkl)); - dkl->key = NULL; - dkl->next = NULL; + memset(dkl, 0, sizeof(*dkl)); return dkl; } /* Function to add dk to config file */ -static dk_list *add_dk_list_entry(dk_list *list, const char *key, - const char *node) +static dk_list *add_dk_list_entry(dk_list *list, char *key, char *node) { if (!list) { @@ -2282,26 +2305,25 @@ return NULL; } - list->key = (char*)malloc(strlen(key) + 1); - strcpy(list->key, key); + 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() +static pk_list *new_pk_list(void) { pk_list *pkl = (pk_list *)malloc(sizeof(*pkl)); - pkl->key = NULL; - pkl->next = NULL; + memset(pkl, 0, sizeof(*pkl)); return pkl; } /* Function to add pk to config file */ -static pk_list *add_pk_list_entry(pk_list *list, const char *key) +static pk_list *add_pk_list_entry(pk_list *list, char *key) { if (!list) { @@ -2309,16 +2331,14 @@ return NULL; } - list->key = (char*)malloc(strlen(key) + 1); - strcpy(list->key, key); - + list->key = key; list->next = new_pk_list(); return list->next; } /* Function to create new certificate list */ -static cert_list *new_cert_list() +static cert_list *new_cert_list(void) { cert_list *list = (cert_list *)malloc(sizeof(*list)); if (!list) @@ -2327,19 +2347,15 @@ return NULL; } - list->host_priv_key = NULL; - list->host_cert = NULL; - list->host_nonce = NULL; - list->host_key_point = NULL; - list->next = 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, const char *host_priv_key, - const char *host_cert, const char *host_nonce, - const char *host_key_point) +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) { @@ -2347,14 +2363,10 @@ return NULL; } - list->host_priv_key = (char*)malloc(strlen(host_priv_key) + 1); - strcpy(list->host_priv_key, host_priv_key); - list->host_cert = (char*)malloc(strlen(host_cert) + 1); - strcpy(list->host_cert, host_cert); - list->host_nonce = (char*)malloc(strlen(host_nonce) + 1); - strcpy(list->host_nonce, host_nonce); - list->host_key_point = (char*)malloc(strlen(host_key_point) + 1); - strcpy(list->host_key_point, host_key_point); + 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(); @@ -2362,7 +2374,7 @@ } /* Function that returns pointer to new title entry list */ -title_entry_list *new_title_entry_list() +title_entry_list *new_title_entry_list(void) { title_entry_list *list = (title_entry_list *)malloc(sizeof(*list)); if (!list) @@ -2371,25 +2383,13 @@ return NULL; } - list->entry.discid = NULL; - list->entry.title = NULL; - list->entry.date.year = 0; - list->entry.date.month = 0; - list->entry.date.day = 0; - list->entry.mek = NULL; - list->entry.vid = NULL; - list->entry.bn = NULL; - list->entry.vuk = NULL; - list->entry.pak = NULL; - list->entry.tk = NULL; - list->entry.uk = NULL; - list->next = 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, const char *entry) +static int add_entry(title_entry_list *list, int type, char *entry) { if (!list) { @@ -2400,31 +2400,33 @@ switch (type) { case ENTRY_TYPE_DISCID: - list->entry.discid = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.discid, entry); + 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: - list->entry.mek = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.mek, entry); + X_FREE(list->entry.mek); + list->entry.mek = entry; break; case ENTRY_TYPE_VID: - list->entry.vid = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.vid, entry); + X_FREE(list->entry.vid); + list->entry.vid = entry; break; case ENTRY_TYPE_VUK: - list->entry.vuk = (char*)malloc(strlen(entry) + 1); - strcpy(list->entry.vuk, entry); + X_FREE(list->entry.vuk); + list->entry.vuk = entry; break; default: + X_FREE(entry); printf("WARNING: entry type passed in unknown\n"); return 0; } @@ -2433,7 +2435,7 @@ } /* Function that returns pointer to new digit key pair list */ -static digit_key_pair_list *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) @@ -2442,16 +2444,14 @@ return NULL; } - list->key_pair.digit = 0; - list->key_pair.key = NULL; - list->next = 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, const char *key) + int type, unsigned int digit, char *key) { if (!list) { @@ -2460,8 +2460,7 @@ } list->key_pair.digit = digit; - list->key_pair.key = (char*)malloc(strlen(key) + 1); - strcpy(list->key_pair.key, key); + list->key_pair.key = key; list->next = new_digit_key_pair_list();
View file
libaacs-0.3.0.tar.bz2/src/libaacs/aacs-version.h -> libaacs-0.6.0.tar.bz2/src/libaacs/aacs-version.h
Changed
@@ -26,10 +26,10 @@ ((micro) * 1)) #define AACS_VERSION_MAJOR 0 -#define AACS_VERSION_MINOR 3 +#define AACS_VERSION_MINOR 6 #define AACS_VERSION_MICRO 0 -#define AACS_VERSION_STRING "0.3.0" +#define AACS_VERSION_STRING "0.6.0" #define AACS_VERSION \ AACS_VERSION_CODE(AACS_VERSION_MAJOR, AACS_VERSION_MINOR, AACS_VERSION_MICRO)
View file
libaacs-0.3.0.tar.bz2/src/libaacs/aacs.c -> libaacs-0.6.0.tar.bz2/src/libaacs/aacs.c
Changed
@@ -45,13 +45,25 @@ struct aacs { - uint8_t pk16, mk16, vuk16, vid16, disc_id20, *uks; - uint32_t num_uks; - struct config_file_t *cf; - struct title_entry_list_t *ce; + /* current disc */ + char *path; + int mkb_version; + uint8_t disc_id20; - uint32_t num_titles; - uint16_t current_cps_unit; + /* VID is cached for BD-J */ + uint8_t vid16; + /* PMSN is cached for BD-J */ + uint8_t pmsn16; + + /* unit key for each CPS unit */ + uint32_t num_uks; + uint8_t *uks; + + /* CPS unit of currently selected title */ + uint16_t current_cps_unit; + + /* title -> CPS unit mappings */ + uint32_t num_titles; uint16_t *cps_units; /* 0 = first play ; 1 = top menu ; 2 = title 1 ... */ }; @@ -63,7 +75,7 @@ uint8_t *mk) { gcry_cipher_hd_t gcry_h; - int a, ret = 0; + int a; uint8_t dec_vd16; char str40; @@ -87,13 +99,53 @@ if (!memcmp(dec_vd, "\x01\x23\x45\x67\x89\xAB\xCD\xEF", 8)) { DEBUG(DBG_AACS, "Processing key %s is valid!\n", print_hex(str, pk, 16)); - ret = 1; + return AACS_SUCCESS; + } + + return AACS_ERROR_NO_PK; +} + +static int _rl_verify_signature(const uint8_t *rl, size_t size) +{ + int entries = MKINT_BE32(rl + 12 + 8); + size_t len = 12 + 12 + 8 * entries; /* type_and_version_rec=12, rl_header=12, rl=entries*8 */ + + if (len + 40 > size) { + DEBUG(DBG_AACS, "revocation list size mismatch\n"); + return 0; } - return ret; + return crypto_aacs_verify_aacsla(rl + len, rl, len); +} + +static void _update_drl(MKB *mkb) +{ + uint32_t version = mkb_version(mkb); + uint32_t cache_version; + + 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"); + } else { + cache_save("drl", version, data, drl_len + 12); + } + X_FREE(data); + } + } } -static int _calc_mk(AACS *aacs, const char *path) +static int _calc_mk(AACS *aacs, uint8_t *mk, pk_list *pkl) { int a, num_uvs = 0; size_t len; @@ -102,13 +154,16 @@ const uint8_t *rec, *uvs; /* Skip if retrieved from config file */ - if (memcmp(aacs->mk, empty_key, 16)) - return 1; + if (memcmp(mk, empty_key, 16)) { + return AACS_SUCCESS; + } DEBUG(DBG_AACS, "Calculate media key...\n"); - if ((mkb = mkb_open(path))) { + if ((mkb = mkb_open(aacs->path))) { DEBUG(DBG_AACS, "Get UVS...\n"); + _update_drl(mkb); + aacs->mkb_version = mkb_version(mkb); uvs = mkb_subdiff_records(mkb, &len); rec = uvs; while (rec < uvs + len) { @@ -120,134 +175,208 @@ DEBUG(DBG_AACS, "Get cvalues...\n"); rec = mkb_cvalues(mkb, &len); - if (aacs->cf->pkl) { - pk_list *pkcursor = aacs->cf->pkl; - while (pkcursor && pkcursor->key) { - hexstring_to_hex_array(aacs->pk, sizeof(aacs->pk), - pkcursor->key); + + for (; pkl && pkl->key; pkl = pkl->next) { + uint8_t pk16; + hexstring_to_hex_array(pk, sizeof(pk), pkl->key); DEBUG(DBG_AACS, "Trying processing key...\n"); for (a = 0; a < num_uvs; a++) { - if (_validate_pk(aacs->pk, rec + a * 16, uvs + 1 + a * 5, - mkb_mk_dv(mkb), aacs->mk)) { + if (AACS_SUCCESS == _validate_pk(pk, 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, aacs->mk, - 16)); - return 1; + DEBUG(DBG_AACS, "Media key: %s\n", print_hex(str, mk, 16)); + return AACS_SUCCESS; } } - - pkcursor = pkcursor->next; } - } 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; } - DEBUG(DBG_AACS, "Error calculating media key!\n"); + DEBUG(DBG_AACS | DBG_CRIT, "Error opening %s/AACS/MKB_RO.inf\n", aacs->path); + return AACS_ERROR_CORRUPTED_DISC; +} - return 0; +static MKB *_get_hrl_mkb(MMC *mmc) +{ + MKB *mkb = NULL; + uint8_t *data; + int mkb_size; + + data = mmc_read_mkb(mmc, 0, &mkb_size); + + /* check acquired hrl signature */ + if (data && mkb_size > 0) { + if (_rl_verify_signature(data, mkb_size)) { + mkb = mkb_init(data, mkb_size); + DEBUG(DBG_AACS, "Partial hrl mkb read. Version: %d\n", mkb_version(mkb)); + } else { + DEBUG(DBG_AACS | DBG_CRIT, "invalid host revocation list signature, not using it\n"); + X_FREE(data); + } + } + + if (mkb) { + /* use latest version, keep cache up-to-date */ + uint32_t size; + size = mkb_data_size(mkb); + 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"); + cache_save("hrl", mkb_version(mkb), mkb_data(mkb), mkb_data_size(mkb)); + X_FREE(data); + } else { + /* use cached version */ + mkb_close(mkb); + mkb = mkb_init(data, size); + } + + } else { + /* use cached version */ + uint32_t size; + data = cache_get_or_update("hrl", NULL, &size, 0); + if (data && size > 0) { + 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"); + cache_remove("hrl"); + } + } + } + + + if (mkb) { + DEBUG(DBG_AACS, "Using hrl version %d\n", mkb_version(mkb)); + } + + return mkb; } -static int _read_vid(AACS *aacs, const char *path) +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 1; + return AACS_SUCCESS; } MMC* mmc = NULL; - if (!(mmc = mmc_open(path))) { - return 0; + if (!(mmc = mmc_open(aacs->path))) { + return AACS_ERROR_MMC_OPEN; } - cert_list *hccursor = aacs->cf->host_cert_list; - while (hccursor && hccursor->host_priv_key && hccursor->host_cert) { + int error_code = AACS_ERROR_NO_CERT; + + MKB *hrl_mkb = _get_hrl_mkb(mmc); + + for (;hcl && hcl->host_priv_key && hcl->host_cert; hcl = hcl->next) { char tmp_str2*92+1; uint8_t priv_key20, cert92; - hexstring_to_hex_array(priv_key, sizeof(priv_key), hccursor->host_priv_key); - hexstring_to_hex_array(cert, sizeof(cert), hccursor->host_cert); + 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)) { - DEBUG(DBG_AACS, "Not using invalid host certificate %s.\n", - print_hex(tmp_str, cert, 92)); + DEBUG(DBG_AACS, "Not using invalid host certificate %s.\n", + print_hex(tmp_str, cert, 92)); + continue; + } - hccursor = hccursor->next; - continue; - } + if (mkb_host_cert_is_revoked(hrl_mkb, cert + 4)) { + DEBUG(DBG_AACS | DBG_CRIT, "Host certificate %s has been revoked.\n", + print_hex(tmp_str, cert + 4, 6)); + error_code = AACS_ERROR_CERT_REVOKED; + //continue; + } DEBUG(DBG_AACS, "Trying host certificate (id 0x%s)...\n", print_hex(tmp_str, cert + 4, 6)); - if (mmc_read_vid(mmc, priv_key, cert, aacs->vid)) { - mmc_close(mmc); - return 1; + int mmc_result = mmc_read_vid(mmc, priv_key, cert, aacs->vid, aacs->pmsn); + switch (mmc_result) { + case MMC_SUCCESS: + mkb_close(hrl_mkb); + mmc_close(mmc); + return AACS_SUCCESS; + case MMC_ERROR_CERT_REVOKED: + error_code = AACS_ERROR_CERT_REVOKED; + break; + case MMC_ERROR: + default: + error_code = AACS_ERROR_MMC_FAILURE; + break; } - - hccursor = hccursor->next; } + mkb_close(hrl_mkb); mmc_close(mmc); DEBUG(DBG_AACS, "Error reading VID!\n"); - return 0; + return error_code; } -static int _calc_vuk(AACS *aacs, const char *path) +static int _calc_vuk(AACS *aacs, uint8_t *mk, uint8_t *vuk, + pk_list *pkl, cert_list *host_cert_list) { + int error_code; + /* Skip if retrieved from config file */ - if (memcmp(aacs->vuk, empty_key, 16)) - return 1; + if (memcmp(vuk, empty_key, 16)) { + DEBUG(DBG_AACS, "Using VUK from config file\n"); + return AACS_SUCCESS; + } /* get cached vuk */ - if (keycache_find("vuk", aacs->disc_id, aacs->vuk, 16)) { + if (keycache_find("vuk", aacs->disc_id, vuk, 16)) { DEBUG(DBG_AACS, "Using cached VUK\n"); - return 1; + return AACS_SUCCESS; } /* make sure we have media key */ - if (!_calc_mk(aacs, path)) { - return 0; + error_code = _calc_mk(aacs, mk, pkl); + if (error_code != AACS_SUCCESS) { + return error_code; } - DEBUG(DBG_AACS, "Calculate volume unique key...\n"); - - if (_read_vid(aacs, path)) { - - int a; - gcry_cipher_hd_t gcry_h; - - gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0); - gcry_cipher_setkey(gcry_h, aacs->mk, 16); - gcry_cipher_decrypt(gcry_h, aacs->vuk, 16, aacs->vid, 16); - gcry_cipher_close(gcry_h); - - for (a = 0; a < 16; a++) { - aacs->vuka ^= aacs->vida; - } + /* acquire VID */ + error_code = _read_vid(aacs, host_cert_list); + if (error_code != AACS_SUCCESS) { + return error_code; + } - char str40; - DEBUG(DBG_AACS, "Volume unique key: %s\n", print_hex(str, aacs->vuk, 16)); + int a; + gcry_cipher_hd_t gcry_h; - /* cache vuk */ - keycache_save("vuk", aacs->disc_id, aacs->vuk, 16); + 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); - return 1; + for (a = 0; a < 16; a++) { + vuka ^= aacs->vida; } - DEBUG(DBG_AACS, "Error calculating VUK!\n"); + char str40; + DEBUG(DBG_AACS, "Volume unique key: %s\n", print_hex(str, vuk, 16)); - return 0; + /* cache vuk */ + keycache_save("vuk", aacs->disc_id, vuk, 16); + + return AACS_SUCCESS; } static uint16_t _read_u16(AACS_FILE_H *fp) { - uint8_t data2; + uint8_t data2 = {0, 0}; file_read(fp, data, sizeof(uint16_t)); @@ -294,84 +423,184 @@ } } -static int _calc_uks(AACS *aacs, const char *path) +static AACS_FILE_H *_open_unit_key_file(const char *path) +{ + AACS_FILE_H *fp; + char *f_name; + + f_name = str_printf("%s/AACS/Unit_Key_RO.inf", path); + fp = file_open(f_name, "rb"); + + if (!fp) { + DEBUG(DBG_AACS | DBG_CRIT, "Error opening unit key file %s\n", f_name); + } + + X_FREE(f_name); + return fp; +} + +/* 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)) { + DEBUG(DBG_AACS, "Found config entry for discid %s\n", + ce->entry.discid); + break; + } + + ce = ce->next; + } + if (!ce) { + return; + } + + if (ce->entry.mek) { + hexstring_to_hex_array(mk, 16, ce->entry.mek); + + DEBUG(DBG_AACS, "Found media key for %s: %s\n", + ce->entry.discid, print_hex(str, mk, 16)); + } + + if (ce->entry.vid) { + hexstring_to_hex_array(aacs->vid, sizeof(aacs->vid), + ce->entry.vid); + + DEBUG(DBG_AACS, "Found volume id for %s: %s\n", + ce->entry.discid, print_hex(str, aacs->vid, 16)); + } + + if (ce->entry.vuk) { + hexstring_to_hex_array(vuk, 16, ce->entry.vuk); + + DEBUG(DBG_AACS, "Found volume unique key for %s: %s\n", + ce->entry.discid, print_hex(str, vuk, 16)); + } + + if (ce->entry.uk) { + DEBUG(DBG_AACS, "Acquire CPS unit keys from keydb config file...\n"); + + digit_key_pair_list *ukcursor = ce->entry.uk; + while (ukcursor && ukcursor->key_pair.key) { + aacs->num_uks++; + + aacs->uks = (uint8_t*)realloc(aacs->uks, 16 * aacs->num_uks); + hexstring_to_hex_array(aacs->uks + (16 * (aacs->num_uks - 1)), 16, + ukcursor->key_pair.key); + + DEBUG(DBG_AACS, "Unit key %d from keydb entry: %s\n", + aacs->num_uks, + print_hex(str, aacs->uks + (16 * (aacs->num_uks - 1)), 16)); + + ukcursor = ukcursor->next; + } + } +} + +static int _calc_uks(AACS *aacs, const char *configfile_path) { AACS_FILE_H *fp = NULL; - char *f_name; uint8_t buf16; uint64_t f_pos; 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); /* Skip if retrieved from config file */ - if (aacs->uks) - return 1; + if (aacs->uks) { + keydbcfg_config_file_close(cf); + return AACS_SUCCESS; + } /* Make sure we have VUK */ - if (!_calc_vuk(aacs, path)) { - return 0; + error_code = _calc_vuk(aacs, mk, vuk, cf->pkl, cf->host_cert_list); + keydbcfg_config_file_close(cf); + if (error_code != AACS_SUCCESS) { + return error_code; } DEBUG(DBG_AACS, "Calculate CPS unit keys...\n"); - f_name = str_printf("%s/AACS/Unit_Key_RO.inf", path); - fp = file_open(f_name, "rb"); - X_FREE(f_name); - - if (fp) { - if ((file_read(fp, buf, 4)) == 4) { - f_pos = MKINT_BE32(buf); - - // Read number of keys - file_seek(fp, f_pos, SEEK_SET); - if ((file_read(fp, buf, 2)) == 2) { - aacs->num_uks = MKINT_BE16(buf); + fp = _open_unit_key_file(aacs->path); + if (!fp) { + return AACS_ERROR_CORRUPTED_DISC; + } - X_FREE(aacs->uks); - aacs->uks = calloc(aacs->num_uks, 16); + if ((file_read(fp, buf, 4)) == 4) { + f_pos = MKINT_BE32(buf); - DEBUG(DBG_AACS, "%d CPS unit keys\n", aacs->num_uks); + // Read number of keys + file_seek(fp, f_pos, SEEK_SET); + if ((file_read(fp, buf, 2)) == 2) { + aacs->num_uks = MKINT_BE16(buf); - } else { - aacs->num_uks = 0; - DEBUG(DBG_AACS, "Error reading number of unit keys!\n"); - } + X_FREE(aacs->uks); + aacs->uks = calloc(aacs->num_uks, 16); - // Read keys - for (i = 0; i < aacs->num_uks; i++) { - f_pos += 48; + DEBUG(DBG_AACS, "%d CPS unit keys\n", aacs->num_uks); - file_seek(fp, f_pos, SEEK_SET); - if ((file_read(fp, buf, 16)) != 16) { - DEBUG(DBG_AACS, "Unit key %d: read error\n", i); - aacs->num_uks = i; - break; - } + } else { + aacs->num_uks = 0; + DEBUG(DBG_AACS | DBG_CRIT, "Error reading number of unit keys\n"); + error_code = AACS_ERROR_CORRUPTED_DISC; + } - gcry_cipher_hd_t gcry_h; - gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, - GCRY_CIPHER_MODE_ECB, 0); - gcry_cipher_setkey(gcry_h, aacs->vuk, 16); - gcry_cipher_decrypt(gcry_h, aacs->uks + 16*i, 16, buf, 16); - gcry_cipher_close(gcry_h); + // Read keys + for (i = 0; i < aacs->num_uks; i++) { + f_pos += 48; - char str40; - DEBUG(DBG_AACS, "Unit key %d: %s\n", i, - print_hex(str, aacs->uks + 16*i, 16)); + file_seek(fp, f_pos, SEEK_SET); + if ((file_read(fp, buf, 16)) != 16) { + DEBUG(DBG_AACS, "Unit key %d: read error\n", i); + aacs->num_uks = i; + error_code = AACS_ERROR_CORRUPTED_DISC; + break; } - _read_uks_map(aacs, fp); + 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); - file_close(fp); - - return aacs->num_uks; + char str40; + DEBUG(DBG_AACS, "Unit key %d: %s\n", i, + print_hex(str, aacs->uks + 16*i, 16)); } + /* failing next is not fatal, it just slows down things */ + _read_uks_map(aacs, fp); + file_close(fp); + + return error_code; } - DEBUG(DBG_AACS, "Could not calculate unit keys!\n"); + file_close(fp); - return 0; + DEBUG(DBG_AACS | DBG_CRIT, "Error reading unit keys\n"); + return AACS_ERROR_CORRUPTED_DISC; } static int _calc_title_hash(const char *path, uint8_t *title_hash) @@ -380,41 +609,32 @@ uint8_t *ukf_buf; char str48; int64_t f_size; - char *f_name; - - f_name = str_printf("%s/AACS/Unit_Key_RO.inf", path); + int result = AACS_SUCCESS; - if (!(fp = file_open(f_name, "rb"))) { - DEBUG(DBG_AACS, "Failed to open unit key file: %s!\n", f_name); - X_FREE(f_name); - return 0; + fp = _open_unit_key_file(path); + if (!fp) { + return AACS_ERROR_CORRUPTED_DISC; } - X_FREE(f_name); - file_seek(fp, 0, SEEK_END); f_size = file_tell(fp); file_seek(fp, 0, SEEK_SET); ukf_buf = malloc(f_size); - if ((file_read(fp, ukf_buf, f_size)) != f_size) { - - DEBUG(DBG_AACS, "Failed to read %"PRIu64" bytes from unit key file!\n", f_size); + if ((file_read(fp, ukf_buf, f_size)) == f_size) { + crypto_aacs_title_hash(ukf_buf, f_size, title_hash); + DEBUG(DBG_AACS, "Disc ID: %s\n", print_hex(str, title_hash, 20)); - file_close(fp); - X_FREE(ukf_buf); - - return 0; + } 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); } - crypto_aacs_title_hash(ukf_buf, f_size, title_hash); - DEBUG(DBG_AACS, "Disc ID: %s\n", print_hex(str, title_hash, 20)); - file_close(fp); X_FREE(ukf_buf); - return 1; + return result; } static int _verify_ts(uint8_t *buf, size_t size) @@ -448,91 +668,6 @@ return 0; } -/* Function that collects keys from keydb config entry */ -static uint32_t _find_config_entry(AACS *aacs, const char *path) -{ - uint8_t discid20; - char str48; - uint32_t retval = 0; - aacs->uks = NULL; - aacs->num_uks = 0; - - if (!_calc_title_hash(path, aacs->disc_id)) { - return 0; - } - - if (aacs->cf && aacs->cf->list) { - aacs->ce = aacs->cf->list; - while (aacs->ce && aacs->ce->entry.discid) { - memset(discid, 0, sizeof(discid)); - hexstring_to_hex_array(discid, sizeof(discid), - aacs->ce->entry.discid); - if (!memcmp(aacs->disc_id, discid, 20)) { - DEBUG(DBG_AACS, "Found config entry for discid %s\n", - aacs->ce->entry.discid); - break; - } - - aacs->ce = aacs->ce->next; - } - - if (aacs->ce->entry.mek) { - hexstring_to_hex_array(aacs->mk, sizeof(aacs->mk), - aacs->ce->entry.mek); - - DEBUG(DBG_AACS, "Found media key for %s: %s\n", - aacs->ce->entry.discid, print_hex(str, aacs->mk, 16)); - - retval = 1; - } - - if (aacs->ce->entry.vid) { - hexstring_to_hex_array(aacs->vid, sizeof(aacs->vid), - aacs->ce->entry.vid); - - DEBUG(DBG_AACS, "Found volume id for %s: %s\n", - aacs->ce->entry.discid, print_hex(str, aacs->vid, 16)); - - retval = 1; - } - - if (aacs->ce->entry.vuk) { - hexstring_to_hex_array(aacs->vuk, sizeof(aacs->vuk), - aacs->ce->entry.vuk); - - DEBUG(DBG_AACS, "Found volume unique key for %s: %s\n", - aacs->ce->entry.discid, print_hex(str, aacs->vuk, 16)); - - retval = 1; - } - - if (aacs->ce && aacs->ce->entry.uk) { - DEBUG(DBG_AACS, "Acquire CPS unit keys from keydb config file...\n"); - - digit_key_pair_list *ukcursor = aacs->ce->entry.uk; - while (ukcursor && ukcursor->key_pair.key) { - aacs->num_uks++; - - aacs->uks = (uint8_t*)realloc(aacs->uks, 16 * aacs->num_uks); - hexstring_to_hex_array(aacs->uks + (16 * (aacs->num_uks - 1)), 16, - ukcursor->key_pair.key); - - char str40; - DEBUG(DBG_AACS, "Unit key %d from keydb entry: %s\n", - aacs->num_uks, - print_hex(str, aacs->uks + (16 * (aacs->num_uks - 1)), 16)); - - ukcursor = ukcursor->next; - } - } - } - - if (aacs->num_uks) - retval = aacs->num_uks; - - return retval; -} - #define ALIGNED_UNIT_LEN 6144 static int _decrypt_unit(AACS *aacs, uint8_t *out_buf, const uint8_t *in_buf, uint32_t curr_uk) { @@ -569,88 +704,70 @@ return 0; } -static int _load_config(AACS *aacs, const char *configfile_path) +void aacs_get_version(int *major, int *minor, int *micro) { - int config_ok = 0; - - aacs->cf = keydbcfg_new_config_file(); - - /* try to load KEYDB.cfg */ - - if (configfile_path) { - config_ok = keydbcfg_parse_config(aacs->cf, configfile_path); - - } else { - /* If no configfile path given, check for config files in user's home or - * under /etc. - */ - char *cfgfile = keydbcfg_find_config_file(); - config_ok = keydbcfg_parse_config(aacs->cf, cfgfile); - X_FREE(cfgfile); - } - - /* Try to load simple (aacskeys) config files */ + *major = AACS_VERSION_MAJOR; + *minor = AACS_VERSION_MINOR; + *micro = AACS_VERSION_MICRO; +} - config_ok = keydbcfg_load_pk_file(aacs->cf) || config_ok; - config_ok = keydbcfg_load_cert_file(aacs->cf) || config_ok; +/* aacs_open2() wrapper for backwards compability */ +AACS *aacs_open(const char *path, const char *configfile_path) +{ + int error_code; + AACS *aacs; - if (!config_ok) { - DEBUG(DBG_AACS, "No valid configuration files found!\n"); + aacs = aacs_open2(path, configfile_path, &error_code); + if (error_code == AACS_SUCCESS) { + return aacs; } - return config_ok; -} - -void aacs_get_version(int *major, int *minor, int *micro) -{ - *major = AACS_VERSION_MAJOR; - *minor = AACS_VERSION_MINOR; - *micro = AACS_VERSION_MICRO; + aacs_close(aacs); + return NULL; } -AACS *aacs_open(const char *path, const char *configfile_path) +AACS *aacs_open2(const char *path, const char *configfile_path, int *error_code) { - DEBUG(DBG_AACS, "libaacs %zd\n", sizeof(AACS)); + DEBUG(DBG_AACS, "libaacs "AACS_VERSION_STRING" %zd\n", sizeof(AACS)); DEBUG(DBG_AACS, "Initializing libgcrypt...\n"); - if (!crypto_init()) - { - DEBUG(DBG_AACS, "Failed to initialize libgcrypt\n"); + if (!crypto_init()) { + DEBUG(DBG_AACS | DBG_CRIT, "Failed to initialize libgcrypt\n"); return NULL; } AACS *aacs = calloc(1, sizeof(AACS)); - if (_load_config(aacs, configfile_path)) { - DEBUG(DBG_AACS, "Searching for keydb config entry...\n"); - _find_config_entry(aacs, path); - - DEBUG(DBG_AACS, "Starting AACS waterfall...\n"); - if (_calc_uks(aacs, path)) { - keydbcfg_config_file_close(aacs->cf); - aacs->cf = NULL; - - DEBUG(DBG_AACS, "AACS initialized! (%p)\n", aacs); - return aacs; - } + aacs->path = str_printf("%s", path); - keydbcfg_config_file_close(aacs->cf); - aacs->cf = NULL; + *error_code = _calc_title_hash(path, aacs->disc_id); + if (*error_code != AACS_SUCCESS) { + aacs_close(aacs); + return NULL; } - DEBUG(DBG_AACS, "Failed to initialize AACS! (%p)\n", aacs); + DEBUG(DBG_AACS, "Starting AACS waterfall...\n"); + *error_code = _calc_uks(aacs, configfile_path); - aacs_close(aacs); + if (*error_code == AACS_SUCCESS) { + DEBUG(DBG_AACS, "AACS initialized!\n"); + } else { + DEBUG(DBG_AACS, "Failed to initialize AACS!\n"); + } - return NULL; + return aacs; } void aacs_close(AACS *aacs) { + if (!aacs) + return; + X_FREE(aacs->uks); X_FREE(aacs->cps_units); + X_FREE(aacs->path); - DEBUG(DBG_AACS, "AACS destroyed! (%p)\n", aacs); + DEBUG(DBG_AACS, "AACS destroyed!\n"); X_FREE(aacs); } @@ -676,11 +793,23 @@ return 1; } - DEBUG(DBG_AACS, "Failed decrypting unit 6144 bytes (%p)\n", aacs); + DEBUG(DBG_AACS, "Failed decrypting unit 6144 bytes\n"); return 0; } +int aacs_get_mkb_version(AACS *aacs) +{ + if (!aacs->mkb_version) { + MKB *mkb; + if ((mkb = mkb_open(aacs->path))) { + aacs->mkb_version = mkb_version(mkb); + mkb_close(mkb); + } + } + return aacs->mkb_version; +} + const uint8_t *aacs_get_disc_id(AACS *aacs) { return aacs->disc_id; @@ -688,9 +817,76 @@ const uint8_t *aacs_get_vid(AACS *aacs) { + if (!memcmp(aacs->vid, empty_key, 16)) { + config_file *cf = keydbcfg_config_load(NULL); + if (cf) { + _read_vid(aacs, cf->host_cert_list); + + keydbcfg_config_file_close(cf); + } + } return aacs->vid; } +const uint8_t *aacs_get_pmsn(AACS *aacs) +{ + if (!memcmp(aacs->vid, empty_key, 16)) { + config_file *cf = keydbcfg_config_load(NULL); + if (cf) { + _read_vid(aacs, cf->host_cert_list); + + keydbcfg_config_file_close(cf); + } + } + return aacs->pmsn; +} + +static AACS_RL_ENTRY *_get_rl(const char *type, int *num_records, int *mkbv) +{ + uint32_t len, version; + void *data = NULL; + + *num_records = *mkbv = 0; + + cache_get(type, &version, &len, NULL); + + if (version > 0 && len > 24) { + data = malloc(len); + if (cache_get(type, &version, &len, data) && len > 24) { + + if (_rl_verify_signature(data, len)) { + *mkbv = version; + *num_records = MKINT_BE32((uint8_t*)data + 20); + memmove(data, (uint8_t*)data + 24, len - 24); + + int ii; + AACS_RL_ENTRY *rl = data; + for (ii = 0; ii < *num_records; ii++) { + rlii.range = MKINT_BE16((uint8_t*)&rlii.range); + } + + return rl; + } + + DEBUG(DBG_AACS | DBG_CRIT, "invalid signature in cached %s\n", type); + } + + X_FREE(data); + } + + return data; +} + +AACS_RL_ENTRY *aacs_get_hrl(int *num_records, int *mkbv) +{ + return _get_rl("hrl", num_records, mkbv); +} + +AACS_RL_ENTRY *aacs_get_drl(int *num_records, int *mkbv) +{ + return _get_rl("drl", num_records, mkbv); +} + void aacs_select_title(AACS *aacs, uint32_t title) { if (!aacs) { @@ -698,22 +894,22 @@ } if (!aacs->cps_units) { - DEBUG(DBG_AACS|DBG_CRIT, "aacs_select_title(): CPS units not read ! (%p)\n", aacs); + DEBUG(DBG_AACS|DBG_CRIT, "aacs_select_title(): CPS units not read !\n"); return; } if (title == 0xffff) { /* first play */ aacs->current_cps_unit = aacs->cps_units0; - DEBUG(DBG_AACS, "aacs_set_title(first_play): CPS unit %d (%p)\n", aacs->current_cps_unit, aacs); + DEBUG(DBG_AACS, "aacs_set_title(first_play): CPS unit %d\n", aacs->current_cps_unit); return; } if (title <= aacs->num_titles) { aacs->current_cps_unit = aacs->cps_unitstitle + 1; - DEBUG(DBG_AACS, "aacs_set_title(%d): CPS unit %d (%p)\n", title, aacs->current_cps_unit, aacs); + DEBUG(DBG_AACS, "aacs_set_title(%d): CPS unit %d\n", title, aacs->current_cps_unit); return; } - DEBUG(DBG_AACS|DBG_CRIT, "aacs_set_title(%d): invalid title ! (%p)\n", title, aacs); + DEBUG(DBG_AACS|DBG_CRIT, "aacs_set_title(%d): invalid title !\n", title); }
View file
libaacs-0.3.0.tar.bz2/src/libaacs/aacs.h -> libaacs-0.6.0.tar.bz2/src/libaacs/aacs.h
Changed
@@ -26,16 +26,39 @@ # define AACS_PUBLIC #endif +/* aacs_open2() error codes */ +#define AACS_SUCCESS 0 /* no errors */ +#define AACS_ERROR_CORRUPTED_DISC -1 /* opening or reading of AACS files failed */ +#define AACS_ERROR_NO_CONFIG -2 /* missing config file */ +#define AACS_ERROR_NO_PK -3 /* no matching processing key */ +#define AACS_ERROR_NO_CERT -4 /* no valid certificate */ +#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 */ + typedef struct aacs AACS; AACS_PUBLIC void aacs_get_version(int *major, int *minor, int *micro); AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path); +AACS_PUBLIC AACS *aacs_open2(const char *path, const char *keyfile_path, int *error_code); AACS_PUBLIC void aacs_close(AACS *aacs); AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */ AACS_PUBLIC int aacs_decrypt_unit(AACS *aacs, uint8_t *buf); + +/* Disc information */ +AACS_PUBLIC int aacs_get_mkb_version(AACS *aacs); AACS_PUBLIC const uint8_t *aacs_get_disc_id(AACS *aacs); -AACS_PUBLIC const uint8_t *aacs_get_vid(AACS *aacs); +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 */ + +/* revocation lists */ +typedef struct { + uint16_t range; + uint8_t id6; +} AACS_RL_ENTRY; +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); #endif /* AACS_H_ */
View file
libaacs-0.3.0.tar.bz2/src/libaacs/crypto.c -> libaacs-0.6.0.tar.bz2/src/libaacs/crypto.c
Changed
@@ -151,7 +151,7 @@ } } -#ifdef HAVE_STRERROR_R +#if defined(HAVE_STRERROR_R) && defined(HAVE_LIBGPG_ERROR) #define LOG_GCRY_ERROR(msg, func, err) \ char errstr100 = {0}; \ gpg_strerror_r(err, errstr, sizeof(errstr)); \
View file
libaacs-0.3.0.tar.bz2/src/libaacs/mkb.c -> libaacs-0.6.0.tar.bz2/src/libaacs/mkb.c
Changed
@@ -43,7 +43,7 @@ if (mkb->bufpos == type) { DEBUG(DBG_MKB, "Retrieved MKB record 0x%02x (%p)\n", type, - mkb->buf + pos); + (void*)(mkb->buf + pos)); return mkb->buf + pos; } @@ -62,7 +62,7 @@ f_name = str_printf("%s/AACS/MKB_RO.inf", path); - DEBUG(DBG_MKB, "Opening MKB %s... (%p)\n", f_name, mkb); + DEBUG(DBG_MKB, "Opening MKB %s...\n", f_name); fp = file_open(f_name, "rb"); X_FREE(f_name); @@ -76,24 +76,56 @@ file_read(fp, mkb->buf, mkb->size); - DEBUG(DBG_MKB, "MKB size: %zd (%p)\n", mkb->size, mkb); - DEBUG(DBG_MKB, "MKB version: %d (%p)\n", mkb_version(mkb), mkb); + DEBUG(DBG_MKB, "MKB size: %zd\n", mkb->size); + DEBUG(DBG_MKB, "MKB version: %d\n", mkb_version(mkb)); file_close(fp); return mkb; } - DEBUG(DBG_MKB, "Error opening MKB! (%p)\n", mkb); + DEBUG(DBG_MKB, "Error opening MKB!\n"); return NULL; } +MKB *mkb_init(uint8_t *data, int len) +{ + MKB *mkb = malloc(sizeof(MKB)); + + mkb->size = len; + mkb->buf = data; + + return mkb; +} + void mkb_close(MKB *mkb) { - X_FREE(mkb->buf); - X_FREE(mkb); + if (mkb) { + X_FREE(mkb->buf); + X_FREE(mkb); + } } +const uint8_t *mkb_data(MKB *mkb) +{ + return mkb->buf; +} + +size_t mkb_data_size(MKB *mkb) +{ + size_t pos = 0; + + while (pos + 4 <= mkb->size) { + if (!mkb->bufpos) { + break; + } + pos += MKINT_BE24(mkb->buf + pos + 1); + } + + return pos; +} + + uint8_t mkb_type(MKB *mkb) { const uint8_t *rec = _record(mkb, 0x10, NULL); @@ -119,17 +151,25 @@ const uint8_t *mkb_host_revokation_entries(MKB *mkb, size_t *len) { const uint8_t *rec = _record(mkb, 0x21, len); - *len -= 4; - return rec + 4; + if (rec) { + rec += 4; + *len -= 4; + } + + return rec; } const uint8_t *mkb_drive_revokation_entries(MKB *mkb, size_t *len) { const uint8_t *rec = _record(mkb, 0x20, len); - *len -= 4; - return rec + 4; + if (rec) { + rec += 4; + *len -= 4; + } + + return rec; } const uint8_t *mkb_subdiff_records(MKB *mkb, size_t *len) @@ -161,3 +201,58 @@ return rec + 4; } + +static int _cert_is_revoked(const uint8_t *rl, size_t rl_size, const uint8_t *cert_id_bin) +{ + if (rl) { + uint64_t cert_id = MKINT_BE48(cert_id_bin); + /*int total = MKINT_BE32(rl);*/ + int entries = MKINT_BE32(rl + 4); + int ii; + + size_t rec_len = 4 + 4 + 8 * entries + 40; + if (rec_len > rl_size) { + DEBUG(DBG_MKB, "revocation list size mismatch\n"); + return -1; + } + + rl += 8; + for (ii=0; ii < entries; ii++) { + 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); + return 1; + } + rl += 8; + } + } + + return 0; +} + +int mkb_host_cert_is_revoked(MKB *mkb, const uint8_t *cert_id) +{ + if (mkb) { + size_t rl_size = 0; + const uint8_t *rl = mkb_host_revokation_entries(mkb, &rl_size); + if (rl) { + return _cert_is_revoked(rl, rl_size, cert_id); + } + } + + return -1; +} + +int mkb_drive_cert_is_revoked(MKB *mkb, const uint8_t *cert_id) +{ + if (mkb) { + size_t rl_size = 0; + const uint8_t *rl = mkb_drive_revokation_entries(mkb, &rl_size); + if (rl) { + return _cert_is_revoked(rl, rl_size, cert_id); + } + } + + return -1; +}
View file
libaacs-0.3.0.tar.bz2/src/libaacs/mkb.h -> libaacs-0.6.0.tar.bz2/src/libaacs/mkb.h
Changed
@@ -28,8 +28,12 @@ typedef struct mkb MKB; AACS_PRIVATE MKB *mkb_open(const char *path); // init MKB +AACS_PRIVATE MKB *mkb_init(uint8_t *data, int len); // init MKB from data AACS_PRIVATE void mkb_close(MKB *mkb); // free MKB +AACS_PRIVATE const uint8_t *mkb_data(MKB *mkb); +AACS_PRIVATE size_t mkb_data_size(MKB *mkb); + // returns type AACS_PRIVATE uint8_t mkb_type(MKB *mkb); // returns version @@ -51,6 +55,9 @@ // returns MKB signature AACS_PRIVATE const uint8_t *mkb_signature(MKB *mkb, size_t *len); +AACS_PRIVATE int mkb_host_cert_is_revoked(MKB *mkb, const uint8_t *cert_id); +AACS_PRIVATE int mkb_drive_cert_is_revoked(MKB *mkb, const uint8_t *cert_id); + /* The Media Key block is of variable size but must be a multiple of 4 * MKB Structure: * Type and Version record (12 bytes)
View file
libaacs-0.3.0.tar.bz2/src/libaacs/mmc.c -> libaacs-0.6.0.tar.bz2/src/libaacs/mmc.c
Changed
@@ -1,3 +1,4 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n @@ -33,10 +34,51 @@ #include <unistd.h> #include <string.h> +#include <stdio.h> + +#ifdef USE_IOKIT + +#include <Carbon/Carbon.h> + +#include <IOKit/IOKitLib.h> +#include <IOKit/IOCFPlugIn.h> + +#include <DiskArbitration/DiskArbitration.h> + +/* need to undefine VERSION as one of the members of struct + SCSICmd_INQUIRY_StandardData is named VERSION (see + IOKit/scsi/SCSICmds_INQUIRY_Definitions.h) */ +#undef VERSION +#include <IOKit/scsi/SCSITaskLib.h> + +#include <IOKit/storage/IOBDMediaBSDClient.h> + +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif + +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif + +#ifdef HAVE_SYS_MOUNT_H +#include <sys/mount.h> +#endif + +#ifdef HAVE_LIBGEN_H +#include <libgen.h> +#endif + +#endif + #ifdef HAVE_MNTENT_H #include <mntent.h> #endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif + #ifdef HAVE_LINUX_CDROM_H #include <sys/ioctl.h> #include <linux/cdrom.h> @@ -84,9 +126,19 @@ #endif // defined(_WIN32) - struct mmc { -#if defined(_WIN32) +#if defined(USE_IOKIT) + MMCDeviceInterface **mmcInterface; + SCSITaskDeviceInterface **taskInterface; + + /* device short name (ie disk1) */ + char bsd_name128; + + /* for mounting/unmounting the disc */ + DADiskRef disk; + DASessionRef session; + bool is_mounted; +#elif defined(_WIN32) HANDLE fd; #else int fd; @@ -128,21 +180,20 @@ int a = ioctl(mmc->fd, CDROM_SEND_PACKET, &cgc); char str512; - DEBUG(DBG_MMC, "Send LINUX MMC cmd %s: (%p)\n", - print_hex(str, cmd, 16), mmc); + DEBUG(DBG_MMC, "Send LINUX MMC cmd %s:\n", + print_hex(str, cmd, 16)); if (tx) { - DEBUG(DBG_MMC, " Buffer: %s -> (%p)\n", print_hex(str, buf, tx), mmc); + DEBUG(DBG_MMC, " Buffer: %s ->\n", print_hex(str, buf, tx>255?255:tx)); } else { - DEBUG(DBG_MMC, " Buffer: %s <- (%p)\n", print_hex(str, buf, rx), mmc); + DEBUG(DBG_MMC, " Buffer: %s <-\n", print_hex(str, buf, rx>255?255:rx)); } if (a >= 0) { - DEBUG(DBG_MMC, " Send succeeded! %d (%p)\n", a, mmc); + DEBUG(DBG_MMC, " Send succeeded! %d\n", a); return 1; } - DEBUG(DBG_MMC, " Send failed! %d %s (%p)\n", a, strerror(errno), - mmc); + DEBUG(DBG_MMC, " Send failed! %d %s\n", a, strerror(errno)); } #elif defined(_WIN32) @@ -194,18 +245,98 @@ &dwBytesReturned, NULL)) { if (sptd_sb.sptd.ScsiStatus == 0 /* STATUS_GOOD */) { - DEBUG(DBG_MMC, " Send succeeded! (%p)\n", mmc); + DEBUG(DBG_MMC, " Send succeeded!\n"); return 1; } } - DEBUG(DBG_MMC, " Send failed! (%p)\n", mmc); + DEBUG(DBG_MMC, " Send failed!\n"); + +#elif defined(USE_IOKIT) + SCSITaskInterface **task = NULL; + SCSI_Sense_Data sense; + SCSITaskStatus status; + SCSITaskSGElement iov; + UInt8 direction; + UInt64 sent; + int rc; + + if (NULL == mmc->taskInterface) { + return 0; + } + + do { + task = (*mmc->taskInterface)->CreateSCSITask (mmc->taskInterface); + if (NULL == task) { + DEBUG(DBG_MMC, "Could not create SCSI Task\n"); + break; + } + + iov.address = (uintptr_t) buf; + iov.length = tx ? tx : rx; + + if (buf) { + direction = tx ? kSCSIDataTransfer_FromInitiatorToTarget : + kSCSIDataTransfer_FromTargetToInitiator; + } else { + direction = kSCSIDataTransfer_NoDataTransfer; + } + + rc = (*task)->SetCommandDescriptorBlock (task, cmd, 16); + if (kIOReturnSuccess != rc) { + DEBUG(DBG_MMC, "Error setting SCSI command\n"); + break; + } + + rc = (*task)->SetScatterGatherEntries (task, &iov, 1, iov.length, direction); + if (kIOReturnSuccess != rc) { + DEBUG(DBG_MMC, "Error setting SCSI scatter gather entries\n"); + break; + } + + rc = (*task)->SetTimeoutDuration (task, 5000000); + if (kIOReturnSuccess != rc) { + DEBUG(DBG_MMC, "Error setting SCSI command timeout\n"); + break; + } + + memset (&sense, 0, sizeof (sense)); + + rc = (*task)->ExecuteTaskSync (task, &sense, &status, &sent); + + char str512; + DEBUG(DBG_MMC, "Send SCSI MMC cmd %s:\n", print_hex(str, cmd, 16)); + if (tx) { + DEBUG(DBG_MMC, " Buffer: %s ->\n", print_hex(str, buf, tx>255?255:tx)); + } else { + DEBUG(DBG_MMC, " Buffer: %s <-\n", print_hex(str, buf, rx>255?255:rx)); + } + + if (kIOReturnSuccess != rc || status != 0) { + DEBUG(DBG_MMC, " Send failed!\n"); + break; + } else { + DEBUG(DBG_MMC, " Send succeeded! sent = %lld status = %u. response = %x\n", + (unsigned long long) sent, status, sense.VALID_RESPONSE_CODE); + } + + (*task)->Release (task); + + return 1; + } while (0); + if (task) { + (*task)->Release (task); + } #endif return 0; } +/* + * + */ + static int _mmc_report_key(MMC *mmc, uint8_t agid, uint32_t addr, uint8_t blocks, uint8_t format, uint8_t *buf, uint16_t len) @@ -214,7 +345,7 @@ memset(cmd, 0, sizeof(cmd)); memset(buf, 0, len); - DEBUG(DBG_MMC, "MMC report key... (%p)\n", mmc); + DEBUG(DBG_MMC, "MMC report key...\n"); cmd0 = 0xa4; cmd2 = (addr >> 24) & 0xff; @@ -237,8 +368,7 @@ char str512; memset(cmd, 0, sizeof(cmd)); - DEBUG(DBG_MMC, "MMC send key %d %s... (%p)\n", len, print_hex(str, buf, len), - mmc); + DEBUG(DBG_MMC, "MMC send key %d %s...\n", len, print_hex(str, buf, len)); cmd0 = 0xa3; cmd7 = 0x02; @@ -246,10 +376,53 @@ cmd9 = len & 0xff; cmd10 = (agid << 6) | (format & 0x3f); - DEBUG(DBG_MMC, "cmd: %s (%p)\n", print_hex(str, cmd, 16), mmc); + DEBUG(DBG_MMC, "cmd: %s\n", print_hex(str, cmd, 16)); return _mmc_send_cmd(mmc, cmd, buf, len, 0); } +static int _mmc_report_disc_structure(MMC *mmc, uint8_t agid, uint8_t format, + uint8_t layer, uint32_t address, + uint8_t *buf, uint16_t len) +{ + uint8_t cmd16; + memset(cmd, 0, sizeof(cmd)); + memset(buf, 0, len); + + cmd0 = 0xad; // operation code + cmd1 = 0x01; // BluRay + cmd2 = (address >> 24) & 0xff; + cmd3 = (address >> 16) & 0xff; + cmd4 = (address >> 8) & 0xff; + cmd5 = address & 0xff; + cmd6 = layer; + cmd7 = format; + cmd8 = (len >> 8) & 0xff; + cmd9 = len & 0xff; + cmd10 = (agid << 6); + + return _mmc_send_cmd(mmc, cmd, buf, 0, len); +} + +static int _mmc_get_configuration(MMC *mmc, uint16_t feature, uint8_t *buf, uint16_t len) +{ + uint8_t cmd16; + memset(cmd, 0, sizeof(cmd)); + memset(buf, 0, len); + + cmd0 = 0x46; // operation code + cmd1 = 0x01; // BluRay + cmd2 = (feature >> 8) & 0xff; + cmd3 = feature & 0xff; + cmd7 = (len >> 8) & 0xff; + cmd8 = len & 0xff; + + return _mmc_send_cmd(mmc, cmd, buf, 0, len); +} + +/* + * + */ + static int _mmc_invalidate_agid(MMC *mmc, uint8_t agid) { uint8_t buf2; @@ -322,6 +495,64 @@ return 0; } + +static int _mmc_check_aacs(MMC *mmc) +{ + uint8_t buf16; + memset(buf, 0, sizeof(buf)); + + if (_mmc_get_configuration(mmc, 0x010d, buf, 16)) { + uint16_t feature = MKINT_BE16(buf+8); + if (feature == 0x010d) { + DEBUG(DBG_MMC, "AACS feature descriptor:\n"); + DEBUG(DBG_MMC, " AACS version: %d\n", buf5+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, " AGID count: %d\n", buf6+8 & 0xf); + + return buf2+8 & 1; + } + DEBUG(DBG_MMC, "incorrect feature ID %04x\n", feature); + } + + DEBUG(DBG_MMC, "_mmc_get_configuration() failed\n"); + return 0; +} + +static uint8_t *_mmc_read_mkb(MMC *mmc, uint8_t agid, int address, int *size) +{ + const int layer = 0; + uint8_t *mkb = NULL; + uint8_t buf32772; + + *size = 0; + if (_mmc_report_disc_structure(mmc, agid, 0x83, layer, address, buf, sizeof(buf))) { + unsigned pack, num_packs = buf3; + int32_t len = MKINT_BE16(buf) - 2; + mkb = malloc(32768 * num_packs); + + DEBUG(DBG_MMC, "got mkb: pack 0/%d %d bytes\n", num_packs, len); + memcpy(mkb, buf + 4, len); + *size += len; + + for (pack = 1; pack < num_packs; pack++) { + if (_mmc_report_disc_structure(mmc, agid, 0x83, layer, pack, buf, sizeof(buf))) { + len = MKINT_BE16(buf) - 2; + DEBUG(DBG_MMC, "got mkb: pack %d/%d %d bytes\n", pack, num_packs, len); + + memcpy(mkb + *size, buf + 4, len); + *size += len; + } else { + break; + } + } + } + + return mkb; +} + static int _mmc_send_host_key(MMC *mmc, uint8_t agid, const uint8_t *host_key_point, const uint8_t *host_key_signature) @@ -340,17 +571,9 @@ uint8_t *mac) { uint8_t buf36; - uint8_t cmd16; - memset(cmd, 0, sizeof(cmd)); - memset(buf, 0, 36); - - cmd0 = 0xad; - cmd1 = 1; // 1 = BLURAY - cmd7 = 0x80; - cmd9 = 0x24; - cmd10 = (agid << 6) & 0xc0; + memset(buf, 0, sizeof(buf)); - if (_mmc_send_cmd(mmc, cmd, buf, 0, 36)) { + if (_mmc_report_disc_structure(mmc, agid, 0x80, 0, 0, buf, 36)) { memcpy(volume_id, buf + 4, 16); memcpy(mac, buf + 20, 16); return 1; @@ -359,6 +582,250 @@ return 0; } +static int _mmc_read_pmsn(MMC *mmc, uint8_t agid, uint8_t *pmsn, + uint8_t *mac) +{ + uint8_t buf36; + memset(buf, 0, sizeof(buf)); + + if (_mmc_report_disc_structure(mmc, agid, 0x81, 0, 0, buf, 36)) { + memcpy(pmsn, buf + 4, 16); + memcpy(mac, 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; + int rc; + + rc = statfs (path, &stat_info); + if (0 != rc) { + return rc; + } + + strncpy (mmc->bsd_name, basename (stat_info.f_mntfromname), sizeof (mmc->bsd_name)); + + return 0; +} + +static void iokit_unmount_complete (DADiskRef disk, DADissenterRef dissenter, + void *context) { + (void)disk; /* suppress warning */ + + if (dissenter) { + DEBUG(DBG_MMC, "Could not unmount the disc\n"); + } else { + DEBUG(DBG_MMC, "Disc unmounted\n"); + ((MMC *)context)->is_mounted = 0; + } +} + +static void iokit_mount_complete (DADiskRef disk, DADissenterRef dissenter, + void *context) { + (void) disk; /* suppress warning */ + (void) dissenter; /* suppress warning */ + + /* the disc mounts despite whether there is a dessenter */ + DEBUG(DBG_MMC, "Disc mounted\n"); + ((MMC *)context)->is_mounted = 1; +} + +static int iokit_unmount (MMC *mmc) { + if (0 == mmc->is_mounted) { + return 0; /* nothing to do */ + } + + DEBUG(DBG_MMC, "Unmounting disk\n"); + + mmc->session = DASessionCreate (kCFAllocatorDefault); + if (NULL == mmc->session) { + DEBUG(DBG_MMC, "Could not create a disc arbitration session\n"); + return -1; + } + + mmc->disk = DADiskCreateFromBSDName (kCFAllocatorDefault, mmc->session, mmc->bsd_name); + if (NULL == mmc->disk) { + DEBUG(DBG_MMC, "Could not create a disc arbitration disc for the device\n"); + CFRelease (mmc->session); + mmc->session = NULL; + return -1; + } + + DAApprovalSessionScheduleWithRunLoop (mmc->session, CFRunLoopGetCurrent (), + kCFRunLoopDefaultMode); + + DADiskUnmount (mmc->disk, kDADiskUnmountOptionForce, iokit_unmount_complete, mmc); + + CFRunLoopRunInMode (kCFRunLoopDefaultMode, 10, true); + + return mmc->is_mounted ? -1 : 0; +} + +static int iokit_mount (MMC *mmc) { + if (0 == mmc->is_mounted) { + if (mmc->disk && mmc->session) { + DADiskMount (mmc->disk, NULL, kDADiskMountOptionDefault, iokit_mount_complete, mmc); + + CFRunLoopRunInMode (kCFRunLoopDefaultMode, 10, true); + + DAApprovalSessionUnscheduleFromRunLoop (mmc->session, CFRunLoopGetCurrent (), + kCFRunLoopDefaultMode); + } + + if (mmc->disk) { + CFRelease (mmc->disk); + mmc->disk = NULL; + } + + if (mmc->session) { + CFRelease (mmc->session); + mmc->session = NULL; + } + } + + return mmc->is_mounted ? 0 : -1; +} + +static int iokit_find_service_matching (MMC *mmc, io_service_t *servp) { + CFMutableDictionaryRef matchingDict = IOServiceMatching("IOBDServices"); + io_iterator_t deviceIterator; + io_service_t service; + int rc; + + assert (NULL != servp); + + *servp = 0; + + if (!matchingDict) { + DEBUG(DBG_MMC, "Could not create a matching dictionary for IOBDServices\n"); + return -1; + } + + /* this call consumes the reference to the matchingDict. we do not need to release it */ + rc = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &deviceIterator); + if (kIOReturnSuccess != rc) { + DEBUG(DBG_MMC, "Could not create device iterator\n"); + return -1; + } + + while (0 != (service = IOIteratorNext (deviceIterator))) { + CFStringRef data; + char name128 = ""; + + data = IORegistryEntrySearchCFProperty (service, kIOServicePlane, CFSTR("BSD Name"), + kCFAllocatorDefault, kIORegistryIterateRecursively); + + if (NULL != data) { + rc = CFStringGetCString (data, name, sizeof (name), kCFStringEncodingASCII); + CFRelease (data); + if (0 == strcmp (name, mmc->bsd_name)) { + break; + } + } + + (void) IOObjectRelease (service); + } + + IOObjectRelease (deviceIterator); + + *servp = service; + + return (service) ? 0 : -1; +} + +static int iokit_find_interfaces (MMC *mmc, io_service_t service) { + IOCFPlugInInterface **plugInInterface = NULL; + SInt32 score; + int rc; + + rc = IOCreatePlugInInterfaceForService (service, kIOMMCDeviceUserClientTypeID, + kIOCFPlugInInterfaceID, &plugInInterface, + &score); + if (kIOReturnSuccess != rc || NULL == plugInInterface) { + return -1; + } + + DEBUG(DBG_MMC, "Getting MMC interface\n"); + + rc = (*plugInInterface)->QueryInterface(plugInInterface, + CFUUIDGetUUIDBytes(kIOMMCDeviceInterfaceID), + (LPVOID)&mmc->mmcInterface); + /* call release instead of IODestroyPlugInInterface to avoid stopping IOBDServices */ + (*plugInInterface)->Release(plugInInterface); + if (kIOReturnSuccess != rc || NULL == mmc->mmcInterface) { + DEBUG(DBG_MMC, "Could not get multimedia commands (MMC) interface\n"); + return -1; + } + + DEBUG(DBG_MMC, "Have an MMC interface (%p). Getting a SCSI task interface...\n", (void*)mmc->mmcInterface); + + mmc->taskInterface = (*mmc->mmcInterface)->GetSCSITaskDeviceInterface (mmc->mmcInterface); + if (NULL == mmc->taskInterface) { + DEBUG(DBG_MMC, "Could not get SCSI task device interface\n"); + return -1; + } + + return 0; +} + +int mmc_open_iokit (const char *path, MMC *mmc) { + io_service_t service; + int rc; + + mmc->mmcInterface = NULL; + mmc->taskInterface = NULL; + mmc->disk = NULL; + mmc->session = NULL; + mmc->is_mounted = true; + + /* get the bsd name associated with this mount */ + rc = get_mounted_device_from_path (mmc, path); + if (0 != rc) { + DEBUG(DBG_MMC, "Could not locate mounted device associated with %s\n", path); + return rc; + } + + /* find a matching io service (IOBDServices) */ + rc = iokit_find_service_matching (mmc, &service); + if (0 != rc) { + DEBUG(DBG_MMC, "Could not find matching IOBDServices mounted @ %s\n", path); + return rc; + } + + /* find mmc and scsi task interfaces */ + rc = iokit_find_interfaces (mmc, service); + + /* done with the ioservice. release it */ + (void) IOObjectRelease (service); + + if (0 != rc) { + return rc; + } + + /* unmount the disk so exclusive access can be obtained (this is required + to use the scsi task interface) */ + rc = iokit_unmount (mmc); + if (0 != rc) { + return rc; + } + + /* finally, obtain exclusive access */ + rc = (*mmc->taskInterface)->ObtainExclusiveAccess (mmc->taskInterface); + if (kIOReturnSuccess != rc) { + DEBUG(DBG_MMC, "Failed to obtain exclusive access. rc = %x\n", rc); + return -1; + } + + DEBUG(DBG_MMC, "MMC Open complete\n"); + + return 0; +} +#endif + MMC *mmc_open(const char *path) { MMC *mmc = calloc(1, sizeof(MMC)); @@ -381,10 +848,23 @@ print_hex(str, mmc->host_key_point, sizeof(mmc->host_key_point))); } -#if defined(HAVE_MNTENT_H) +#if defined(USE_IOKIT) + int rc = mmc_open_iokit (path, mmc); + if (0 != rc) { + mmc_close (mmc); + return NULL; + } + +#elif defined(HAVE_MNTENT_H) #ifdef HAVE_REALPATH - char *file_path = realpath(path, NULL); + char *file_path = malloc(PATH_MAX); + if (!file_path || !realpath(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); @@ -400,7 +880,7 @@ file_pathpath_len = '\0'; } - DEBUG(DBG_MMC, "Opening LINUX MMC drive %s... (%p)\n", file_path, mmc); + DEBUG(DBG_MMC, "Opening LINUX MMC drive %s...\n", file_path); if ((proc_mounts = setmntent("/proc/mounts", "r"))) { struct mntent* mount_entry; @@ -409,23 +889,23 @@ if (strcmp(mount_entry->mnt_dir, file_path) == 0) { mmc->fd = open(mount_entry->mnt_fsname, O_RDONLY | O_NONBLOCK); if (mmc->fd >= 0) { - DEBUG(DBG_MMC, "LINUX MMC drive %s opened - fd: %d (%p)\n", - mount_entry->mnt_fsname, mmc->fd, mmc); + DEBUG(DBG_MMC, "LINUX MMC drive %s opened - fd: %d\n", + mount_entry->mnt_fsname, mmc->fd); break; } - DEBUG(DBG_MMC, "Failed opening LINUX MMC drive %s mounted to %s (%p)\n", - mount_entry->mnt_fsname, file_path, mmc); + DEBUG(DBG_MMC, "Failed opening LINUX MMC drive %s mounted to %s\n", + mount_entry->mnt_fsname, file_path); } } endmntent(proc_mounts); } else { - DEBUG(DBG_MMC, "Error opening /proc/mounts (%p)\n", mmc); + DEBUG(DBG_MMC, "Error opening /proc/mounts\n"); } if (mmc->fd < 0) { - DEBUG(DBG_MMC, "Error opening LINUX MMC drive mounted to %s (%p)\n", file_path, mmc); + DEBUG(DBG_MMC | DBG_CRIT, "Error opening LINUX MMC drive mounted to %s\n", file_path); X_FREE(mmc); } @@ -435,12 +915,12 @@ char drive = { path0, ':', '\\', 0 }; char volume = {'\\', '\\', '.', '\\', path0, ':', 0}; - DEBUG(DBG_MMC, "Opening Windows MMC drive %s... (%p)\n", drive, mmc); + DEBUG(DBG_MMC, "Opening Windows MMC drive %s...\n", drive); UINT type = GetDriveType(drive); if (type != DRIVE_CDROM) { - DEBUG(DBG_MMC, "Drive %s is not CD/DVD drive !\n", drive); + DEBUG(DBG_MMC | DBG_CRIT, "Drive %s is not CD/DVD drive\n", drive); X_FREE(mmc); return NULL; } @@ -453,21 +933,29 @@ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (mmc->fd == INVALID_HANDLE_VALUE) { - DEBUG(DBG_MMC, "Failed opening Windows MMC drive %s (%p)\n", volume, mmc); + DEBUG(DBG_MMC, "Failed opening Windows MMC drive %s\n", volume); X_FREE(mmc); return NULL; } } - DEBUG(DBG_MMC, "Windows MMC drive %s opened (%p)\n", volume, mmc); + DEBUG(DBG_MMC, "Windows MMC drive %s opened\n", volume); #else - DEBUG(DBG_MMC, "No MMC drive support !\n"); + DEBUG(DBG_MMC | DBG_CRIT, "No MMC drive support\n"); X_FREE(mmc); #endif +#ifndef _WIN32 + if (mmc && !_mmc_check_aacs(mmc)) { + DEBUG(DBG_MMC | DBG_CRIT, "AACS not active or supported by the drive\n"); + mmc_close (mmc); + return NULL; + } +#endif + return mmc; } @@ -484,9 +972,22 @@ if (mmc->fd != INVALID_HANDLE_VALUE) { CloseHandle(mmc->fd); } +#elif defined(USE_IOKIT) + if (mmc->taskInterface) { + (*mmc->taskInterface)->ReleaseExclusiveAccess (mmc->taskInterface); + (*mmc->taskInterface)->Release (mmc->taskInterface); + mmc->taskInterface = NULL; + } + + if (mmc->mmcInterface) { + (*mmc->mmcInterface)->Release (mmc->mmcInterface); + mmc->mmcInterface = NULL; + } + + (void) iokit_mount (mmc); #endif - DEBUG(DBG_MMC, "Closed MMC drive (%p)\n", mmc); + DEBUG(DBG_MMC, "Closed MMC drive\n"); X_FREE(mmc); } @@ -503,66 +1004,65 @@ 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) +int mmc_read_vid(MMC *mmc, const uint8_t *host_priv_key, const uint8_t *host_cert, uint8_t *vid, uint8_t *pmsn) { uint8_t agid = 0, hks40, dn20, dc92, dkp40, dks40, mac16; char str512; + int error_code = MMC_ERROR; memset(hks, 0, sizeof(hks)); - DEBUG(DBG_MMC, "Reading VID from drive... (%p)\n", mmc); + DEBUG(DBG_MMC, "Reading VID from drive...\n"); _mmc_invalidate_agids(mmc); if (!_mmc_report_agid(mmc, &agid)) { - DEBUG(DBG_MMC | DBG_CRIT, "Didn't get AGID from drive (%p)\n", mmc); - return 0; + DEBUG(DBG_MMC | DBG_CRIT, "Didn't get AGID from drive\n"); + return MMC_ERROR; } - DEBUG(DBG_MMC, "Got AGID from drive: %d (%p)\n", agid, mmc); + DEBUG(DBG_MMC, "Got AGID from drive: %d\n", agid); if (!PATCHED_DRIVE) do { if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Host certificate : %s (%p)\n", print_hex(str, host_cert, 92), mmc); - DEBUG(DBG_MMC, "Host nonce : %s (%p)\n", print_hex(str, mmc->host_nonce, 20), mmc); + 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)); } // 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 ? " - "(%p)\n", mmc); + DEBUG(DBG_MMC | DBG_CRIT, "Host key / Certificate has been revoked by your drive ?\n"); + error_code = MMC_ERROR_CERT_REVOKED; break; } // receive mmc cert + nonce if (!_mmc_read_drive_cert(mmc, agid, dn, dc)) { DEBUG(DBG_MMC | DBG_CRIT, - "Drive doesn't give its certificate (%p)\n", mmc); + "Drive doesn't give its certificate\n"); break; } if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Drive certificate : %s (%p)\n", print_hex(str, dc, 92), mmc); - DEBUG(DBG_MMC, "Drive nonce : %s (%p)\n", print_hex(str, dn, 20), mmc); + DEBUG(DBG_MMC, "Drive certificate : %s\n", print_hex(str, dc, 92)); + DEBUG(DBG_MMC, "Drive nonce : %s\n", print_hex(str, dn, 20)); } // verify drive certificate if (!crypto_aacs_verify_drive_cert(dc)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid (%p)\n", mmc); + DEBUG(DBG_MMC | DBG_CRIT, "Drive certificate is invalid\n"); break; } // receive mmc key if (!_mmc_read_drive_key(mmc, agid, dkp, dks)) { - DEBUG(DBG_MMC | DBG_CRIT, "Drive doesn't give its drive key (%p)\n", - mmc); + DEBUG(DBG_MMC | DBG_CRIT, "Drive doesn't give its drive key\n"); break; } if (DEBUG_KEYS) { - DEBUG(DBG_MMC, "Drive key point : %s (%p)\n", print_hex(str, dkp, 40), mmc); - DEBUG(DBG_MMC, "Drive key signature : %s (%p)\n", print_hex(str, dks, 40), mmc); + 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 @@ -583,27 +1083,49 @@ // 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 (%p)\n", - mmc); - DEBUG(DBG_MMC, "Host key signature : %s (%p)\n", - print_hex(str, hks, 40), mmc); + DEBUG(DBG_MMC | DBG_CRIT, "Error sending host signature\n"); + DEBUG(DBG_MMC, "Host key signature : %s\n", print_hex(str, hks, 40)); break; } } while (0); if (_mmc_read_vid(mmc, agid, vid, mac)) { - DEBUG(DBG_MMC, "VID: %s (%p)\n", print_hex(str, vid, 16), mmc); - DEBUG(DBG_MMC, "MAC: %s (%p)\n", print_hex(str, mac, 16), mmc); + 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"); + } _mmc_invalidate_agid(mmc, agid); - return 1; + return MMC_SUCCESS; } - DEBUG(DBG_MMC | DBG_CRIT, "Unable to read VID from drive! (%p)\n", mmc); + DEBUG(DBG_MMC | DBG_CRIT, "Unable to read VID from drive!\n"); _mmc_invalidate_agid(mmc, agid); - return 0; + return error_code; +} + +uint8_t *mmc_read_mkb(MMC *mmc, int address, int *size) +{ + uint8_t agid = 0; + + _mmc_report_agid(mmc, &agid); + + uint8_t *mkb = _mmc_read_mkb(mmc, agid, address, size); + + _mmc_invalidate_agid(mmc, agid); + + return mkb; }
View file
libaacs-0.3.0.tar.bz2/src/libaacs/mmc.h -> libaacs-0.6.0.tar.bz2/src/libaacs/mmc.h
Changed
@@ -1,6 +1,7 @@ /* * This file is part of libaacs * Copyright (C) 2009-2010 Obliter0n + * 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 @@ -26,9 +27,16 @@ typedef struct mmc MMC; +#define MMC_SUCCESS 0 /* no errors */ +#define MMC_ERROR -1 /* MMC failed */ +#define MMC_ERROR_CERT_REVOKED -2 /* revoked certificate */ + 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 *vid, uint8_t *pmsn); + +/* read partial MKB */ +AACS_PRIVATE uint8_t *mmc_read_mkb(MMC *mmc, int address, int *size); #endif /* MMC_H_ */
View file
libaacs-0.3.0.tar.bz2/src/util/logging.c -> libaacs-0.6.0.tar.bz2/src/util/logging.c
Changed
@@ -69,9 +69,9 @@ va_list args; va_start(args, format); - vsprintf(buffer, format, args); + sprintf(buffer, "libaacs: %s:%d: %s", file, line, format); + vfprintf(logfile, buffer, args); va_end(args); - fprintf(logfile, "%s:%d: %s", file, line, buffer); } }
View file
libaacs-0.3.0.tar.bz2/src/util/logging.h -> libaacs-0.6.0.tar.bz2/src/util/logging.h
Changed
@@ -24,7 +24,7 @@ #include <stdint.h> -#define DEBUG(X,Y,...) aacs_debug(__FILE__,__LINE__,X,Y,##__VA_ARGS__) +#define DEBUG(MASK,...) aacs_debug(__FILE__,__LINE__,MASK,##__VA_ARGS__) enum debug_mask_enum { DBG_RESERVED = 0x0001,
View file
libaacs-0.3.0.tar.bz2/src/util/macro.h -> libaacs-0.6.0.tar.bz2/src/util/macro.h
Changed
@@ -30,6 +30,9 @@ #define MKINT_BE16(X) ( (X)0 << 8 | (X)1 ) #define MKINT_BE24(X) ( (X)0 << 16 | (X)1 << 8 | (X)2 ) #define MKINT_BE32(X) ( (X)0 << 24 | (X)1 << 16 | (X)2 << 8 | (X)3 ) +#define MKINT_BE48(X) ( (uint64_t)((X)0) << 40 | (uint64_t)((X)1) << 32 | (uint64_t)((X)2) << 24 | \ + (uint64_t)((X)3) << 16 | (uint64_t)((X)4) << 8 | (uint64_t)((X)5) ) + #define X_FREE(X) do { if (X) free(X); X = NULL; } while(0) #endif /* MACRO_H_ */
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.