APKBUILD 1.88 KB
Newer Older
TBK's avatar
TBK committed
1
# Contributor: TBK <alpine@jjtc.eu>
2
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
TBK's avatar
TBK committed
3
pkgname=libretls
J0WI's avatar
J0WI committed
4
pkgver=3.3.4
J0WI's avatar
J0WI committed
5
pkgrel=3
6
pkgdesc="port of libtls from libressl to openssl"
TBK's avatar
TBK committed
7
8
9
arch="all"
url="https://git.causal.agency/libretls/"
license="ISC AND (BSD-3-Clause OR MIT)"
10
depends="ca-certificates-bundle"
11
depends_dev="openssl1.1-compat-dev"
12
13
base_deps="autoconf automake libtool"
makedepends="$depends_dev $base_deps"
14
makedepends_host="openssl1.1-compat-dev"
15
16
makedepends_build="$base_deps"

TBK's avatar
TBK committed
17
subpackages="$pkgname-doc $pkgname-static $pkgname-dev"
18
source="https://causal.agency/libretls/libretls-$pkgver.tar.gz
J0WI's avatar
J0WI committed
19
	CVE-2022-0778.patch
20
	test_program.c"
TBK's avatar
TBK committed
21

J0WI's avatar
J0WI committed
22
23
24
25
# secfixes:
#   3.3.4-r3:
#     - CVE-2022-0778

26
27
28
prepare() {
	default_prepare

29
30
31
32
33
34
35
	# Override the LIBTLS_VERSION to be 2:*:*, as libtls-standalone was 1:0:0.
	# also make sure the LIBTLS version is different from upstream libressl
	# so they can be installed in parallel
	local _current _rev _age
	IFS=: read _current _rev _age < LIBTLS_VERSION
	printf "%d:%d:%d\n" $(( $_current - 18 )) $_rev $_age > LIBTLS_VERSION

36
37
38
	autoreconf
}

TBK's avatar
TBK committed
39
build() {
40
41
42
43
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
TBK's avatar
TBK committed
44
45
46
47
48
49
50
	make all
}

package() {
	make DESTDIR="$pkgdir" install
}

51
52
53
check() {
	set -x

J0WI's avatar
J0WI committed
54
	# shellcheck disable=SC2046
55
56
57
58
59
60
61
	gcc -o test_program "$srcdir"/test_program.c -I"$builddir"/include -L"$builddir"/.libs -ltls $(pkgconf --cflags --libs openssl)
	LD_LIBRARY_PATH="$builddir"/.libs ./test_program

	set +x
}

sha512sums="
J0WI's avatar
J0WI committed
62
ae6f1b7bf9f61948e88ce87c93921b2b27652d85a95062f38abe7dfbb30d40c974c79b7d6faab43b3a987abff5e761b5c2a1982af8cc1511fb3136c580a0e3d6  libretls-3.3.4.tar.gz
J0WI's avatar
J0WI committed
63
e6371f3e2b071f9cd805562a81aa2a1e5cf141d3b8f05d03713deb9f4f13778fe1ec5c05a7a398bfe358442b5776e9905f4c9b78ec109a2c98c9f12473bb4ccf  CVE-2022-0778.patch
64
65
71d36fe25c95a0a45497e3f699b01dddcaae9053dd1b1e2419df94272c47024cf6516c51c902129201061601b04a72551904b15a332a4cf53358983b5db73618  test_program.c
"