-
Notifications
You must be signed in to change notification settings - Fork 33
Cannot set a wpa password with special chars #14
Comments
I'm going to label this issue as an "enhancement" and not a "bug" since I think this is a missing feature rather than an bug. A WPA-compliant regular expression for PSK validation could be the following
But... I'd be very cautious and "conservative" about what OWM accepts as user input for this field as our system and OpenWRT require some character to be escaped in order to be used as WPA-PSK. First of all the "key" field is used with 3 different meanings with different formats and different length requirements:
Second let's take for instance the double-quote char ("): this must be escaped by OWM because it would be "printed" as-is in the wifi UCI configuration file for OpenWRT and it will almost certainly "close" the previous double-quote... Another example could be the dollar ($) sign or the back-tick char: these could be very dangerous. |
What do you (@idemarinis @mtylty @nemesisdesign @riblo @spawnazzo) think about this? What OWM should accept for the :key field? (and how it should process it) |
I've just ran into this: http://www.ruby-doc.org/core-1.9.3/String.html#method-i-dump
It could be useful. |
What kind of characters we want to accept? Let's choose the most useful one and include them in the regexp. What do you think? |
I suppose that the form may be conditional if we use a wpa2 password we must accept all chars, if we select a radius |
@spawnazzo yes, you're right. But I've just realized that we have some complications here. As stated in the official OpenWRT documentation:
|
@spawnazzo news? |
A user cannot set a WPA password that contains special chars.
The problem is in /app/models/vim vap_template.rb in this regex
validates_format_of :key, :with => /\A[\s\w\d._]+\Z/i, :if => :key_needed?
according to the standard it can allow special chars. Isn't it?
@dguerri @nemesisdesign
The text was updated successfully, but these errors were encountered: