summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-07-12 14:57:54 +0200
committerWerner Koch <wk@gnupg.org>1999-07-12 14:57:54 +0200
commit8be0d60594153ee058acbfae91efc0d4d1b17e12 (patch)
tree07e7e5f3b397c351bca6931578cc19498be60e73
parentSee ChangeLog: Thu Jul 8 16:21:27 CEST 1999 Werner Koch (diff)
downloadgnupg2-8be0d60594153ee058acbfae91efc0d4d1b17e12.tar.xz
gnupg2-8be0d60594153ee058acbfae91efc0d4d1b17e12.zip
See ChangeLog: Mon Jul 12 14:55:34 CEST 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--THOUGHTS7
-rw-r--r--TODO10
-rw-r--r--cipher/ChangeLog4
-rw-r--r--g10/ChangeLog16
-rw-r--r--g10/g10.c46
-rw-r--r--g10/mainproc.c82
-rw-r--r--g10/openfile.c2
-rw-r--r--g10/passphrase.c4
-rw-r--r--g10/seckey-cert.c2
-rw-r--r--scripts/ChangeLog5
-rwxr-xr-xscripts/autogen.sh2
-rw-r--r--util/ChangeLog6
-rw-r--r--util/argparse.c14
13 files changed, 161 insertions, 39 deletions
diff --git a/THOUGHTS b/THOUGHTS
index 70d3dff99..247264c90 100644
--- a/THOUGHTS
+++ b/THOUGHTS
@@ -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
packet formats).
+
+Suggested things which I will not do:
+=====================================
+ * Let take --help an option to select some topics.
+ Using grep is much easier
+
+
diff --git a/TODO b/TODO
index 7a70f6437..6b0917eae 100644
--- a/TODO
+++ b/TODO
@@ -6,11 +6,6 @@
* 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.
* 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
for the IN ENCR/SIGN hack.
- * Not all user names are correctly converted to UTF8.
-
Nice to have
------------
- * Let take --help an option to select some topics.
* Offcial test vectors for 3DES-EDE3
* use DEL and ^H for erasing the previous character (util/ttyio.c).
or better readline.
@@ -43,7 +35,7 @@ Nice to have
stuff?
* the pubkey encrypt functions should do some sanity checks.
* 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
verification status of the message to the output (i.e. write something to
the --output file and not only to stderr.
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 91a27704a..1c6a7c15e 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,11 +1,9 @@
Wed Jul 7 13:08:40 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
-
* Makefile.am: Support for libtool.
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
* 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>
-
* primegen.c, elgamal.c, dsa.c (progess): New and replaced all
fputc with a call to this function.
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.
* cipher.c (do_cbc_encrypt, do_cbc_decrypt): New.
diff --git a/g10/ChangeLog b/g10/ChangeLog
index fcc2a97eb..480aa1f98 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -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>
diff --git a/g10/g10.c b/g10/g10.c
index 092def68a..f22f62905 100644
--- a/g10/g10.c
+++ b/g10/g10.c
@@ -442,6 +442,19 @@ wrong_args( const char *text)
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
set_debug(void)
{
@@ -494,6 +507,7 @@ main( int argc, char **argv )
int orig_argc;
char **orig_argv;
const char *fname;
+ char *username;
STRLIST sl, remusr= NULL, locusr=NULL;
STRLIST nrings=NULL, sec_nrings=NULL;
armor_filter_context_t afx;
@@ -1050,10 +1064,10 @@ main( int argc, char **argv )
case aDeleteKey:
if( argc != 1 )
wrong_args(_("--delete-key username"));
- /* note: fname is the user id! */
- /* fixme: do utf8 conversion */
- if( (rc = delete_key(fname, cmd==aDeleteSecretKey)) )
- log_error("%s: delete key failed: %s\n", print_fname_stdin(fname), g10_errstr(rc) );
+ username = make_username( fname );
+ if( (rc = delete_key(username, cmd==aDeleteSecretKey)) )
+ log_error("%s: delete key failed: %s\n", username, g10_errstr(rc) );
+ m_free(username);
break;
@@ -1068,7 +1082,7 @@ main( int argc, char **argv )
secret_key_list( argc, argv );
break;
- case aKMode: /* list keyring */
+ case aKMode: /* list keyring -- NOTE: This will be removed soon */
if( argc < 2 ) /* -kv [userid] */
public_key_list( (argc && **argv)? 1:0, argv );
else if( argc == 2 ) { /* -kv userid keyring */
@@ -1114,7 +1128,7 @@ main( int argc, char **argv )
case aRecvKeys:
sl = NULL;
for( ; argc; argc--, argv++ )
- add_to_strlist( &sl, *argv );
+ add_to_strlist2( &sl, *argv, utf8_strings );
if( cmd == aSendKeys )
hkp_export( sl );
else if( cmd == aRecvKeys )
@@ -1127,7 +1141,7 @@ main( int argc, char **argv )
case aExportSecret:
sl = NULL;
for( ; argc; argc--, argv++ )
- add_to_strlist( &sl, *argv );
+ add_to_strlist2( &sl, *argv, utf8_strings );
export_seckeys( sl );
free_strlist(sl);
break;
@@ -1135,7 +1149,9 @@ main( int argc, char **argv )
case aGenRevoke:
if( argc != 1 )
wrong_args("--gen-revoke user-id");
- gen_revoke( *argv );
+ username = make_username(*argv);
+ gen_revoke( username );
+ m_free( username );
break;
case aDeArmor:
@@ -1258,8 +1274,11 @@ main( int argc, char **argv )
if( !argc )
check_trustdb(NULL);
else {
- for( ; argc; argc--, argv++ )
- check_trustdb( *argv );
+ for( ; argc; argc--, argv++ ) {
+ username = make_username( *argv );
+ check_trustdb( username );
+ m_free(username);
+ }
}
break;
@@ -1272,8 +1291,11 @@ main( int argc, char **argv )
case aListTrustPath:
if( !argc )
wrong_args("--list-trust-path <usernames>");
- for( ; argc; argc--, argv++ )
- list_trust_path( *argv );
+ for( ; argc; argc--, argv++ ) {
+ username = make_username( *argv );
+ list_trust_path( username );
+ m_free(username);
+ }
break;
case aExportOwnerTrust:
diff --git a/g10/mainproc.c b/g10/mainproc.c
index edd393a1e..1e06a78c8 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -39,6 +39,16 @@
#include "trustdb.h"
#include "hkp.h"
+
+struct kidlist_item {
+ struct kidlist_item *next;
+ u32 kid[2];
+ int pubkey_algo;
+ int reason;
+};
+
+
+
/****************
* Structure to hold the context
*/
@@ -60,6 +70,8 @@ struct mainproc_context {
IOBUF iobuf; /* used to get the filename etc. */
int trustletter; /* temp usage in list_node */
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;
proc_tree(c, 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;
}
@@ -213,6 +231,8 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
m_free(c->dek); c->dek = NULL;
}
}
+ else
+ result = G10ERR_NO_SECKEY;
}
else
result = G10ERR_PUBKEY_ALGO;
@@ -223,22 +243,66 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
if( opt.verbose > 1 )
log_info( _("public key encrypted data: good DEK\n") );
}
- else {
- /* fixme: defer this message until we have parsed all packets of
- * this type - do this by building a list of keys with their stati
- * and store it with the context. do_proc_packets can then use
- * this list to display some information */
- log_error(_("public key decryption failed: %s\n"), g10_errstr(result));
+ else { /* store it for later display */
+ struct kidlist_item *x = m_alloc( sizeof *x );
+ x->kid[0] = enc->keyid[0];
+ x->kid[1] = enc->keyid[1];
+ x->pubkey_algo = enc->pubkey_algo;
+ x->reason = result;
+ x->next = c->failed_pkenc;
+ c->failed_pkenc = x;
}
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
proc_encrypted( CTX c, PACKET *pkt )
{
int result = 0;
+ print_failed_pkenc( c->failed_pkenc );
+
/*log_debug("dat: %sencrypted data\n", c->dek?"":"conventional ");*/
if( !c->dek && !c->last_was_session_key ) {
/* assume this is old conventional encrypted data */
@@ -267,8 +331,8 @@ proc_encrypted( CTX c, PACKET *pkt )
else {
write_status( STATUS_DECRYPTION_FAILED );
log_error(_("decryption failed: %s\n"), g10_errstr(result));
- /* FIXME: if this is secret key not available, try with
- * other keys */
+ /* Hmmm: does this work when we have encrypted using a multiple
+ * ways to specify the session key (symmmetric and PK)*/
}
free_packet(pkt);
c->last_was_session_key = 0;
@@ -452,7 +516,6 @@ do_check_sig( CTX c, KBNODE node, int *is_selfsig )
}
-
static void
print_userid( PACKET *pkt )
{
@@ -544,6 +607,7 @@ print_notation_data( PKT_signature *sig )
/* TODO */
}
+
/****************
* List the certificate in a user friendly way
*/
diff --git a/g10/openfile.c b/g10/openfile.c
index ebf954843..4d16db500 100644
--- a/g10/openfile.c
+++ b/g10/openfile.c
@@ -94,7 +94,7 @@ make_outfile_name( const char *iname )
return buf;
}
- log_error(_("%s: unknown suffix\n"), iname );
+ log_info(_("%s: unknown suffix\n"), iname );
return NULL;
}
diff --git a/g10/passphrase.c b/g10/passphrase.c
index 80c6fa33f..6026ff7f9 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -187,8 +187,8 @@ passphrase_to_dek( u32 *keyid, int pubkey_algo,
strcpy( pw, fd_passwd );
}
else if( opt.batch ) {
- write_status( STATUS_MISSING_PASSPHRASE );
- log_fatal("Can't query password in batchmode\n");
+ log_error(_("can't query password in batchmode\n"));
+ pw = m_strdup( "" ); /* return an empty passphrase */
}
else {
pw = cpr_get_hidden("passphrase.enter", _("Enter passphrase: ") );
diff --git a/g10/seckey-cert.c b/g10/seckey-cert.c
index 95af40b78..a8fae04d6 100644
--- a/g10/seckey-cert.c
+++ b/g10/seckey-cert.c
@@ -164,7 +164,7 @@ check_secret_key( PKT_secret_key *sk, int n )
int i;
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++ ) {
if( i )
diff --git a/scripts/ChangeLog b/scripts/ChangeLog
index 14765db2f..6f73e8cca 100644
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -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>
* autogen.sh: Fixed the error message for a missing libtool.
diff --git a/scripts/autogen.sh b/scripts/autogen.sh
index 045716b87..23cb5bd0d 100755
--- a/scripts/autogen.sh
+++ b/scripts/autogen.sh
@@ -87,6 +87,8 @@ fi
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force
+echo "Running libtoolize... Ignore non-fatal messages."
+echo "no" | libtoolize
echo "Running aclocal..."
diff --git a/util/ChangeLog b/util/ChangeLog
index 44c0f7f65..0e67818fe 100644
--- a/util/ChangeLog
+++ b/util/ChangeLog
@@ -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>
diff --git a/util/argparse.c b/util/argparse.c
index 707d75ecf..b6934148b 100644
--- a/util/argparse.c
+++ b/util/argparse.c
@@ -155,6 +155,7 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
log_bug("Invalid argument for ArgParse\n");
}
+
if( arg->err ) { /* last option was erroneous */
const char *s;
@@ -194,6 +195,10 @@ initialize( ARGPARSE_ARGS *arg, const char *filename, unsigned *lineno )
exit(2);
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 */
arg->r_opt = -6; /* error */
else {
+ char *p;
if( !buffer ) {
keyword[i] = 0;
buffer = m_strdup(keyword);
@@ -317,7 +323,13 @@ optfile_parse( FILE *fp, const char *filename, unsigned *lineno,
buffer[i] = 0;
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);
}
break;