summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaranjeiro2009-02-17 13:47:19 +0000
committerlaranjeiro2009-02-17 13:47:19 +0000
commit54ce8e5db9e305ec642ae63e62e5cc8f6c5b99eb (patch)
tree1eefe982bd72bd8e1f8c4ea1caf13bd813c68510
parent1c7329c037736b328810732c3843f71cbe299ab9 (diff)
maximus/python/tools/csi: Added a verification of the length of the Device
password. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@4011 017c9cb6-072f-447c-8318-d5b54f68fe89
-rw-r--r--cesar/maximus/python/tools/csi/csiavln.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/cesar/maximus/python/tools/csi/csiavln.py b/cesar/maximus/python/tools/csi/csiavln.py
index 1989b492b5..01b3190abd 100644
--- a/cesar/maximus/python/tools/csi/csiavln.py
+++ b/cesar/maximus/python/tools/csi/csiavln.py
@@ -30,17 +30,20 @@ class csiAvln:
if self.__hp_sta_max <= self.get_nb_sta():
return None
+ if len (dpw) < 16 or len (dpw) > 64:
+ raise Exception ("Device password wrong length, must be at least 16 characters at most 64")
+
for i in range (0, self.get_nb_sta()):
if (self.get_sta(i).get_mac_addr() == mac_addr):
return None
- if len (self.__sta_list) > 0:
- if self.__sta_list[len(self.__sta_list) -1].get_delay_ms() > delay_ms:
- raise Exception ('Delay value smaller than the previous station delay')
+ if len (self.__sta_list) > 0:
+ if self.__sta_list[len(self.__sta_list) -1].get_delay_ms() > delay_ms:
+ raise Exception ('Delay value smaller than the previous station delay')
- sta = csiSta (mac_addr, cco_pref, was_cco, self.get_npw(), dpw, mhfid, uhfid, self.get_ahfid(), sl, debug, delay_ms)
- self.__sta_list.append (sta)
- return sta
+ sta = csiSta (mac_addr, cco_pref, was_cco, self.get_npw(), dpw, mhfid, uhfid, self.get_ahfid(), sl, debug, delay_ms)
+ self.__sta_list.append (sta)
+ return sta
def sta_remove (self, mac_addr):