opentechinstitute / commotion-linux-py

DEPRECATED, see commotion-client - Python implementation of core commotion functions for Linux
Other
3 stars 5 forks source link

add Input validation to readProfile #19

Open dismantl opened 10 years ago

dismantl commented 10 years ago

https://github.com/opentechinstitute/commotion-linux-py/blob/master/commotionc.py#L67

We need to add input validation to the various parameters such as 'ssid', 'channel', 'ip', 'netmask', 'dns', 'ipgenerate', 'bssid'.

Rules for input validation can be modelled from this: https://github.com/opentechinstitute/commotion-lua-helpers/blob/master/modules/validate.lua

jumoke021 commented 10 years ago

Hi! The bssid parameter is sometimes empty so when it's validated show it be checked to make sure it is empty/ follows the pattern XX:XX:XX:XX:XX:XX? I have a mockup of a validator function written in the file validate-commotion.py . Let me know if I'm heading in the right direction/ things I need to change. It's under a branch named validation.

dismantl commented 10 years ago

looks like a good start, @jumoke021. I would suggest making the validations more strict to the specifications if you can. For instance, SSID can be of length 1-32 of any characters, not just alphanumeric, the first byte of BSSID must be 02, and each octet of the IP address must be 0-255.

dismantl commented 10 years ago

also, make sure characters in the BSSID are hex only, not just alphanumeric.

jumoke021 commented 10 years ago

Oh! okay. I'll make the changes. Thanks!

Jumoke A. Williams Biology 2012 MIT

"A man (or woman) won't respect you until you respect yourself. You, however, won't respect yourself until you do something to earn it and remember only a fool will lie "to" himself or herself "about" himself or herself. "

2014-03-19 9:12 GMT-05:00 Dan Staples notifications@github.com:

also, make sure characters in the BSSID are hex only, not just alphanumeric.

Reply to this email directly or view it on GitHubhttps://github.com/opentechinstitute/commotion-linux-py/issues/19#issuecomment-38054530 .

jumoke021 commented 10 years ago

I've sent a pull request. But I mistakenly didn't attach it to this thread. Hopefully it's still viewable.