summaryrefslogtreecommitdiff
path: root/sbin/ipsecctl/parse.y
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2006-06-01 15:33:09 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2006-06-01 15:33:09 +0000
commitdad963a3b3eeee63ceef41474a2fafd7201569bc (patch)
tree52a327ad23626b95b163a82fa3634ed53c54e5a7 /sbin/ipsecctl/parse.y
parent7e6c0a91af1cce984648479f09233a007773f44a (diff)
print actual key size when warning about the wrong key size; ok hshoexer
Diffstat (limited to 'sbin/ipsecctl/parse.y')
-rw-r--r--sbin/ipsecctl/parse.y12
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index 806c8ecde85..c96e0422505 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.86 2006/06/01 06:50:58 deraadt Exp $ */
+/* $OpenBSD: parse.y,v 1.87 2006/06/01 15:33:08 markus Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1822,13 +1822,15 @@ validate_sa(u_int32_t spi, u_int8_t satype, struct ipsec_transforms *xfs,
}
if (enckey) {
if (enckey->len < xfs->encxf->keymin) {
- yyerror("encryption key too short, "
- "minimum %d bits", xfs->encxf->keymin * 8);
+ yyerror("encryption key too short (%d bits), "
+ "minimum %d bits", enckey->len * 8,
+ xfs->encxf->keymin * 8);
return (0);
}
if (xfs->encxf->keymax < enckey->len) {
- yyerror("encryption key too long, "
- "maximum %d bits", xfs->encxf->keymax * 8);
+ yyerror("encryption key too long (%d bits), "
+ "maximum %d bits", enckey->len * 8,
+ xfs->encxf->keymax * 8);
return (0);
}
}