271
210
KBNODE keyblock, un;
273
tty_printf(_("No trust value assigned to:\n"
274
"%4u%c/%08lX %s \""),
275
nbits_from_pk( pk ), pubkey_letter( pk->pubkey_algo ),
276
(ulong)keyid[1], datestr_from_pk( pk ) );
277
p = get_user_id( keyid, &n );
278
tty_print_utf8_string( p, n ),
212
tty_printf(_("No trust value assigned to:\n"));
213
tty_printf("%4u%c/%s %s\n",nbits_from_pk( pk ),
214
pubkey_letter( pk->pubkey_algo ),
215
keystr(keyid), datestr_from_pk( pk ) );
216
p=get_user_id_native(keyid);
217
tty_printf(_(" \"%s\"\n"),p);
282
220
keyblock = get_pubkeyblock (keyid);
285
for (un=keyblock; un; un = un->next) {
223
for (un=keyblock; un; un = un->next)
286
225
if (un->pkt->pkttype != PKT_USER_ID )
288
227
if (un->pkt->pkt.user_id->is_revoked )
290
229
if (un->pkt->pkt.user_id->is_expired )
292
231
/* Only skip textual primaries */
293
if (un->pkt->pkt.user_id->is_primary &&
294
!un->pkt->pkt.user_id->attrib_data )
232
if (un->pkt->pkt.user_id->is_primary
233
&& !un->pkt->pkt.user_id->attrib_data )
297
236
if((opt.verify_options&VERIFY_SHOW_PHOTOS)
298
237
&& un->pkt->pkt.user_id->attrib_data)
299
show_photos(un->pkt->pkt.user_id->attribs,
300
un->pkt->pkt.user_id->numattribs,pk,NULL);
302
tty_printf (" %s", _(" aka \""));
303
tty_print_utf8_string (un->pkt->pkt.user_id->name,
304
un->pkt->pkt.user_id->len );
238
show_photos(un->pkt->pkt.user_id->attribs,
239
un->pkt->pkt.user_id->numattribs,pk,NULL);
241
p=utf8_to_native(un->pkt->pkt.user_id->name,
242
un->pkt->pkt.user_id->len,0);
244
tty_printf(_(" aka \"%s\"\n"),p);
308
247
print_fingerprint (pk, NULL, 2);
309
248
tty_printf("\n");
249
release_kbnode (keyblock);
311
/* This string also used in keyedit.c:sign_uids */
313
"Please decide how far you trust this user to correctly\n"
314
"verify other users' keys (by looking at passports,\n"
315
"checking fingerprints from different sources...)?\n\n"));
252
if(opt.trust_model==TM_DIRECT)
254
tty_printf(_("How much do you trust that this key actually "
255
"belongs to the named user?\n"));
260
/* This string also used in keyedit.c:trustsig_prompt */
261
tty_printf(_("Please decide how far you trust this user to"
262
" correctly verify other users' keys\n"
263
"(by looking at passports, checking fingerprints from"
264
" different sources, etc.)\n"));
317
tty_printf (_(" %d = I don't know\n"), 1);
269
tty_printf (_(" %d = I don't know or won't say\n"), 1);
319
tty_printf (_(" %d = I do NOT trust\n"), 2);
271
tty_printf (_(" %d = I do NOT trust\n"), 2);
321
tty_printf (_(" %d = I trust marginally\n"), 3);
273
tty_printf (_(" %d = I trust marginally\n"), 3);
323
tty_printf (_(" %d = I trust fully\n"), 4);
275
tty_printf (_(" %d = I trust fully\n"), 4);
325
tty_printf (_(" %d = I trust ultimately\n"), 5);
277
tty_printf (_(" %d = I trust ultimately\n"), 5);
327
279
/* not yet implemented */
328
tty_printf (_(" i = please show me more information\n") );
280
tty_printf (" i = please show me more information\n");
331
tty_printf(_(" m = back to the main menu\n"));
283
tty_printf(_(" m = back to the main menu\n"));
334
tty_printf(_(" s = skip this key\n"));
335
tty_printf(_(" q = quit\n"));
286
tty_printf(_(" s = skip this key\n"));
287
tty_printf(_(" q = quit\n"));
337
289
tty_printf("\n");
439
390
* Returns: true if we trust.
442
do_we_trust( PKT_public_key *pk, unsigned int *trustlevel )
393
do_we_trust( PKT_public_key *pk, unsigned int trustlevel )
444
unsigned int trustmask = 0;
446
/* FIXME: get_pubkey_byname already checks the validity and won't
447
* return keys which are either expired or revoked - so these
448
* question here won't get triggered. We have to find a solution
449
* for this. It might make sense to have a function in getkey.c
450
* which does only the basic checks and returns even revoked and
451
* expired keys. This fnction could then also returhn a list of
452
* keys if the speicified name is ambiguous
454
if( (*trustlevel & TRUST_FLAG_REVOKED) ) {
455
log_info(_("key %08lX: key has been revoked!\n"),
456
(ulong)keyid_from_pk( pk, NULL) );
457
show_revocation_reason( pk, 0 );
461
if( !cpr_get_answer_is_yes("revoked_key.override",
462
_("Use this key anyway? ")) )
464
trustmask |= TRUST_FLAG_REVOKED;
466
if( (*trustlevel & TRUST_FLAG_SUB_REVOKED) ) {
467
log_info(_("key %08lX: subkey has been revoked!\n"),
468
(ulong)keyid_from_pk( pk, NULL) );
469
show_revocation_reason( pk, 0 );
473
if( !cpr_get_answer_is_yes("revoked_key.override",
474
_("Use this key anyway? ")) )
476
trustmask |= TRUST_FLAG_SUB_REVOKED;
478
*trustlevel &= ~trustmask;
480
if( opt.trust_model==TM_ALWAYS ) {
482
log_info("No trust check due to --trust-model always option\n");
486
switch( (*trustlevel & TRUST_MASK) ) {
488
log_info(_("%08lX: key has expired\n"),
489
(ulong)keyid_from_pk( pk, NULL) );
493
log_error ("invalid trustlevel %u returned from validation layer\n",
497
case TRUST_UNDEFINED:
498
log_info(_("%08lX: There is no assurance this key belongs "
499
"to the named user\n"),(ulong)keyid_from_pk( pk, NULL) );
502
/* No way to get here? */
504
log_info(_("%08lX: We do NOT trust this key\n"),
505
(ulong)keyid_from_pk( pk, NULL) );
509
log_info(_("%08lX: There is limited assurance this key belongs "
510
"to the named user\n"),(ulong)keyid_from_pk(pk,NULL));
515
log_info(_("This key probably belongs to the named user\n"));
520
log_info(_("This key belongs to us\n"));
395
/* We should not be able to get here with a revoked or expired
397
if(trustlevel & TRUST_FLAG_REVOKED
398
|| trustlevel & TRUST_FLAG_SUB_REVOKED
399
|| (trustlevel & TRUST_MASK) == TRUST_EXPIRED)
402
if( opt.trust_model==TM_ALWAYS )
405
log_info("No trust check due to `--trust-model always' option\n");
409
switch(trustlevel & TRUST_MASK)
412
log_error ("invalid trustlevel %u returned from validation layer\n",
416
case TRUST_UNDEFINED:
417
log_info(_("%s: There is no assurance this key belongs"
418
" to the named user\n"),keystr_from_pk(pk));
422
log_info(_("%s: There is limited assurance this key belongs"
423
" to the named user\n"),keystr_from_pk(pk));
428
log_info(_("This key probably belongs to the named user\n"));
433
log_info(_("This key belongs to us\n"));
437
return 1; /*NOTREACHED*/
529
441
/****************
530
442
* wrapper around do_we_trust, so we can ask whether to use the
762
/* This is the central function to collect the keys for recipients.
763
It is thus used to prepare a public key encryption. encrypt-to
764
keys, default keys and the keys for the actual recipients are all
765
collected here. When not in batch mode and no recipient has been
766
passed on the commandline, the function will also ask for
769
RCPTS is a string list with the recipients; NULL is an allowed
770
value but not very useful. Group expansion is done on these names;
771
they may be in any of the user Id formats we can handle. The flags
772
bits for each string in the string list are used for:
773
Bit 0: This is an encrypt-to recipient.
774
Bit 1: This is a hidden recipient.
776
USE is the desired use for the key - usually PUBKEY_USAGE_ENC.
779
On success a list of keys is stored at the address RET_PK_LIST; the
780
caller must free this list. On error the value at this address is
801
build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned use )
784
build_pk_list( strlist_t rcpts, PK_LIST *ret_pk_list, unsigned int use )
803
PK_LIST pk_list = NULL;
804
PKT_public_key *pk=NULL;
806
int any_recipients=0;
808
char *def_rec = NULL;
811
remusr=expand_group(rcpts);
815
/* check whether there are any recipients in the list and build the
816
* list of the encrypt-to ones (we always trust them) */
817
for( rov = remusr; rov; rov = rov->next ) {
818
if( !(rov->flags & 1) )
822
if((rov->flags&2) && (PGP2 || PGP6 || PGP7 || PGP8))
824
log_info(_("you may not use %s while in %s mode\n"),
825
"--hidden-recipient",
826
compliance_option_string());
828
compliance_failure();
831
else if( (use & PUBKEY_USAGE_ENC) && !opt.no_encrypt_to ) {
832
pk = xcalloc (1, sizeof *pk );
834
/* We can encrypt-to a disabled key */
835
if( (rc = get_pubkey_byname( pk, rov->d, NULL, NULL, 1 )) ) {
836
free_public_key( pk ); pk = NULL;
837
log_error(_("%s: skipped: %s\n"), rov->d, gpg_strerror (rc) );
838
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
839
rov->d, strlen (rov->d), -1);
842
else if( !(rc=openpgp_pk_test_algo (pk->pubkey_algo, use )) ) {
843
/* Skip the actual key if the key is already present
845
if (key_present_in_pk_list(pk_list, pk) == 0) {
846
free_public_key(pk); pk = NULL;
847
log_info(_("%s: skipped: public key already present\n"),
852
r = xmalloc ( sizeof *r );
853
r->pk = pk; pk = NULL;
855
r->flags = (rov->flags&2)?1:0;
858
if(r->flags&1 && (PGP2 || PGP6 || PGP7 || PGP8))
860
log_info(_("you may not use %s while in %s mode\n"),
861
"--hidden-encrypt-to",
862
compliance_option_string());
864
compliance_failure();
869
free_public_key( pk ); pk = NULL;
870
log_error(_("%s: skipped: %s\n"), rov->d, gpg_strerror (rc) );
871
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
872
rov->d, strlen (rov->d), -1);
786
PK_LIST pk_list = NULL;
787
PKT_public_key *pk=NULL;
789
int any_recipients=0;
790
strlist_t rov,remusr;
791
char *def_rec = NULL;
793
/* Try to expand groups if any have been defined. */
795
remusr = expand_group (rcpts);
799
/* Check whether there are any recipients in the list and build the
800
* list of the encrypt-to ones (we always trust them). */
801
for ( rov = remusr; rov; rov = rov->next )
803
if ( !(rov->flags & 1) )
805
/* This is a regular recipient; i.e. not an encrypt-to
809
/* Hidden recipients are not allowed while in PGP mode,
810
issue a warning and switch into GnuPG mode. */
811
if ((rov->flags&2) && (PGP2 || PGP6 || PGP7 || PGP8))
813
log_info(_("you may not use %s while in %s mode\n"),
814
"--hidden-recipient",
815
compliance_option_string());
817
compliance_failure();
820
else if ( (use & PUBKEY_USAGE_ENC) && !opt.no_encrypt_to )
822
/* Encryption has been requested and --encrypt-to has not
823
been disabled. Check this encrypt-to key. */
824
pk = xmalloc_clear( sizeof *pk );
827
/* We explicitly allow encrypt-to to an disabled key; thus
828
we pass 1 as last argument. */
829
if ( (rc = get_pubkey_byname ( pk, rov->d, NULL, NULL, 1 )) )
831
free_public_key ( pk ); pk = NULL;
832
log_error (_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) );
833
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
834
rov->d, strlen (rov->d), -1);
837
else if ( !(rc=openpgp_pk_test_algo2 (pk->pubkey_algo, use)) )
839
/* Skip the actual key if the key is already present
840
* in the list. Add it to our list if not. */
841
if (key_present_in_pk_list(pk_list, pk) == 0)
843
free_public_key (pk); pk = NULL;
844
log_info (_("%s: skipped: public key already present\n"),
850
r = xmalloc( sizeof *r );
851
r->pk = pk; pk = NULL;
853
r->flags = (rov->flags&2)?1:0;
856
/* Hidden encrypt-to recipients are not allowed while
857
in PGP mode, issue a warning and switch into
859
if ((r->flags&1) && (PGP2 || PGP6 || PGP7 || PGP8))
861
log_info(_("you may not use %s while in %s mode\n"),
862
"--hidden-encrypt-to",
863
compliance_option_string());
865
compliance_failure();
871
/* The public key is not usable for encryption or not
873
free_public_key( pk ); pk = NULL;
874
log_error(_("%s: skipped: %s\n"), rov->d, g10_errstr(rc) );
875
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
876
rov->d, strlen (rov->d), -1);
878
if( !any_recipients && !opt.batch ) { /* ask */
881
STRLIST backlog=NULL;
883
def_rec = default_recipient();
884
have_def_rec = !!def_rec;
887
"You did not specify a user ID. (you may use \"-r\")\n"));
896
answer = strlist_pop (&backlog);
899
answer = cpr_get_utf8("pklist.user_id.enter",
900
_("\nEnter the user ID. End with an empty line: "));
904
if( !answer || !*answer ) {
908
if(expand_id(answer,&backlog,0))
911
free_public_key( pk );
912
pk = xcalloc (1, sizeof *pk );
914
rc = get_pubkey_byname( pk, answer, NULL, NULL, 0 );
916
tty_printf(_("No such user ID.\n"));
917
else if( !(rc=openpgp_pk_test_algo (pk->pubkey_algo, use)) ) {
919
if (key_present_in_pk_list(pk_list, pk) == 0) {
920
free_public_key(pk); pk = NULL;
921
log_info(_("skipped: public key "
922
"already set as default recipient\n") );
925
PK_LIST r = xmalloc ( sizeof *r );
926
r->pk = pk; pk = NULL;
928
r->flags = 0; /* no throwing default ids */
882
/* If we don't have any recipients yet and we are not in batch mode
883
drop into interactive selection mode. */
884
if ( !any_recipients && !opt.batch )
888
strlist_t backlog = NULL;
892
def_rec = default_recipient();
893
have_def_rec = !!def_rec;
895
tty_printf(_("You did not specify a user ID. (you may use \"-r\")\n"));
903
/* A default recipient is taken as the first entry. */
909
/* This is part of our trick to expand and display groups. */
910
answer = strlist_pop (&backlog);
914
/* Show the list of already collected recipients and ask
919
tty_printf(_("Current recipients:\n"));
920
for (iter=pk_list;iter;iter=iter->next)
924
keyid_from_pk(iter->pk,keyid);
925
tty_printf("%4u%c/%s %s \"",
926
nbits_from_pk(iter->pk),
927
pubkey_letter(iter->pk->pubkey_algo),
929
datestr_from_pk(iter->pk));
931
if (iter->pk->user_id)
932
tty_print_utf8_string(iter->pk->user_id->name,
933
iter->pk->user_id->len);
937
char *p = get_user_id( keyid, &n );
938
tty_print_utf8_string( p, n );
944
answer = cpr_get_utf8("pklist.user_id.enter",
945
_("\nEnter the user ID. "
946
"End with an empty line: "));
951
if ( !answer || !*answer )
954
break; /* No more recipients entered - get out of loop. */
957
/* Do group expand here too. The trick here is to continue
958
the loop if any expansion occured. The code above will
959
then list all expanded keys. */
960
if (expand_id(answer,&backlog,0))
963
/* Get and check key for the current name. */
965
free_public_key (pk);
966
pk = xmalloc_clear( sizeof *pk );
968
rc = get_pubkey_byname( pk, answer, NULL, NULL, 0 );
970
tty_printf(_("No such user ID.\n"));
971
else if ( !(rc=openpgp_pk_test_algo2 (pk->pubkey_algo, use)) )
975
/* No validation for a default recipient. */
976
if (!key_present_in_pk_list(pk_list, pk))
978
free_public_key (pk); pk = NULL;
979
log_info (_("skipped: public key "
980
"already set as default recipient\n") );
984
PK_LIST r = xmalloc (sizeof *r);
985
r->pk = pk; pk = NULL;
987
r->flags = 0; /* No throwing default ids. */
994
{ /* Check validity of this key. */
937
trustlevel = get_validity (pk, pk->user_id);
938
if( (trustlevel & TRUST_FLAG_DISABLED) ) {
939
tty_printf(_("Public key is disabled.\n") );
941
else if( do_we_trust_pre( pk, trustlevel ) ) {
942
/* Skip the actual key if the key is already present
944
if (key_present_in_pk_list(pk_list, pk) == 0) {
945
free_public_key(pk); pk = NULL;
946
log_info(_("skipped: public key already set\n") );
952
keyid_from_pk( pk, keyid);
953
tty_printf("Added %4u%c/%08lX %s \"",
955
pubkey_letter( pk->pubkey_algo ),
957
datestr_from_pk( pk ) );
959
tty_print_utf8_string(pk->user_id->name,
964
char *p = get_user_id( keyid, &n );
965
tty_print_utf8_string( p, n );
970
r = xmalloc ( sizeof *r );
971
r->pk = pk; pk = NULL;
973
r->flags = 0; /* no throwing interactive ids */
981
xfree (def_rec); def_rec = NULL;
985
free_public_key( pk );
997
trustlevel = get_validity (pk, pk->user_id);
998
if ( (trustlevel & TRUST_FLAG_DISABLED) )
1000
tty_printf (_("Public key is disabled.\n") );
1002
else if ( do_we_trust_pre (pk, trustlevel) )
1004
/* Skip the actual key if the key is already
1005
* present in the list */
1006
if (!key_present_in_pk_list(pk_list, pk))
1008
free_public_key(pk); pk = NULL;
1009
log_info(_("skipped: public key already set\n") );
1014
r = xmalloc( sizeof *r );
1015
r->pk = pk; pk = NULL;
1017
r->flags = 0; /* No throwing interactive ids. */
1025
xfree(def_rec); def_rec = NULL;
1030
free_public_key( pk );
989
else if( !any_recipients && (def_rec = default_recipient()) ) {
990
pk = xcalloc (1, sizeof *pk );
992
/* The default recipient may be disabled */
993
rc = get_pubkey_byname( pk, def_rec, NULL, NULL, 1 );
995
log_error(_("unknown default recipient `%s'\n"), def_rec );
996
else if( !(rc=openpgp_pk_test_algo (pk->pubkey_algo, use)) ) {
997
/* Mark any_recipients here since the default recipient
1034
else if ( !any_recipients && (def_rec = default_recipient()) )
1036
/* We are in batch mode and have only a default recipient. */
1037
pk = xmalloc_clear( sizeof *pk );
1038
pk->req_usage = use;
1040
/* The default recipient is allowed to be disabled; thus pass 1
1041
as last argument. */
1042
rc = get_pubkey_byname (pk, def_rec, NULL, NULL, 1);
1044
log_error(_("unknown default recipient \"%s\"\n"), def_rec );
1045
else if ( !(rc=openpgp_pk_test_algo2(pk->pubkey_algo, use)) )
1047
/* Mark any_recipients here since the default recipient
998
1048
would have been used if it wasn't already there. It
999
1049
doesn't really matter if we got this key from the default
1000
1050
recipient or an encrypt-to. */
1002
if (key_present_in_pk_list(pk_list, pk) == 0)
1003
log_info(_("skipped: public key already set as default recipient\n"));
1005
PK_LIST r = xmalloc ( sizeof *r );
1006
r->pk = pk; pk = NULL;
1008
r->flags = 0; /* no throwing default ids */
1013
free_public_key( pk );
1016
xfree (def_rec); def_rec = NULL;
1020
for(; remusr; remusr = remusr->next ) {
1021
if( (remusr->flags & 1) )
1022
continue; /* encrypt-to keys are already handled */
1024
pk = xcalloc (1, sizeof *pk );
1025
pk->req_usage = use;
1026
if( (rc = get_pubkey_byname( pk, remusr->d, NULL, NULL, 0 )) ) {
1027
free_public_key( pk ); pk = NULL;
1028
log_error(_("%s: skipped: %s\n"), remusr->d, gpg_strerror (rc) );
1029
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
1030
remusr->d, strlen (remusr->d),
1034
else if( !(rc=openpgp_pk_test_algo (pk->pubkey_algo, use )) ) {
1037
trustlevel = get_validity (pk, pk->user_id);
1038
if( (trustlevel & TRUST_FLAG_DISABLED) ) {
1039
free_public_key(pk); pk = NULL;
1040
log_info(_("%s: skipped: public key is disabled\n"),
1042
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
1046
rc = gpg_error (GPG_ERR_UNUSABLE_PUBKEY);
1049
else if( do_we_trust_pre( pk, trustlevel ) ) {
1050
/* note: do_we_trust may have changed the trustlevel */
1052
/* We have at least one valid recipient. It doesn't matters
1053
* if this recipient is already present. */
1056
/* Skip the actual key if the key is already present
1058
if (key_present_in_pk_list(pk_list, pk) == 0) {
1059
free_public_key(pk); pk = NULL;
1060
log_info(_("%s: skipped: public key already present\n"),
1065
r = xmalloc ( sizeof *r );
1066
r->pk = pk; pk = NULL;
1068
r->flags = (remusr->flags&2)?1:0;
1072
else { /* we don't trust this pk */
1073
free_public_key( pk ); pk = NULL;
1074
write_status_text_and_buffer (STATUS_INV_RECP, "10 ",
1078
rc = gpg_error (GPG_ERR_UNUSABLE_PUBKEY);
1083
free_public_key( pk ); pk = NULL;
1084
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
1088
log_error(_("%s: skipped: %s\n"), remusr->d, gpg_strerror (rc) );
1094
if( !rc && !any_recipients ) {
1095
log_error(_("no valid addressees\n"));
1096
write_status_text (STATUS_NO_RECP, "0");
1097
rc = GPG_ERR_NO_USER_ID;
1052
if (!key_present_in_pk_list(pk_list, pk))
1053
log_info (_("skipped: public key already set "
1054
"as default recipient\n"));
1057
PK_LIST r = xmalloc( sizeof *r );
1058
r->pk = pk; pk = NULL;
1060
r->flags = 0; /* No throwing default ids. */
1066
free_public_key( pk );
1069
xfree(def_rec); def_rec = NULL;
1073
/* General case: Check all keys. */
1075
for (; remusr; remusr = remusr->next )
1077
if ( (remusr->flags & 1) )
1078
continue; /* encrypt-to keys are already handled. */
1080
pk = xmalloc_clear( sizeof *pk );
1081
pk->req_usage = use;
1082
if ( (rc = get_pubkey_byname( pk, remusr->d, NULL, NULL, 0 )) )
1084
/* Key not found or other error. */
1085
free_public_key( pk ); pk = NULL;
1086
log_error(_("%s: skipped: %s\n"), remusr->d, g10_errstr(rc) );
1087
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
1088
remusr->d, strlen (remusr->d),
1092
else if ( !(rc=openpgp_pk_test_algo2(pk->pubkey_algo, use )) )
1094
/* Key found and usable. Check validity. */
1097
trustlevel = get_validity (pk, pk->user_id);
1098
if ( (trustlevel & TRUST_FLAG_DISABLED) )
1100
/*Key has been disabled. */
1101
free_public_key(pk); pk = NULL;
1102
log_info(_("%s: skipped: public key is disabled\n"),
1104
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
1108
rc=G10ERR_UNU_PUBKEY;
1111
else if ( do_we_trust_pre( pk, trustlevel ) )
1113
/* Note: do_we_trust may have changed the trustlevel */
1115
/* We have at least one valid recipient. It doesn't
1116
* matters if this recipient is already present. */
1119
/* Skip the actual key if the key is already present
1121
if (!key_present_in_pk_list(pk_list, pk))
1123
free_public_key(pk); pk = NULL;
1124
log_info(_("%s: skipped: public key already present\n"),
1130
r = xmalloc( sizeof *r );
1131
r->pk = pk; pk = NULL;
1133
r->flags = (remusr->flags&2)?1:0;
1138
{ /* We don't trust this key. */
1139
free_public_key( pk ); pk = NULL;
1140
write_status_text_and_buffer (STATUS_INV_RECP, "10 ",
1144
rc=G10ERR_UNU_PUBKEY;
1150
/* Key found but not usable for us (e.g. sign-only key). */
1151
free_public_key( pk ); pk = NULL;
1152
write_status_text_and_buffer (STATUS_INV_RECP, "0 ",
1156
log_error(_("%s: skipped: %s\n"), remusr->d, g10_errstr(rc) );
1162
if ( !rc && !any_recipients )
1164
log_error(_("no valid addressees\n"));
1165
write_status_text (STATUS_NO_RECP, "0");
1166
rc = G10ERR_NO_USER_ID;
1103
release_pk_list( pk_list );
1105
*ret_pk_list = pk_list;
1107
free_strlist(remusr);
1172
release_pk_list( pk_list );
1174
*ret_pk_list = pk_list;
1176
free_strlist(remusr);