summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--TODO3
-rw-r--r--cipher/rndunix.c7
-rw-r--r--g10/ChangeLog11
-rw-r--r--g10/Makefile.am4
-rw-r--r--g10/g10.c3
-rw-r--r--g10/hkp.c72
-rw-r--r--g10/hkp.h (renamed from g10/pref.h)26
-rw-r--r--g10/import.c39
-rw-r--r--g10/main.h1
-rw-r--r--g10/mainproc.c5
-rw-r--r--g10/options.h1
-rw-r--r--g10/options.skel8
-rw-r--r--g10/plaintext.c2
-rw-r--r--g10/pref.c81
-rw-r--r--include/errors.h1
-rw-r--r--po/POTFILES.in2
-rw-r--r--scripts/ChangeLog5
-rwxr-xr-xscripts/commit26
-rwxr-xr-xscripts/config.guess4
-rwxr-xr-xscripts/config.sub8
-rw-r--r--util/ChangeLog5
-rw-r--r--util/Makefile.am6
23 files changed, 202 insertions, 121 deletions
diff --git a/NEWS b/NEWS
index b9635c92b..1ba580758 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
* add some additional time warp checks.
+ * Some HKP support
+
+ * Upgraded to zlib 1.1.3
Noteworthy changes in version 0.9.1
-----------------------------------
diff --git a/TODO b/TODO
index 3607a3fdd..7157a9883 100644
--- a/TODO
+++ b/TODO
@@ -44,6 +44,9 @@ Needed
-Wl,-export-dynamic flag from my Makefile and it linked and seems to
be working OK so far.
+ * text_filter.c: use iobuf_readline for cleartext signatures.
+
+
Minor Bugs
----------
diff --git a/cipher/rndunix.c b/cipher/rndunix.c
index 9e49ebc75..f0b631975 100644
--- a/cipher/rndunix.c
+++ b/cipher/rndunix.c
@@ -58,6 +58,9 @@
#include "dynload.h"
#endif
+#ifndef EAGAIN
+ #define EAGAIN EWOULDBLOCK
+#endif
#define GATHER_BUFSIZE 49152 /* Usually about 25K are filled */
@@ -426,7 +429,11 @@ slow_poll(FILE *dbgfp, int dbgall, size_t *nbytes )
dataSources[i].pipeFD = fileno(dataSources[i].pipe);
if (dataSources[i].pipeFD > maxFD)
maxFD = dataSources[i].pipeFD;
+ #ifdef O_NONBLOCK /* Ohhh what a hack (used for Atari) */
fcntl(dataSources[i].pipeFD, F_SETFL, O_NONBLOCK);
+ #else
+ #warning O_NONBLOCK is missing
+ #endif
FD_SET(dataSources[i].pipeFD, &fds);
dataSources[i].length = 0;
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 68255f01b..821e9b305 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,14 @@
+Sat Jan 16 09:27:30 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
+
+ * import.c (import_key_stream): New
+ (import): New, moved most of import_keys here.
+ * g10.c: New option --keyserver
+ * mainproc.c (check_sig_and_print): Hook to import a pubkey.
+
+ * pref.c pref.h : Removed
+
+ * hkp.c hkp.h: New
+
Wed Jan 13 14:10:15 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* armor.c (radix64_read): Print an error if a bad armor was detected.
diff --git a/g10/Makefile.am b/g10/Makefile.am
index 5920365af..c062d770e 100644
--- a/g10/Makefile.am
+++ b/g10/Makefile.am
@@ -35,8 +35,8 @@ common_source = \
trustdb.h \
tdbio.c \
tdbio.h \
- pref.h \
- pref.c \
+ hkp.h \
+ hkp.c \
packet.h \
parse-packet.c \
passphrase.c \
diff --git a/g10/g10.c b/g10/g10.c
index dd8fddbf3..7e714262f 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -152,6 +152,7 @@ enum cmd_and_opt_values { aNull = 0,
oNotDashEscaped,
oEscapeFrom,
oLockOnce,
+ oKeyServer,
aTest };
@@ -229,6 +230,7 @@ static ARGPARSE_OPTS opts[] = {
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")},
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")},
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")},
+ { oKeyServer, "keyserver",2, N_("|HOST|use this keyserver to lookup keys")},
{ oCharset, "charset" , 2, N_("|NAME|set terminal charset to NAME") },
{ oOptions, "options" , 2, N_("read options from file")},
@@ -785,6 +787,7 @@ main( int argc, char **argv )
case oNotDashEscaped: opt.not_dash_escaped = 1; break;
case oEscapeFrom: opt.escape_from = 1; break;
case oLockOnce: opt.lock_once = 1; break;
+ case oKeyServer: opt.keyserver_name = pargs.r.ret_str; break;
default : pargs.err = configfp? 1:2; break;
}
diff --git a/g10/hkp.c b/g10/hkp.c
new file mode 100644
index 000000000..3d43dbfcf
--- /dev/null
+++ b/g10/hkp.c
@@ -0,0 +1,72 @@
+/* hkp.c - Horrowitz Keyserver Protocol
+ * Copyright (C) 1999 Free Software Foundation, Inc.
+ *
+ * This file is part of GnuPG.
+ *
+ * GnuPG is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GnuPG is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+
+#include "errors.h"
+#include "util.h"
+#include "ttyio.h"
+#include "i18n.h"
+#include "options.h"
+#include "http.h"
+#include "main.h"
+
+
+/****************
+ * Try to import the key with KEYID from a keyserver but ask the user
+ * before doing so.
+ * Returns: 0 the key was successfully imported
+ * -1 key not found on server or user does not want to
+ * import the key
+ * or other error codes.
+ */
+int
+hkp_ask_import( u32 *keyid )
+{
+ struct http_context hd;
+ char *request;
+ int rc;
+
+ if( !opt.keyserver_name )
+ return -1;
+ log_info("requesting key %08lX from %s ...\n", (ulong)keyid[1],
+ opt.keyserver_name );
+ request = m_alloc( strlen( opt.keyserver_name ) + 100 );
+ sprintf( request, "x-hkp://%s:11371/pks/lookup?op=get&search=0x%08lX%08lX",
+ opt.keyserver_name, (ulong)keyid[0], (ulong)keyid[1] );
+ rc = open_http_document( &hd, request, 0 );
+ if( rc ) {
+ log_info("can't get key from keyserver: %s\n", g10_errstr(rc) );
+ goto leave;
+ }
+ rc = import_keys_stream( hd.fp_read , 0 );
+ close_http_document( &hd );
+
+ leave:
+ m_free( request );
+ return rc;
+}
+
+
diff --git a/g10/pref.h b/g10/hkp.h
index cc827bbc5..6ea555204 100644
--- a/g10/pref.h
+++ b/g10/hkp.h
@@ -1,5 +1,5 @@
-/* pref.h
- * Copyright (C) 1998 Free Software Foundation, Inc.
+/* hkp.h - Horrowitz Keyserver Protocol
+ * Copyright (C) 1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -18,25 +18,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#ifndef G10_PREF_H
-#define G10_PREF_H 1
+#ifndef G10_HKP_H
+#define G10_HKP_H 1
-/* a structure to hold information abopu preferred algorithms */
-typedef struct pref_list_s *PREF_LIST;
-#ifndef DEFINES_PREF_LIST
-struct pref_list_s { char preference_stuff[1]; };
-#endif
+int hkp_ask_import( u32 *keyid );
-PREF_LIST new_pref_list(void);
-void release_pref_list( PREF_LIST pref );
-
-
-
-
-
-
-
-
-#endif /*G10_PREF_H*/
+#endif /*G10_HKP_H*/
diff --git a/g10/import.c b/g10/import.c
index 0b5fdf29b..2167f87d5 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -51,6 +51,7 @@ static struct {
} stats;
+static int import( IOBUF inp, int fast, const char* fname );
static int read_block( IOBUF a, compress_filter_context_t *cfx,
PACKET **pending_pkt, KBNODE *ret_root );
static int import_one( const char *fname, KBNODE keyblock, int fast );
@@ -106,10 +107,35 @@ static int merge_keysigs( KBNODE dst, KBNODE src, int *n_sigs,
int
import_keys( const char *fname, int fast )
{
+ IOBUF inp = NULL;
+ int rc;
+
+ inp = iobuf_open(fname);
+ if( !fname )
+ fname = "[stdin]";
+ if( !inp ) {
+ log_error_f(fname, _("can't open file: %s\n"), strerror(errno) );
+ return G10ERR_OPEN_FILE;
+ }
+
+ rc = import( inp, fast, fname );
+
+ iobuf_close(inp);
+ return rc;
+}
+
+int
+import_keys_stream( IOBUF inp, int fast )
+{
+ return import( inp, fast, "[stream]" );
+}
+
+static int
+import( IOBUF inp, int fast, const char* fname )
+{
armor_filter_context_t afx;
compress_filter_context_t cfx;
PACKET *pending_pkt = NULL;
- IOBUF inp = NULL;
KBNODE keyblock;
int rc = 0;
ulong count=0;
@@ -121,15 +147,6 @@ import_keys( const char *fname, int fast )
/* fixme: don't use static variables */
memset( &stats, 0, sizeof( stats ) );
- /* open file */
- inp = iobuf_open(fname);
- if( !fname )
- fname = "[stdin]";
- if( !inp ) {
- log_error_f(fname, _("can't open file: %s\n"), strerror(errno) );
- return G10ERR_OPEN_FILE;
- }
-
getkey_disable_caches();
@@ -185,8 +202,6 @@ import_keys( const char *fname, int fast )
if( stats.secret_dups )
log_info(_(" secret keys unchanged: %lu\n"), stats.secret_dups );
-
- iobuf_close(inp);
return rc;
}
diff --git a/g10/main.h b/g10/main.h
index b917bae26..94ace8ea2 100644
--- a/g10/main.h
+++ b/g10/main.h
@@ -109,6 +109,7 @@ KBNODE make_mpi_comment_node( const char *s, MPI a );
/*-- import.c --*/
int import_keys( const char *filename, int fast );
+int import_keys_stream( IOBUF inp, int fast );
/*-- export.c --*/
int export_pubkeys( STRLIST users, int onlyrfc );
int export_seckeys( STRLIST users );
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 6b69eefa1..2e5575dd8 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -38,6 +38,7 @@
#include "status.h"
#include "i18n.h"
#include "trustdb.h"
+#include "hkp.h"
/****************
* Structure to hold the context
@@ -840,6 +841,10 @@ check_sig_and_print( CTX c, KBNODE node )
(int)strlen(tstr), tstr, astr? astr: "?", (ulong)sig->keyid[1] );
rc = do_check_sig(c, node, NULL );
+ if( rc == G10ERR_NO_PUBKEY && opt.keyserver_name ) {
+ if( !hkp_ask_import( sig->keyid ) )
+ rc = do_check_sig(c, node, NULL );
+ }
if( !rc || rc == G10ERR_BAD_SIGN ) {
char *us = get_long_user_id_string( sig->keyid );
write_status_text( rc? STATUS_BADSIG : STATUS_GOODSIG, us );
diff --git a/g10/options.h b/g10/options.h
index e6491864e..d7450dba8 100644
--- a/g10/options.h
+++ b/g10/options.h
@@ -67,6 +67,7 @@ struct {
int not_dash_escaped;
int escape_from;
int lock_once;
+ const char *keyserver_name;
} opt;
diff --git a/g10/options.skel b/g10/options.skel
index 1ad93b487..4b6a3fce6 100644
--- a/g10/options.skel
+++ b/g10/options.skel
@@ -56,3 +56,11 @@ lock-once
# you probably have to uncomment the next line:
#load-extension rndunix
+
+# GnuPG can import a key from a HKP keyerver if one is missing
+# for sercain operations. Is you set this option to a keyserver
+# you will be asked in such a case whether GnuPG should try to
+# import the key from that server (server do syncronize with each
+# others and DNS Round-Robin may give you a random server each time).
+#keyserver keys.pgp.net
+
diff --git a/g10/plaintext.c b/g10/plaintext.c
index 887b583f6..0dc246939 100644
--- a/g10/plaintext.c
+++ b/g10/plaintext.c
@@ -231,7 +231,7 @@ hash_datafiles( MD_HANDLE md, STRLIST files,
STRLIST sl=NULL;
if( !files ) {
- /* check whether we can opne the signed material */
+ /* check whether we can open the signed material */
fp = open_sigfile( sigfilename );
if( fp ) {
do_hash( md, fp, textmode );
diff --git a/g10/pref.c b/g10/pref.c
deleted file mode 100644
index 53ae41845..000000000
--- a/g10/pref.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* pref.c
- * Copyright (C) 1998 Free Software Foundation, Inc.
- *
- * This file is part of GnuPG.
- *
- * GnuPG is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GnuPG is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#define DEFINES_PREF_LIST 1
-#include <config.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "errors.h"
-#include "memory.h"
-#include "util.h"
-#include "ttyio.h"
-#include "i18n.h"
-#include "pref.h"
-
-
-#define N_CIPHERS 3
-#define N_DIGESTS 4
-#define N_COMPRS 3
-
-struct pref_list_s {
- PREF_LIST *extend; /* if we need more, we link them together */
- byte cipher[N_CIPHERS]; /* cipher algos */
- byte digest[N_DIGESTS]; /* digest algos */
- byte compr [N_COMPRS ]; /* compress algos (a 255 denotes no compression)*/
-};
-
-
-#if 0
-PREF_LIST
-new_pref_list()
-{
- return m_alloc_clear( sizeof(*PREF_LIST) );
-}
-
-void
-release_pref_list( PREF_LIST pref )
-{
- while( pref ) {
- PREF_LIST tmp = pref->extend;
- m_free( pref );
- pref = tmp;
- }
-}
-
-PREF_LIST
-copy_pref_list( PREF_LIST s )
-{
- PREF_LIST ss, ss, d = new_pref_list();
- *d = *s;
- for( ss = s->extend; ss; ss = ss->extend ) {
-
- WORK WORK WORK
- d->extend = new_pref_list();
-
- *d->extend = *ss;
- }
- return d;
-}
-#endif
-
diff --git a/include/errors.h b/include/errors.h
index aca224c80..56dd14ada 100644
--- a/include/errors.h
+++ b/include/errors.h
@@ -68,6 +68,7 @@
#define G10ERR_BAD_URI 46 /* syntax error in URI */
#define G10ERR_INVALID_URI 47 /* e.g. unsupported scheme */
#define G10ERR_NETWORK 48 /* general network error */
+#define G10ERR_UNKNOWN_HOST 49
#ifndef HAVE_STRERROR
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ec35732fa..3fb020b0c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -31,7 +31,7 @@ g10/parse-packet.c
g10/passphrase.c
g10/plaintext.c
g10/pubkey-enc.c
-g10/pref.c
+g10/hkp.c
g10/seckey-cert.c
g10/sig-check.c
g10/sign.c
diff --git a/scripts/ChangeLog b/scripts/ChangeLog
index 9437367e3..b3eaae7f3 100644
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jan 16 09:27:30 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
+
+ * config.guess (m68k-atari-mint): New.
+ * config.sub: Add support for atarist-MiNT
+
Wed Jan 13 12:49:36 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* gnupg.spec.in: New
diff --git a/scripts/commit b/scripts/commit
index d74747e95..992f93c3d 100755
--- a/scripts/commit
+++ b/scripts/commit
@@ -23,5 +23,31 @@ for i in `find . -name Changes -print`; do
fi
done
+# Execute canned cvs remove commands
+for i in `find . -name cvs-remove -print`; do
+ dir=`dirname $i`
+ if [ -s $dir/cvs-remove ]; then
+ here=`pwd`
+ cd $dir
+ if cvs remove -f `cat cvs-remove`; then
+ rm cvs-remove
+ fi
+ cd $here
+ fi
+done
+
+# Execute canned cvs add commands
+for i in `find . -name cvs-add -print`; do
+ dir=`dirname $i`
+ if [ -s $dir/cvs-add ]; then
+ here=`pwd`
+ cd $dir
+ if cvs add `cat cvs-add`; then
+ rm cvs-add
+ fi
+ cd $here
+ fi
+done
+
cvs commit -m "See ChangeLog: $date $name" $*
diff --git a/scripts/config.guess b/scripts/config.guess
index 6413fa44f..03db0ec08 100755
--- a/scripts/config.guess
+++ b/scripts/config.guess
@@ -1,6 +1,6 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 1999 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -138,7 +138,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
atari*:OpenBSD:*:*)
echo m68k-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
- atari*:[Mm]i[Nn][Tt]:*:*)
+ atari*:MiNT:*:*)
echo m68k-atari-mint
exit 0 ;;
sun3*:NetBSD:*:*)
diff --git a/scripts/config.sub b/scripts/config.sub
index a0deddae0..b95132478 100755
--- a/scripts/config.sub
+++ b/scripts/config.sub
@@ -1,6 +1,6 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
-# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96, 1999 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
@@ -279,6 +279,9 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
;;
+ atarist)
+ basic_machine=m68k-atari
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -965,6 +968,9 @@ case $os in
-xenix)
os=-xenix
;;
+ -MiNT | -mint)
+ os=-mint
+ ;;
-none)
;;
*)
diff --git a/util/ChangeLog b/util/ChangeLog
index 7c4fb3bb7..0fea6dd32 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -1,3 +1,8 @@
+Sat Jan 16 09:27:30 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
+
+ * http.c: New
+
+
Wed Jan 13 14:10:15 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
* iobuf.c (iobuf_fdopen): New.
diff --git a/util/Makefile.am b/util/Makefile.am
index 3f2f9a3d0..5b0b99df2 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -7,8 +7,12 @@ noinst_LIBRARIES = libutil.a
libutil_a_SOURCES = g10u.c logger.c fileutil.c miscutil.c strgutil.c \
ttyio.c argparse.c memory.c secmem.c errors.c iobuf.c \
- dotlock.c
+ dotlock.c http.c
+http-test: http.c
+ gcc -DHAVE_CONFIG_H -I. -I. -I.. $(INCLUDES) -g -Wall -DTEST \
+ -o http-test http.c libutil.a ../mpi/libmpi.a @INTLLIBS@
+