/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

  • Committer: Teddy Hogeborn
  • Date: 2015-07-20 03:03:33 UTC
  • Revision ID: teddy@recompile.se-20150720030333-203m2aeblypcsfte
Bug fix for GnuTLS 3: be compatible with old 2048-bit DSA keys.

The mandos-keygen program in Mandos version 1.6.0 and older generated
2048-bit DSA keys, and when GnuTLS uses these it has trouble
connecting using the Mandos default priority string.  This was
previously fixed in Mandos 1.6.2, but the bug reappeared when using
GnuTLS 3, so the default priority string has to change again; this
time also the Mandos client has to change its default, so now the
server and the client should use the same default priority string:

SECURE256:!CTYPE-X.509:+CTYPE-OPENPGP:!RSA:+SIGN-DSA-SHA256

* mandos (main/server_defaults): Changed default priority string.
* mandos-options.xml (/section/para[id="priority_compat"]): Removed.
  (/section/para[id="priority"]): Changed default priority string.
* mandos.conf ([DEFAULT]/priority): - '' -
* mandos.conf.xml (OPTIONS/priority): Refer to the id "priority"
                                      instead of "priority_compat".
* mandos.xml (OPTIONS/--priority): - '' -
* plugins.d/mandos-client.c (main): Changed default priority string.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
CONFDIR="/conf/conf.d/mandos"
71
71
MANDOSDIR="/lib/mandos"
72
72
PLUGINDIR="${MANDOSDIR}/plugins.d"
 
73
PLUGINHELPERDIR="${MANDOSDIR}/plugin-helpers"
73
74
HOOKDIR="${MANDOSDIR}/network-hooks.d"
74
75
 
75
76
# Make directories
76
77
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
77
 
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}"
 
78
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}" \
 
79
        "${DESTDIR}${PLUGINHELPERDIR}"
78
80
install --owner=${mandos_user} --group=${mandos_group} --directory \
79
81
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
80
82
 
98
100
    esac
99
101
done
100
102
 
 
103
# Copy the packaged plugin helpers
 
104
for file in "$libdir"/mandos/plugin-helpers/*; do
 
105
    base="`basename \"$file\"`"
 
106
    # Is this plugin overridden?
 
107
    if [ -e "/etc/mandos/plugin-helpers/$base" ]; then
 
108
        continue
 
109
    fi
 
110
    case "$base" in
 
111
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
 
112
            : ;;
 
113
        "*") : ;;
 
114
        *) copy_exec "$file" "${PLUGINHELPERDIR}" ;;
 
115
    esac
 
116
done
 
117
 
101
118
# Copy any user-supplied plugins
102
119
for file in /etc/mandos/plugins.d/*; do
103
120
    base="`basename \"$file\"`"
109
126
    esac
110
127
done
111
128
 
 
129
# Copy any user-supplied plugin helpers
 
130
for file in /etc/mandos/plugin-helpers/*; do
 
131
    base="`basename \"$file\"`"
 
132
    case "$base" in
 
133
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
 
134
            : ;;
 
135
        "*") : ;;
 
136
        *) copy_exec "$file" "${PLUGINHELPERDIR}" ;;
 
137
    esac
 
138
done
 
139
 
112
140
# Get DEVICE from initramfs.conf and other files
113
141
. /etc/initramfs-tools/initramfs.conf
114
142
for conf in /etc/initramfs-tools/conf.d/*; do
150
178
done
151
179
 
152
180
# GPGME needs GnuPG
 
181
gpg=/usr/bin/gpg
153
182
libgpgme11_version="`dpkg-query --showformat='${Version}' --show libgpgme11`"
154
 
if dpkg --compare-versions "$libgpgme11_version" ge 1.4.1-0.1; then
 
183
if dpkg --compare-versions "$libgpgme11_version" ge 1.5.0-0.1; then
 
184
    if [ -e /usr/bin/gpgconf ]; then
 
185
        if [ ! -e "${DESTDIR}/usr/bin/gpgconf" ]; then
 
186
            copy_exec /usr/bin/gpgconf
 
187
        fi
 
188
        gpg="`/usr/bin/gpgconf|sed --quiet --expression='s/^gpg:[^:]*://p'`"
 
189
    fi
 
190
elif dpkg --compare-versions "$libgpgme11_version" ge 1.4.1-0.1; then
155
191
    gpg=/usr/bin/gpg2
156
 
else
157
 
    gpg=/usr/bin/gpg
158
192
fi
159
193
if [ ! -e "${DESTDIR}$gpg" ]; then
160
194
    copy_exec "$gpg"
185
219
    if [ -d "$file" ]; then
186
220
        continue
187
221
    fi
188
 
    cp --archive --sparse=always "$file" "${DESTDIR}${CONFDIR}"
189
 
    chown ${mandos_user}:${mandos_group} \
190
 
        "${DESTDIR}${CONFDIR}/`basename \"$file\"`"
 
222
    case "$file" in
 
223
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-bak|*.dpkg-new|*.dpkg-divert)
 
224
            : ;;
 
225
        "*") : ;;
 
226
        *)
 
227
            cp --archive --sparse=always "$file" \
 
228
               "${DESTDIR}${CONFDIR}"
 
229
            chown ${mandos_user}:${mandos_group} \
 
230
                  "${DESTDIR}${CONFDIR}/`basename \"$file\"`"
 
231
            ;;
 
232
    esac
191
233
done
 
234
# Use Diffie-Hellman parameters file if available
 
235
if [ -e "${DESTDIR}${CONFDIR}"/dhparams.pem ]; then
 
236
    sed --in-place \
 
237
        --expression="1i--options-for=mandos-client:--dh-params=${CONFDIR}/dhparams.pem" \
 
238
        "${DESTDIR}/${CONFDIR}/plugin-runner.conf"
 
239
fi
192
240
 
193
241
# /lib/mandos/plugin-runner will drop priviliges, but needs access to
194
242
# its plugin directory and its config file.  However, since almost all