tMake signature invalid if not at the end - sick - sign and check files using ed25519
HTML git clone git://z3bra.org/sick
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 1e699f32b8e2a0cfeaae3ac182b7ca0db6cb9c92
DIR parent 398fc545a7d63eafa6764cf0ca320798ec3b88b3
HTML Author: z3bra <willyatmailoodotorg>
Date: Wed, 14 Sep 2016 23:53:16 +0200
Make signature invalid if not at the end
Diffstat:
M sick.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR diff --git a/sick.c b/sick.c
t@@ -142,7 +142,7 @@ extractsig(unsigned char **sig, char *buf, size_t len)
/* search start and end strings for the signatures */
begin = memstr(buf, len, SIGBEGIN, strlen(SIGBEGIN)) + strlen(SIGBEGIN);
end = memstr(buf, len, SIGEND, strlen(SIGEND));
- if (!(begin && end))
+ if (!(begin && end) || end != (buf + len - strlen(SIGEND)))
return 0;
/* ed25519 signatures are 64 bytes longs */