mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
See ChangeLog: Sat Jan 16 09:27:30 CET 1999 Werner Koch
This commit is contained in:
parent
e99e43cd53
commit
29c08419db
3
NEWS
3
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
|
||||
-----------------------------------
|
||||
|
3
TODO
3
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
|
||||
----------
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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 \
|
||||
|
@ -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;
|
||||
}
|
||||
|
72
g10/hkp.c
Normal file
72
g10/hkp.c
Normal file
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
/* 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
|
||||
#ifndef G10_HKP_H
|
||||
#define G10_HKP_H 1
|
||||
|
||||
|
||||
PREF_LIST new_pref_list(void);
|
||||
void release_pref_list( PREF_LIST pref );
|
||||
int hkp_ask_import( u32 *keyid );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /*G10_PREF_H*/
|
||||
#endif /*G10_HKP_H*/
|
39
g10/import.c
39
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 );
|
||||
@ -105,11 +106,36 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
@ -67,6 +67,7 @@ struct {
|
||||
int not_dash_escaped;
|
||||
int escape_from;
|
||||
int lock_once;
|
||||
const char *keyserver_name;
|
||||
} opt;
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 );
|
||||
|
81
g10/pref.c
81
g10/pref.c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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" $*
|
||||
|
||||
|
4
scripts/config.guess
vendored
4
scripts/config.guess
vendored
@ -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:*:*)
|
||||
|
8
scripts/config.sub
vendored
8
scripts/config.sub
vendored
@ -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)
|
||||
;;
|
||||
*)
|
||||
|
@ -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.
|
||||
|
@ -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@
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user