sick

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

commit cc294e4bf70f3e2bb907a15c94b18f3535011105
parent 0283c9565a52696b5c3129fcb1d5cbf672329e9a
Author: z3bra <willyatmailoodotorg>
Date:   Wed Sep 14 13:43:08 +0200

Pass correct buffer lenght to extract message

Diffstat:
sick.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sick.c b/sick.c @@ -111,7 +111,7 @@ extractmsg(unsigned char **msg, char *buf, size_t buflen) char *sig; /* signature start is identified by SIGBEGIN */ - sig = memstr(buf, len, SIGBEGIN, strlen(SIGBEGIN)); + sig = memstr(buf, buflen, SIGBEGIN, strlen(SIGBEGIN)); /* if signature is not found, return the whole buffer */ if (sig == NULL) { @@ -367,7 +367,7 @@ check(FILE *fp, FILE *key) if (verbose) fprintf(stderr, "Extracting signature from input\n"); - if (extractsig(&sig, buf, len) != 64) { + if (extractsig(&sig, buf, len) != 65) { if (verbose) fprintf(stderr, "ERROR: No valid signature found\n");