summaryrefslogtreecommitdiff
path: root/debian/adjust-openssl-dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'debian/adjust-openssl-dependencies')
-rwxr-xr-xdebian/adjust-openssl-dependencies39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/adjust-openssl-dependencies b/debian/adjust-openssl-dependencies
new file mode 100755
index 000000000..cd740a8e1
--- /dev/null
+++ b/debian/adjust-openssl-dependencies
@@ -0,0 +1,39 @@
1#! /bin/sh
2# Attempt to tighten libssl dependencies to match the check in entropy.c.
3# Must be run after dpkg-shlibdeps.
4
5client=debian/openssh-client.substvars
6server=debian/openssh-server.substvars
7
8libssl_version="$(dpkg-query -W libssl1.0-dev 2>/dev/null | cut -f2)"
9if [ -z "$libssl_version" ]; then
10 libssl_version="$(dpkg-query -W libssl-dev 2>/dev/null | cut -f2)"
11fi
12if [ -z "$libssl_version" ]; then
13 echo "Can't find libssl-dev version; leaving dependencies alone."
14 exit 0
15fi
16libssl_version="$(echo "$libssl_version" | sed 's/[a-z-].*//')"
17
18libssl_package="$(sed -n 's/.*[= ]\(libssl[0-9][a-z0-9+.-]*\).*/\1/p' "$client")"
19if [ "$libssl_package" ]; then
20 new_dep="$libssl_package (>= $libssl_version)"
21 sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client"
22 sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server"
23fi
24
25client_udeb=debian/openssh-client-udeb.substvars
26server_udeb=debian/openssh-server-udeb.substvars
27
28libcrypto_package="$(sed -n 's/.*[= ]\(libcrypto[0-9][a-z0-9+.-]*\).*/\1/p' "$client_udeb")"
29if [ "$libcrypto_package" ]; then
30 new_dep="$libcrypto_package (>= $libssl_version)"
31 if [ -e "$client_udeb" ]; then
32 sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$client_udeb"
33 fi
34 if [ -e "$server_udeb" ]; then
35 sed -i "/^shlibs:Depends=/s/\$/, $new_dep/" "$server_udeb"
36 fi
37fi
38
39exit 0