aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/command.c')
-rw-r--r--agent/command.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/agent/command.c b/agent/command.c
index a9eb0104e..dcb758e37 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -541,14 +541,26 @@ cmd_istrusted (assuan_context_t ctx, char *line)
{
ctrl_t ctrl = assuan_get_pointer (ctx);
int rc, n, i;
- char *p;
+ char *p, *pn;
char fpr[41];
/* Parse the fingerprint value. */
+ pn = NULL; /* Indicates that we have not reparsed. */
+ parseagain:
for (p=line,n=0; hexdigitp (p); p++, n++)
;
if (*p || !(n == 40 || n == 32))
- return set_error (GPG_ERR_ASS_PARAMETER, "invalid fingerprint");
+ {
+ if (!pn && *p && strchr (p, ':'))
+ {
+ for (pn=p=line; *p ; p++)
+ if (*p != ':')
+ *pn++ = *p;
+ *pn = 0;
+ goto parseagain;
+ }
+ return set_error (GPG_ERR_ASS_PARAMETER, "invalid fingerprint");
+ }
i = 0;
if (n==32)
{