a09887ec78
- Use openssl for crypto, we have too many duplicated implementations of common digest algos - Autotools fixes. OBS-URL: https://build.opensuse.org/request/show/129499 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/libdvdread?expand=0&rev=12
134 lines
4.0 KiB
Diff
134 lines
4.0 KiB
Diff
--- src/dvd_reader.c.orig
|
|
+++ src/dvd_reader.c
|
|
@@ -32,6 +32,7 @@
|
|
#include <unistd.h>
|
|
#include <limits.h>
|
|
#include <dirent.h>
|
|
+#include <openssl/evp.h>
|
|
|
|
/* misc win32 helpers */
|
|
#ifdef WIN32
|
|
@@ -68,7 +69,6 @@ static inline int _private_gettimeofday(
|
|
#include "dvdread/dvd_udf.h"
|
|
#include "dvd_input.h"
|
|
#include "dvdread/dvd_reader.h"
|
|
-#include "md5.h"
|
|
|
|
#define DEFAULT_UDF_CACHE_LEVEL 1
|
|
|
|
@@ -1326,7 +1326,7 @@ ssize_t DVDFileSize( dvd_file_t *dvd_fil
|
|
|
|
int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid )
|
|
{
|
|
- struct md5_ctx ctx;
|
|
+ EVP_MD_CTX *ctx;
|
|
int title;
|
|
int nr_of_files = 0;
|
|
|
|
@@ -1336,7 +1336,9 @@ int DVDDiscID( dvd_reader_t *dvd, unsign
|
|
|
|
/* Go through the first 10 IFO:s, in order,
|
|
* and md5sum them, i.e VIDEO_TS.IFO and VTS_0?_0.IFO */
|
|
- md5_init_ctx( &ctx );
|
|
+ ctx = EVP_MD_CTX_create();
|
|
+ EVP_DigestInit_ex(ctx, EVP_md5(), NULL);
|
|
+
|
|
for( title = 0; title < 10; title++ ) {
|
|
dvd_file_t *dvd_file = DVDOpenFile( dvd, title, DVD_READ_INFO_FILE );
|
|
if( dvd_file != NULL ) {
|
|
@@ -1360,15 +1362,14 @@ int DVDDiscID( dvd_reader_t *dvd, unsign
|
|
free( buffer_base );
|
|
return -1;
|
|
}
|
|
-
|
|
- md5_process_bytes( buffer, file_size, &ctx );
|
|
-
|
|
+ EVP_DigestUpdate(ctx, buffer, file_size);
|
|
DVDCloseFile( dvd_file );
|
|
free( buffer_base );
|
|
nr_of_files++;
|
|
}
|
|
}
|
|
- md5_finish_ctx( &ctx, discid );
|
|
+ EVP_DigestFinal_ex(ctx, discid, NULL);
|
|
+ EVP_MD_CTX_destroy(ctx);
|
|
if(!nr_of_files)
|
|
return -1;
|
|
|
|
--- src/Makefile.am.orig
|
|
+++ src/Makefile.am
|
|
@@ -2,17 +2,17 @@ include $(top_srcdir)/misc/Makefile.comm
|
|
|
|
includedir = ${prefix}/include/dvdread
|
|
|
|
-AM_CPPFLAGS = -I$(top_srcdir)/src
|
|
+AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/src
|
|
|
|
lib_LTLIBRARIES = libdvdread.la
|
|
|
|
libdvdread_la_SOURCES = dvd_reader.c nav_read.c ifo_read.c \
|
|
- dvd_input.c dvd_udf.c md5.c nav_print.c ifo_print.c bitreader.c \
|
|
- bswap.h dvd_input.h dvdread_internal.h dvd_udf.h md5.h bitreader.h
|
|
+ dvd_input.c dvd_udf.c nav_print.c ifo_print.c bitreader.c \
|
|
+ bswap.h dvd_input.h dvdread_internal.h dvd_udf.h bitreader.h
|
|
|
|
-libdvdread_la_LIBADD = $(DYNAMIC_LD_LIBS)
|
|
+libdvdread_la_LIBADD = $(DYNAMIC_LD_LIBS) $(OPENSSL_LIBS)
|
|
|
|
-libdvdread_la_LDFLAGS = -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \
|
|
+libdvdread_la_LDFLAGS = -no-undefined -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \
|
|
-export-symbols-regex "(^dvd.*|^nav.*|^ifo.*|^DVD.*|^UDF.*)"
|
|
|
|
include_HEADERS = dvdread/dvd_reader.h dvdread/nav_read.h dvdread/ifo_read.h \
|
|
--- configure.ac.orig
|
|
+++ configure.ac
|
|
@@ -82,10 +82,9 @@ dnl ------------------------------------
|
|
dnl Checks for programs.
|
|
dnl --------------------------------------------------------------
|
|
dnl Save CFLAGS, AC_ISC_POSIX set some unwanted default CFLAGS
|
|
-saved_CFLAGS="$CFLAGS"
|
|
-AC_ISC_POSIX
|
|
-CFLAGS="$saved_CFLAGS"
|
|
-AC_PROG_CC
|
|
+AC_PROG_CC_STDC
|
|
+AC_USE_SYSTEM_EXTENSIONS
|
|
+AC_SYS_LARGEFILE
|
|
AC_PROG_MAKE_SET
|
|
AC_PROG_INSTALL
|
|
AC_PROG_LN_S
|
|
@@ -95,17 +94,7 @@ dnl Libtool
|
|
dnl --------------------------------------------------------------
|
|
dnl LT_PREREQ only available in libtool-2.2+
|
|
dnl LT_PREREQ([1.4.0])
|
|
-AC_LIBTOOL_DLOPEN
|
|
-AC_DISABLE_STATIC
|
|
-AC_PROG_LIBTOOL
|
|
-AC_SUBST(LIBTOOL_DEPS)
|
|
-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
|
|
- STATIC="-static"
|
|
-else
|
|
- STATIC=
|
|
-fi
|
|
-AC_SUBST(STATIC)
|
|
-
|
|
+LT_INIT([disable-static pic-only])
|
|
dnl --------------------------------------------------------------
|
|
dnl Checks for header files.
|
|
dnl --------------------------------------------------------------
|
|
@@ -158,14 +147,11 @@ case $host in
|
|
;;
|
|
esac
|
|
|
|
+PKG_CHECK_MODULES(OPENSSL, openssl)
|
|
dnl ---------------------------------------------
|
|
dnl cflags
|
|
dnl ---------------------------------------------
|
|
dnl Common cflags for all platforms
|
|
-CFLAGS="-O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE $CFLAGS"
|
|
-DEBUG_CFLAGS="-g -DDEBUG $CFLAGS"
|
|
-
|
|
-AC_SUBST(DEBUG_CFLAGS)
|
|
|
|
dnl ---------------------------------------------
|
|
dnl Check for doxygen (dynamic documentation generator)
|