/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 debian/mandos-client.postinst

  • Committer: Teddy Hogeborn
  • Date: 2015-07-09 20:32:52 UTC
  • Revision ID: teddy@recompile.se-20150709203252-u10p7trfsxc1a9yp
Install client Diffie-Hellman parameters into initramfs.

* debian/control (Package: mandos-client/Recommends): Added
  "gnutls-bin | openssl" (to generate DH parameters).
* debian/mandos-client.postinst (create_dh_params): New function
                                                    called on package
                                                    configure.
* plugins.d/mandos-client.c (main): Bug fix: Work around Debian bug
                                    #633582 also for the
                                    "client-dhparams.pem" file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
# Update the initial RAM file system image
21
21
update_initramfs()
22
22
{
23
 
    update-initramfs -u -k all
 
23
    if [ -x /usr/sbin/update-initramfs ]; then
 
24
        update-initramfs -u -k all
 
25
    fi
24
26
    
25
27
    if dpkg --compare-versions "$2" lt-nl "1.0.10-1"; then
26
28
        # Make old initrd.img files unreadable too, in case they were
56
58
        -a -r /etc/keys/mandos/seckey.txt ]; then
57
59
        return 0
58
60
    fi
59
 
    mandos-keygen
 
61
    if [ -x /usr/sbin/mandos-keygen ]; then
 
62
        mandos-keygen
 
63
    fi
60
64
}
61
65
 
62
66
create_dh_params(){
63
 
    if [ -r /etc/keys/mandos/dhparams.pem ]; then
 
67
    if [ -r /etc/keys/mandos/client-dhparams.pem ]; then
64
68
        return 0
65
69
    fi
66
70
    # Create a Diffe-Hellman parameters file
80
84
        "$DHFILE"
81
85
    sed --in-place --expression='1i-----BEGIN DH PARAMETERS-----' \
82
86
            "$DHFILE"
83
 
    cp --archive "$DHFILE" /etc/keys/mandos/dhparams.pem
 
87
    cp --archive "$DHFILE" /etc/keys/mandos/client-dhparams.pem
84
88
    rm -- "$DHFILE"
85
89
}
86
90