def testUnicodePBKDF2(self): psk = wifi.PreSharedKey98() psk.passphrase = u'\xc2\xb4\nX' key = psk.GetKey('SSID') self.assertEqual( key, '508cee82b5e379fff82ab7bc8f0e81cebf051c13e1613be9865ba5e0e53bd291')
def testPBKDF2(self): psk = wifi.PreSharedKey98() # http://connect.microsoft.com/VisualStudio/feedback/details/95506/ psk.KeyPassphrase = 'ThisIsAPassword' key = psk.GetKey('ThisIsASSID') self.assertEqual( key, '0dc0d6eb90555ed6419756b9a15ec3e3209b63df707dd508d14581f8982721af')
def __init__(self, ifname): BASE98WIFI.__init__(self) self._ifname = ifname self.wl = Wl(ifname) # Unimplemented, but not yet evaluated self.Unexport('Alias') self.Unexport('BeaconAdvertisementEnabled') self.Unexport('ChannelsInUse') self.Unexport('MaxBitRate') self.Unexport('PossibleDataTransmitRates') self.Unexport('TotalIntegrityFailures') self.Unexport('TotalPSKFailures') self.AssociatedDeviceList = tr.core.AutoDict( 'AssociatedDeviceList', iteritems=self.IterAssociations, getitem=self.GetAssociationByIndex) self.PreSharedKeyList = {} for i in range(1, 2): # tr-98 spec deviation: spec says 10 PreSharedKeys objects, # BRCM only supports one. self.PreSharedKeyList[i] = wifi.PreSharedKey98() self.WEPKeyList = {} for i in range(1, 5): self.WEPKeyList[i] = wifi.WEPKey98() self.LocationDescription = '' # No RADIUS support, could be added later. self.Unexport('AuthenticationServiceMode') # Local settings, currently unimplemented. Will require more # coordination with the underlying platform support. self.Unexport('InsecureOOBAccessEnabled') # MAC Access controls, currently unimplemented but could be supported. self.Unexport('MACAddressControlEnabled') # Wifi Protected Setup, currently unimplemented and not recommended. self.Unexport(objects='WPS') # Wifi MultiMedia, currently unimplemented but could be supported. # "wl wme_*" commands self.Unexport(lists='APWMMParameter') self.Unexport(lists='STAWMMParameter') self.Unexport('UAPSDEnable') self.Unexport('WMMEnable') # WDS, currently unimplemented but could be supported at some point. self.Unexport('PeerBSSID') self.Unexport('DistanceFromRoot') self.config = self._GetDefaultSettings() self.old_config = None
def __init__(self, ifname): super(BrcmWifiWlanConfiguration, self).__init__() self._ifname = ifname self.wl = Wl(ifname) # Unimplemented, but not yet evaluated self.Unexport([ 'Alias', 'BeaconAdvertisementEnabled', 'ChannelsInUse', 'MaxBitRate', 'PossibleDataTransmitRates', 'TotalIntegrityFailures', 'TotalPSKFailures', 'OperatingStandards', 'SupportedStandards', 'RekeyingInterval', 'GuardInterval', 'X_CATAWAMPUS-ORG_Width24G', 'X_CATAWAMPUS-ORG_Width5G', 'X_CATAWAMPUS-ORG_AutoChannelAlgorithm', 'X_CATAWAMPUS-ORG_RecommendedChannel', 'X_CATAWAMPUS-ORG_InitiallyRecommendedChannel', 'X_CATAWAMPUS-ORG_AutoChanType', 'X_CATAWAMPUS-ORG_AllowAutoDisable', 'X_CATAWAMPUS-ORG_AutoDisableRecommended', 'X_CATAWAMPUS-ORG_ClientIsolation', 'X_CATAWAMPUS-ORG_OverrideSSID', 'X_CATAWAMPUS-ORG_Suffix24G' ]) self.PreSharedKeyList = {} for i in range(1, 2): # tr-98 spec deviation: spec says 10 PreSharedKeys objects, # BRCM only supports one. self.PreSharedKeyList[i] = wifi.PreSharedKey98() self._Stats = BrcmWlanConfigurationStats(ifname) self.WEPKeyList = {} for i in range(1, 5): self.WEPKeyList[i] = wifi.WEPKey98() self.LocationDescription = '' # No support for acting as a client, could be added later. self.Unexport(['ClientEnable']) # No RADIUS support, could be added later. self.Unexport(['AuthenticationServiceMode']) # Local settings, currently unimplemented. Will require more # coordination with the underlying platform support. self.Unexport(['InsecureOOBAccessEnabled']) # MAC Access controls, currently unimplemented but could be supported. self.Unexport(['MACAddressControlEnabled']) # Wifi Protected Setup, currently unimplemented and not recommended. self.Unexport(objects=['WPS']) # Wifi MultiMedia, currently unimplemented but could be supported. # "wl wme_*" commands self.Unexport(lists=['APWMMParameter', 'STAWMMParameter']) self.Unexport(['UAPSDEnable', 'WMMEnable']) # WDS, currently unimplemented but could be supported at some point. self.Unexport(['PeerBSSID', 'DistanceFromRoot']) self.config = self._GetDefaultSettings() self.old_config = None
def testPreSharedKeyValidate(self): psk = wifi.PreSharedKey98() psk.ValidateExports()
def testUnicodeKeyPassphrase(self): psk = wifi.PreSharedKey98() self.assertRaises(ValueError, psk.KeyPassphrase, u'\xc2\xb4\nX')
def testPreSharedKeyValidate(self): psk = wifi.PreSharedKey98() tr.handle.ValidateExports(psk)