1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

See ChangeLog: Mon Jul 12 14:55:34 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-07-12 12:57:54 +00:00
parent c5ca275573
commit 8be0d60594
13 changed files with 161 additions and 39 deletions

View File

@ -215,3 +215,10 @@ Probably more things but this keyserver is not a goal for the
of the existing key servers (I think they bail out on some rfc2440 of the existing key servers (I think they bail out on some rfc2440
packet formats). packet formats).
Suggested things which I will not do:
=====================================
* Let take --help an option to select some topics.
Using grep is much easier

10
TODO
View File

@ -6,11 +6,6 @@
* print a warning when a revoked/expired _secret_ key is used. * print a warning when a revoked/expired _secret_ key is used.
* remove more "Fixmes"
* when decryptiong multiple key: print a warning only if no usable pubkey
encrypt package was found. Extension: display a list of all recipients.
* Add NO_PUBKEY and NO_SECKEY status lines. * Add NO_PUBKEY and NO_SECKEY status lines.
* Solaris make has problems with the generated POTFILES - seems to be a * Solaris make has problems with the generated POTFILES - seems to be a
@ -19,12 +14,9 @@
* find a way to allow the import of non-self-signed keys. This is needed * find a way to allow the import of non-self-signed keys. This is needed
for the IN ENCR/SIGN hack. for the IN ENCR/SIGN hack.
* Not all user names are correctly converted to UTF8.
Nice to have Nice to have
------------ ------------
* Let take --help an option to select some topics.
* Offcial test vectors for 3DES-EDE3 * Offcial test vectors for 3DES-EDE3
* use DEL and ^H for erasing the previous character (util/ttyio.c). * use DEL and ^H for erasing the previous character (util/ttyio.c).
or better readline. or better readline.
@ -43,7 +35,7 @@ Nice to have
stuff? stuff?
* the pubkey encrypt functions should do some sanity checks. * the pubkey encrypt functions should do some sanity checks.
* dynload: implement the hint stuff. * dynload: implement the hint stuff.
* "gpg filename.tar.gz.asc" sollte wie mit --verify funktionieren (-sab). * "gpg filename.tar.gz.asc" should work like --verify (-sab).
* for messages created with "-t", it might make sense to append the * for messages created with "-t", it might make sense to append the
verification status of the message to the output (i.e. write something to verification status of the message to the output (i.e. write something to
the --output file and not only to stderr. the --output file and not only to stderr.

View File

@ -1,11 +1,9 @@
Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* Makefile.am: Support for libtool. * Makefile.am: Support for libtool.
Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* dsa.c (gen_k): Changed algorithm to consume less random bytes * dsa.c (gen_k): Changed algorithm to consume less random bytes
* elgamal.c (gen_k): Ditto. * elgamal.c (gen_k): Ditto.
@ -13,13 +11,11 @@ Fri Jul 2 11:45:54 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
Thu Jul 1 12:47:31 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Thu Jul 1 12:47:31 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* primegen.c, elgamal.c, dsa.c (progess): New and replaced all * primegen.c, elgamal.c, dsa.c (progess): New and replaced all
fputc with a call to this function. fputc with a call to this function.
Sat Jun 26 12:15:59 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Sat Jun 26 12:15:59 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* rndegd.c (do_write): s/ssize_t/int/ due to SunOS 4.1 probs. * rndegd.c (do_write): s/ssize_t/int/ due to SunOS 4.1 probs.
* cipher.c (do_cbc_encrypt, do_cbc_decrypt): New. * cipher.c (do_cbc_encrypt, do_cbc_decrypt): New.

View File

@ -1,3 +1,19 @@
Mon Jul 12 14:55:34 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* mainproc.c (kidlist_item): New.
(release_list): Release failed pk-enc-list.
(print_failed_pkenc): New
(proc_encrypted): Print info about failed PK enc.
* openfile.c (make_outfile_name): s/error/info/
* passphrase.c (passphrase_to_dek): Return an empty passphrase when
in batch mode and don't make the warbing message fatal
* seckey-cert.c (check_secret_key): Try only once when in batch mode.
* g10.c (make_username): New.
Thu Jul 8 16:21:27 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Thu Jul 8 16:21:27 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>

View File

@ -442,6 +442,19 @@ wrong_args( const char *text)
g10_exit(2); g10_exit(2);
} }
static char *
make_username( const char *string )
{
char *p;
if( utf8_strings )
p = native_to_utf8( string );
else
p = m_strdup(string);
return p;
}
static void static void
set_debug(void) set_debug(void)
{ {
@ -494,6 +507,7 @@ main( int argc, char **argv )
int orig_argc; int orig_argc;
char **orig_argv; char **orig_argv;
const char *fname; const char *fname;
char *username;
STRLIST sl, remusr= NULL, locusr=NULL; STRLIST sl, remusr= NULL, locusr=NULL;
STRLIST nrings=NULL, sec_nrings=NULL; STRLIST nrings=NULL, sec_nrings=NULL;
armor_filter_context_t afx; armor_filter_context_t afx;
@ -1050,10 +1064,10 @@ main( int argc, char **argv )
case aDeleteKey: case aDeleteKey:
if( argc != 1 ) if( argc != 1 )
wrong_args(_("--delete-key username")); wrong_args(_("--delete-key username"));
/* note: fname is the user id! */ username = make_username( fname );
/* fixme: do utf8 conversion */ if( (rc = delete_key(username, cmd==aDeleteSecretKey)) )
if( (rc = delete_key(fname, cmd==aDeleteSecretKey)) ) log_error("%s: delete key failed: %s\n", username, g10_errstr(rc) );
log_error("%s: delete key failed: %s\n", print_fname_stdin(fname), g10_errstr(rc) ); m_free(username);
break; break;
@ -1068,7 +1082,7 @@ main( int argc, char **argv )
secret_key_list( argc, argv ); secret_key_list( argc, argv );
break; break;
case aKMode: /* list keyring */ case aKMode: /* list keyring -- NOTE: This will be removed soon */
if( argc < 2 ) /* -kv [userid] */ if( argc < 2 ) /* -kv [userid] */
public_key_list( (argc && **argv)? 1:0, argv ); public_key_list( (argc && **argv)? 1:0, argv );
else if( argc == 2 ) { /* -kv userid keyring */ else if( argc == 2 ) { /* -kv userid keyring */
@ -1114,7 +1128,7 @@ main( int argc, char **argv )
case aRecvKeys: case aRecvKeys:
sl = NULL; sl = NULL;
for( ; argc; argc--, argv++ ) for( ; argc; argc--, argv++ )
add_to_strlist( &sl, *argv ); add_to_strlist2( &sl, *argv, utf8_strings );
if( cmd == aSendKeys ) if( cmd == aSendKeys )
hkp_export( sl ); hkp_export( sl );
else if( cmd == aRecvKeys ) else if( cmd == aRecvKeys )
@ -1127,7 +1141,7 @@ main( int argc, char **argv )
case aExportSecret: case aExportSecret:
sl = NULL; sl = NULL;
for( ; argc; argc--, argv++ ) for( ; argc; argc--, argv++ )
add_to_strlist( &sl, *argv ); add_to_strlist2( &sl, *argv, utf8_strings );
export_seckeys( sl ); export_seckeys( sl );
free_strlist(sl); free_strlist(sl);
break; break;
@ -1135,7 +1149,9 @@ main( int argc, char **argv )
case aGenRevoke: case aGenRevoke:
if( argc != 1 ) if( argc != 1 )
wrong_args("--gen-revoke user-id"); wrong_args("--gen-revoke user-id");
gen_revoke( *argv ); username = make_username(*argv);
gen_revoke( username );
m_free( username );
break; break;
case aDeArmor: case aDeArmor:
@ -1258,8 +1274,11 @@ main( int argc, char **argv )
if( !argc ) if( !argc )
check_trustdb(NULL); check_trustdb(NULL);
else { else {
for( ; argc; argc--, argv++ ) for( ; argc; argc--, argv++ ) {
check_trustdb( *argv ); username = make_username( *argv );
check_trustdb( username );
m_free(username);
}
} }
break; break;
@ -1272,8 +1291,11 @@ main( int argc, char **argv )
case aListTrustPath: case aListTrustPath:
if( !argc ) if( !argc )
wrong_args("--list-trust-path <usernames>"); wrong_args("--list-trust-path <usernames>");
for( ; argc; argc--, argv++ ) for( ; argc; argc--, argv++ ) {
list_trust_path( *argv ); username = make_username( *argv );
list_trust_path( username );
m_free(username);
}
break; break;
case aExportOwnerTrust: case aExportOwnerTrust:

View File

@ -39,6 +39,16 @@
#include "trustdb.h" #include "trustdb.h"
#include "hkp.h" #include "hkp.h"
struct kidlist_item {
struct kidlist_item *next;
u32 kid[2];
int pubkey_algo;
int reason;
};
/**************** /****************
* Structure to hold the context * Structure to hold the context
*/ */
@ -60,6 +70,8 @@ struct mainproc_context {
IOBUF iobuf; /* used to get the filename etc. */ IOBUF iobuf; /* used to get the filename etc. */
int trustletter; /* temp usage in list_node */ int trustletter; /* temp usage in list_node */
ulong local_id; /* ditto */ ulong local_id; /* ditto */
struct kidlist_item *failed_pkenc; /* list of packets for which
we do not have a secret key */
}; };
@ -76,6 +88,12 @@ release_list( CTX c )
return; return;
proc_tree(c, c->list ); proc_tree(c, c->list );
release_kbnode( c->list ); release_kbnode( c->list );
while( c->failed_pkenc ) {
struct kidlist_item *tmp = c->failed_pkenc->next;
m_free( c->failed_pkenc );
c->failed_pkenc = tmp;
}
c->failed_pkenc = NULL;
c->list = NULL; c->list = NULL;
} }
@ -213,6 +231,8 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
m_free(c->dek); c->dek = NULL; m_free(c->dek); c->dek = NULL;
} }
} }
else
result = G10ERR_NO_SECKEY;
} }
else else
result = G10ERR_PUBKEY_ALGO; result = G10ERR_PUBKEY_ALGO;
@ -223,22 +243,66 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
if( opt.verbose > 1 ) if( opt.verbose > 1 )
log_info( _("public key encrypted data: good DEK\n") ); log_info( _("public key encrypted data: good DEK\n") );
} }
else { else { /* store it for later display */
/* fixme: defer this message until we have parsed all packets of struct kidlist_item *x = m_alloc( sizeof *x );
* this type - do this by building a list of keys with their stati x->kid[0] = enc->keyid[0];
* and store it with the context. do_proc_packets can then use x->kid[1] = enc->keyid[1];
* this list to display some information */ x->pubkey_algo = enc->pubkey_algo;
log_error(_("public key decryption failed: %s\n"), g10_errstr(result)); x->reason = result;
x->next = c->failed_pkenc;
c->failed_pkenc = x;
} }
free_packet(pkt); free_packet(pkt);
} }
/****************
* Print the list of public key encrypted packets which we could
* not decrypt.
*/
static void
print_failed_pkenc( struct kidlist_item *list )
{
for( ; list; list = list->next ) {
PKT_public_key *pk = m_alloc_clear( sizeof *pk );
const char *algstr = pubkey_algo_to_string( list->pubkey_algo );
pk->pubkey_algo = list->pubkey_algo;
if( !get_pubkey( pk, list->kid ) ) {
size_t n;
char *p;
log_info( _("encrypted with %u-bit %s key, ID %08lX, created %s\n"),
nbits_from_pk( pk ), algstr, (ulong)list->kid[1],
strtimestamp(pk->timestamp) );
fputs(" \"", log_stream() );
p = get_user_id( list->kid, &n );
print_string( log_stream(), p, n, '"' );
m_free(p);
fputs("\"\n", log_stream() );
}
else {
log_info(_("encrypted with %s key, ID %08lX\n"),
algstr, (ulong) list->kid[1] );
}
free_public_key( pk );
if( list->reason == G10ERR_NO_SECKEY )
log_info(_("no secret key for decryption available\n"));
else
log_error(_("public key decryption failed: %s\n"),
g10_errstr(list->reason));
}
}
static void static void
proc_encrypted( CTX c, PACKET *pkt ) proc_encrypted( CTX c, PACKET *pkt )
{ {
int result = 0; int result = 0;
print_failed_pkenc( c->failed_pkenc );
/*log_debug("dat: %sencrypted data\n", c->dek?"":"conventional ");*/ /*log_debug("dat: %sencrypted data\n", c->dek?"":"conventional ");*/
if( !c->dek && !c->last_was_session_key ) { if( !c->dek && !c->last_was_session_key ) {
/* assume this is old conventional encrypted data */ /* assume this is old conventional encrypted data */
@ -267,8 +331,8 @@ proc_encrypted( CTX c, PACKET *pkt )
else { else {
write_status( STATUS_DECRYPTION_FAILED ); write_status( STATUS_DECRYPTION_FAILED );
log_error(_("decryption failed: %s\n"), g10_errstr(result)); log_error(_("decryption failed: %s\n"), g10_errstr(result));
/* FIXME: if this is secret key not available, try with /* Hmmm: does this work when we have encrypted using a multiple
* other keys */ * ways to specify the session key (symmmetric and PK)*/
} }
free_packet(pkt); free_packet(pkt);
c->last_was_session_key = 0; c->last_was_session_key = 0;
@ -452,7 +516,6 @@ do_check_sig( CTX c, KBNODE node, int *is_selfsig )
} }
static void static void
print_userid( PACKET *pkt ) print_userid( PACKET *pkt )
{ {
@ -544,6 +607,7 @@ print_notation_data( PKT_signature *sig )
/* TODO */ /* TODO */
} }
/**************** /****************
* List the certificate in a user friendly way * List the certificate in a user friendly way
*/ */

View File

@ -94,7 +94,7 @@ make_outfile_name( const char *iname )
return buf; return buf;
} }
log_error(_("%s: unknown suffix\n"), iname ); log_info(_("%s: unknown suffix\n"), iname );
return NULL; return NULL;
} }

View File

@ -187,8 +187,8 @@ passphrase_to_dek( u32 *keyid, int pubkey_algo,
strcpy( pw, fd_passwd ); strcpy( pw, fd_passwd );
} }
else if( opt.batch ) { else if( opt.batch ) {
write_status( STATUS_MISSING_PASSPHRASE ); log_error(_("can't query password in batchmode\n"));
log_fatal("Can't query password in batchmode\n"); pw = m_strdup( "" ); /* return an empty passphrase */
} }
else { else {
pw = cpr_get_hidden("passphrase.enter", _("Enter passphrase: ") ); pw = cpr_get_hidden("passphrase.enter", _("Enter passphrase: ") );

View File

@ -164,7 +164,7 @@ check_secret_key( PKT_secret_key *sk, int n )
int i; int i;
if( n < 1 ) if( n < 1 )
n = 3; /* use the default value */ n = opt.batch? 1 : 3; /* use the default value */
for(i=0; i < n && rc == G10ERR_BAD_PASS; i++ ) { for(i=0; i < n && rc == G10ERR_BAD_PASS; i++ ) {
if( i ) if( i )

View File

@ -1,3 +1,8 @@
Mon Jul 12 14:55:34 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* autogen.sh: Run libtoolize
Sat May 22 22:47:26 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Sat May 22 22:47:26 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* autogen.sh: Fixed the error message for a missing libtool. * autogen.sh: Fixed the error message for a missing libtool.

View File

@ -87,6 +87,8 @@ fi
echo "Running gettextize... Ignore non-fatal messages." echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force echo "no" | gettextize --force
echo "Running libtoolize... Ignore non-fatal messages."
echo "no" | libtoolize
echo "Running aclocal..." echo "Running aclocal..."

View File

@ -1,3 +1,9 @@
Mon Jul 12 14:55:34 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* argparse.c (initialize): Init ret_xxx.
(optfile_parse): Remove quotes from arguments.
Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>

View File

@ -155,6 +155,7 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
log_bug("Invalid argument for ArgParse\n"); log_bug("Invalid argument for ArgParse\n");
} }
if( arg->err ) { /* last option was erroneous */ if( arg->err ) { /* last option was erroneous */
const char *s; const char *s;
@ -194,6 +195,10 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
exit(2); exit(2);
arg->err = 0; arg->err = 0;
} }
/* clearout the return value union */
arg->r.ret_str = NULL;
arg->r.ret_long= 0;
} }
@ -309,6 +314,7 @@ optfile_parse( FILE *fp, const char *filename, unsigned *lineno,
else if( !(opts[idx].flags & 7) ) /* does not take an arg */ else if( !(opts[idx].flags & 7) ) /* does not take an arg */
arg->r_opt = -6; /* error */ arg->r_opt = -6; /* error */
else { else {
char *p;
if( !buffer ) { if( !buffer ) {
keyword[i] = 0; keyword[i] = 0;
buffer = m_strdup(keyword); buffer = m_strdup(keyword);
@ -317,7 +323,13 @@ optfile_parse( FILE *fp, const char *filename, unsigned *lineno,
buffer[i] = 0; buffer[i] = 0;
trim_spaces( buffer ); trim_spaces( buffer );
if( !set_opt_arg(arg, opts[idx].flags, buffer) ) p = buffer;
if( *p == '"' ) { /* remove quotes */
p++;
if( *p && p[strlen(p)-1] == '"' )
p[strlen(p)-1] = 0;
}
if( !set_opt_arg(arg, opts[idx].flags, p) )
m_free(buffer); m_free(buffer);
} }
break; break;