/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: 2009-04-16 01:00:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090416010035-y7ta6ra2da4gf6mp
Minor code cleanup; one minor bug fix.

* initramfs-tools-hook: Bug fix: Use the primary group of the first
                        suitable user found, do not look for a
                        group separately.
* mandos: Unconditionally import "struct" and "fcntl".  Use unicode
          strings everywhere possible.
  (Client._datetime_to_milliseconds): New static method.
  (Client.timeout_milliseconds, Client.interval_milliseconds): Use
                                                               above
                                                               method.
  (ClientDBus.CheckedOK,
  ClientDBus.Enable, ClientDBus.StopChecker): Define normally.
  (if_nametoindex): Document non-acceptance of unicode strings.  All
                    callers adjusted.  Do not import "struct" or
                    "fcntl".  Log warning message if if_nametoindex
                    cannot be found using ctypes modules.
  (main): Bug fix: Do not look for user named "nogroup".

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
# Contact the authors at <mandos@fukt.bsnet.se>.
22
22
23
23
 
24
 
VERSION="1.0.3"
 
24
VERSION="1.0.8"
25
25
 
26
26
KEYDIR="/etc/keys/mandos"
27
27
KEYTYPE=DSA
147
147
        echo "Invalid key length" >&2
148
148
        exit 1
149
149
    fi
150
 
 
 
150
    
151
151
    if [ -z "$KEYEXPIRE" ]; then
152
152
        echo "Empty key expiration" >&2
153
153
        exit 1
172
172
    if [ -n "$KEYEMAIL" ]; then
173
173
        KEYEMAILLINE="Name-Email: $KEYEMAIL"
174
174
    fi
175
 
 
 
175
    
176
176
    # Create temporary gpg batch file
177
177
    BATCHFILE="`mktemp -t mandos-keygen-batch.XXXXXXXXXX`"
178
178
fi
284
284
        stty echo
285
285
        if [ "$first" != "$second" ]; then
286
286
            echo -e "Passphrase mismatch" >&2
287
 
            false
 
287
            touch "$RINGDIR"/mismatch
288
288
        else
289
289
            echo -n "$first"
290
290
        fi
292
292
        --homedir "$RINGDIR" --trust-model always --armor --encrypt \
293
293
        --sign --recipient "$FINGERPRINT" --comment "$FILECOMMENT" \
294
294
        > "$SECFILE"
295
 
    status="${PIPESTATUS[0]}"
296
 
    if [ "$status" -ne 0 ]; then
297
 
        exit "$status"
 
295
    if [ -e "$RINGDIR"/mismatch ]; then
 
296
        rm --force "$RINGDIR"/mismatch
 
297
        exit 1
298
298
    fi
299
299
    
300
300
    cat <<-EOF