diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-13 00:19:49 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1999-02-13 00:19:49 +0000 |
commit | fd6c1e9905964fa28a540a8483a80c33283893d3 (patch) | |
tree | 63ad912adc75b0e29aebd8446f32436ae5fef30b /sbin | |
parent | b1b6a913b3767892c9e108e431e8d447e11d0890 (diff) |
Verify that keys and IVs are in hex.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipsecadm/ipsecadm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sbin/ipsecadm/ipsecadm.c b/sbin/ipsecadm/ipsecadm.c index fbe86095392..4f643c80ef4 100644 --- a/sbin/ipsecadm/ipsecadm.c +++ b/sbin/ipsecadm/ipsecadm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsecadm.c,v 1.1 1998/11/14 23:37:20 deraadt Exp $ */ +/* $OpenBSD: ipsecadm.c,v 1.2 1999/02/13 00:19:48 angelos Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -118,6 +118,11 @@ x2i(char *s) ss[1] = s[1]; ss[2] = 0; + if (!isxdigit(s[0]) || !isxdigit(s[1])) { + fprintf(stderr, + "Keys and IVs should be specified in hex digits.\n"); + exit(-1); + } return strtoul(ss, NULL, 16); } |