/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: 2019-07-29 16:35:53 UTC
  • Revision ID: teddy@recompile.se-20190729163553-1i442i2cbx64c537
Make tests and man page examples match

Make the tests test_manual_page_example[1-5] match exactly what is
written in the manual page, and add comments to manual page as
reminders to keep tests and manual page examples in sync.

* mandos-ctl (Test_commands_from_options.test_manual_page_example_1):
  Remove "--verbose" option, since the manual does not have it as the
  first example, and change assertion to match.
* mandos-ctl.xml (EXAMPLE): Add comments to all examples documenting
  which test function they correspond to.  Also remove unnecessary
  quotes from option arguments in fourth example, and clarify language
  slightly in fifth example.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# Contact the authors at <mandos@recompile.se>.
24
24
25
25
 
26
 
VERSION="1.8.0"
 
26
VERSION="1.8.4"
27
27
 
28
28
KEYDIR="/etc/keys/mandos"
29
29
KEYTYPE=RSA
252
252
        # Backup any old key files
253
253
        if cp --backup=numbered --force "$TLS_PRIVKEYFILE" "$TLS_PRIVKEYFILE" \
254
254
              2>/dev/null; then
255
 
            shred --remove "$TLS_PRIVKEYFILE"
 
255
            shred --remove "$TLS_PRIVKEYFILE" 2>/dev/null || :
256
256
        fi
257
257
        if cp --backup=numbered --force "$TLS_PUBKEYFILE" "$TLS_PUBKEYFILE" \
258
258
              2>/dev/null; then
259
259
            rm --force "$TLS_PUBKEYFILE"
260
260
        fi
261
261
        cp --archive "$TLS_PRIVKEYTMP" "$TLS_PRIVKEYFILE"
262
 
        shred --remove "$TLS_PRIVKEYTMP"
 
262
        shred --remove "$TLS_PRIVKEYTMP" 2>/dev/null || :
263
263
 
264
264
        ## TLS public key
265
265
 
296
296
    # Backup any old key files
297
297
    if cp --backup=numbered --force "$SECKEYFILE" "$SECKEYFILE" \
298
298
        2>/dev/null; then
299
 
        shred --remove "$SECKEYFILE"
 
299
        shred --remove "$SECKEYFILE" 2>/dev/null || :
300
300
    fi
301
301
    if cp --backup=numbered --force "$PUBKEYFILE" "$PUBKEYFILE" \
302
302
        2>/dev/null; then
381
381
    
382
382
    while [ ! -s "$SECFILE" ]; do
383
383
        if [ -n "$PASSFILE" ]; then
384
 
            cat "$PASSFILE"
 
384
            cat -- "$PASSFILE"
385
385
        else
386
386
            tty --quiet && stty -echo
387
387
            echo -n "Enter passphrase: " >/dev/tty
444
444
set +e
445
445
# Remove the password file, if any
446
446
if [ -n "$SECFILE" ]; then
447
 
    shred --remove "$SECFILE"
 
447
    shred --remove "$SECFILE" 2>/dev/null
448
448
fi
449
449
# Remove the key rings
450
450
shred --remove "$RINGDIR"/sec* 2>/dev/null