a new release

This commit is contained in:
Werner Koch 1998-10-07 13:30:43 +00:00
parent f04db56311
commit 786a2870df
22 changed files with 2245 additions and 1648 deletions

View File

@ -6,15 +6,15 @@ EXTRA_DIST = VERSION PROJECTS
dist-hook:
@set -e; \
for file in `find $(srcdir) -type f -name distfiles`; do \
for file in `cd $(top_srcdir); find . -type f -name distfiles`; do \
dir=`dirname $$file` ; $(mkinstalldirs) $(distdir)/$$dir ; \
for i in distfiles `cat $$file` ; do \
ln $(srcdir)/$$dir/$$i $(distdir)/$$dir/$$i 2> /dev/null \
|| cp -p $(srcdir)/$$dir/$$i $(distdir)/$$dir/$$i; \
for i in distfiles `cat $(top_srcdir)/$$file` ; do \
ln $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i 2> /dev/null \
|| cp -p $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i; \
done ; \
done
@set -e; \
sed -e 's/@pkg_version@/$(VERSION)/g' $(srcdir)/scripts/gnupg.spec \
sed -e 's/@pkg_version@/$(VERSION)/g' $(top_srcdir)/scripts/gnupg.spec \
> $(distdir)/scripts/gnupg-$(VERSION).spec

4
NEWS
View File

@ -17,7 +17,9 @@ Noteworthy changes in version 0.4.1
* Checked gnupg against the August 1998 draft (07) and I believe
it is in compliance with this document (except for one point).
* Fixed some bugs in the import merging code.
* Fixed some bugs in the import merging code and rewrote some
code for the trustdb.
Noteworthy changes in version 0.4.0
-----------------------------------

15
README
View File

@ -1,3 +1,5 @@
-----BEGIN PGP SIGNED MESSAGE-----
GNUPG - The GNU Privacy Guard
-------------------------------
Version 0.4
@ -55,7 +57,7 @@
Installation
------------
Please read the file INSTALL.
Please read the file INSTALL!
Here is a quick summary:
@ -328,5 +330,14 @@
Please direct bug reports to <gnupg-bugs@gnu.org> or better
post them to the mailing list <g10@net.lut.ac.uk> (this is a closed list,
please subscribe before posting).
please subscribe before posting, see above (~line 33)).
-----BEGIN PGP SIGNATURE-----
Version: GNUPG v0.4.0a (GNU/Linux)
Comment: For info finger gcrypt@ftp.guug.de
iQB1AwUBNhtSpB0Z9MEMmFelAQHWNQMAuPaj71rzjjtVNlYDV0MYljPFZqAK7tvmbH3i9Lti
UuvGPCpx1/ej7jwZ2LSQ61O8c/xRwV07chHa5MGmSGT4KZg5g5MejUOliMQJIJwjY5PoZAVb
6F7+hZf5Bt5Jl2J7
=6Mbb
-----END PGP SIGNATURE-----

9
TODO
View File

@ -1,12 +1,9 @@
* check for working mmap()
* after creating a new uid, the preferences in the trustdb are not updated.
We should always sync the trustdb in such cases.
* The critical bit of signature subpackets is not yet supported; i.e.
it is ignored.
* Read more records at once in tdbio.c and provide a lazy write cache.
* Exportable Certification Flag is ignored
* Why does OpenPGP say: The algorithm byte is included in the
@ -59,7 +56,7 @@
* change the fake_data stuff to mpi_set_opaque
* Is it okay to use gettext for the help system???
* Is it okay to use gettext for the help system?
* Add some stuff for DU cc

View File

@ -1 +1 @@
0.4.0a
0.4.1

View File

@ -21,7 +21,6 @@ expect {
-exact "Please select what kind of key you want:\r
(1) DSA and ElGamal (default)\r
(2) ElGamal (sign and encrypt)\r
(3) ElGamal (encrypt only)\r
(4) DSA (sign only)\r
(5) ElGamal in a v3 packet\r
Your selection? " { send -- "1\r" }

View File

@ -10,6 +10,6 @@ else
rm err.tmp.$$
exit 1
fi
fgrep -v -f run-gpg.patterns err.tmp.$$
fgrep -v -f $srcdir/run-gpg.patterns err.tmp.$$
rm err.tmp.$$

View File

@ -65,7 +65,8 @@ Record type 1:
(Used to keep track of the time, when this TrustDB was checked
against the pubring)
1 u32 record number of keyhashtable
12 bytes reserved
1 u32 first free record
8 bytes reserved
Record type 2: (directory record)
@ -222,6 +223,11 @@ Record type 11 (hash list)
For the current record length of 40, n is 7
Record type 254: (free record)
1 byte value 254
1 byte reserved (0)
1 u32 next_free
Packet Headers

View File

@ -1,3 +1,20 @@
Wed Oct 7 11:15:36 1998 Werner Koch (wk@isil.d.shuttle.de)
* keyedit.c (sign_uids): Fixed a problem with SK which could caused
a save of an unprotected key.
(menu_adduid): Ditto.
* keyedit.c (keyedit_menu): Prefs are now correctly listed for
new user ids.
* trustdb.c (update_trust_record): New.
(insert_trust_record): Now makes use of update_trust_record.
Tue Oct 6 16:18:03 1998 Werner Koch (wk@isil.d.shuttle.de)
* trustdb.c (read_record): replaces most of the tdbio_read_records.
(write_record): Ditto.
Sat Oct 3 11:01:21 1998 Werner Koch (wk@isil.d.shuttle.de)
* keygen.c (ask_alogo): enable ElGamal enc-only only for addmode.

View File

@ -87,6 +87,7 @@ enum cmd_and_opt_values { aNull = 0,
aPrintMD,
aPrintMDs,
aCheckTrustDB,
aFixTrustDB,
aListTrustDB,
aListTrustPath,
aExportOwnerTrust,
@ -177,6 +178,7 @@ static ARGPARSE_OPTS opts[] = {
{ aExportOwnerTrust, "export-ownertrust", 256, N_("export the ownertrust values")},
{ aImportOwnerTrust, "import-ownertrust", 256 , N_("import ownertrust values")},
{ aCheckTrustDB, "check-trustdb",0 , N_("|[NAMES]|check the trust database")},
{ aFixTrustDB, "fix-trustdb",0 , N_("fix a corrupted trust database")},
{ aDeArmor, "dearmor", 256, N_("De-Armor a file or stdin") },
{ aEnArmor, "enarmor", 256, N_("En-Armor a file or stdin") },
{ aPrintMD, "print-md" , 256, N_("|algo [files]|print message digests")},
@ -636,6 +638,7 @@ main( int argc, char **argv )
case aPrintMDs: set_cmd( &cmd, aPrintMDs); break;
case aListTrustDB: set_cmd( &cmd, aListTrustDB); break;
case aCheckTrustDB: set_cmd( &cmd, aCheckTrustDB); break;
case aFixTrustDB: set_cmd( &cmd, aFixTrustDB); break;
case aListTrustPath: set_cmd( &cmd, aListTrustPath); break;
case aDeArmor: set_cmd( &cmd, aDeArmor); break;
case aEnArmor: set_cmd( &cmd, aEnArmor); break;
@ -856,6 +859,7 @@ main( int argc, char **argv )
case aGenRandom:
case aDeArmor:
case aEnArmor:
case aFixTrustDB:
break;
case aKMode:
case aListKeys:
@ -1165,6 +1169,12 @@ main( int argc, char **argv )
}
break;
case aFixTrustDB:
log_error("this command ist not yet implemented.\"\n");
log_error("A workaround is to use \"--export-ownertrust\", remove\n");
log_error("the trustdb file and do an \"--import-ownertrust\".\n" );
break;
case aListTrustPath:
if( argc != 2 )
wrong_args("--list-trust-path [-- -]<maxdepth> <username>");

View File

@ -212,6 +212,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified )
int rc = 0;
SK_LIST sk_list = NULL;
SK_LIST sk_rover = NULL;
PKT_secret_key *sk = NULL;
KBNODE node, uidnode;
PKT_public_key *primary_pk;
int select_all = !count_selected_uids(keyblock);
@ -228,7 +229,14 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified )
size_t n;
char *p;
keyid_from_sk( sk_rover->sk, sk_keyid );
/* we have to use a copy of the sk, because make_keysig_packet
* may remove the protection from sk and if we did other
* changes to the secret key, we would save the unprotected
* version */
if( sk )
free_secret_key(sk);
sk = copy_secret_key( NULL, sk_rover->sk );
keyid_from_sk( sk, sk_keyid );
/* set mark A for all selected user ids */
for( node=keyblock; node; node = node->next ) {
if( select_all || (node->flag & NODFLG_SELUID) )
@ -261,6 +269,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified )
/* Ask whether we really should sign these user id(s) */
tty_printf("\n");
show_key_with_all_names( keyblock, 1, 1, 0, 0 );
tty_printf("\n");
tty_printf(_(
"Are you really sure that you want to sign this key\n"
"with your key: \""));
@ -287,7 +296,7 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified )
rc = make_keysig_packet( &sig, primary_pk,
node->pkt->pkt.user_id,
NULL,
sk_rover->sk,
sk,
0x10, 0, NULL, NULL );
if( rc ) {
log_error(_("signing failed: %s\n"), g10_errstr(rc));
@ -311,6 +320,8 @@ sign_uids( KBNODE keyblock, STRLIST locusr, int *ret_modified )
leave:
release_sk_list( sk_list );
if( sk )
free_secret_key(sk);
return rc;
}
@ -587,10 +598,13 @@ keyedit_menu( const char *username, STRLIST locusr )
break;
}
}
/* FIXME: UPDATE/INVALIDATE trustdb !! */
}
else
tty_printf(_("Key not changed so no update needed.\n"));
rc = update_trust_record( keyblock );
if( rc )
log_error(_("update of trust db failed: %s\n"),
g10_errstr(rc) );
goto leave;
case cmdLIST:
@ -643,6 +657,14 @@ keyedit_menu( const char *username, STRLIST locusr )
if( menu_adduid( keyblock, sec_keyblock ) ) {
redisplay = 1;
sec_modified = modified = 1;
/* must update the trustdb already here, so that preferences
* get listed correctly */
rc = update_trust_record( keyblock );
if( rc ) {
log_error(_("update of trust db failed: %s\n"),
g10_errstr(rc) );
rc = 0;
}
}
break;
@ -808,8 +830,10 @@ show_key_with_all_names( KBNODE keyblock, int only_marked,
expirestr_from_pk(pk) );
if( node->pkt->pkttype == PKT_PUBLIC_KEY ) {
tty_printf(" trust: %c/%c", otrust, trust );
if( with_fpr )
if( with_fpr ) {
tty_printf("\n");
show_fingerprint( pk );
}
}
tty_printf("\n");
}
@ -933,7 +957,7 @@ menu_adduid( KBNODE pub_keyblock, KBNODE sec_keyblock )
pub_where = NULL;
for( node = sec_keyblock; node; sec_where = node, node = node->next ) {
if( node->pkt->pkttype == PKT_SECRET_KEY )
sk = node->pkt->pkt.secret_key;
sk = copy_secret_key( NULL, node->pkt->pkt.secret_key);
else if( node->pkt->pkttype == PKT_SECRET_SUBKEY )
break;
}
@ -943,6 +967,7 @@ menu_adduid( KBNODE pub_keyblock, KBNODE sec_keyblock )
rc = make_keysig_packet( &sig, pk, uid, NULL, sk, 0x13, 0,
keygen_add_std_prefs, sk );
free_secret_key( sk );
if( rc ) {
log_error("signing failed: %s\n", g10_errstr(rc) );
free_user_id(uid);

View File

@ -153,9 +153,7 @@ _("Could not find a valid trust path to the key. Let's see whether we\n"
lid = pk->local_id;
while( !(rc=enum_trust_web( &context, &lid )) ) {
rc = get_ownertrust( lid, &trust );
if( rc )
log_fatal("Ooops: couldn't get owner trust for %lu\n", lid);
trust = get_ownertrust( lid );
if( trust == TRUST_UNDEFINED || trust == TRUST_EXPIRED ||
trust == TRUST_UNKNOWN ) {
if( edit_ownertrust( lid, 0 ) )

View File

@ -369,10 +369,12 @@ tdbio_dump_record( TRUSTREC *rec, FILE *fp )
fprintf(fp, "rec %5lu, ", rnum );
switch( rec->rectype ) {
case 0: fprintf(fp, "free\n");
case 0: fprintf(fp, "blank\n");
break;
case RECTYPE_VER: fprintf(fp, "version, keyhashtbl=%lu\n",
rec->r.ver.keyhashtbl );
case RECTYPE_VER: fprintf(fp, "version, keyhashtbl=%lu, firstfree=%lu\n",
rec->r.ver.keyhashtbl, rec->r.ver.firstfree );
break;
case RECTYPE_FREE: fprintf(fp, "free, next=%lu\n", rec->r.free.next );
break;
case RECTYPE_DIR:
fprintf(fp, "dir %lu, keys=%lu, uids=%lu, cach=%lu, ot=%02x",
@ -505,6 +507,7 @@ tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected )
rec->r.ver.modified = buftoulong(p); p += 4;
rec->r.ver.validated= buftoulong(p); p += 4;
rec->r.ver.keyhashtbl=buftoulong(p); p += 4;
rec->r.ver.firstfree =buftoulong(p); p += 4;
if( recnum ) {
log_error_f( db_name, "version record with recnum %lu\n",
(ulong)recnum );
@ -516,6 +519,9 @@ tdbio_read_record( ulong recnum, TRUSTREC *rec, int expected )
rc = G10ERR_TRUSTDB;
}
break;
case RECTYPE_FREE:
rec->r.free.next = buftoulong(p); p += 4;
break;
case RECTYPE_DIR: /*directory record */
rec->r.dir.lid = buftoulong(p); p += 4;
rec->r.dir.keylist = buftoulong(p); p += 4;
@ -619,6 +625,11 @@ tdbio_write_record( TRUSTREC *rec )
ulongtobuf(p, rec->r.ver.modified); p += 4;
ulongtobuf(p, rec->r.ver.validated); p += 4;
ulongtobuf(p, rec->r.ver.keyhashtbl); p += 4;
ulongtobuf(p, rec->r.ver.firstfree ); p += 4;
break;
case RECTYPE_FREE:
ulongtobuf(p, rec->r.free.next); p += 4;
break;
case RECTYPE_DIR: /*directory record */
@ -707,11 +718,22 @@ tdbio_write_record( TRUSTREC *rec )
int
tdbio_delete_record( ulong recnum )
{
TRUSTREC rec;
TRUSTREC vr, rec;
int rc;
rc = tdbio_read_record( 0, &vr, RECTYPE_VER );
if( rc )
log_fatal_f( db_name, _("error reading version record: %s\n"),
g10_errstr(rc) );
rec.recnum = recnum;
rec.rectype = 0;
return tdbio_write_record( &rec );
rec.rectype = RECTYPE_FREE;
rec.r.free.next = vr.r.ver.firstfree;
vr.r.ver.firstfree = recnum;
rc = tdbio_write_record( &rec );
if( !rc )
rc = tdbio_write_record( &vr );
return rc;
}
/****************
@ -722,25 +744,55 @@ tdbio_new_recnum()
{
off_t offset;
ulong recnum;
TRUSTREC rec;
TRUSTREC vr, rec;
int rc;
/* fixme: look for unused records */
offset = lseek( db_fd, 0, SEEK_END );
if( offset == -1 )
log_fatal("trustdb: lseek to end failed: %s\n", strerror(errno) );
recnum = offset / TRUST_RECORD_LEN;
assert(recnum); /* this is will never be the first record */
/* we must write a record, so that the next call to this function
* returns another recnum */
memset( &rec, 0, sizeof rec );
rec.rectype = 0; /* free record */
rec.recnum = recnum;
rc = tdbio_write_record( &rec );
/* look for unused records */
rc = tdbio_read_record( 0, &vr, RECTYPE_VER );
if( rc )
log_fatal_f(db_name,_("failed to append a record: %s\n"),
g10_errstr(rc));
log_fatal_f( db_name, _("error reading version record: %s\n"),
g10_errstr(rc) );
if( vr.r.ver.firstfree ) {
recnum = vr.r.ver.firstfree;
rc = tdbio_read_record( recnum, &rec, RECTYPE_FREE );
if( rc ) {
log_error_f( db_name, _("error reading free record: %s\n"),
g10_errstr(rc) );
return rc;
}
/* update dir record */
vr.r.ver.firstfree = rec.r.free.next;
rc = tdbio_write_record( &vr );
if( rc ) {
log_error_f( db_name, _("error writing dir record: %s\n"),
g10_errstr(rc) );
return rc;
}
/*zero out the new record */
memset( &rec, 0, sizeof rec );
rec.rectype = 0; /* unused record */
rec.recnum = recnum;
rc = tdbio_write_record( &rec );
if( rc )
log_fatal_f(db_name,_("failed to zero a record: %s\n"),
g10_errstr(rc));
}
else { /* not found, append a new record */
offset = lseek( db_fd, 0, SEEK_END );
if( offset == -1 )
log_fatal("trustdb: lseek to end failed: %s\n", strerror(errno) );
recnum = offset / TRUST_RECORD_LEN;
assert(recnum); /* this is will never be the first record */
/* we must write a record, so that the next call to this function
* returns another recnum */
memset( &rec, 0, sizeof rec );
rec.rectype = 0; /* unused record */
rec.recnum = recnum;
rc = tdbio_write_record( &rec );
if( rc )
log_fatal_f(db_name,_("failed to append a record: %s\n"),
g10_errstr(rc));
}
return recnum ;
}

View File

@ -42,6 +42,7 @@
#define RECTYPE_CACH 9
#define RECTYPE_HTBL 10
#define RECTYPE_HLST 11
#define RECTYPE_FREE 254
#define DIRF_CHECKED 1 /* everything has been checked, the other bits are
@ -58,9 +59,8 @@
struct trust_record {
int rectype;
struct trust_record *next; /* help pointer to build lists in memory */
struct trust_record *help_pref;
int mark;
struct trust_record *next; /* help pointer to build lists in memory */
ulong recnum;
union {
struct { /* version record: */
@ -69,7 +69,11 @@ struct trust_record {
ulong modified; /* timestamp of last modification */
ulong validated; /* timestamp of last validation */
ulong keyhashtbl;
ulong firstfree;
} ver;
struct { /* free record */
ulong next;
} free;
struct { /* directory record */
ulong lid;
ulong keylist; /* List of keys (the first is the primary key)*/

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@ int init_trustdb( int level, const char *dbname );
int check_trust( PKT_public_key *pk, unsigned *r_trustlevel );
int query_trust_info( PKT_public_key *pk );
int enum_trust_web( void **context, ulong *lid );
int get_ownertrust( ulong lid, unsigned *r_otrust );
unsigned get_ownertrust( ulong lid );
int get_ownertrust_info( ulong lid );
byte *get_pref_data( ulong lid, const byte *namehash, size_t *ret_n );
int is_algo_in_prefs( ulong lid, int preftype, int algo );

View File

@ -1,3 +1,7 @@
Wed Oct 7 13:12:00 1998 Werner Koch (wk@isil.d.shuttle.de)
* Makefile.in.in: Fixed mkinstalldirs problems
Mon Sep 21 15:03:44 1998 Werner Koch (wk@(none))
* it.po: New version from Marco d'Itri

View File

@ -26,7 +26,8 @@ subdir = po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
### This doe not work: MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
MKINSTALLDIRS = $(top_srcdir)/scripts/mkinstalldirs
CC = @CC@
GENCAT = @GENCAT@
@ -120,7 +121,7 @@ install-data-yes: all
cat=`basename $$cat`; \
case "$$cat" in \
*.gmo) destdir=$(gnulocaledir);; \
*) destdir=$(localedir);; \
*) destdir=$(localedir);; \
esac; \
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \
@ -232,8 +233,8 @@ POTFILES: POTFILES.in
posrcprefix="../"; \
fi; \
rm -f $@-t $@ \
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
| sed -e '$$s/\\$$//') > $@-t \
&& chmod a-w $@-t \
&& mv $@-t $@ )

580
po/de.po

File diff suppressed because it is too large Load Diff

766
po/en.po

File diff suppressed because it is too large Load Diff

778
po/fr.po

File diff suppressed because it is too large Load Diff

777
po/it.po

File diff suppressed because it is too large Load Diff