Subject: [alpine-aports] [PATCH] community/mbedtls: security upgrade to 2.4.2

From: Daniel Sabogal <[email-masked]>
Date: Sat, 11 Mar 2017 10:48:37 -0500

multiple security fixes (including CVE-2017-2784)
clean abuild
add check
---
 community/mbedtls/APKBUILD | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/community/mbedtls/APKBUILD b/community/mbedtls/APKBUILD
index ce3a5ba42e..6428b7ff1d 100644
--- a/community/mbedtls/APKBUILD
+++ b/community/mbedtls/APKBUILD
@@ -1,7 +1,7 @@
 # Contributor: Łukasz Jendrysik <[email-masked]>
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=mbedtls
-pkgver=2.4.1
+pkgver=2.4.2
 pkgrel=0
 pkgdesc="Light-weight cryptographic and SSL/TLS library"
 url="https://tls.mbed.org/"
@@ -13,30 +13,39 @@ subpackages="$pkgname-static $pkgname-dev $pkgname-utils"
 source="$pkgname-$pkgver.tar.gz::https://github.com/ARMmbed/$pkgname/archive/$pkgname-$pkgver.tar.gz
 	verbose-testsuite.patch"
 
+# secfixes:
+#   2.4.2-r0
+#   - CVE-2017-2784
+
 builddir="$srcdir/$pkgname-$pkgname-$pkgver"
 build() {
 	cd "$builddir"
 
 	# enable flags for non-embedded systems
-	sed -i -e 's|//\(#define MBEDTLS_THREADING_C\)|\1|' -e 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' include/mbedtls/config.h
+	sed -i -e 's|//\(#define MBEDTLS_THREADING_C\)|\1|' \
+		-e 's|//\(#define MBEDTLS_THREADING_PTHREAD\)|\1|' \
+		include/mbedtls/config.h
+
 	cmake . \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DCMAKE_BUILD_TYPE="Release" \
 		-DUSE_SHARED_MBEDTLS_LIBRARY=1 \
 		|| return 1
-	make || return 1
-	make test || return 1
+	make
+}
+
+check() {
+	make -C "$builddir" test
 }
 
 package() {
-	cd "$builddir"
-	make DESTDIR="$pkgdir" install || return 1
+	make DESTDIR="$pkgdir" -C "$builddir" install
 }
 
 utils() {
 	pkgdesc="Utilities for mbedtls"
 	mkdir -p "$subpkgdir"/usr/libexec
-	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/libexec/mbedtls || return 1
+	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/libexec/mbedtls
 }
 
 static() {
@@ -45,9 +54,5 @@ static() {
 	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
 }
 
-md5sums="a4494630e2c2e3705238526d51428971  mbedtls-2.4.1.tar.gz
-8136afec9a4503c0087fa93eb1920bd9  verbose-testsuite.patch"
-sha256sums="0c85fe59e1f0426b1c8f17efdc0c41bd531828b6cff746c392beb53c774af4cb  mbedtls-2.4.1.tar.gz
-21460d566f678f76bef8c2895e6c93d8a23792f6481aed5853dc63daf8cfcbaa  verbose-testsuite.patch"
-sha512sums="c452ec701c90bca236be1fbacb728036a01eca257c9df8b0d738e02f4a3570183e34ae23221ca61933dd34e42ca7659bae9ce5de0a6fdd870e77c4b7154d3688  mbedtls-2.4.1.tar.gz
+sha512sums="39ab068ffad99afe228749fc7f69a02a8c79f0fdb73e2dbcde2e97f737338030e2fb8507e9d1cb866429e89b255197a2225607d6645421d31d7f2ccb65bfc04f  mbedtls-2.4.2.tar.gz
 1a0f0c8c794f8aab2a050b660e86f3cba293fcd4d0ffba9a1a1b8fd88f631d68fe194256495ed584d13e577c577829f0bbe821ffaf11165163b5a78c9d68efe8  verbose-testsuite.patch"
-- 
2.11.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---