/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: 2008-10-03 09:32:30 UTC
  • Revision ID: teddy@fukt.bsnet.se-20081003093230-rshn19e0c19zz12i
* .bzrignore (plugins.d/askpass-fifo): Added.

* Makefile (FORTIFY): Added "-fstack-protector-all".
  (mandos, mandos-keygen): Use more strict regexps when updating the
                           version number.

* mandos (Client.__init__): Use os.path.expandvars() and
                            os.path.expanduser() on the "secfile"
                            config value.

* plugins.d/splashy.c: Update comments and order of #include's.
  (main): Check user and group when looking for running splashy
          process.  Do not ignore ENOENT from execl().  Use _exit()
          instead of "return" when an error happens in child
          processes.  Bug fix: Only wait for splashy_update
          completion if it was started.  Bug fix: detect failing
          waitpid().  Only kill splashy_update if it is running.  Do
          the killing of the old splashy process before the fork().
          Do setsid() and setuid(geteuid()) before starting the new
          splashy.  Report failing execl().

* plugins.d/usplash.c: Update comments and order of #include's.
  (main): Check user and group when looking for running usplash
          process.  Do not report execv() error if interrupted by a
          signal.

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 Teddy Hogeborn & Björn Påhlsson
7
6
8
7
# This program is free software: you can redistribute it and/or modify
9
8
# it under the terms of the GNU General Public License as published by
21
20
# Contact the authors at <mandos@fukt.bsnet.se>.
22
21
23
22
 
24
 
VERSION="1.0.8"
 
23
VERSION="1.0"
25
24
 
26
25
KEYDIR="/etc/keys/mandos"
27
26
KEYTYPE=DSA
147
146
        echo "Invalid key length" >&2
148
147
        exit 1
149
148
    fi
150
 
    
 
149
 
151
150
    if [ -z "$KEYEXPIRE" ]; then
152
151
        echo "Empty key expiration" >&2
153
152
        exit 1
172
171
    if [ -n "$KEYEMAIL" ]; then
173
172
        KEYEMAILLINE="Name-Email: $KEYEMAIL"
174
173
    fi
175
 
    
 
174
 
176
175
    # Create temporary gpg batch file
177
176
    BATCHFILE="`mktemp -t mandos-keygen-batch.XXXXXXXXXX`"
178
177
fi
284
283
        stty echo
285
284
        if [ "$first" != "$second" ]; then
286
285
            echo -e "Passphrase mismatch" >&2
287
 
            touch "$RINGDIR"/mismatch
 
286
            false
288
287
        else
289
288
            echo -n "$first"
290
289
        fi
291
290
    fi | gpg --quiet --batch --no-tty --no-options --enable-dsa2 \
292
291
        --homedir "$RINGDIR" --trust-model always --armor --encrypt \
293
 
        --sign --recipient "$FINGERPRINT" --comment "$FILECOMMENT" \
 
292
        --recipient "$FINGERPRINT" --comment "$FILECOMMENT" \
294
293
        > "$SECFILE"
295
 
    if [ -e "$RINGDIR"/mismatch ]; then
296
 
        rm --force "$RINGDIR"/mismatch
297
 
        exit 1
 
294
    status="${PIPESTATUS[0]}"
 
295
    if [ "$status" -ne 0 ]; then
 
296
        exit "$status"
298
297
    fi
299
298
    
300
299
    cat <<-EOF