From 7733cb2604c38a1b9370a0cd0edf2a382f1e4a5c Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 3 Feb 2022 02:38:05 +0000 Subject: [PATCH] Maybe don't destroy the signature if we're going to try to validate again. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3815 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ssb.c b/src/ssb.c index 9deb3009..dbbe7b3f 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -548,8 +548,15 @@ static bool _tf_ssb_verify_and_strip_signature_internal(JSContext* context, JSVa JS_FreeCString(context, sigstr); JS_FreeCString(context, str); JS_FreeValue(context, sigval); - JS_FreeValue(context, signature); JS_FreeValue(context, authorval); + if (verified) + { + JS_FreeValue(context, signature); + } + else + { + JS_SetPropertyStr(context, val, "signature", signature); + } return verified; }