From c287a8d05bfa08a3ea7d2c8fc8ae8c3a740aef1c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 11 Oct 2000 17:26:49 +0000 Subject: [PATCH] Add features packet and fixes MIPS3. --- TODO | 8 +++++++- g10/ChangeLog | 8 ++++++++ g10/build-packet.c | 1 + g10/keygen.c | 3 +++ g10/packet.h | 1 + g10/parse-packet.c | 9 ++++++++- mpi/ChangeLog | 6 ++++++ mpi/config.links | 11 +++++++++++ mpi/generic/distfiles | 1 + mpi/generic/mpi-asm-defs.h | 9 +++++++++ mpi/mips3/distfiles | 1 + mpi/mips3/mpi-asm-defs.h | 10 ++++++++++ 12 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 mpi/generic/mpi-asm-defs.h create mode 100644 mpi/mips3/mpi-asm-defs.h diff --git a/TODO b/TODO index da49089d7..30e27e75f 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,11 @@ - * options.skel wird mit umaks von root installiert. + * Look at FEATURES packet to decide wether to use MDC. We should + rethink the whole preference implementation and drop that ugly hamehash + stuff. Is it possible to that in getkey? We have to see whether we + realy lookit up by user name or whethre there is a double lookup, + first by userid and then later by keyid - which is bad. + + * options.skel wird mit umask von root installiert. * See how we can handle the symlinks in ./gcrypt diff --git a/g10/ChangeLog b/g10/ChangeLog index 6f73abf96..4fb562ff6 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2000-10-11 Werner Koch + + * packet.h: Add features sig subpacket definition. + * parse-packet.c (dump_sig_subpkt,parse_one_sig_subpkt, + can_handle_critical): Implemented it here. + * build-packet.c (build_sig_subpkt): and here. + * keygen.c (keygen_add_std_prefs): Generate a features packet. + 2000-10-09 Werner Koch * keygen.c (do_generate_keypair): Removed the keyblock locking. diff --git a/g10/build-packet.c b/g10/build-packet.c index 7291f74b2..93381879c 100644 --- a/g10/build-packet.c +++ b/g10/build-packet.c @@ -702,6 +702,7 @@ build_sig_subpkt( PKT_signature *sig, sigsubpkttype_t type, case SIGSUBPKT_POLICY: case SIGSUBPKT_REVOC_REASON: case SIGSUBPKT_KEY_FLAGS: + case SIGSUBPKT_FEATURES: hashed = 1; break; default: hashed = 0; break; } diff --git a/g10/keygen.c b/g10/keygen.c index 415c54a2a..790dd58ba 100644 --- a/g10/keygen.c +++ b/g10/keygen.c @@ -148,6 +148,9 @@ keygen_add_std_prefs( PKT_signature *sig, void *opaque ) buf[1] = 1; build_sig_subpkt( sig, SIGSUBPKT_PREF_COMPR, buf, 2 ); + buf[0] = 1; /* supports MDC packets (15 + 16) */ + build_sig_subpkt( sig, SIGSUBPKT_FEATURES, buf, 1 ); + buf[0] = 0x80; /* no modify - It is reasonable that a key holder * has the possibility to reject signatures from users * who are known to sign everything without any diff --git a/g10/packet.h b/g10/packet.h index 33bcf792a..2f7f16f8c 100644 --- a/g10/packet.h +++ b/g10/packet.h @@ -275,6 +275,7 @@ typedef enum { SIGSUBPKT_KEY_FLAGS =27, /* key flags */ SIGSUBPKT_SIGNERS_UID =28, /* signer's user id */ SIGSUBPKT_REVOC_REASON =29, /* reason for revocation */ + SIGSUBPKT_FEATURES =30, /* feature flags */ SIGSUBPKT_PRIV_ADD_SIG =101,/* signatur is also valid for this uid */ SIGSUBPKT_FLAG_CRITICAL=128 diff --git a/g10/parse-packet.c b/g10/parse-packet.c index b22a59989..691be6662 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -843,7 +843,12 @@ dump_sig_subpkt( int hashed, int type, int critical, printf("%02X", buffer[i] ); } break; - case SIGSUBPKT_PRIV_ADD_SIG: + case SIGSUBPKT_FEATURES: + fputs ( "features:", stdout ); + for( i=0; i < length; i++ ) + printf(" %02X", buffer[i] ); + break; + case SIGSUBPKT_PRIV_ADD_SIG: /* gnupg private - to be removed */ p = "signs additional user ID"; break; default: p = "?"; break; @@ -889,6 +894,7 @@ parse_one_sig_subpkt( const byte *buffer, size_t n, int type ) case SIGSUBPKT_PREF_SYM: case SIGSUBPKT_PREF_HASH: case SIGSUBPKT_PREF_COMPR: + case SIGSUBPKT_FEATURES: case SIGSUBPKT_POLICY: return 0; case SIGSUBPKT_PRIMARY_UID: @@ -925,6 +931,7 @@ can_handle_critical( const byte *buffer, size_t n, int type ) case SIGSUBPKT_PREF_SYM: case SIGSUBPKT_PREF_HASH: case SIGSUBPKT_PREF_COMPR: + case SIGSUBPKT_FEATURES: case SIGSUBPKT_KEY_FLAGS: return 1; diff --git a/mpi/ChangeLog b/mpi/ChangeLog index 97ae3cd22..64b0b3867 100644 --- a/mpi/ChangeLog +++ b/mpi/ChangeLog @@ -1,3 +1,9 @@ +2000-10-11 Werner Koch + + * generic/mpi-asm-defs.h: New. + * mips3/mpi-asm-defs.h: New. + * config.links: Create a link to one of the above files. + Fri Jul 28 18:19:11 CEST 2000 Werner Koch * mpicoder.c (gcry_mpi_scan): Normalize the returned MPI. diff --git a/mpi/config.links b/mpi/config.links index 6f6b276da..2a261ed3e 100644 --- a/mpi/config.links +++ b/mpi/config.links @@ -278,3 +278,14 @@ for fn in $mpi_ln_modules ; do done done +# Same thing for the file which defines the limb size +path="$path generic" +for dir in $path ; do + rm -f $srcdir/mpi/mpi-asm-defs.h + if test -f $srcdir/mpi/$dir/mpi-asm-defs.h ; then + mpi_ln_src="$mpi_ln_src mpi/$dir/mpi-asm-defs.h" + mpi_ln_dst="$mpi_ln_dst mpi/mpi-asm-defs.h" + break; + fi +done + diff --git a/mpi/generic/distfiles b/mpi/generic/distfiles index 0bf4600fb..649e829b7 100644 --- a/mpi/generic/distfiles +++ b/mpi/generic/distfiles @@ -6,4 +6,5 @@ mpih-lshift.c mpih-rshift.c mpih-sub1.c udiv-w-sdiv.c +mpi-asm-defs.h diff --git a/mpi/generic/mpi-asm-defs.h b/mpi/generic/mpi-asm-defs.h new file mode 100644 index 000000000..c25f966a9 --- /dev/null +++ b/mpi/generic/mpi-asm-defs.h @@ -0,0 +1,9 @@ +/* This file defines some basic constants for the MPI machinery. We + * need to define the types on a per-CPU basis, so it is done with + * this file here. */ +#define BYTES_PER_MPI_LIMB (sizeof unsigned long) + + + + + diff --git a/mpi/mips3/distfiles b/mpi/mips3/distfiles index b88f4f869..85260fc8e 100644 --- a/mpi/mips3/distfiles +++ b/mpi/mips3/distfiles @@ -6,4 +6,5 @@ mpih-mul2.S mpih-mul3.S mpih-lshift.S mpih-rshift.S +mpi-asm-defs.h diff --git a/mpi/mips3/mpi-asm-defs.h b/mpi/mips3/mpi-asm-defs.h new file mode 100644 index 000000000..2d9a9c1f2 --- /dev/null +++ b/mpi/mips3/mpi-asm-defs.h @@ -0,0 +1,10 @@ +/* This file defines some basic constants for the MPI machinery. We + * need to define the types on a per-CPU basis, so it is done with + * this file here. */ +#define BYTES_PER_MPI_LIMB 8 + + + + + +