diff options
author | David Shaw <[email protected]> | 2002-06-03 12:39:23 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-06-03 12:39:23 +0000 |
commit | cd2450f41f5595d9adab03d65bb06b2f2ee208c5 (patch) | |
tree | 8f9f06da2511bed2e244fb1a675a9015ab552c65 | |
parent | * photoid.c (show_photos): Work properly when not called with a public (diff) | |
download | gnupg-cd2450f41f5595d9adab03d65bb06b2f2ee208c5.tar.gz gnupg-cd2450f41f5595d9adab03d65bb06b2f2ee208c5.zip |
* 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).
-rw-r--r-- | g10/ChangeLog | 12 | ||||
-rw-r--r-- | g10/keyedit.c | 2 | ||||
-rw-r--r-- | g10/keylist.c | 2 | ||||
-rw-r--r-- | g10/misc.c | 3 | ||||
-rw-r--r-- | g10/options.skel | 6 | ||||
-rw-r--r-- | g10/photoid.c | 7 | ||||
-rw-r--r-- | g10/photoid.h | 3 |
7 files changed, 30 insertions, 5 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog index 14cca8154..60ca07349 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,15 @@ +2002-06-03 David Shaw <[email protected]> + + * 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 <[email protected]> * photoid.c (show_photos): Work properly when not called with a diff --git a/g10/keyedit.c b/g10/keyedit.c index a8e49a286..9a38b97bf 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -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); } } } diff --git a/g10/keylist.c b/g10/keylist.c index 57df6c232..f91d38439 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -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]; diff --git a/g10/misc.c b/g10/misc.c index 6a008d5fb..f97db523e 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -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; diff --git a/g10/options.skel b/g10/options.skel index 5beb3da9c..7d16914fa 100644 --- a/g10/options.skel +++ b/g10/options.skel @@ -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 diff --git a/g10/photoid.c b/g10/photoid.c index 65a0243f1..251ff9907 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -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 && diff --git a/g10/photoid.h b/g10/photoid.h index ddd36af37..45d104f8c 100644 --- a/g10/photoid.h +++ b/g10/photoid.h @@ -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_ */ |