summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-06-10 19:38:25 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2006-06-10 19:38:25 +0000
commit858192e677ef663ff6ccbe184fe7af6cae73fa5f (patch)
treeacf0703c040f6c65a80708ee79fb85ad69864a76
parente2440ff18cd3c03374c24efb2df53ac1ef0978f8 (diff)
Better error message when a key file can not be opened or the provided key is
not of correct size. Suggested by david@
-rw-r--r--sbin/ipsecctl/parse.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index 53b8cfc96de..a9d62bc42a3 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.104 2006/06/10 12:02:56 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.105 2006/06/10 19:38:24 hshoexer Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1249,11 +1249,11 @@ parsekeyfile(char *filename)
unsigned char *hex;
if ((fd = open(filename, O_RDONLY)) < 0)
- err(1, "parsekeyfile: open");
+ err(1, "open %s", filename);
if (fstat(fd, &sb) < 0)
err(1, "parsekeyfile: stat %s", filename);
if ((sb.st_size > KEYSIZE_LIMIT) || (sb.st_size == 0))
- errx(1, "parsekeyfile: key too %s", sb.st_size ? "large" :
+ errx(1, "%s: key too %s", filename, sb.st_size ? "large" :
"small");
if ((hex = calloc(sb.st_size, sizeof(unsigned char))) == NULL)
err(1, "parsekeyfile: calloc");