From 54ce8e5db9e305ec642ae63e62e5cc8f6c5b99eb Mon Sep 17 00:00:00 2001 From: laranjeiro Date: Tue, 17 Feb 2009 13:47:19 +0000 Subject: 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 --- cesar/maximus/python/tools/csi/csiavln.py | 15 +++++++++------ 1 file 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): -- cgit v1.2.3