/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-09-06 17:24:58 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080906172458-2x5wlfkn7oqckt1y
* legalnotice.xml: Copy DocBook 4.4-formatted text from
                   <http://www.gnu.org/licenses/gpl-3.0.dbk>.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
        [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|*) FORCE=0;;
149
149
    esac
150
150
    
151
 
    if { [ -e "$SECKEYFILE" ] || [ -e "$PUBKEYFILE" ]; } \
152
 
        && [ "$FORCE" -eq 0 ]; then
 
151
    if [ \( -e "$SECKEYFILE" -o -e "$PUBKEYFILE" \) \
 
152
        -a "$FORCE" -eq 0 ]; then
153
153
        echo "Refusing to overwrite old key files; use --force" >&2
154
154
        exit 1
155
155
    fi
254
254
    FINGERPRINT="`gpg --quiet --batch --no-tty --no-options \
255
255
        --enable-dsa2 --homedir \"$RINGDIR\" --trust-model always \
256
256
        --fingerprint --with-colons \
257
 
        | sed -n -e '/^fpr:/{s/^fpr:.*:\\([0-9A-Z]*\\):\$/\\1/p;q}'`"
 
257
        | sed --quiet \
 
258
        --expression='/^fpr:/{s/^fpr:.*:\\([0-9A-Z]*\\):\$/\\1/p;q}'`"
258
259
    
259
260
    test -n "$FINGERPRINT"
260
261
    
262
263
    
263
264
    stty -echo
264
265
    echo -n "Enter passphrase: " >&2
265
 
    sed -e '1q' \
 
266
    head --lines=1 | tr --delete '\n' \
266
267
        | gpg --quiet --batch --no-tty --no-options --enable-dsa2 \
267
268
        --homedir "$RINGDIR" --trust-model always --armor --encrypt \
268
269
        --recipient "$FINGERPRINT" --comment "$FILECOMMENT" \
276
277
        fingerprint = $FINGERPRINT
277
278
        secret =
278
279
EOF
279
 
    sed -n -e '
 
280
    sed --quiet --expression='
280
281
        /^-----BEGIN PGP MESSAGE-----$/,/^-----END PGP MESSAGE-----$/{
281
282
            /^$/,${
282
283
                # Remove 24-bit Radix-64 checksum