From: Felix Fietkau Date: Wed, 18 Jan 2006 02:03:27 +0000 (+0000) Subject: revert last wep key validation patch, because of device-specific handling of ascii... X-Git-Tag: whiterussian_rc5~221 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5f8a371bf04a2107cc84d35096f2a9fbe65b2ab5;p=openwrt%2Fsvn-archive%2Fopenwrt.git revert last wep key validation patch, because of device-specific handling of ascii wep keys (see mbm's comment in #222) SVN-Revision: 3012 --- diff --git a/openwrt/package/webif/files/usr/lib/webif/validate.awk b/openwrt/package/webif/files/usr/lib/webif/validate.awk index 9173aa702d..490b128160 100644 --- a/openwrt/package/webif/files/usr/lib/webif/validate.awk +++ b/openwrt/package/webif/files/usr/lib/webif/validate.awk @@ -38,12 +38,12 @@ $1 == "int" { $1 == "wep" { valid_type = 1 - if ((length(value) != 0) && (length(value) != 5) && (length(value) != 10) && (length(value) != 13) && (length(value) != 26)) { + if (value !~ /^[0-9A-Fa-f]*$/) { valid = 0 - verr = "Invalid key length: Hex keys must be 10 or 26 hexdigits; Ascii keys must be 5 or 13 chars." - } else if (((length(value) == 10) || (length(value) == 26)) && (value !~ /^[0-9A-Fa-f]*$/)) { + verr = "Invalid value" + } else if ((length(value) != 0) && (length(value) != 10) && (length(value) != 26)) { valid = 0 - verr = "Invalid key: Hex keys may only contain hexdigits (0-9,A-F,a-f)" + verr = "Invalid key length" } else if (value ~ /0$/) { valid = 0 verr = "Key must not end with '0'"