aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorezkrg <ezkrg@ezkrg.me>2021-09-25 17:34:52 +0000
committerezkrg <ezkrg@ezkrg.me>2021-09-25 17:34:52 +0000
commit5ce8515ee1c1f91a4e36d85287ff6517daa80bca (patch)
treef832ad109db090080e7016d4b1b43b08814d15c3
parentchange release process (diff)
downloaddocker-bitlbee-libpurple-5ce8515ee1c1f91a4e36d85287ff6517daa80bca.tar.gz
docker-bitlbee-libpurple-5ce8515ee1c1f91a4e36d85287ff6517daa80bca.zip
upgrade base image 3.12 => 3.14
-rw-r--r--Dockerfile17
-rw-r--r--sipe-tls-tester.c.patch11
-rw-r--r--sipe-tls.c.patch20
3 files changed, 42 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index a38ad0c..350831f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
-ARG ALPINE_VERSION=3.12
+FROM alpine:3.14 as base-image
-FROM alpine:${ALPINE_VERSION} as bitlbee-build
+FROM base-image as bitlbee-build
ARG BITLBEE_VERSION=3.6
@@ -174,12 +174,17 @@ FROM bitlbee-build as sipe-build
ARG SIPE=1
ARG SIPE_VERSION=1.25.0
+COPY sipe-tls-tester.c.patch /tmp/sipe-tls-tester.c.patch
+COPY sipe-tls.c.patch /tmp/sipe-tls.c.patch
+
RUN echo SIPE=${SIPE} > /tmp/status \
&& if [ ${SIPE} -eq 1 ]; \
then cd /tmp \
&& git clone -n https://repo.or.cz/siplcs.git \
&& cd siplcs \
&& git checkout ${SIPE_VERSION} \
+ && patch -p0 < ../sipe-tls-tester.c.patch \
+ && patch -p0 < ../sipe-tls.c.patch \
&& ./autogen.sh \
&& ./configure --prefix=/usr \
&& make \
@@ -327,7 +332,7 @@ RUN echo ICYQUE=${ICYQUE} > /tmp/status \
# ---
-FROM alpine:${ALPINE_VERSION} as bitlbee-plugins
+FROM base-image as bitlbee-plugins
COPY --from=bitlbee-build /usr/sbin/bitlbee /tmp/usr/sbin/bitlbee
COPY --from=bitlbee-build /usr/share/man/man8/bitlbee.8 /tmp/usr/share/man/man8/bitlbee.8
@@ -396,12 +401,12 @@ RUN apk add --update --no-cache findutils \
# ---
-FROM alpine:${ALPINE_VERSION} as bitlbee-libpurple
+FROM base-image as bitlbee-libpurple
COPY --from=bitlbee-plugins /tmp/ /
-ARG PKGS="tzdata bash glib libssl1.1 libpurple libpurple-xmpp \
- libpurple-oscar libpurple-bonjour"
+ARG PKGS="tzdata bash glib libssl1.1 libpurple \
+ libpurple-xmpp libpurple-bonjour"
RUN addgroup -g 101 -S bitlbee \
&& adduser -u 101 -D -S -G bitlbee bitlbee \
diff --git a/sipe-tls-tester.c.patch b/sipe-tls-tester.c.patch
new file mode 100644
index 0000000..f14344d
--- /dev/null
+++ b/sipe-tls-tester.c.patch
@@ -0,0 +1,11 @@
+--- src/core/sipe-tls-tester.c
++++ src/core/sipe-tls-tester.c.new
+@@ -155,7 +155,7 @@
+ printf("received %d bytes from server\n", result);
+ record = g_new0(struct record, 1);
+ record->length = result;
+- record->msg = g_memdup(buffer, result);
++ record->msg = g_memdup2(buffer, result);
+ length += result;
+ fragments = g_slist_append(fragments, record);
+ }
diff --git a/sipe-tls.c.patch b/sipe-tls.c.patch
new file mode 100644
index 0000000..37c7c21
--- /dev/null
+++ b/sipe-tls.c.patch
@@ -0,0 +1,20 @@
+--- src/core/sipe-tls.c
++++ src/core/sipe-tls.c.new
+@@ -427,7 +427,7 @@
+ gsize half = (secret_length + 1) / 2;
+ gsize newseed_length = label_length + seed_length;
+ /* secret: used as S1; secret2: last half of original secret (S2) */
+- guchar *secret2 = g_memdup(secret + secret_length - half, half);
++ guchar *secret2 = g_memdup2(secret + secret_length - half, half);
+ guchar *newseed = g_malloc(newseed_length);
+ guchar *md5, *dest;
+ guchar *sha1, *src;
+@@ -1525,7 +1525,7 @@
+
+ /* found all the required fields */
+ state->server_random.length = server_random->length;
+- state->server_random.buffer = g_memdup(server_random->data,
++ state->server_random.buffer = g_memdup2(server_random->data,
+ server_random->length);
+ tls_calculate_secrets(state);
+