update to 1.2.10, add negative caching to keys

This commit is contained in:
espie 2011-08-29 09:54:51 +00:00
parent 7adaf18e54
commit d7ceace5c0
6 changed files with 85 additions and 11 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.17 2008/01/23 02:18:10 kurt Exp $
# $OpenBSD: Makefile,v 1.18 2011/08/29 09:54:51 espie Exp $
COMMENT= descramble scrambled DVDs
VER= 1.2.9
VER= 1.2.10
DISTNAME= libdvdcss-${VER}
SHARED_LIBS += dvdcss 2.7 # .2.7
SHARED_LIBS += dvdcss 2.8 # .2.7
CATEGORIES= converters
MASTER_SITES= http://www.videolan.org/pub/videolan/libdvdcss/${VER}/ \
http://www.fr.videolan.org/pub/videolan/vlc/${VER}/
@ -18,8 +18,9 @@ PERMIT_PACKAGE_CDROM= Free speech issue
PERMIT_PACKAGE_FTP= Yes
USE_LIBTOOL=Yes
CONFIGURE_STYLE= gnu
CONFIGURE_STYLE= autoconf
AUTOCONF_VERSION = 2.61
CONFIGURE_ENV= ac_cv_path_DOXYGEN=no ac_cv_path_LATEX=no
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/autotools
MODGNU_CONFIG_GUESS_DIRS=${WRKSRC}/.auto
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (libdvdcss-1.2.9.tar.gz) = vsZ6V0Nqf4DFrrPDq8y9ng==
RMD160 (libdvdcss-1.2.9.tar.gz) = AaTW1YvyB2WRBlbLrYKgnnCYY0M=
SHA1 (libdvdcss-1.2.9.tar.gz) = ezFmWuQlWeWAGc/Nk6J0fRG88GA=
SHA256 (libdvdcss-1.2.9.tar.gz) = C7a3aXH5qxhsQM9sPzYRi0se8RG1apWK3FyUXvyUcUQ=
SIZE (libdvdcss-1.2.9.tar.gz) = 388723
MD5 (libdvdcss-1.2.10.tar.gz) = ewOpVxw6hdgBMwx3cs1pxA==
RMD160 (libdvdcss-1.2.10.tar.gz) = t0S0gDHPeK33uPDkMfuslBu3mAY=
SHA1 (libdvdcss-1.2.10.tar.gz) = NvVGEKZu8vLU8BH8la6yViKd4yE=
SHA256 (libdvdcss-1.2.10.tar.gz) = mkR9eqLYgConV6tTGcYdGHCHTKarYxn8R5lnp9WRPCA=
SIZE (libdvdcss-1.2.10.tar.gz) = 420996

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-configure_ac,v 1.1 2011/08/29 09:54:51 espie Exp $
--- configure.ac.orig Fri Aug 29 20:59:00 2008
+++ configure.ac Wed Aug 17 11:51:22 2011
@@ -1,4 +1,4 @@
-AC_INIT(src/libdvdcss.c)
+AC_INIT(libdvdcss, 1.2.10)
AC_PREREQ(2.50)
AC_CONFIG_AUX_DIR(.auto)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-doc_Makefile_in,v 1.1 2011/08/29 09:54:51 espie Exp $
--- doc/Makefile.in.orig Wed Aug 17 11:05:03 2011
+++ doc/Makefile.in Wed Aug 17 11:05:16 2011
@@ -335,7 +335,7 @@ all: stamp-doxygen stamp-latex
doxygen.cfg: $(srcdir)/doxygen.cfg.in
-rm -f $@
- sed 's|@SRCDIR@|$(srcdir)|g; s|@TOP_SRCDIR@|$(top_srcdir)|g' $< > $@
+ sed 's|@SRCDIR@|$(srcdir)|g; s|@TOP_SRCDIR@|$(top_srcdir)|g' $(srcdir)/doxygen.cfg.in > $@
stamp-doxygen: doxygen.cfg
@DOXYGEN_TRUE@ doxygen doxygen.cfg

View File

@ -0,0 +1,50 @@
$OpenBSD: patch-src_css_c,v 1.1 2011/08/29 09:54:51 espie Exp $
--- src/css.c.orig Fri Aug 29 20:42:47 2008
+++ src/css.c Sun Aug 28 15:26:39 2011
@@ -172,10 +172,13 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block )
{
char psz_key[KEY_SIZE * 3];
unsigned int k0, k1, k2, k3, k4;
+ int n;
- psz_key[KEY_SIZE * 3 - 1] = '\0';
+ memset(psz_key, 0, sizeof psz_key);
+ n = read( i_fd, psz_key, KEY_SIZE * 3 - 1 );
+ close( i_fd );
- if( read( i_fd, psz_key, KEY_SIZE * 3 - 1 ) == KEY_SIZE * 3 - 1
+ if( n == KEY_SIZE * 3 - 1
&& sscanf( psz_key, "%x:%x:%x:%x:%x",
&k0, &k1, &k2, &k3, &k4 ) == 5 )
{
@@ -189,9 +192,12 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block )
/* Don't try to save it again */
b_cache = 0;
i_ret = 1;
+ }
+ else if (n > 0 && strcmp(psz_key, PACKAGE_VERSION "\n") == 0)
+ {
+ /* didn't crack it, negative caching */
+ return -1;
}
-
- close( i_fd );
}
}
@@ -203,6 +209,15 @@ int _dvdcss_title ( dvdcss_t dvdcss, int i_block )
if( i_ret < 0 )
{
print_error( dvdcss, "fatal error in vts css key" );
+ i_fd = open( dvdcss->psz_cachefile, O_RDWR|O_CREAT, 0644 );
+ if( i_fd >= 0 )
+ {
+ char message[sizeof(PACKAGE_VERSION) + 3];
+
+ sprintf( message, "%s\n", PACKAGE_VERSION);
+ write( i_fd, message, strlen(message) );
+ close( i_fd );
+ }
return i_ret;
}

View File

@ -1,6 +1,8 @@
@comment $OpenBSD: PLIST,v 1.6 2004/08/06 16:06:03 espie Exp $
@comment $OpenBSD: PLIST,v 1.7 2011/08/29 09:54:51 espie Exp $
include/dvdcss/
include/dvdcss/dvdcss.h
lib/libdvdcss.a
lib/libdvdcss.la
%%SHARED%%
lib/pkgconfig/
lib/pkgconfig/libdvdcss.pc