diff --git a/audio/wavpack/Makefile b/audio/wavpack/Makefile index 198ca86688c..d3d8770c7ea 100644 --- a/audio/wavpack/Makefile +++ b/audio/wavpack/Makefile @@ -1,19 +1,20 @@ -# $OpenBSD: Makefile,v 1.28 2019/07/12 20:43:42 sthen Exp $ +# $OpenBSD: Makefile,v 1.29 2020/01/05 18:35:34 juanfra Exp $ COMMENT = audio codec for lossless, lossy and hybrid compression -DISTNAME = wavpack-5.1.0 -REVISION = 2 +DISTNAME = wavpack-5.2.0 CATEGORIES = audio HOMEPAGE = http://www.wavpack.com/ -SHARED_LIBS += wavpack 0.2 # 3.0 +MAINTAINER = Juan Francisco Cantero Hurtado + +SHARED_LIBS += wavpack 0.3 # 3.1 # BSD PERMIT_PACKAGE = Yes -WANTLIB = c iconv m +WANTLIB = c crypto iconv m MASTER_SITES = ${HOMEPAGE} EXTRACT_SUFX = .tar.bz2 @@ -21,19 +22,15 @@ EXTRACT_SUFX = .tar.bz2 LIB_DEPENDS = converters/libiconv SEPARATE_BUILD = Yes -CONFIGURE_STYLE = autoreconf -CONFIGURE_ARGS = --enable-tests +CONFIGURE_STYLE = gnu +CONFIGURE_ARGS = --enable-legacy \ + --enable-libcrypto \ + --enable-tests CONFIGURE_ENV = CPPFLAGS="-I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib" DOCDIR = ${PREFIX}/share/doc/wavpack -AUTOMAKE_VERSION = 1.14 -AUTOCONF_VERSION = 2.69 - -pre-configure: - sed -i 's,#include "md5.h",#include ,' ${WRKSRC}/cli/*.c - post-install: ${INSTALL_DATA_DIR} ${DOCDIR} ${INSTALL_DATA} ${WRKSRC}/ChangeLog ${WRKSRC}/doc/* ${DOCDIR} diff --git a/audio/wavpack/distinfo b/audio/wavpack/distinfo index e530f8aff1c..4d07c6c9c4e 100644 --- a/audio/wavpack/distinfo +++ b/audio/wavpack/distinfo @@ -1,2 +1,2 @@ -SHA256 (wavpack-5.1.0.tar.bz2) = GTlifVNY0dpivGFY1j9+0SkFVS86eZx5nukClqdhKUQ= -SIZE (wavpack-5.1.0.tar.bz2) = 824331 +SHA256 (wavpack-5.2.0.tar.bz2) = PCOMxDYlI6wkMmUq8VhheW/n3prgjx7388aQutdJThg= +SIZE (wavpack-5.2.0.tar.bz2) = 849348 diff --git a/audio/wavpack/patches/patch-cli_Makefile_am b/audio/wavpack/patches/patch-cli_Makefile_am deleted file mode 100644 index c1fb7c1428c..00000000000 --- a/audio/wavpack/patches/patch-cli_Makefile_am +++ /dev/null @@ -1,34 +0,0 @@ -$OpenBSD: patch-cli_Makefile_am,v 1.1 2017/05/15 16:39:58 sthen Exp $ - -Defer to libc's md5 functions, the internal version fails on -strict-alignment architectures. - -Index: cli/Makefile.am ---- cli/Makefile.am.orig -+++ cli/Makefile.am -@@ -1,6 +1,6 @@ - bin_PROGRAMS = wavpack wvunpack wvgain wvtag - --wavpack_SOURCES = wavpack.c riff.c wave64.c caff.c dsdiff.c dsf.c utils.c md5.c import_id3.c -+wavpack_SOURCES = wavpack.c riff.c wave64.c caff.c dsdiff.c dsf.c utils.c import_id3.c - if WINDOWS_HOST - wavpack_SOURCES += win32_unicode_support.c - endif -@@ -10,7 +10,7 @@ wavpack_LDFLAGS = -rpath $(libdir) - endif - wavpack_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) $(ICONV_LIBS) - --wvunpack_SOURCES = wvunpack.c riff.c wave64.c caff.c dsdiff.c dsf.c utils.c md5.c -+wvunpack_SOURCES = wvunpack.c riff.c wave64.c caff.c dsdiff.c dsf.c utils.c - if WINDOWS_HOST - wvunpack_SOURCES += win32_unicode_support.c - endif -@@ -42,7 +42,7 @@ wvtag_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/li - - if ENABLE_TESTS - bin_PROGRAMS += wvtest --wvtest_SOURCES = wvtest.c md5.c -+wvtest_SOURCES = wvtest.c - wvtest_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/include - if ENABLE_RPATH - wvtest_LDFLAGS = -rpath $(libdir) diff --git a/audio/wavpack/patches/patch-cli_caff_c b/audio/wavpack/patches/patch-cli_caff_c deleted file mode 100644 index e8f37cfaf03..00000000000 --- a/audio/wavpack/patches/patch-cli_caff_c +++ /dev/null @@ -1,61 +0,0 @@ -$OpenBSD: patch-cli_caff_c,v 1.1 2018/03/16 22:18:41 juanfra Exp $ - -CVE-2018-7254 - -https://github.com/dbry/WavPack/commit/8e3fe45a7bac31d9a3b558ae0079e2d92a04799e - -Index: cli/caff.c ---- cli/caff.c.orig -+++ cli/caff.c -@@ -89,8 +89,8 @@ typedef struct - - #define CAFChannelDescriptionFormat "LLLLL" - --static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21 }; --static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16 }; -+static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21,0 }; -+static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16,0 }; - - static struct { - uint32_t mChannelLayoutTag; // Core Audio layout, 100 - 146 in high word, num channels in low word -@@ -274,10 +274,19 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilen - } - } - else if (!strncmp (caf_chunk_header.mChunkType, "chan", 4)) { -- CAFChannelLayout *caf_channel_layout = malloc ((size_t) caf_chunk_header.mChunkSize); -+ CAFChannelLayout *caf_channel_layout; - -- if (caf_chunk_header.mChunkSize < sizeof (CAFChannelLayout) || -- !DoReadFile (infile, caf_channel_layout, (uint32_t) caf_chunk_header.mChunkSize, &bcount) || -+ if (caf_chunk_header.mChunkSize < sizeof (CAFChannelLayout) || caf_chunk_header.mChunkSize > 1024) { -+ error_line ("this .CAF file has an invalid 'chan' chunk!"); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ if (debug_logging_mode) -+ error_line ("'chan' chunk is %d bytes", (int) caf_chunk_header.mChunkSize); -+ -+ caf_channel_layout = malloc ((size_t) caf_chunk_header.mChunkSize); -+ -+ if (!DoReadFile (infile, caf_channel_layout, (uint32_t) caf_chunk_header.mChunkSize, &bcount) || - bcount != caf_chunk_header.mChunkSize) { - error_line ("%s is not a valid .CAF file!", infilename); - free (caf_channel_layout); -@@ -495,8 +504,15 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilen - } - else { // just copy unknown chunks to output file - -- int bytes_to_copy = (uint32_t) caf_chunk_header.mChunkSize; -- char *buff = malloc (bytes_to_copy); -+ uint32_t bytes_to_copy = (uint32_t) caf_chunk_header.mChunkSize; -+ char *buff; -+ -+ if (caf_chunk_header.mChunkSize < 0 || caf_chunk_header.mChunkSize > 1048576) { -+ error_line ("%s is not a valid .CAF file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ buff = malloc (bytes_to_copy); - - if (debug_logging_mode) - error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", diff --git a/audio/wavpack/patches/patch-cli_dsdiff_c b/audio/wavpack/patches/patch-cli_dsdiff_c deleted file mode 100644 index c967f933899..00000000000 --- a/audio/wavpack/patches/patch-cli_dsdiff_c +++ /dev/null @@ -1,28 +0,0 @@ -$OpenBSD: patch-cli_dsdiff_c,v 1.1 2018/03/16 22:18:41 juanfra Exp $ - -CVE-2018-7253 - -https://github.com/dbry/WavPack/commit/36a24c7881427d2e1e4dc1cef58f19eee0d13aec - -Index: cli/dsdiff.c ---- cli/dsdiff.c.orig -+++ cli/dsdiff.c -@@ -153,7 +153,17 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infil - error_line ("dsdiff file version = 0x%08x", version); - } - else if (!strncmp (dff_chunk_header.ckID, "PROP", 4)) { -- char *prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize); -+ char *prop_chunk; -+ -+ if (dff_chunk_header.ckDataSize < 4 || dff_chunk_header.ckDataSize > 1024) { -+ error_line ("%s is not a valid .DFF file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ if (debug_logging_mode) -+ error_line ("got PROP chunk of %d bytes total", (int) dff_chunk_header.ckDataSize); -+ -+ prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize); - - if (!DoReadFile (infile, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize, &bcount) || - bcount != dff_chunk_header.ckDataSize) { diff --git a/audio/wavpack/patches/patch-cli_riff_c b/audio/wavpack/patches/patch-cli_riff_c deleted file mode 100644 index 35f14593244..00000000000 --- a/audio/wavpack/patches/patch-cli_riff_c +++ /dev/null @@ -1,108 +0,0 @@ -$OpenBSD: patch-cli_riff_c,v 1.1 2018/03/16 22:18:41 juanfra Exp $ - -CVE-2018-6767 - -https://github.com/dbry/WavPack/commit/d5bf76b5a88d044a1be1d5656698e3ba737167e5 - -Index: cli/riff.c ---- cli/riff.c.orig -+++ cli/riff.c -@@ -42,6 +42,7 @@ typedef struct { - - #pragma pack(pop) - -+#define CS64ChunkFormat "4D" - #define DS64ChunkFormat "DDDL" - - #define WAVPACK_NO_ERROR 0 -@@ -101,13 +102,13 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilen - - if (!strncmp (chunk_header.ckID, "ds64", 4)) { - if (chunk_header.ckSize < sizeof (DS64Chunk) || -- !DoReadFile (infile, &ds64_chunk, chunk_header.ckSize, &bcount) || -- bcount != chunk_header.ckSize) { -+ !DoReadFile (infile, &ds64_chunk, sizeof (DS64Chunk), &bcount) || -+ bcount != sizeof (DS64Chunk)) { - error_line ("%s is not a valid .WAV file!", infilename); - return WAVPACK_SOFT_ERROR; - } - else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && -- !WavpackAddWrapper (wpc, &ds64_chunk, chunk_header.ckSize)) { -+ !WavpackAddWrapper (wpc, &ds64_chunk, sizeof (DS64Chunk))) { - error_line ("%s", WavpackGetErrorMessage (wpc)); - return WAVPACK_SOFT_ERROR; - } -@@ -315,10 +316,11 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilen - - int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, int qmode) - { -- int do_rf64 = 0, write_junk = 1; -+ int do_rf64 = 0, write_junk = 1, table_length = 0; - ChunkHeader ds64hdr, datahdr, fmthdr; - RiffChunkHeader riffhdr; - DS64Chunk ds64_chunk; -+ CS64Chunk cs64_chunk; - JunkChunk junkchunk; - WaveHeader wavhdr; - uint32_t bcount; -@@ -380,6 +382,7 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wp - strncpy (riffhdr.formType, "WAVE", sizeof (riffhdr.formType)); - total_riff_bytes = sizeof (riffhdr) + wavhdrsize + sizeof (datahdr) + ((total_data_bytes + 1) & ~(int64_t)1); - if (do_rf64) total_riff_bytes += sizeof (ds64hdr) + sizeof (ds64_chunk); -+ total_riff_bytes += table_length * sizeof (CS64Chunk); - if (write_junk) total_riff_bytes += sizeof (junkchunk); - strncpy (fmthdr.ckID, "fmt ", sizeof (fmthdr.ckID)); - strncpy (datahdr.ckID, "data", sizeof (datahdr.ckID)); -@@ -394,11 +397,12 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wp - - if (do_rf64) { - strncpy (ds64hdr.ckID, "ds64", sizeof (ds64hdr.ckID)); -- ds64hdr.ckSize = sizeof (ds64_chunk); -+ ds64hdr.ckSize = sizeof (ds64_chunk) + (table_length * sizeof (CS64Chunk)); - CLEAR (ds64_chunk); - ds64_chunk.riffSize64 = total_riff_bytes; - ds64_chunk.dataSize64 = total_data_bytes; - ds64_chunk.sampleCount64 = total_samples; -+ ds64_chunk.tableLength = table_length; - riffhdr.ckSize = (uint32_t) -1; - datahdr.ckSize = (uint32_t) -1; - WavpackNativeToLittleEndian (&ds64hdr, ChunkHeaderFormat); -@@ -409,6 +413,14 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wp - datahdr.ckSize = (uint32_t) total_data_bytes; - } - -+ // this "table" is just a dummy placeholder for testing (normally not written) -+ -+ if (table_length) { -+ strncpy (cs64_chunk.ckID, "dmmy", sizeof (cs64_chunk.ckID)); -+ cs64_chunk.chunkSize64 = 12345678; -+ WavpackNativeToLittleEndian (&cs64_chunk, CS64ChunkFormat); -+ } -+ - // write the RIFF chunks up to just before the data starts - - WavpackNativeToLittleEndian (&riffhdr, ChunkHeaderFormat); -@@ -418,8 +430,21 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wp - - if (!DoWriteFile (outfile, &riffhdr, sizeof (riffhdr), &bcount) || bcount != sizeof (riffhdr) || - (do_rf64 && (!DoWriteFile (outfile, &ds64hdr, sizeof (ds64hdr), &bcount) || bcount != sizeof (ds64hdr))) || -- (do_rf64 && (!DoWriteFile (outfile, &ds64_chunk, sizeof (ds64_chunk), &bcount) || bcount != sizeof (ds64_chunk))) || -- (write_junk && (!DoWriteFile (outfile, &junkchunk, sizeof (junkchunk), &bcount) || bcount != sizeof (junkchunk))) || -+ (do_rf64 && (!DoWriteFile (outfile, &ds64_chunk, sizeof (ds64_chunk), &bcount) || bcount != sizeof (ds64_chunk)))) { -+ error_line ("can't write .WAV data, disk probably full!"); -+ return FALSE; -+ } -+ -+ // again, this is normally not written except for testing -+ -+ while (table_length--) -+ if (!DoWriteFile (outfile, &cs64_chunk, sizeof (cs64_chunk), &bcount) || bcount != sizeof (cs64_chunk)) { -+ error_line ("can't write .WAV data, disk probably full!"); -+ return FALSE; -+ } -+ -+ -+ if ((write_junk && (!DoWriteFile (outfile, &junkchunk, sizeof (junkchunk), &bcount) || bcount != sizeof (junkchunk))) || - !DoWriteFile (outfile, &fmthdr, sizeof (fmthdr), &bcount) || bcount != sizeof (fmthdr) || - !DoWriteFile (outfile, &wavhdr, wavhdrsize, &bcount) || bcount != wavhdrsize || - !DoWriteFile (outfile, &datahdr, sizeof (datahdr), &bcount) || bcount != sizeof (datahdr)) { diff --git a/audio/wavpack/pkg/PLIST b/audio/wavpack/pkg/PLIST index 906cd92e61f..c325a93fc2b 100644 --- a/audio/wavpack/pkg/PLIST +++ b/audio/wavpack/pkg/PLIST @@ -1,11 +1,11 @@ -@comment $OpenBSD: PLIST,v 1.6 2017/02/01 22:06:14 tim Exp $ +@comment $OpenBSD: PLIST,v 1.7 2020/01/05 18:35:35 juanfra Exp $ @bin bin/wavpack @bin bin/wvgain @bin bin/wvtag @bin bin/wvunpack include/wavpack/ include/wavpack/wavpack.h -lib/libwavpack.a +@static-lib lib/libwavpack.a lib/libwavpack.la @lib lib/libwavpack.so.${LIBwavpack_VERSION} lib/pkgconfig/wavpack.pc