1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-15 00:29:49 +02:00

* options.skel: Sample photo viewers for Win32.

* misc.c (pct_expando): Use the seckey for %k/%K if the pubkey is not
available.

* photoid.h, photoid.c (show_photos): Include the seckey in case a user
tries to view a photo on a secret key, and change all callers in keyedit.c
(menu_showphoto), keylist.c (list_keyblock_print), and photoid.c
(generate_photo_id).
This commit is contained in:
David Shaw 2002-06-03 12:39:23 +00:00
parent e96f8f1fe0
commit cd2450f41f
7 changed files with 30 additions and 5 deletions

View File

@ -1,3 +1,15 @@
2002-06-03 David Shaw <dshaw@jabberwocky.com>
* options.skel: Sample photo viewers for Win32.
* misc.c (pct_expando): Use the seckey for %k/%K if the pubkey is
not available.
* photoid.h, photoid.c (show_photos): Include the seckey in case a
user tries to view a photo on a secret key, and change all callers
in keyedit.c (menu_showphoto), keylist.c (list_keyblock_print),
and photoid.c (generate_photo_id).
2002-06-02 David Shaw <dshaw@jabberwocky.com>
* photoid.c (show_photos): Work properly when not called with a

View File

@ -3116,7 +3116,7 @@ menu_showphoto( KBNODE keyblock )
"key 0x%08lX (uid %d)\n"),
image_type_to_string(type,1),
(ulong)size,(ulong)keyid[1],count);
show_photos(&uid->attribs[i],1,pk);
show_photos(&uid->attribs[i],1,pk,NULL);
}
}
}

View File

@ -401,7 +401,7 @@ list_keyblock_print ( KBNODE keyblock, int secret, int fpr, void *opaque )
if(opt.show_photos && node->pkt->pkt.user_id->attribs!=NULL)
show_photos(node->pkt->pkt.user_id->attribs,
node->pkt->pkt.user_id->numattribs,pk);
node->pkt->pkt.user_id->numattribs,pk,sk);
}
else if( node->pkt->pkttype == PKT_PUBLIC_SUBKEY ) {
u32 keyid2[2];

View File

@ -464,6 +464,9 @@ pct_expando(const char *string,struct expando_args *args)
if(args->sk)
keyid_from_sk(args->sk,sk_keyid);
if(!args->pk && args->sk)
keyid_from_sk(args->sk,pk_keyid);
while(*ch!='\0')
{
char *str=NULL;

View File

@ -171,6 +171,12 @@ lock-once
#
# Use your MIME handler to view photos:
# photo-viewer "metamail -q -d -b -c %T -s 'KeyID 0x%k' -f GnuPG"
#
# Use the Win32 registry to pick a viewer for you:
# On Win95/98/Me (also the default on Win32):
# photo-viewer "start /w"
# On NT/2k/XP:
# photo-viewer "cmd /c start /w"
# Passphrase agent

View File

@ -120,7 +120,7 @@ PKT_user_id *generate_photo_id(PKT_public_key *pk)
parse_attribute_subpkts(uid);
make_attribute_uidname(uid);
show_photos(uid->attribs,uid->numattribs,pk);
show_photos(uid->attribs,uid->numattribs,pk,NULL);
switch(cpr_get_answer_yes_no_quit("photoid.jpeg.okay",
_("Is this photo correct (y/N/q)? ")))
{
@ -215,7 +215,7 @@ char *image_type_to_string(byte type,int style)
}
void show_photos(const struct user_attribute *attrs,
int count,PKT_public_key *pk)
int count,PKT_public_key *pk,PKT_secret_key *sk)
{
int i;
struct expando_args args;
@ -224,9 +224,12 @@ void show_photos(const struct user_attribute *attrs,
memset(&args,0,sizeof(args));
args.pk=pk;
args.sk=sk;
if(pk)
keyid_from_pk(pk,kid);
else if(sk)
keyid_from_sk(sk,kid);
for(i=0;i<count;i++)
if(attrs[i].type==ATTRIB_IMAGE &&

View File

@ -8,6 +8,7 @@
PKT_user_id *generate_photo_id(PKT_public_key *pk);
int parse_image_header(const struct user_attribute *attr,byte *type,u32 *len);
char *image_type_to_string(byte type,int style);
void show_photos(const struct user_attribute *attrs,int count,PKT_public_key *pk);
void show_photos(const struct user_attribute *attrs,
int count,PKT_public_key *pk,PKT_secret_key *sk);
#endif /* !_PHOTOID_H_ */