1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-05-28 21:50:02 +02:00

See ChangeLog: Sat Jun 5 15:30:33 CEST 1999 Werner Koch

This commit is contained in:
Werner Koch 1999-06-05 13:36:15 +00:00
parent 04a0e61a7b
commit 717bce345c
7 changed files with 92 additions and 39 deletions

View File

@ -1,3 +1,7 @@
Sat Jun 5 15:30:33 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* pkclist.c (key_present_in_pk_list): New (Michael).
Tue May 25 19:50:32 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* configure.in (IS_DEVELOPMENT_VERSION): Fixed detection.

2
NEWS
View File

@ -10,6 +10,8 @@
* Another hack to cope with pgp2 generated detached signatures.
* latin-2 character set works (--charset=iso-8859-2).
Noteworthy changes in version 0.9.7
-----------------------------------

2
TODO
View File

@ -27,6 +27,8 @@
* find a way to allow the import of non-self-signed keys. This is needed
for the IN ENCR/SIGN hack.
* convert the given user ID to UTF-8 and add an option to suppress this.
Nice to have
------------
* Let take --help an option to select some topics.

View File

@ -351,7 +351,8 @@ B<--charset> I<name>
Set the name of the native character set. This is used
to convert some strings to proper UTF-8 encoding.
Valid values for I<name> are:
B<iso-8859-1> This is the default.
B<iso-8859-1> This is the default Latin 1 set.
B<iso-8859-2> The Latin 2 set.
B<koi8-r> The usual Russian set (rfc1489).
B<--options> I<file>

View File

@ -547,6 +547,17 @@ release_pk_list( PK_LIST pk_list )
}
}
static int
key_present_in_pk_list(PK_LIST pk_list, PKT_public_key *pk)
{
for( ; pk_list; pk_list = pk_list->next)
if (cmp_public_keys(pk_list->pk, pk) == 0)
return 0;
return -1;
}
int
build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
{
@ -569,14 +580,23 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
log_error(_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) );
}
else if( !(rc=check_pubkey_algo2(pk->pubkey_algo, use )) ) {
PK_LIST r;
/* Skip the actual key if the key is already present
* in the list */
if (key_present_in_pk_list(pk_list, pk) == 0) {
free_public_key(pk); pk = NULL;
log_info(_("%s: skipped: public key already present\n"),
rov->d);
}
else {
PK_LIST r;
r = m_alloc( sizeof *r );
r->pk = pk; pk = NULL;
r->next = pk_list;
r->mark = 0;
pk_list = r;
}
}
else {
free_public_key( pk ); pk = NULL;
log_error(_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) );
@ -655,14 +675,26 @@ build_pk_list( STRLIST remusr, PK_LIST *ret_pk_list, unsigned use )
}
else if( do_we_trust_pre( pk, trustlevel ) ) {
/* note: do_we_trust may have changed the trustlevel */
PK_LIST r;
/* We have at least one valid recipient. It doesn't matters
* if this recipient is already present. */
any_recipients = 1;
/* Skip the actual key if the key is already present
* in the list */
if (key_present_in_pk_list(pk_list, pk) == 0) {
free_public_key(pk); pk = NULL;
log_info(_("%s: skipped: public key already present\n"),
remusr->d);
}
else {
PK_LIST r;
r = m_alloc( sizeof *r );
r->pk = pk; pk = NULL;
r->next = pk_list;
r->mark = 0;
pk_list = r;
any_recipients = 1;
}
}
else { /* we don't trust this pk */
free_public_key( pk ); pk = NULL;

View File

@ -1,3 +1,7 @@
Sat Jun 5 15:30:33 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* strgutil.c (set_native_charset): Support Latin-2
Tue Jun 1 16:01:46 CEST 1999 Werner Koch <wk@isil.d.shuttle.de>
* iobuf.c (iobuf_get_real_fname): Made global and now keep a

View File

@ -27,8 +27,7 @@
#include "memory.h"
static int use_koi8 = 0;
static ushort koi82unicode[128] = {
static ushort koi8_unicode[128] = {
0x2500,0x2502,0x250c,0x2510,0x2514,0x2518,0x251c,0x2524,
0x252c,0x2534,0x253c,0x2580,0x2584,0x2588,0x258c,0x2590,
0x2591,0x2592,0x2593,0x2320,0x25a0,0x2219,0x221a,0x2248,
@ -47,7 +46,6 @@ static ushort koi82unicode[128] = {
0x042c,0x042b,0x0417,0x0428,0x042d,0x0429,0x0427,0x042a
};
#if 0
static ushort latin2_unicode[128] = {
0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
@ -66,7 +64,9 @@ static ushort latin2_unicode[128] = {
0x0111,0x0144,0x0148,0x00F3,0x00F4,0x0151,0x00F6,0x00F7,
0x0159,0x016F,0x00FA,0x0171,0x00FC,0x00FD,0x0163,0x02D9
};
#endif
static const char *active_charset_name = "iso-8859-1";
static ushort *active_charset = NULL;
void
@ -261,10 +261,18 @@ string_count_chr( const char *string, int c )
int
set_native_charset( const char *newset )
{
if( !stricmp( newset, "iso-8859-1" ) )
use_koi8 = 0;
else if( !stricmp( newset, "koi8-r" ) )
use_koi8 = 1;
if( !stricmp( newset, "iso-8859-1" ) ) {
active_charset_name = "iso-8859-1";
active_charset = NULL;
}
else if( !stricmp( newset, "iso-8859-2" ) ) {
active_charset_name = "iso-8859-2";
active_charset = latin2_unicode;
}
else if( !stricmp( newset, "koi8-r" ) ) {
active_charset_name = "koi8-r";
active_charset = koi8_unicode;
}
else
return G10ERR_GENERAL;
return 0;
@ -273,7 +281,7 @@ set_native_charset( const char *newset )
const char*
get_native_charset()
{
return use_koi8? "koi8-r" : "iso-8859-1";
return active_charset_name;
}
/****************
@ -288,7 +296,7 @@ native_to_utf8( const char *string )
byte *p;
size_t length=0;
if( use_koi8 ) {
if( active_charset ) {
for(s=string; *s; s++ ) {
length++;
if( *s & 0x80 )
@ -297,7 +305,7 @@ native_to_utf8( const char *string )
buffer = m_alloc( length + 1 );
for(p=buffer, s=string; *s; s++ ) {
if( *s & 0x80 ) {
ushort val = koi82unicode[ *s & 0x7f ];
ushort val = active_charset[ *s & 0x7f ];
if( val < 0x0800 ) {
*p++ = 0xc0 | ( (val >> 6) & 0x1f );
*p++ = 0x80 | ( val & 0x3f );