summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-04-22 05:44:40 +0000
committertedu <tedu@openbsd.org>2014-04-22 05:44:40 +0000
commit41b393a4d6ffc2ac13491676ec9ca91b58685b8c (patch)
tree98184e3d11660a680c7f9f37db0332d984951dda
parentgets() is gone (diff)
downloadwireguard-openbsd-41b393a4d6ffc2ac13491676ec9ca91b58685b8c.tar.xz
wireguard-openbsd-41b393a4d6ffc2ac13491676ec9ca91b58685b8c.zip
errx when errno won't be set.
-rw-r--r--usr.bin/signify/signify.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index 4bab03a605f..410d8967c33 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.70 2014/04/14 00:35:32 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.71 2014/04/22 05:44:40 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -137,7 +137,7 @@ parseb64file(const char *filename, char *b64, void *buf, size_t buflen,
if (comment) {
if (strlcpy(comment, b64 + COMMENTHDRLEN,
COMMENTMAXLEN) >= COMMENTMAXLEN)
- err(1, "comment too long");
+ errx(1, "comment too long");
}
b64end = strchr(commentend + 1, '\n');
if (!b64end)
@@ -235,7 +235,7 @@ writeb64file(const char *filename, const char *comment, const void *buf,
fd = xopen(filename, O_CREAT|oflags|O_NOFOLLOW|O_WRONLY, mode);
if (snprintf(header, sizeof(header), "%s%s\n",
COMMENTHDR, comment) >= sizeof(header))
- err(1, "comment too long");
+ errx(1, "comment too long");
writeall(fd, header, strlen(header), filename);
if ((rv = b64_ntop(buf, buflen, b64, sizeof(b64)-1)) == -1)
errx(1, "b64 encode failed");
@@ -327,7 +327,7 @@ generate(const char *pubkeyfile, const char *seckeyfile, int rounds,
if (snprintf(commentbuf, sizeof(commentbuf), "%s secret key",
comment) >= sizeof(commentbuf))
- err(1, "comment too long");
+ errx(1, "comment too long");
writeb64file(seckeyfile, commentbuf, &enckey,
sizeof(enckey), NULL, 0, O_EXCL, 0600);
explicit_bzero(&enckey, sizeof(enckey));
@@ -336,7 +336,7 @@ generate(const char *pubkeyfile, const char *seckeyfile, int rounds,
memcpy(pubkey.fingerprint, fingerprint, FPLEN);
if (snprintf(commentbuf, sizeof(commentbuf), "%s public key",
comment) >= sizeof(commentbuf))
- err(1, "comment too long");
+ errx(1, "comment too long");
writeb64file(pubkeyfile, commentbuf, &pubkey,
sizeof(pubkey), NULL, 0, O_EXCL, 0666);
}
@@ -383,11 +383,11 @@ sign(const char *seckeyfile, const char *msgfile, const char *sigfile,
if ((secname = strstr(seckeyfile, ".sec")) && strlen(secname) == 4) {
if (snprintf(sigcomment, sizeof(sigcomment), VERIFYWITH "%.*s.pub",
(int)strlen(seckeyfile) - 4, seckeyfile) >= sizeof(sigcomment))
- err(1, "comment too long");
+ errx(1, "comment too long");
} else {
if (snprintf(sigcomment, sizeof(sigcomment), "signature from %s",
comment) >= sizeof(sigcomment))
- err(1, "comment too long");
+ errx(1, "comment too long");
}
if (embedded)
writeb64file(sigfile, sigcomment, &sig, sizeof(sig), msg,