aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
{