diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-01-09 12:22:31 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-01-09 12:22:31 +0000 |
commit | a245f64bf6efe20aad24c64606ffdf6fd6561e81 (patch) | |
tree | 6221cad07bc9603c77ea3e56a4d3776fedda5450 | |
parent | bae85086a3e6054e86a2c1629d27ef533a285ba5 (diff) |
don't restrict tcp signature keys to ascii; ok mcbride
-rw-r--r-- | sys/netinet/tcp_subr.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 74203f61dce..6d308645b00 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.72 2004/01/06 17:38:13 markus Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.73 2004/01/09 12:22:30 markus Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -1057,31 +1057,9 @@ tcp_signature_tdb_init(tdbp, xsp, ii) struct xformsw *xsp; struct ipsecinit *ii; { - char *c; -#define isdigit(c) (((c) >= '0') && ((c) <= '9')) -#define isalpha(c) ( (((c) >= 'A') && ((c) <= 'Z')) || \ - (((c) >= 'a') && ((c) <= 'z')) ) - if ((ii->ii_authkeylen < 1) || (ii->ii_authkeylen > 80)) return (EINVAL); - c = (char *)ii->ii_authkey; - - while (c < (char *)ii->ii_authkey + ii->ii_authkeylen - 1) { - if (isdigit(*c)) { - if (*(c + 1) == ' ') - return (EINVAL); - } else { - if (!isalpha(*c)) - return (EINVAL); - } - - c++; - } - - if (!isdigit(*c) && !isalpha(*c)) - return (EINVAL); - tdbp->tdb_amxkey = malloc(ii->ii_authkeylen, M_XDATA, M_DONTWAIT); if (tdbp->tdb_amxkey == NULL) return (ENOMEM); |