aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <[email protected]>2015-12-09 18:01:04 +0000
committerNeal H. Walfield <[email protected]>2016-01-06 14:05:21 +0000
commit2c3e67430d9b523c85c81ae562223fd51e3608cc (patch)
tree02653589ae7fdba22ac1554a79bb868d8c1eb762 /g10
parentgpg: Silence some regression tests. (diff)
downloadgnupg-2c3e67430d9b523c85c81ae562223fd51e3608cc.tar.gz
gnupg-2c3e67430d9b523c85c81ae562223fd51e3608cc.zip
Fix keystrlen to work when OPT.KEYID_FORMAT is KF_DEFAULT.
* g10/keyid.c (keystrlen): If opt.keyid_format is KF_DEFAULT unset, default to KF_SHORT. (format_keyid): Default to KF_SHORT, not KF_0xLONG. -- Without this fix, gpgv2 fails with: gpgv: Ohhhh jeeee: ... this is a bug (keyid.c:342:keystrlen) Signed-off-by: Daniel Kahn Gillmor <[email protected]> Signed-off-by: Neal H. Walfield <[email protected]>
Diffstat (limited to 'g10')
-rw-r--r--g10/keyid.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/g10/keyid.c b/g10/keyid.c
index cb237ef54..69acbe425 100644
--- a/g10/keyid.c
+++ b/g10/keyid.c
@@ -284,7 +284,7 @@ format_keyid (u32 *keyid, int format, char *buffer, int len)
if (format == KF_DEFAULT)
format = opt.keyid_format;
if (format == KF_DEFAULT)
- format = KF_0xLONG;
+ format = KF_SHORT;
switch (format)
{
@@ -324,7 +324,11 @@ format_keyid (u32 *keyid, int format, char *buffer, int len)
size_t
keystrlen(void)
{
- switch(opt.keyid_format)
+ int format = opt.keyid_format;
+ if (format == KF_DEFAULT)
+ format = KF_SHORT;
+
+ switch(format)
{
case KF_SHORT:
return 8;