def configStrings(iface):
hardware_info = HardwareInfo()
if hardware_info.device_name != "dm7025":
rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
etpm = eTPM()
l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
if l2cert is None:
return
l2key = validate_cert(l2cert, rootkey)
if l2key is None:
return
l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
if l3cert is None:
print "better run the genuine dreambox plugin"
return
l3key = validate_cert(l3cert, l2key)
if l3key is None:
return
rnd = read_random()
if rnd is None:
return
val = etpm.challenge(rnd)
result = decrypt_block(val, l3key)
if hardware_info.device_name == "dm7025" or result[80:88] == rnd:
driver = iNetwork.detectWlanModule(iface)
else:
driver = 'dreambox'
ret = ""
if driver == 'madwifi' and config.plugins.wlan.essid.value == "hidden...":
ret += "\tpre-up iwconfig " + iface + " essid \"" + config.plugins.wlan.hiddenessid.value + "\" || true\n"
ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
return ret
def Plugins(**kwargs):
return PluginDescriptor(name=_("Wireless LAN"), description=_("Connect to a Wireless Network"), where = PluginDescriptor.WHERE_NETWORKSETUP, needsRestart = False, fnc={"ifaceSupported": callFunction, "configStrings": configStrings, "WlanPluginEntry": lambda x: "Wireless Network Configuartion..."})