~ubuntu-branches/ubuntu/trusty/mandos/trusty-proposed

« back to all changes in this revision

Viewing changes to mandos-keygen

  • Committer: Bazaar Package Importer
  • Author(s): Teddy Hogeborn
  • Date: 2011-03-08 20:22:57 UTC
  • mfrom: (1.3.1 upstream) (9.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110308202257-pkve2lo3df4jyfhg
Tags: 1.3.0-1
* New upstream release.
* debian/control (mandos): Depend on Python 2.6, remove dependency on
  python-multiprocessing.
(mandos-client): Conflict with dropbear (<< 0.52-5).
* debian/mandos-client.postrm (purge): Bug fix: update initramfs also on
  purge.
* debian/mandos-client.lintian-overrides: Added plugins.d/plymouth.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
3
3
# Mandos key generator - create a new OpenPGP key for a Mandos client
4
4
5
 
# Copyright © 2008,2009 Teddy Hogeborn
6
 
# Copyright © 2008,2009 Björn Påhlsson
 
5
# Copyright © 2008-2011 Teddy Hogeborn
 
6
# Copyright © 2008-2011 Björn Påhlsson
7
7
8
8
# This program is free software: you can redistribute it and/or modify
9
9
# it under the terms of the GNU General Public License as published by
21
21
# Contact the authors at <mandos@fukt.bsnet.se>.
22
22
23
23
 
24
 
VERSION="1.0.14"
 
24
VERSION="1.3.0"
25
25
 
26
26
KEYDIR="/etc/keys/mandos"
27
27
KEYTYPE=DSA
195
195
stty echo; \
196
196
" EXIT
197
197
 
 
198
set -e
 
199
 
198
200
umask 077
199
201
 
200
202
if [ "$mode" = keygen ]; then
217
219
        %commit
218
220
        EOF
219
221
    
 
222
    if tty --quiet; then
 
223
        cat <<-EOF
 
224
        Note: Due to entropy requirements, key generation could take
 
225
        anything from a few minutes to SEVERAL HOURS.  Please be
 
226
        patient and/or supply the system with more entropy if needed.
 
227
        EOF
 
228
        echo -n "Started: "
 
229
        date
 
230
    fi
 
231
    
220
232
    # Generate a new key in the key rings
221
233
    gpg --quiet --batch --no-tty --no-options --enable-dsa2 \
222
234
        --homedir "$RINGDIR" --trust-model always \
223
235
        --gen-key "$BATCHFILE"
224
236
    rm --force "$BATCHFILE"
225
237
    
 
238
    if tty --quiet; then
 
239
        echo -n "Finished: "
 
240
        date
 
241
    fi
 
242
    
226
243
    # Backup any old key files
227
244
    if cp --backup=numbered --force "$SECKEYFILE" "$SECKEYFILE" \
228
245
        2>/dev/null; then
278
295
        stty -echo
279
296
        echo -n "Enter passphrase: " >&2
280
297
        first="$(head --lines=1 | tr --delete '\n')"
281
 
        echo -n -e "\nRepeat passphrase: " >&2
 
298
        echo >&2
 
299
        echo -n "Repeat passphrase: " >&2
282
300
        second="$(head --lines=1 | tr --delete '\n')"
283
301
        echo >&2
284
302
        stty echo
285
303
        if [ "$first" != "$second" ]; then
286
 
            echo -e "Passphrase mismatch" >&2
 
304
            echo "Passphrase mismatch" >&2
287
305
            touch "$RINGDIR"/mismatch
288
306
        else
289
307
            echo -n "$first"