diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ChangeLog | 4 | ||||
-rw-r--r-- | tools/Makefile.am | 4 | ||||
-rwxr-xr-x | tools/ring-a-party | 103 |
3 files changed, 109 insertions, 2 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog index f3b32eac0..e936bfcd9 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,7 @@ +Tue May 23 09:19:00 CEST 2000 Werner Koch <[email protected]> + + * ring-a-party: New. + Thu Jul 8 16:21:27 CEST 1999 Werner Koch <[email protected]> diff --git a/tools/Makefile.am b/tools/Makefile.am index 2cf2e20ea..b4050abf9 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -2,8 +2,8 @@ EXTRA_DIST = lspgpot INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl -needed_libs = ../cipher/libcipher.la \ - ../mpi/libmpi.la ../util/libutil.la @INTLLIBS@ +needed_libs = ../cipher/libcipher.a \ + ../mpi/libmpi.a ../util/libutil.a @INTLLIBS@ noinst_PROGRAMS = mpicalc bftest clean-sat mk-tdata shmtest diff --git a/tools/ring-a-party b/tools/ring-a-party new file mode 100755 index 000000000..561b51336 --- /dev/null +++ b/tools/ring-a-party @@ -0,0 +1,103 @@ +#!/bin/sh +# ring-a-party - print a keyring suitable for a key signing party + +if [ $# -lt 1 ]; then + echo "usage: ring-a-party keyring [headerline]" >&2 + exit 1 +fi + +keyring="$1" +hdrline="$1" +if [ $# -gt 1 ]; then + hdrline="$2" +fi + +if [ ! -f $keyring ]; then + echo "ring-a-party: '$keyring': no such file" >&2 + exit 1 +fi + +echo "ring-a-party: output will be written to 'a.pub'" >&2 + + +gpg --dry-run --with-fingerprint --with-colons $keyring \ + | gawk -v "KEYRING=$hdrline" ' +BEGIN { FS=":" + algos[1] = "RSA"; + algos[16] = "ElGamal"; + algos[17] = "DSA"; + any = 0; + lines = -1; + page = 0; + now = strftime("%b %d %H:%M %Y"); + } +$1 == "pub" { + if( any ) myflush(); + uidcount = 0; + signencrypt = 0; + uids[uidcount++] = $10; + nbits = $3; + keyid = substr($5,9); + created = $6; + expires = $7; + algostr = mapalgo($4); + if( $4 == 20 || $4 == 1 ) signencrypt = 1; + any = 1; + } +$1 == "fpr" { fpr = $10 } +$1 == "uid" { uids[uidcount++] = $10 } +$1 == "sub" { if( $4 != 17 && $4 != 3 ) signencrypt=1 } + +function myflush() +{ + # fixme: take lines to print here into account + if( lines > 50 || lines == -1 ) { + if( lines != -1 ) printf "\f"; + page++; + printf "%s %-50.50s Page %d\n\n", now, KEYRING, page ; + printf "Type Bits KeyID Created Expires Algorithm Use\n"; + lines = 1; + } + printf "pub %04d 0x%s %10s %10s %-10s %15s\n", + nbits, keyid, created, expires == ""? "----------":expires, algostr, + signencrypt == 1? "Sign & Encrypt":"Sign only"; + length(fpr) == 40 ? printfpr20( fpr ) : printfpr16( fpr ); + lnes += 2; + for( i=0; i < uidcount; i++ ) { + printf "uid %s\n", uids[i]; + lines++; + } + printf "\n\n"; + lines += 2; +} + +function mapalgo( no ) +{ + if( no in algos ) + return algos[no]; + return sprintf( "algoID=%ds", no ); +} + + +function printfpr16( s ) +{ + printf "f16 Fingerprint16 ="; + for(i=0; i < 16; i++ ) { + if( i == 8 ) printf " "; + printf " %s", substr( s, i*2, 2 ); + } + printf "\n" +} + +function printfpr20( s ) +{ + printf "f20 Fingerprint20 ="; + for(i=0; i < 10; i++ ) { + if( i == 5 ) printf " "; + printf " %s", substr( s, i*4, 4 ); + } + printf "\n" +} + +' | tee a.pub | gpg --print-mds + |