diff options
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | checks/ChangeLog | 4 | ||||
-rwxr-xr-x | checks/genkey1024.test | 2 | ||||
-rw-r--r-- | checks/run-gpg.patterns | 2 | ||||
-rw-r--r-- | g10/ChangeLog | 3 | ||||
-rw-r--r-- | g10/getkey.c | 7 | ||||
-rw-r--r-- | g10/keydb.h | 1 | ||||
-rw-r--r-- | g10/keygen.c | 7 | ||||
-rw-r--r-- | tools/ChangeLog | 4 | ||||
-rwxr-xr-x | tools/mail-signed-keys | 69 | ||||
-rw-r--r-- | util/ChangeLog | 7 | ||||
-rw-r--r-- | util/http.c | 1 | ||||
-rw-r--r-- | util/ttyio.c | 8 |
13 files changed, 83 insertions, 33 deletions
@@ -143,6 +143,7 @@ Stefan Keller [email protected] Steffen Ullrich [email protected] Steffen Zahn [email protected] Steven Bakker [email protected] +Steven Murdoch [email protected] Susanne Schultz [email protected] Ted Cabeen [email protected] Thiago Jung Bauermann [email protected] diff --git a/checks/ChangeLog b/checks/ChangeLog index 1d07f7209..4b3a7d072 100644 --- a/checks/ChangeLog +++ b/checks/ChangeLog @@ -1,3 +1,7 @@ +2001-03-27 Werner Koch <[email protected]> + + * run-gpg.patterns (gpg): Add some more patterns. + 2001-03-20 Werner Koch <[email protected]> * Makefile.am: Import the pubdemo.asc file diff --git a/checks/genkey1024.test b/checks/genkey1024.test index 81cb24fce..4eb8370ae 100755 --- a/checks/genkey1024.test +++ b/checks/genkey1024.test @@ -13,7 +13,7 @@ fi LANG= LANGUAGE= -expect - <<EOF >/dev/null +expect - <<EOF >/dev/null #set timeout -1 set timeout 8 match_max 100000 diff --git a/checks/run-gpg.patterns b/checks/run-gpg.patterns index a4eb47d41..62eb39077 100644 --- a/checks/run-gpg.patterns +++ b/checks/run-gpg.patterns @@ -11,4 +11,6 @@ gpg: NOTE: signature key expired NOTE: this is a development version! gpg: encrypted with "test two (no pp) <[email protected]>" +"Test one (pp=def) <[email protected]>" +"pgp5 test <[email protected]>" gpg: using secondary key diff --git a/g10/ChangeLog b/g10/ChangeLog index abb9005ec..2e60f2d81 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,8 @@ 2001-03-27 Werner Koch <[email protected]> + * getkey.c (cache_public_key): Made global. + * keygen.c (write_selfsig, write_keybinding): Cache the new key. + * getkey.c (key_byname): Add new arg secmode and changed all callers to request explicitly the mode. Deriving this information from the other supplied parameters does not work if neither pk nor diff --git a/g10/getkey.c b/g10/getkey.c index d0ec1e368..09633c98a 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -40,6 +40,11 @@ #define MAX_PK_CACHE_ENTRIES 200 #define MAX_UID_CACHE_ENTRIES 200 +#if MAX_PK_CACHE_ENTRIES < 2 + #error We need the cache for key creation +#endif + + /* A map of the all characters valid used for word_match() * Valid characters are in in this table converted to uppercase. * because the upper 128 bytes have special meaning, we assume @@ -177,7 +182,7 @@ print_stats() #endif -static void +void cache_public_key( PKT_public_key *pk ) { #if MAX_PK_CACHE_ENTRIES diff --git a/g10/keydb.h b/g10/keydb.h index 3aeb39aed..8468a272e 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -142,6 +142,7 @@ char *get_last_passphrase(void); /*-- getkey.c --*/ int classify_user_id( const char *name, u32 *keyid, byte *fprint, const char **retstr, size_t *retlen ); +void cache_public_key( PKT_public_key *pk ); void getkey_disable_caches(void); int get_pubkey( PKT_public_key *pk, u32 *keyid ); KBNODE get_pubkeyblock( u32 *keyid ); diff --git a/g10/keygen.c b/g10/keygen.c index 727bca385..00fbb301b 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -185,6 +185,9 @@ write_selfsig( KBNODE root, KBNODE pub_root, PKT_secret_key *sk ) if( !node ) BUG(); pk = node->pkt->pkt.public_key; + /* we have to cache the key, so that the verification of the signature + * creation is able to retrieve the public key */ + cache_public_key (pk); /* and make the signature */ rc = make_keysig_packet( &sig, pk, uid, NULL, sk, 0x13, 0, @@ -218,6 +221,10 @@ write_keybinding( KBNODE root, KBNODE pub_root, PKT_secret_key *sk ) if( !node ) BUG(); pk = node->pkt->pkt.public_key; + /* we have to cache the key, so that the verification of the signature + * creation is able to retrieve the public key */ + cache_public_key (pk); + /* find the last subkey */ subpk = NULL; for(node=pub_root; node; node = node->next ) { diff --git a/tools/ChangeLog b/tools/ChangeLog index afb0f57dd..994ac2518 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,7 @@ +2001-03-27 Werner Koch <[email protected]> + + * mail-signed-keys: Add option --dry-run. + 2001-03-21 Werner Koch <[email protected]> * shmtest.c: Add sys/types.h diff --git a/tools/mail-signed-keys b/tools/mail-signed-keys index a9ec154bd..2f1df9445 100755 --- a/tools/mail-signed-keys +++ b/tools/mail-signed-keys @@ -2,6 +2,12 @@ # FIXME: Add --dry-run, use only valid email addreses, extract only given keys +dryrun=0 +if [ "$1" = "--dry-run" ]; then + dryrun=1 + shift +fi + if [ -z "$1" -o -z "$2" ]; then echo "usage: mail-signed-keys keyring signedby" >&2 exit 1 @@ -13,7 +19,7 @@ if [ ! -f $1 ]; then fi [ -f '.#tdb.tmp' ] && rm '.#tdb.tmp' -ro="--trustdb-name=./.#tdb.tmp --dry-run --lock-never --no-default-keyring --keyring $1" +ro="--homedir . --no-options --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}'` @@ -23,14 +29,15 @@ if [ -z "$signedby" ]; then 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 - +if [ "$dryrun" = "0" ]; then + 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 +fi gpg $ro --check-sigs --with-colons 2>/dev/null \ - | awk -F: -v signedby="$signedby" -v gpgopt="$ro" ' + | awk -F: -v signedby="$signedby" -v gpgopt="$ro" -v dryrun="$dryrun" ' BEGIN { sendmail="/usr/lib/sendmail -oi -t " } $1 == "pub" { nextkid=$5; nextuid=$10 if( uidcount > 0 ) { myflush() } @@ -46,30 +53,34 @@ function myflush() 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 - } + if( dryrun == 0 ) { + 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 + if(dryrun == 0) { + 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 ) } - print "" | sendmail - close(cmd) - close( sendmail ) uidcount=0 } ' diff --git a/util/ChangeLog b/util/ChangeLog index ff85c9235..b1236dea0 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,10 @@ +2001-03-26 Werner Koch <[email protected]> + + * ttyio.c: Define TERMDEVICE depending on OS. + + * http.c (http_start_data): send a CRLF and not just a LF. + Pointed out by Steven Murdoch. + 2001-03-13 Werner Koch <[email protected]> * iobuf.c (iobuf_sockopen): New. diff --git a/util/http.c b/util/http.c index 269e9238d..e61f20972 100644 --- a/util/http.c +++ b/util/http.c @@ -150,6 +150,7 @@ void http_start_data( HTTP_HD hd ) { if( !hd->in_data ) { + iobuf_put( hd->fp_write, '\r' ); iobuf_put( hd->fp_write, '\n' ); hd->in_data = 1; } diff --git a/util/ttyio.c b/util/ttyio.c index bef688221..c1e0d7951 100644 --- a/util/ttyio.c +++ b/util/ttyio.c @@ -50,7 +50,11 @@ #include "ttyio.h" #define CONTROL_D ('D' - 'A' + 1) - +#ifdef __VMS + #define TERMDEVICE "/dev/tty" +#else + #define TERMDEVICE "/dev/tty" +#endif #ifdef __MINGW32__ /* use the odd Win32 functions */ static struct { @@ -120,7 +124,7 @@ init_ttyfp(void) #elif defined(__EMX__) ttyfp = stdout; /* Fixme: replace by the real functions: see wklib */ #else - ttyfp = batchmode? stderr : fopen("/dev/tty", "r+"); + ttyfp = batchmode? stderr : fopen(TERMDEVICE, "r+"); if( !ttyfp ) { log_error("cannot open /dev/tty: %s\n", strerror(errno) ); exit(2); |