Changeset View
Changeset View
Standalone View
Standalone View
b/g10/pkclist.c
Context not available. | |||||
* Return a malloced string with a default recipient if there is any | * Return a malloced string with a default recipient if there is any | ||||
*/ | */ | ||||
static char * | static char * | ||||
default_recipient(void) | default_recipient(ctrl_t ctrl) | ||||
{ | { | ||||
PKT_public_key *pk; | PKT_public_key *pk; | ||||
byte fpr[MAX_FINGERPRINT_LEN+1]; | byte fpr[MAX_FINGERPRINT_LEN+1]; | ||||
Context not available. | |||||
if( !opt.def_recipient_self ) | if( !opt.def_recipient_self ) | ||||
return NULL; | return NULL; | ||||
pk = xmalloc_clear( sizeof *pk ); | pk = xmalloc_clear( sizeof *pk ); | ||||
i = get_seckey_default (pk); | i = get_seckey_default (ctrl, pk); | ||||
if( i ) { | if( i ) { | ||||
free_public_key( pk ); | free_public_key( pk ); | ||||
return NULL; | return NULL; | ||||
Context not available. | |||||
if (pk_list) | if (pk_list) | ||||
any_recipients = 1; | any_recipients = 1; | ||||
def_rec = default_recipient(); | def_rec = default_recipient(ctrl); | ||||
have_def_rec = !!def_rec; | have_def_rec = !!def_rec; | ||||
if ( !have_def_rec ) | if ( !have_def_rec ) | ||||
tty_printf(_("You did not specify a user ID. (you may use \"-r\")\n")); | tty_printf(_("You did not specify a user ID. (you may use \"-r\")\n")); | ||||
Context not available. | |||||
pk = NULL; | pk = NULL; | ||||
} | } | ||||
} | } | ||||
else if ( !any_recipients && (def_rec = default_recipient()) ) | else if ( !any_recipients && (def_rec = default_recipient(ctrl)) ) | ||||
{ | { | ||||
/* We are in batch mode and have only a default recipient. */ | /* We are in batch mode and have only a default recipient. */ | ||||
pk = xmalloc_clear( sizeof *pk ); | pk = xmalloc_clear( sizeof *pk ); | ||||
Context not available. |