1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Print an error if gpg-protect reads the extended key format.

* agent/protect-tool.c (read_key): Detect simple extended key format.
--

This is a quick hack to get a useful error messages.  The real fix is
to replace the protect tool by a more useful new tool.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-03-30 17:27:42 +02:00
parent 9c5c7c6f60
commit c5c21a0646
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -318,6 +318,11 @@ read_key (const char *fname)
buf = read_file (fname, &buflen); buf = read_file (fname, &buflen);
if (!buf) if (!buf)
return NULL; return NULL;
if (buflen >= 4 && !memcmp (buf, "Key:", 4))
{
log_error ("Extended key format is not supported by this tool\n");
return NULL;
}
key = make_canonical (fname, buf, buflen); key = make_canonical (fname, buf, buflen);
xfree (buf); xfree (buf);
return key; return key;