aboutsummaryrefslogtreecommitdiffstats
path: root/g10/misc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-04-15 14:40:48 +0000
committerWerner Koch <[email protected]>2014-04-17 19:44:09 +0000
commite184a11f94e2d41cd9266484542631bec23628b5 (patch)
tree3be1b428fd499e94afa9fda630fb06fdb7c941e1 /g10/misc.c
parentcommon: Add z-base-32 encoder. (diff)
downloadgnupg-e184a11f94e2d41cd9266484542631bec23628b5.tar.gz
gnupg-e184a11f94e2d41cd9266484542631bec23628b5.zip
gpg: New %U expando for the photo viewer.
* g10/photoid.c (show_photos): Set namehash. * g10/misc.c (pct_expando): Add "%U" expando. -- This makes is possible to extract all photos ids from a key to different files.
Diffstat (limited to 'g10/misc.c')
-rw-r--r--g10/misc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c
index ba83b1910..77928aa6c 100644
--- a/g10/misc.c
+++ b/g10/misc.c
@@ -822,6 +822,23 @@ pct_expando(const char *string,struct expando_args *args)
}
break;
+ case 'U': /* z-base-32 encoded user id hash. */
+ if (args->namehash)
+ {
+ char *tmp = zb32_encode (args->namehash, 8*20);
+ if (tmp)
+ {
+ if (idx + strlen (tmp) < maxlen)
+ {
+ strcpy (ret+idx, tmp);
+ idx += strlen (tmp);
+ }
+ xfree (tmp);
+ done = 1;
+ }
+ }
+ break;
+
case 'c': /* signature count from card, if any. */
if(idx+10<maxlen)
{