diff options
author | Werner Koch <[email protected]> | 2017-03-31 18:03:52 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2017-03-31 18:07:20 +0000 |
commit | 8f2671d2cc022af2f564e296bdeb3bb2d2734ef4 (patch) | |
tree | 0a5dfac0bb36cf364e313b000967863e42783793 /g10/passphrase.c | |
parent | gpg: Consistent use of preprocessor conditionals. (diff) | |
download | gnupg-8f2671d2cc022af2f564e296bdeb3bb2d2734ef4.tar.gz gnupg-8f2671d2cc022af2f564e296bdeb3bb2d2734ef4.zip |
gpg: Pass CTRL to many more functions.
--
For proper operations as a server we need to avoid global variables.
Thus we need to pass the session state CTRL to most functions. Quite
a lot of changes but fortunately straightforward to do.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r-- | g10/passphrase.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c index 02371fe9f..a498f627b 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -441,12 +441,13 @@ passphrase_to_dek (int cipher_algo, STRING2KEY *s2k, /* Emit the USERID_HINT and the NEED_PASSPHRASE status messages. MAINKEYID may be NULL. */ void -emit_status_need_passphrase (u32 *keyid, u32 *mainkeyid, int pubkey_algo) +emit_status_need_passphrase (ctrl_t ctrl, + u32 *keyid, u32 *mainkeyid, int pubkey_algo) { char buf[50]; char *us; - us = get_long_user_id_string (keyid); + us = get_long_user_id_string (ctrl, keyid); write_status_text (STATUS_USERID_HINT, us); xfree (us); @@ -466,7 +467,7 @@ emit_status_need_passphrase (u32 *keyid, u32 *mainkeyid, int pubkey_algo) MODE describes the use of the key description; use one of the FORMAT_KEYDESC_ macros. */ char * -gpg_format_keydesc (PKT_public_key *pk, int mode, int escaped) +gpg_format_keydesc (ctrl_t ctrl, PKT_public_key *pk, int mode, int escaped) { char *uid; size_t uidlen; @@ -484,7 +485,7 @@ gpg_format_keydesc (PKT_public_key *pk, int mode, int escaped) && pk->keyid[1] != pk->main_keyid[1]); algo_name = openpgp_pk_algo_name (pk->pubkey_algo); timestr = strtimestamp (pk->timestamp); - uid = get_user_id (is_subkey? pk->main_keyid:pk->keyid, &uidlen); + uid = get_user_id (ctrl, is_subkey? pk->main_keyid:pk->keyid, &uidlen); orig_codeset = i18n_switchto_utf8 (); |