-/* $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>
*
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)
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");
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));
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);
}
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,