/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:
75
75
 
76
76
# Make directories
77
77
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
78
 
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}"
 
78
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}" \
 
79
        "${DESTDIR}${PLUGINHELPERDIR}"
79
80
install --owner=${mandos_user} --group=${mandos_group} --directory \
80
 
        --mode=u=rwx "${DESTDIR}${PLUGINDIR}" \
81
 
        "${DESTDIR}${PLUGINHELPERDIR}"
82
 
 
83
 
copy_exec "$libdir"/mandos/mandos-to-cryptroot-unlock "${MANDOSDIR}"
 
81
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
84
82
 
85
83
# Copy the Mandos plugin runner
86
84
copy_exec "$libdir"/mandos/plugin-runner "${MANDOSDIR}"
144
142
for conf in /etc/initramfs-tools/conf.d/*; do
145
143
    if [ -n `basename \"$conf\" | grep '^[[:alnum:]][[:alnum:]\._-]*$' \
146
144
        | grep -v '\.dpkg-.*$'` ]; then
147
 
        [ -f "${conf}" ] && . "${conf}"
 
145
        [ -f ${conf} ] && . ${conf}
148
146
    fi
149
147
done
150
148
export DEVICE
159
157
    if [ -x "$hook" ]; then
160
158
        # Copy any files needed by the network hook
161
159
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
162
 
            VERBOSITY=0 "$hook" files | while read -r file target; do
 
160
            VERBOSITY=0 "$hook" files | while read file target; do
163
161
            if [ ! -e "${file}" ]; then
164
162
                echo "WARNING: file ${file} not found, requested by Mandos network hook '${hook##*/}'" >&2
165
163
            fi
171
169
        done
172
170
        # Copy and load any modules needed by the network hook
173
171
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=modules \
174
 
            VERBOSITY=0 "$hook" modules | while read -r module; do
175
 
            force_load "$module"
 
172
            VERBOSITY=0 "$hook" modules | while read module; do
 
173
            if [ -z "${target}" ]; then
 
174
                force_load "$module"
 
175
            fi
176
176
        done
177
177
    fi
178
178
done
186
186
            copy_exec /usr/bin/gpgconf
187
187
        fi
188
188
        gpg="`/usr/bin/gpgconf|sed --quiet --expression='s/^gpg:[^:]*://p'`"
189
 
        gpgagent="`/usr/bin/gpgconf|sed --quiet --expression='s/^gpg-agent:[^:]*://p'`"
190
 
        # Newer versions of GnuPG 2 requires the gpg-agent binary
191
 
        if [ -e "$gpgagent" ] && [ ! -e "${DESTDIR}$gpgagent" ]; then
192
 
            copy_exec "$gpgagent"
193
 
        fi
194
189
    fi
195
190
elif dpkg --compare-versions "$libgpgme11_version" ge 1.4.1-0.1; then
196
191
    gpg=/usr/bin/gpg2
252
247
# initrd; it is intended to affect the initrd.img file itself, since
253
248
# it now contains secret key files.  There is, however, no other way
254
249
# to set the permission of the initrd.img file without a race
255
 
# condition.  This umask is set by "initramfs-tools-conf", installed
256
 
# as "/usr/share/initramfs-tools/conf.d/mandos-conf".)
 
250
# condition.  This umask is set by "initramfs-tools-hook-conf",
 
251
# installed as "/usr/share/initramfs-tools/conf-hooks.d/mandos".)
257
252
258
253
for full in "${MANDOSDIR}" "${CONFDIR}"; do
259
254
    while [ "$full" != "/" ]; do
271
266
done
272
267
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
273
268
    if [ -d "$dir" ]; then
274
 
        find "$dir" \! -perm -u+rw,g+r -prune -or \! -type l -print0 \
275
 
            | xargs --null --no-run-if-empty chmod a+rX --
 
269
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
 
270
            | xargs --null --no-run-if-empty chmod a+rX
276
271
    fi
277
272
done