upgrade base image 3.12 => 3.14

This commit is contained in:
ezkrg
2021-09-25 19:34:52 +02:00
parent 397d549e6a
commit 5ce8515ee1
3 changed files with 42 additions and 6 deletions

View File

@@ -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 \

11
sipe-tls-tester.c.patch Normal file
View File

@@ -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);
}

20
sipe-tls.c.patch Normal file
View File

@@ -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);