sick

sign and check files using ed25519
git clone git://z3bra.org/sick
Log | Files | Refs | Submodules | README | LICENSE

commit 1e699f32b8e2a0cfeaae3ac182b7ca0db6cb9c92
parent 398fc545a7d63eafa6764cf0ca320798ec3b88b3
Author: z3bra <willyatmailoodotorg>
Date:   Wed Sep 14 23:53:16 +0200

Make signature invalid if not at the end

Diffstat:
sick.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sick.c b/sick.c @@ -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 */