/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: 2015-10-24 17:48:13 UTC
  • mto: This revision was merged to the branch mainline in revision 791.
  • Revision ID: teddy@recompile.se-20151024174813-56h6prp05qt30fx0
Tags: version-1.7.1-1
* Makefile (version): Changed to "1.7.1".
* NEWS (Version 1.7.1): New entry.
* debian/changelog (1.7.1-1): - '' -

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-2017 Teddy Hogeborn
6
 
# Copyright © 2008-2017 Björn Påhlsson
 
5
# Copyright © 2008-2015 Teddy Hogeborn
 
6
# Copyright © 2008-2015 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@recompile.se>.
22
22
23
23
 
24
 
VERSION="1.7.15"
 
24
VERSION="1.7.1"
25
25
 
26
26
KEYDIR="/etc/keys/mandos"
27
27
KEYTYPE=RSA
161
161
        [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|*) FORCE=0;;
162
162
    esac
163
163
    
164
 
    if { [ -e "$SECKEYFILE" ] || [ -e "$PUBKEYFILE" ]; } \
165
 
        && [ "$FORCE" -eq 0 ]; then
 
164
    if [ \( -e "$SECKEYFILE" -o -e "$PUBKEYFILE" \) \
 
165
        -a "$FORCE" -eq 0 ]; then
166
166
        echo "Refusing to overwrite old key files; use --force" >&2
167
167
        exit 1
168
168
    fi
218
218
        #Handle: <no-spaces>
219
219
        #%pubring pubring.gpg
220
220
        #%secring secring.gpg
221
 
        %no-protection
222
221
        %commit
223
222
        EOF
224
223
    
286
285
    esac
287
286
    
288
287
    if [ $SSH -eq 1 ]; then
289
 
        for ssh_keytype in ecdsa-sha2-nistp256 ed25519 rsa; do
 
288
        for ssh_keytype in ed25519 rsa; do
290
289
            set +e
291
290
            ssh_fingerprint="`ssh-keyscan -t $ssh_keytype localhost 2>/dev/null`"
292
 
            err=$?
293
291
            set -e
294
 
            if [ $err -ne 0 ]; then
 
292
            if [ $? -ne 0 ]; then
295
293
                ssh_fingerprint=""
296
294
                continue
297
295
            fi
326
324
            cat "$PASSFILE"
327
325
        else
328
326
            tty --quiet && stty -echo
329
 
            echo -n "Enter passphrase: " >/dev/tty
330
 
            read -r first
 
327
            echo -n "Enter passphrase: " >&2
 
328
            read first
331
329
            tty --quiet && echo >&2
332
 
            echo -n "Repeat passphrase: " >/dev/tty
333
 
            read -r second
 
330
            echo -n "Repeat passphrase: " >&2
 
331
            read second
334
332
            if tty --quiet; then
335
333
                echo >&2
336
334
                stty echo