diff options
author | David Shaw <[email protected]> | 2004-08-20 17:24:08 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2004-08-20 17:24:08 +0000 |
commit | 297459b28b9fb3cd7978ad5be3c5e552273c05fa (patch) | |
tree | 472eed1e9ca647f7633a5ecb01d0943cd351f055 | |
parent | * hkp.c (hkp_search): Translate string to search for from utf8 to native (diff) | |
download | gnupg-297459b28b9fb3cd7978ad5be3c5e552273c05fa.tar.gz gnupg-297459b28b9fb3cd7978ad5be3c5e552273c05fa.zip |
* 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.
-rw-r--r-- | g10/ChangeLog | 10 | ||||
-rw-r--r-- | g10/encode.c | 2 | ||||
-rw-r--r-- | g10/getkey.c | 28 | ||||
-rw-r--r-- | g10/hkp.c | 10 | ||||
-rw-r--r-- | g10/import.c | 10 | ||||
-rw-r--r-- | g10/keydb.h | 7 | ||||
-rw-r--r-- | g10/sign.c | 2 |
7 files changed, 43 insertions, 26 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 096e6ac2e..10885f227 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,13 @@ +2004-08-20 David Shaw <[email protected]> + + * 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. + 2004-08-19 David Shaw <[email protected]> * hkp.c (hkp_search): Translate string to search for from utf8 to diff --git a/g10/encode.c b/g10/encode.c index ccdbb0f87..8644f856a 100644 --- a/g10/encode.c +++ b/g10/encode.c @@ -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 ); diff --git a/g10/getkey.c b/g10/getkey.c index 3bee10a35..31828a704 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -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; + char *p = get_user_id_string( keyid ); + char *p2 = utf8_to_native( p, strlen(p), 0 ); + m_free(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; + size_t rn; + char *p = get_user_id( keyid, &rn ); + char *p2 = utf8_to_native( p, rn, 0 ); + m_free(p); + return p2; } KEYDB_HANDLE @@ -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; diff --git a/g10/import.c b/g10/import.c index ac1749bb1..e4c75ed69 100644 --- a/g10/import.c +++ b/g10/import.c @@ -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); diff --git a/g10/keydb.h b/g10/keydb.h index 9f47123ec..b90a88ea4 100644 --- a/g10/keydb.h +++ b/g10/keydb.h @@ -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 --*/ diff --git a/g10/sign.c b/g10/sign.c index e8f5191b7..905817102 100644 --- a/g10/sign.c +++ b/g10/sign.c @@ -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); |