summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-05-14 15:55:11 +0000
committertedu <tedu@openbsd.org>2014-05-14 15:55:11 +0000
commit032a32d970f51296e898aa1f44bf475e135eaa6d (patch)
tree6527d667696fed50ad37230d6a1ef8e9bfdaf5c5
parentrecode base64 hashes if necessary (diff)
downloadwireguard-openbsd-032a32d970f51296e898aa1f44bf475e135eaa6d.tar.xz
wireguard-openbsd-032a32d970f51296e898aa1f44bf475e135eaa6d.zip
save some memory by reducing buffer sizes
-rw-r--r--usr.bin/signify/signify.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index 64d51503150..59242b1e183 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.80 2014/05/14 15:52:24 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.81 2014/05/14 15:55:11 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -533,14 +533,14 @@ verify(const char *pubkeyfile, const char *msgfile, const char *sigfile,
#ifndef VERIFYONLY
struct checksum {
char file[1024];
- char hash[1024];
- char algo[256];
+ char hash[224];
+ char algo[32];
};
static void
recodehash(char *hash)
{
- uint8_t data[512];
+ uint8_t data[112];
int i, rv;
if (strlen(hash) == SHA256_DIGEST_STRING_LENGTH ||
@@ -573,7 +573,7 @@ verifychecksums(char *msg, int argc, char **argv, int quiet)
c = &checksums[nchecksums++];
if ((endline = strchr(line, '\n')))
*endline++ = '\0';
- rv = sscanf(line, "%255s %1023s = %1023s",
+ rv = sscanf(line, "%31s %1023s = %223s",
c->algo, buf, c->hash);
if (rv != 3 || buf[0] != '(' || buf[strlen(buf) - 1] != ')')
errx(1, "unable to parse checksum line %s", line);