aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2000-07-17 14:32:21 +0000
committerWerner Koch <[email protected]>2000-07-17 14:32:21 +0000
commit0bf44b072ca648336bca9cf1ec24ea9d257cea9a (patch)
tree92df532ce40c43627283e16bb5a06f39bd3a466c /tools
parentSee ChangeLog: Fri Jul 14 19:38:23 CEST 2000 Werner Koch (diff)
downloadgnupg-0bf44b072ca648336bca9cf1ec24ea9d257cea9a.tar.gz
gnupg-0bf44b072ca648336bca9cf1ec24ea9d257cea9a.zip
See ChangeLog: Mon Jul 17 16:35:47 CEST 2000 Werner Koch
Diffstat (limited to '')
-rw-r--r--tools/ChangeLog7
-rw-r--r--tools/Makefile.am2
-rwxr-xr-xtools/mail-signed-keys75
-rwxr-xr-xtools/ring-a-party103
4 files changed, 184 insertions, 3 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index 0227d0721..79bba89f2 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jul 17 16:35:47 CEST 2000 Werner Koch <wk@>
+
+ * mail-signed-keys: New.
+ * ring-a-party: New.
+
Mon Jan 31 17:46:35 CET 2000 Werner Koch <wk@>
* Makefile.am: Add libjnlib.
@@ -10,7 +15,6 @@ Thu Jul 8 16:21:27 CEST 1999 Werner Koch <[email protected]>
Wed Jul 7 13:08:40 CEST 1999 Werner Koch <[email protected]>
-
* Makefile.am: Support for libtool.
Tue Jun 8 13:36:25 CEST 1999 Werner Koch <[email protected]>
@@ -30,4 +34,3 @@ Tue Apr 7 19:50:41 1998 Werner Koch ([email protected])
* bftest.c: Now supports all availabe ciphers.
-
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 057f883e5..4911d1703 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-EXTRA_DIST = lspgpot
+EXTRA_DIST = lspgpot mail-signed-keys ring-a-party
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
# we need to add libutil.la a second time because we have to resolve
# gpg_log_ in some libjnlib modules. - very ugly - should be removed soon.
diff --git a/tools/mail-signed-keys b/tools/mail-signed-keys
new file mode 100755
index 000000000..3f9f01831
--- /dev/null
+++ b/tools/mail-signed-keys
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+if [ -z "$1" -o -z "$2" ]; then
+ echo "usage: mail-signed-keys keyring signedby" >&2
+ exit 1
+fi
+
+if [ ! -f $1 ]; then
+ echo "mail-signed-keys: '$1': no such file" >&2
+ exit 1
+fi
+
+[ -f '.#tdb.tmp' ] && rm '.#tdb.tmp'
+ro="--trustdb-name=./.#tdb.tmp --dry-run --lock-never --no-default-keyring --keyring $1"
+
+signedby=`gpg $ro --fast-list-mode --list-keys --with-colons $2 \
+ 2>/dev/null | awk -F: '$1=="pub" {print $5; exit 0}'`
+
+if [ -z "$signedby" ]; then
+ echo "mail-signed-keys: '$2': no such signator" >&2
+ exit 1
+fi
+
+echo "About to send the the keys signed by $signedby" >&2
+echo -n "to their owners. Do you really want to do this? (y/N)" >&2
+read
+[ "$REPLY" != "y" -a "$REPLY" != "Y" ] && exit 0
+
+
+gpg $ro --check-sigs --with-colons 2>/dev/null \
+ | awk -F: -v signedby="$signedby" -v gpgopt="$ro" '
+BEGIN { sendmail="/usr/lib/sendmail -oi -t " }
+$1 == "pub" { nextkid=$5; nextuid=$10
+ if( uidcount > 0 ) { myflush() }
+ kid=nextkid; uid=nextuid; next
+ }
+$1 == "uid" { uid=$10 ; next }
+$1 == "sig" && $2 == "!" && $5 == signedby { uids[uidcount++] = uid; next }
+END { if( uidcount > 0 ) { myflush() } }
+
+function myflush()
+{
+ if ( kid == signedby ) { uidcount=0; return }
+ print "sending key " substr(kid,9) " to" | "cat >&2"
+ for(i=0; i < uidcount; i++ ) {
+ print " " uids[i] | "cat >&2"
+ if( i == 0 ) {
+ printf "To: %s", uids[i] | sendmail
+ }
+ else {
+ printf ",\n %s", uids[i] | sendmail
+ }
+ }
+ printf "\n" | sendmail
+ print "Subject: I signed your key " substr(kid,9) | sendmail
+ print "" | sendmail
+ print "Hi," | sendmail
+ print "" | sendmail
+ print "Here you get back the signed key." | sendmail
+ print "" | sendmail
+ print "ciao," | sendmail
+ print " your Key Signator" | sendmail
+ print "" | sendmail
+ cmd = "gpg " gpgopt " --export -a " kid " 2>/dev/null"
+ while( (cmd | getline) > 0 ) {
+ print | sendmail
+ }
+ print "" | sendmail
+ close(cmd)
+ close( sendmail )
+ uidcount=0
+}
+'
+
+
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
+