1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-31 11:41:32 +01:00

* 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, keylist.c, and
encode.c.
This commit is contained in:
David Shaw 2004-08-23 17:55:49 +00:00
parent d612492e7d
commit 9d4327ba4d
7 changed files with 31 additions and 30 deletions

View File

@ -1,5 +1,10 @@
2004-08-23 David Shaw <dshaw@jabberwocky.com>
* 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, keylist.c, and encode.c.
* keyserver.c (keyserver_search_prompt): Make sure the search
string is converted from UTF-8 before display.

View File

@ -814,7 +814,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.
@ -2632,14 +2632,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;
}
@ -2696,15 +2694,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

View File

@ -1,5 +1,5 @@
/* import.c
* 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.
@ -781,7 +781,7 @@ import_one( const char *fname, KBNODE keyblock,
/* we are ready */
if( !opt.quiet )
{
char *p=get_user_id_printable (keyid);
char *p=get_user_id_native (keyid);
log_info( _("key %s: public key \"%s\" imported\n"),
keystr(keyid),p);
m_free(p);
@ -861,7 +861,7 @@ import_one( const char *fname, KBNODE keyblock,
/* 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 %s: \"%s\" 1 new user ID\n"),
keystr(keyid),p);
@ -898,7 +898,7 @@ import_one( const char *fname, KBNODE keyblock,
if( !opt.quiet )
{
char *p=get_user_id_printable(keyid);
char *p=get_user_id_native(keyid);
log_info( _("key %s: \"%s\" not changed\n"),keystr(keyid),p);
m_free(p);
}
@ -1215,7 +1215,7 @@ import_revoke_cert( const char *fname, KBNODE node, struct stats_s *stats )
/* we are ready */
if( !opt.quiet )
{
char *p=get_user_id_printable (keyid);
char *p=get_user_id_native (keyid);
log_info( _("key %s: \"%s\" revocation certificate imported\n"),
keystr(keyid),p);
m_free(p);
@ -1766,7 +1766,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 %s: \"%s\" revocation"
" certificate added\n"), keystr(keyid),p);
m_free(p);

View File

@ -1,5 +1,5 @@
/* keydb.h - Key database
* Copyright (C) 1998, 1999, 2000, 2001, 2003,
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003,
* 2004 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
@ -230,10 +230,10 @@ int enum_secret_keys( void **context, PKT_secret_key *sk,
int with_subkeys, int with_spm );
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

@ -1,5 +1,5 @@
/* keylist.c
* 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.
@ -116,7 +116,7 @@ print_seckey_info (PKT_secret_key *sk)
char *p;
keyid_from_sk (sk, keyid);
p=get_user_id_printable(keyid);
p=get_user_id_native(keyid);
tty_printf ("\nsec %4u%c/%s %s %s\n",
nbits_from_sk (sk),
@ -136,7 +136,7 @@ print_pubkey_info (FILE *fp, PKT_public_key *pk)
char *p;
keyid_from_pk (pk, keyid);
p=get_user_id_printable(keyid);
p=get_user_id_native(keyid);
if (fp)
fprintf (fp, "pub %4u%c/%s %s %s\n",

View File

@ -369,7 +369,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/%s signature from: \"%s\"\n"),
pubkey_algo_to_string(sk->pubkey_algo),
digest_algo_to_string(sig->digest_algo),