From 6e99286d45be482effe47feb057948b98495a49f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 10 May 2018 09:16:50 -0400 Subject: hs-v3: Add an extra white-space when parsing descriptor The specification describes the signature token to be right after a newline (\n) then the token "signature" and then a white-space followed by the encoded signature. This commit makes sure that when we parse the signature from the descriptor, we are always looking for that extra white-space at the end of the token. It will allow us also to support future fields that might start with "signature". Fixes #26069 Signed-off-by: David Goulet --- src/or/hs_descriptor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/or') diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c index fae527b2db..3ec02618bf 100644 --- a/src/or/hs_descriptor.c +++ b/src/or/hs_descriptor.c @@ -1849,7 +1849,7 @@ desc_sig_is_valid(const char *b64_sig, } /* Find the start of signature. */ - sig_start = tor_memstr(encoded_desc, encoded_len, "\n" str_signature); + sig_start = tor_memstr(encoded_desc, encoded_len, "\n" str_signature " "); /* Getting here means the token parsing worked for the signature so if we * can't find the start of the signature, we have a code flow issue. */ if (!sig_start) { -- cgit v1.2.3-54-g00ecf