/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 mandos-keygen

  • Committer: Teddy Hogeborn
  • Date: 2011-03-08 11:08:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20110308110835-3sh7b314tf7q3o1i
* plugins.d/password-prompt.c (conflict_detection): Check for both
                                                    "plymouth" and
                                                    "plymouthd".

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.2.3"
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
278
280
    
279
281
    # Get fingerprint of key
280
282
    FINGERPRINT="`gpg --quiet --batch --no-tty --no-options \
281
 
        --enable-dsa2 --homedir '"'$RINGDIR'"' --trust-model always \
 
283
        --enable-dsa2 --homedir \"$RINGDIR\" --trust-model always \
282
284
        --fingerprint --with-colons \
283
285
        | sed --quiet \
284
286
        --expression='/^fpr:/{s/^fpr:.*:\\([0-9A-Z]*\\):\$/\\1/p;q}'`"
293
295
        stty -echo
294
296
        echo -n "Enter passphrase: " >&2
295
297
        first="$(head --lines=1 | tr --delete '\n')"
296
 
        echo -n -e "\nRepeat passphrase: " >&2
 
298
        echo >&2
 
299
        echo -n "Repeat passphrase: " >&2
297
300
        second="$(head --lines=1 | tr --delete '\n')"
298
301
        echo >&2
299
302
        stty echo
300
303
        if [ "$first" != "$second" ]; then
301
 
            echo -e "Passphrase mismatch" >&2
 
304
            echo "Passphrase mismatch" >&2
302
305
            touch "$RINGDIR"/mismatch
303
306
        else
304
307
            echo -n "$first"