From ba0eddee91cf4d005616e0834b8e1c9310d86b11 Mon Sep 17 00:00:00 2001 From: brad Date: Fri, 29 Mar 2013 23:39:13 +0000 Subject: [PATCH] Merge in my original update. ok ian@ --- devel/libmtp/Makefile | 8 +++++--- devel/libmtp/patches/patch-src_mtpz_c | 18 +++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/devel/libmtp/Makefile b/devel/libmtp/Makefile index 90af3240362..67cb4d2d1ce 100644 --- a/devel/libmtp/Makefile +++ b/devel/libmtp/Makefile @@ -1,11 +1,13 @@ -# $OpenBSD: Makefile,v 1.25 2013/03/29 13:23:50 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.26 2013/03/29 23:39:13 brad Exp $ COMMENT= Media Transfer Protocol (MTP) implementation DISTNAME= libmtp-1.1.6 -SHARED_LIBS += mtp 5.1 # 9.5 +REVISION= 0 CATEGORIES= devel +SHARED_LIBS += mtp 6.0 # 10.0 + HOMEPAGE= http://libmtp.sourceforge.net/ # LGPLv2.1 @@ -24,7 +26,7 @@ LIB_DEPENDS= devel/libusb1 \ CONFIGURE_STYLE= gnu CONFIGURE_ARGS+= --enable-doxygen -CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib -pthread" \ +CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib" \ CPPFLAGS="-I${LOCALBASE}/include" FAKE_FLAGS+= pkgdocdir="${PREFIX}/share/doc/libmtp/" diff --git a/devel/libmtp/patches/patch-src_mtpz_c b/devel/libmtp/patches/patch-src_mtpz_c index 0a53dd72dfb..301a35da2e2 100644 --- a/devel/libmtp/patches/patch-src_mtpz_c +++ b/devel/libmtp/patches/patch-src_mtpz_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-src_mtpz_c,v 1.1 2013/01/26 09:46:35 brad Exp $ ---- src/mtpz.c.orig Sun Sep 2 10:46:25 2012 -+++ src/mtpz.c Mon Jan 14 10:41:14 2013 -@@ -236,7 +236,7 @@ unsigned int mtpz_aes_gb9[]; +$OpenBSD: patch-src_mtpz_c,v 1.2 2013/03/29 23:39:13 brad Exp $ +--- src/mtpz.c.orig Fri Mar 15 02:34:22 2013 ++++ src/mtpz.c Fri Mar 15 18:31:28 2013 +@@ -238,7 +238,7 @@ unsigned int mtpz_aes_gb9[]; #define MTPZ_ENCRYPTIONBYTE2(val) (((val) >> 8) & 0xFF) #define MTPZ_ENCRYPTIONBYTE3(val) (((val) >> 0) & 0xFF) @@ -10,14 +10,14 @@ $OpenBSD: patch-src_mtpz_c,v 1.1 2013/01/26 09:46:35 brad Exp $ void mtpz_encryption_cipher(unsigned char *data, unsigned int len, char encrypt); void mtpz_encryption_cipher_advanced(unsigned char *key, unsigned int key_len, unsigned char *data, unsigned int data_len, char encrypt); -@@ -248,6 +248,17 @@ void mtpz_encryption_encrypt_custom(unsigned char *dat +@@ -250,6 +250,17 @@ void mtpz_encryption_encrypt_custom(unsigned char *dat void mtpz_encryption_encrypt_mac(unsigned char *hash, unsigned int hash_length, unsigned char *seed, unsigned int seed_len, unsigned char *out); +static inline uint32_t mtpz_bswap32(uint32_t x) +{ +#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) || defined(__clang__) -+ return __builtin_bswap32(x) ++ return __builtin_bswap32(x); +#else + return (x >> 24) | + ((x >> 8) & 0x0000ff00) | @@ -28,7 +28,7 @@ $OpenBSD: patch-src_mtpz_c,v 1.1 2013/01/26 09:46:35 brad Exp $ /* MTPZ RSA implementation */ -@@ -1574,11 +1585,11 @@ ptp_mtpz_validatehandshakeresponse (PTPParams* params, +@@ -1576,11 +1587,11 @@ ptp_mtpz_validatehandshakeresponse (PTPParams* params, mtpz_encryption_cipher_advanced((unsigned char *)hash_key, 16, act_msg, 832, 0); act_reader++; @@ -42,7 +42,7 @@ $OpenBSD: patch-src_mtpz_c,v 1.1 2013/01/26 09:46:35 brad Exp $ act_reader += 2; unsigned char *rand_data = (unsigned char *)malloc(rand_length); memcpy(rand_data, act_reader, rand_length); -@@ -1590,19 +1601,19 @@ ptp_mtpz_validatehandshakeresponse (PTPParams* params, +@@ -1592,19 +1603,19 @@ ptp_mtpz_validatehandshakeresponse (PTPParams* params, free(rand_data); act_reader += rand_length; @@ -65,7 +65,7 @@ $OpenBSD: patch-src_mtpz_c,v 1.1 2013/01/26 09:46:35 brad Exp $ act_reader += 2; unsigned char *machash_data = (unsigned char *)malloc(machash_length); memcpy(machash_data, act_reader, machash_length); -@@ -1636,8 +1647,8 @@ ptp_mtpz_opensecuresyncsession (PTPParams* params, uns +@@ -1638,8 +1649,8 @@ ptp_mtpz_opensecuresyncsession (PTPParams* params, uns mtpz_encryption_encrypt_mac(hash, 16, (unsigned char *)(&macCount), 4, mch); ret = ptp_mtpz_wmdrmpd_enabletrustedfilesoperations(params,