1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

* hkp.c (dehtmlize): Understand the quote character (i.e. """) in

HTML responses.

* keydb.h, getkey.c (get_user_id_printable): Rename to get_user_id_native
and remove the printable stuff since we're print-ifying valid utf8
characters.  Change all callers in import.c, sign.c, and encode.c.
This commit is contained in:
David Shaw 2004-08-20 17:24:08 +00:00
parent 081a9b6fb7
commit 297459b28b
7 changed files with 43 additions and 26 deletions

View File

@ -1,3 +1,13 @@
2004-08-20 David Shaw <dshaw@jabberwocky.com>
* hkp.c (dehtmlize): Understand the quote character
(i.e. "&quot;") in HTML responses.
* keydb.h, getkey.c (get_user_id_printable): Rename to
get_user_id_native and remove the printable stuff since we're
print-ifying valid utf8 characters. Change all callers in
import.c, sign.c, and encode.c.
2004-08-19 David Shaw <dshaw@jabberwocky.com>
* hkp.c (hkp_search): Translate string to search for from utf8 to

View File

@ -740,7 +740,7 @@ write_pubkey_enc_from_list( PK_LIST pk_list, DEK *dek, IOBUF out )
log_error("pubkey_encrypt failed: %s\n", g10_errstr(rc) );
else {
if( opt.verbose ) {
char *ustr = get_user_id_string_printable (enc->keyid);
char *ustr = get_user_id_string_native (enc->keyid);
log_info(_("%s/%s encrypted for: \"%s\"\n"),
pubkey_algo_to_string(enc->pubkey_algo),
cipher_algo_to_string(dek->algo), ustr );

View File

@ -1,5 +1,5 @@
/* getkey.c - Get a key from the database
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
* 2004 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
@ -2611,14 +2611,12 @@ get_user_id_string( u32 *keyid )
char*
get_user_id_string_printable ( u32 *keyid )
get_user_id_string_native ( u32 *keyid )
{
char *p = get_user_id_string( keyid );
char *p2 = utf8_to_native( p, strlen(p), 0 );
m_free(p);
p = make_printable_string (p2, strlen (p2), 0);
m_free (p2);
return p;
return p2;
}
@ -2675,15 +2673,13 @@ get_user_id( u32 *keyid, size_t *rn )
}
char*
get_user_id_printable( u32 *keyid )
get_user_id_native( u32 *keyid )
{
size_t rn;
char *p = get_user_id( keyid, &rn );
char *p2 = utf8_to_native( p, rn, 0 );
m_free(p);
p = make_printable_string (p2, strlen (p2), 0);
m_free (p2);
return p;
return p2;
}
KEYDB_HANDLE

View File

@ -310,6 +310,16 @@ dehtmlize(char *line)
line+=5;
break;
}
else if((*(line+1)!='\0' && ascii_tolower(*(line+1))=='q') &&
(*(line+2)!='\0' && ascii_tolower(*(line+2))=='u') &&
(*(line+3)!='\0' && ascii_tolower(*(line+3))=='o') &&
(*(line+4)!='\0' && ascii_tolower(*(line+4))=='t') &&
(*(line+5)!='\0' && *(line+5)==';'))
{
parsed[parsedindex++]='"';
line+=6;
break;
}
default:
parsed[parsedindex++]=*line;

View File

@ -658,7 +658,7 @@ import_one( const char *fname, KBNODE keyblock, int fast,
/* we are ready */
if( !opt.quiet ) {
char *p=get_user_id_printable (keyid);
char *p=get_user_id_native (keyid);
log_info( _("key %08lX: public key \"%s\" imported\n"),
(ulong)keyid[1],p);
m_free(p);
@ -734,7 +734,7 @@ import_one( const char *fname, KBNODE keyblock, int fast,
/* we are ready */
if( !opt.quiet ) {
char *p=get_user_id_printable(keyid);
char *p=get_user_id_native(keyid);
if( n_uids == 1 )
log_info( _("key %08lX: \"%s\" 1 new user ID\n"),
(ulong)keyid[1], p);
@ -769,7 +769,7 @@ import_one( const char *fname, KBNODE keyblock, int fast,
print_import_ok (pk, NULL, 0);
if( !opt.quiet ) {
char *p=get_user_id_printable(keyid);
char *p=get_user_id_native(keyid);
log_info( _("key %08lX: \"%s\" not changed\n"),
(ulong)keyid[1],p);
m_free(p);
@ -974,7 +974,7 @@ import_revoke_cert( const char *fname, KBNODE node, struct stats_s *stats )
keydb_release (hd); hd = NULL;
/* we are ready */
if( !opt.quiet ) {
char *p=get_user_id_printable (keyid);
char *p=get_user_id_native (keyid);
log_info( _("key %08lX: \"%s\" revocation certificate imported\n"),
(ulong)keyid[1],p);
m_free(p);
@ -1502,7 +1502,7 @@ merge_blocks( const char *fname, KBNODE keyblock_orig, KBNODE keyblock,
++*n_sigs;
if(!opt.quiet)
{
char *p=get_user_id_printable (keyid);
char *p=get_user_id_native (keyid);
log_info(_("key %08lX: \"%s\" revocation "
"certificate added\n"), (ulong)keyid[1],p);
m_free(p);

View File

@ -1,5 +1,6 @@
/* keydb.h - Key database
* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
* 2004 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@ -218,10 +219,10 @@ void get_seckey_end( GETKEY_CTX ctx );
int enum_secret_keys( void **context, PKT_secret_key *sk, int with_subkeys );
void merge_keys_and_selfsig( KBNODE keyblock );
char*get_user_id_string( u32 *keyid );
char*get_user_id_string_printable( u32 *keyid );
char*get_user_id_string_native( u32 *keyid );
char*get_long_user_id_string( u32 *keyid );
char*get_user_id( u32 *keyid, size_t *rn );
char*get_user_id_printable( u32 *keyid );
char*get_user_id_native( u32 *keyid );
KEYDB_HANDLE get_ctx_handle(GETKEY_CTX ctx);
/*-- keyid.c --*/

View File

@ -318,7 +318,7 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
log_error(_("signing failed: %s\n"), g10_errstr(rc) );
else {
if( opt.verbose ) {
char *ustr = get_user_id_string_printable (sig->keyid);
char *ustr = get_user_id_string_native (sig->keyid);
log_info(_("%s signature from: \"%s\"\n"),
pubkey_algo_to_string(sk->pubkey_algo), ustr );
m_free(ustr);