aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-06-25 18:23:01 +0000
committerWerner Koch <[email protected]>2021-06-25 18:23:01 +0000
commita6efde307f7beb199b543f78b61c317fa2708202 (patch)
tree4d0fdff4b09255378d3fcca25b2bcd5d6924b300
parentgpg: Let --fetch-key return an exit code on failure. (diff)
downloadgnupg-a6efde307f7beb199b543f78b61c317fa2708202.tar.gz
gnupg-a6efde307f7beb199b543f78b61c317fa2708202.zip
agent: Fix regression in agent_get_shadow_info_type.
* agent/protect.c (agent_get_shadow_info_type): Return the correct value. -- Fixes-commit: 33a2362e566c0e0d7011abf2e5fa5704d7cb4206 GnuPG-bug-id: 5393
-rw-r--r--agent/protect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/agent/protect.c b/agent/protect.c
index 2c63a85fe..7ae067ec7 100644
--- a/agent/protect.c
+++ b/agent/protect.c
@@ -1610,8 +1610,8 @@ agent_get_shadow_info_type (const unsigned char *shadowkey,
unsigned char const **shadow_info,
unsigned char **shadow_type)
{
- const unsigned char *s;
- size_t n;
+ const unsigned char *s, *saved_s;
+ size_t n, saved_n;
int depth = 0;
s = shadowkey;
@@ -1660,6 +1660,8 @@ agent_get_shadow_info_type (const unsigned char *shadowkey,
n = snext (&s);
if (!n)
return gpg_error (GPG_ERR_INV_SEXP);
+ saved_s = s;
+ saved_n = n;
if (smatch (&s, n, "t1-v1") || smatch(&s, n, "tpm2-v1"))
{
if (*s != '(')
@@ -1669,6 +1671,8 @@ agent_get_shadow_info_type (const unsigned char *shadowkey,
}
else
return gpg_error (GPG_ERR_UNSUPPORTED_PROTOCOL);
+ s = saved_s;
+ n = saved_n;
if (shadow_type)
{