1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

See ChangeLog: Wed Sep 22 10:14:17 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-09-22 08:14:21 +00:00
parent db78307c03
commit 2f94e980b2
7 changed files with 86 additions and 18 deletions

View File

@ -181,6 +181,15 @@ more arguments in future versions.
<n_uids> <n_subk> <n_sigs> <n_revoc> <sec_read> <sec_imported> <sec_dups> <n_uids> <n_subk> <n_sigs> <n_revoc> <sec_read> <sec_imported> <sec_dups>
Final statistics on import process (this is one long line) Final statistics on import process (this is one long line)
FILE_START <what> <filename>
Start processing a file <filename>. <what> indicates the performed
operation:
1 - verify
FILE_DONE
Marks the end of a file processing which has been started
by FILE_START.
Key generation Key generation

View File

@ -1,3 +1,18 @@
Wed Sep 22 10:14:17 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* openfile.c (make_outfile_name): Use case-insenstive compare for
DOS systems. Add ".pgp" to the list of know extensions.
(open_outfile): For DOS systems try to replace the suffiy instead of
appending it.
* status.c, status.h: Add STATUS_FILE_{START,DONE}.
* verify.c (verify_one_file): Emit these new stati.
* sign.c (clearsign_file): Avoid duplicated Entries in the "Hash:"
line. Those headers are now only _not_ printed when there are
only old-style keys _and_ all hashs are MD5.
Mon Sep 20 12:24:41 CEST 1999 Werner Koch <wk@isil.d.shuttle.de> Mon Sep 20 12:24:41 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>

View File

@ -39,6 +39,13 @@
#define SKELEXT ".skel" #define SKELEXT ".skel"
#endif #endif
#ifdef HAVE_DRIVE_LETTERS
#define CMP_FILENAME(a,b) stricmp( (a), (b) )
#else
#define CMP_FILENAME(a,b) strcmp( (a), (b) )
#endif
/* FIXME: Implement opt.interactive. */ /* FIXME: Implement opt.interactive. */
/**************** /****************
@ -82,13 +89,11 @@ make_outfile_name( const char *iname )
if( (!iname || (*iname=='-' && !iname[1]) )) if( (!iname || (*iname=='-' && !iname[1]) ))
return m_strdup("-"); return m_strdup("-");
#ifdef HAVE_DRIVE_LETTERS
#warning add case insensitive compare
#endif
n = strlen(iname); n = strlen(iname);
if( n > 4 && ( !strcmp(iname+n-4,".gpg") if( n > 4 && ( !CMP_FILENAME(iname+n-4,".gpg")
|| !strcmp(iname+n-4,".sig") || !CMP_FILENAME(iname+n-4,".pgp")
|| !strcmp(iname+n-4,".asc") ) ) { || !CMP_FILENAME(iname+n-4,".sig")
|| !CMP_FILENAME(iname+n-4,".asc") ) ) {
char *buf = m_strdup( iname ); char *buf = m_strdup( iname );
buf[n-4] = 0; buf[n-4] = 0;
return buf; return buf;
@ -169,11 +174,33 @@ open_outfile( const char *iname, int mode, IOBUF *a )
name = opt.outfile; name = opt.outfile;
else { else {
#ifdef USE_ONLY_8DOT3 #ifdef USE_ONLY_8DOT3
#warning please implement 8.3 files /* It is quite common DOS system to have only one dot in a
#endif * a filename So if we have something like this, we simple
* replace the suffix execpt in cases where the suffix is
* larger than 3 characters and not the same as.
* We should really map the filenames to 8.3 but this tends to
* be more complicated and is probaly a duty of the filesystem
*/
char *dot;
const char *newsfx = mode==1 ? ".asc" :
mode==2 ? ".sig" : ".gpg";
buf = m_alloc(strlen(iname)+4+1);
strcpy(buf,iname);
dot = strchr(buf, '.' );
if( dot && dot > buf && dot[1] && strlen(dot) <= 4
&& CMP_FILENAME(newsfx, dot) ) {
strcpy(buf, newsfx );
}
else if( dot && !dot[1] ) /* don't duplicate a dot */
strcpy( dot, newsfx );
else
strcat( buf, newsfx );
#else
buf = m_alloc(strlen(iname)+4+1); buf = m_alloc(strlen(iname)+4+1);
strcpy(stpcpy(buf,iname), mode==1 ? ".asc" : strcpy(stpcpy(buf,iname), mode==1 ? ".asc" :
mode==2 ? ".sig" : ".gpg"); mode==2 ? ".sig" : ".gpg");
#endif
name = buf; name = buf;
} }
@ -204,9 +231,6 @@ open_sigfile( const char *iname )
IOBUF a = NULL; IOBUF a = NULL;
size_t len; size_t len;
#ifdef USE_ONLY_8DOT3
#warning please implement 8.3 files
#endif
if( iname && !(*iname == '-' && !iname[1]) ) { if( iname && !(*iname == '-' && !iname[1]) ) {
len = strlen(iname); len = strlen(iname);
if( len > 4 && ( !strcmp(iname + len - 4, ".sig") if( len > 4 && ( !strcmp(iname + len - 4, ".sig")

View File

@ -594,23 +594,30 @@ clearsign_file( const char *fname, STRLIST locusr, const char *outfile )
} }
} }
if( old_style || only_md5 ) if( old_style && only_md5 )
iobuf_writestr(out, "\n" ); iobuf_writestr(out, "\n" );
else { else {
const char *s; const char *s;
int any = 0; int any = 0;
byte hashs_seen[256];
memset( hashs_seen, 0, sizeof hashs_seen );
iobuf_writestr(out, "Hash: " ); iobuf_writestr(out, "Hash: " );
for( sk_rover = sk_list; sk_rover; sk_rover = sk_rover->next ) { for( sk_rover = sk_list; sk_rover; sk_rover = sk_rover->next ) {
PKT_secret_key *sk = sk_rover->sk; PKT_secret_key *sk = sk_rover->sk;
s = digest_algo_to_string( hash_for(sk->pubkey_algo) ); int i = hash_for(sk->pubkey_algo);
if( !hashs_seen[ i & 0xff ] ) {
s = digest_algo_to_string( i );
if( s ) { if( s ) {
hashs_seen[ i & 0xff ] = 1;
if( any ) if( any )
iobuf_put(out, ',' ); iobuf_put(out, ',' );
iobuf_writestr(out, s ); iobuf_writestr(out, s );
any = 1; any = 1;
} }
} }
}
assert(any); assert(any);
iobuf_writestr(out, "\n" ); iobuf_writestr(out, "\n" );
if( opt.not_dash_escaped ) if( opt.not_dash_escaped )

View File

@ -117,6 +117,8 @@ write_status_text ( int no, const char *text)
case STATUS_ERRMDC : s = "ERRMDC\n"; break; case STATUS_ERRMDC : s = "ERRMDC\n"; break;
case STATUS_IMPORTED : s = "IMPORTED\n"; break; case STATUS_IMPORTED : s = "IMPORTED\n"; break;
case STATUS_IMPORT_RES : s = "IMPORT_RES\n"; break; case STATUS_IMPORT_RES : s = "IMPORT_RES\n"; break;
case STATUS_FILE_START : s = "FILE_START\n"; break;
case STATUS_FILE_DONE : s = "FILE_DONE\n"; break;
default: s = "?\n"; break; default: s = "?\n"; break;
} }

View File

@ -65,6 +65,8 @@
#define STATUS_ERRMDC 35 #define STATUS_ERRMDC 35
#define STATUS_IMPORTED 36 #define STATUS_IMPORTED 36
#define STATUS_IMPORT_RES 37 #define STATUS_IMPORT_RES 37
#define STATUS_FILE_START 38
#define STATUS_FILE_DONE 39
/*-- status.c --*/ /*-- status.c --*/

View File

@ -33,6 +33,7 @@
#include "memory.h" #include "memory.h"
#include "util.h" #include "util.h"
#include "main.h" #include "main.h"
#include "status.h"
#include "filter.h" #include "filter.h"
#include "ttyio.h" #include "ttyio.h"
#include "i18n.h" #include "i18n.h"
@ -90,6 +91,13 @@ verify_one_file( const char *name )
armor_filter_context_t afx; armor_filter_context_t afx;
int rc; int rc;
{
char *p = m_alloc(strlen(name)+10);
sprintf(p, "1 %s", name );
write_status_text( STATUS_FILE_START, p );
m_free(p);
}
fp = iobuf_open(name); fp = iobuf_open(name);
if( !fp ) { if( !fp ) {
log_error(_("can't open `%s'\n"), print_fname_stdin(name)); log_error(_("can't open `%s'\n"), print_fname_stdin(name));
@ -105,6 +113,7 @@ verify_one_file( const char *name )
rc = proc_signature_packets( NULL, fp, NULL, name ); rc = proc_signature_packets( NULL, fp, NULL, name );
iobuf_close(fp); iobuf_close(fp);
write_status( STATUS_FILE_DONE );
return rc; return rc;
} }